query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
ef5897a9ceb634c3da42f77625c9bc65
Shuffles a given array to produce random reordering when invoked
[ { "docid": "ca347cf0f9360a35adf557d90bca7d8e", "score": "0.0", "text": "function shuffleArray(arr) {\n for (let i = 0; i < arr.length; i++) {\n const j = Math.floor(Math.random() * (i + 1));\n [arr[i], arr[j]] = [arr[j], arr[i]];\n }\n return arr;\n}", "title": "" } ]
[ { "docid": "cbfa90c8d8a16491a9bb593b48b8ff21", "score": "0.8330316", "text": "function shuffle(array) {\n\t \n\t var j, x, i;\n\t \n\t for (i = array.length; i; i -= 1) {\n\t j = Math.floor(Math.random() * i);\n\t x = array[i - 1];\n\t array[i - 1] = array[j];\n\t array[j] = x;\n\t }\n}", "title": "" }, { "docid": "b2814163c7095f6dccedb41bb9f0ba30", "score": "0.8180885", "text": "static shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n }", "title": "" }, { "docid": "68469d0645f6dfae62a9ba72e369a356", "score": "0.8087676", "text": "function shuffle(array) {\r\n var currentIndex = array.length, tempVal, randomIndex;\r\n while(0!=currentIndex) {\r\n randomIndex = getRandomInt(currentIndex);\r\n currentIndex--;\r\n\r\n tempVal = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = tempVal;\r\n }\r\n }", "title": "" }, { "docid": "94be5a3d0c02cf37d536285860fdc993", "score": "0.80419445", "text": "function shuffle(array) {\n for (var i = array.length - 1; i > 0; --i) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n }", "title": "" }, { "docid": "953f2c353894fc70d8419387b3eae0d9", "score": "0.801932", "text": "function shuffleArray(array) {\n\t\t\t\t for (var i = array.length - 1; i > 0; i--) {\n\t\t\t\t var j = Math.floor(Math.random() * (i + 1));\n\t\t\t\t var _ref = [array[j], array[i]];\n\t\t\t\t array[i] = _ref[0];\n\t\t\t\t array[j] = _ref[1];\n\t\t\t\t }\n\t\t\t\t}", "title": "" }, { "docid": "12b70df419216ec1ef32640d9a346039", "score": "0.80111957", "text": "function shuffle(array) {\n array.forEach(function (el, i) {\n var randomIndex = parseInt(Math.random() * array.length);\n var p = array[randomIndex];\n array[randomIndex] = array[i];\n array[i] = p;\n });\n return array;\n }", "title": "" }, { "docid": "9bca78501c8ccbe500a6f6198f9e4f96", "score": "0.8007935", "text": "function shuffle(array) {\n const len = array.length\n\n if (len <= 1) return\n\n for (let i = 0; i < len - 1; i++) {\n const randomIndex = getRandom(i, len - 1)\n\n if (i !== randomIndex) swapArrItemsInPlace(array, i, randomIndex)\n }\n}", "title": "" }, { "docid": "cd56fd0a96c5220fbdb2d23cb3ba6bbd", "score": "0.80028856", "text": "function shuffle(array) {\n\n\t\tvar index = array.length;\n\t\tvar indexValue;\n\t\tvar randomIndex;\n\t\twhile (0 !== index) {\n\t\t\trandomIndex = Math.floor(Math.random() * index);\n\t\t\tindex -= 1;\n\t\t\t//swap\n\t\t\tindexValue = array[index];\n\t\t\tarray[index] = array[randomIndex];\n\t\t\tarray[randomIndex] = indexValue;\n\t\t}\n\t\treturn array;\n\t}", "title": "" }, { "docid": "2a222a9edf3e052684561193b326da0a", "score": "0.797945", "text": "function shuffle(array) {\n\tfor (let i = array.length - 1; i > 0; i--) {\n\t\tconst j = Math.floor(Math.random() * (i + 1));\n\t\t[array[i], array[j]] = [array[j], array[i]];\n\t}\n}", "title": "" }, { "docid": "8b41e5b0826777c53a2e16645489403a", "score": "0.79731256", "text": "function shuffle (array) {\n var m = array.length, t, i;\n while (m) {\n i = Math.floor(Math.random() * m--);\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n}", "title": "" }, { "docid": "eed13b65feff823f5224d9ee04fc7af3", "score": "0.7965663", "text": "static shuffleArray1(array, nrShuffles) {\n for (let i = 0; i < nrShuffles; i++) {\n let currentIndex = array.length;\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n // Pick a remaining element...\n const randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n // And swap it with the current element.\n const temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n }\n }", "title": "" }, { "docid": "0e86441b75001505f00152474dfe9b76", "score": "0.7963291", "text": "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue, randomIndex;\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n \r\n }\r\n return array;\r\n }", "title": "" }, { "docid": "6eaa5933e7998d318d335c7f45b5a780", "score": "0.79601425", "text": "function shuffle(array){\n\tfor(var i = array.length-1;i>0;i--){\n\t\tvar j = Math.floor(Math.random()*(i+1));\n\t\tvar temp = array[i];\n\t\tarray[i] = array[j];\n\t\tarray[j] = temp;\n\t\t}\n\t}", "title": "" }, { "docid": "19dd73784a2302d7ea2fbba74713bb76", "score": "0.79524636", "text": "function shuffle(array) {\n for(var j, x, i = array.length; i; j = Math.floor(Math.random() * i), x = array[--i], array[i] = array[j], array[j] = x);\n return array;\n }", "title": "" }, { "docid": "6fc165a77ae4aac9a489ac580572a961", "score": "0.79371125", "text": "function shuffle(array) {\n var currentIndex = array.length\n , temporaryValue\n , randomIndex\n ;\n\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "title": "" }, { "docid": "0073d70a2e267ea1667be669e19df88f", "score": "0.7923163", "text": "function shuffle(array) {\n for (var i = array.length - 1; i > 0; --i) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}", "title": "" }, { "docid": "6e6a0d2f56e288d4384f7a2701d761f9", "score": "0.79168254", "text": "function shuffle(array) {\n var i = 0,\n j = 0,\n temp = null;\n\n for (i = array.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1));\n temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}", "title": "" }, { "docid": "fc492bf9df5d7d8a9945d3fe811a68fb", "score": "0.79163563", "text": "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "title": "" }, { "docid": "0162882b3a65aea3551341bfb4b0a4f2", "score": "0.79132104", "text": "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n \n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "title": "" }, { "docid": "b821f5db1026e6762ac6130bb25e17af", "score": "0.7912234", "text": "function shuffle (array) {\n var i = 0\n , j = 0\n , temp = null\n\n for (i = array.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1))\n temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n}", "title": "" }, { "docid": "b821f5db1026e6762ac6130bb25e17af", "score": "0.7912234", "text": "function shuffle (array) {\n var i = 0\n , j = 0\n , temp = null\n\n for (i = array.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1))\n temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n}", "title": "" }, { "docid": "fe6dab78ae440be2a1a05027ea2e6302", "score": "0.7907045", "text": "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "title": "" }, { "docid": "449b5f8fe0406acbb2d34e0965a90b73", "score": "0.79040223", "text": "function shuffle(array) { // shuffle function\n\t\tfor (var i = array.length - 1; i > 0; i--) { // en forloop \n\t\t\tvar j = Math.floor(Math.random() * (i + 1)); // väljer slumpmässigt index från 0 till 1\n\t\t\t[array[i], array[j]] = [array[j], array[i]]; // byter element\n\t\t}\n\t}", "title": "" }, { "docid": "b70ccaf18f34768f01021b73e203a949", "score": "0.7900784", "text": "function shuffle(array){\n\t\t\t\t\t\t\t\t \tvar currentIndex = array.length;\n\t\t\t\t\t\t\t\t \tvar temporaryValue;\n\t\t\t\t\t\t\t\t \t//var randIndex;\n\n\t\t\t\t\t\t\t\t \twhile (currentIndex > 0){\n\t\t\t\t\t\t\t\t \t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\t\t\t\t\t\t \t\tcurrentIndex --;\n\n\t\t\t\t\t\t\t\t \t\ttemporaryValue = array[currentIndex];\n\t\t\t\t\t\t\t\t \t\tarray[currentIndex] = array[randomIndex];\n\t\t\t\t\t\t\t\t \t\tarray[randomIndex] = temporaryValue;\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t \t\treturn array;\n}", "title": "" }, { "docid": "a381f6022c08cf027c005cc28ddab327", "score": "0.79006803", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1)); // random index from 0 to i\n // swap elements array[i] and array[j] using destructuring syntax\n [array[i], array[j]] = [array[j], array[i]];\n }\n }", "title": "" }, { "docid": "f6db6854162c2dc4abf60454eeba9ae0", "score": "0.7898829", "text": "function shuffle(a) {\n\t var j, x, i;\n\t for (i = a.length; i; i--) {\n\t j = Math.floor(Math.random() * i);\n\t x = a[i - 1];\n\t a[i - 1] = a[j];\n\t a[j] = x;\n\t }\n\t}", "title": "" }, { "docid": "77eebae73f314af04b7ac1a1c53737ba", "score": "0.78842926", "text": "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n }", "title": "" }, { "docid": "77eebae73f314af04b7ac1a1c53737ba", "score": "0.78842926", "text": "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n }", "title": "" }, { "docid": "f4fef6ae5ab45d3f07862c6cbdb650c9", "score": "0.78826547", "text": "function shuffle (array) {\n let i = 0,\n j = 0,\n temp = null\n\n for (i = array.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1))\n temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n}", "title": "" }, { "docid": "168652bcf373148833a22772b6a27617", "score": "0.78817934", "text": "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "title": "" }, { "docid": "7b8da69d63301107fe6ab5bf6039e444", "score": "0.78773", "text": "function shuffle(array) {\n var currentIndex = array.length, randomIndex;\n\n while (0 !== currentIndex) {\n\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n \n\n [array[currentIndex], array[randomIndex]] = [\n array[randomIndex], array[currentIndex]];\n }\n \n return array;\n }", "title": "" }, { "docid": "56c59961cbdc44bf0ee18865fa87f9ea", "score": "0.7876878", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n }", "title": "" }, { "docid": "beed0d87968449392fb0ae3337cbe54e", "score": "0.78724086", "text": "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "title": "" }, { "docid": "097358ad393d0546a27c8aceae9b8966", "score": "0.7868949", "text": "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "title": "" }, { "docid": "097358ad393d0546a27c8aceae9b8966", "score": "0.7868949", "text": "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "title": "" }, { "docid": "c1c8b7ac62b77e0f37aa1680e27fe38f", "score": "0.7864008", "text": "function shuffle(array) {\n for (var j, x, i = array.length; i; j = parseInt(Math.random() * i), x = array[--i], array[i] = array[j], array[j] = x) { }\n return array;\n }", "title": "" }, { "docid": "0e88d1c23d4194c97b1e108fd6e688d5", "score": "0.78618896", "text": "shuffle(array) {\n\t var currentIndex = array.length, temporaryValue, randomIndex;\n\t while (0 !== currentIndex) {\n\t randomIndex = Math.floor(Math.random() * currentIndex);\n\t currentIndex -= 1;\n\t temporaryValue = array[currentIndex];\n\t array[currentIndex] = array[randomIndex];\n\t array[randomIndex] = temporaryValue;\n\t }\n\t return array;\n\t}", "title": "" }, { "docid": "efd7faf0b54dcd180682759fcdf8255b", "score": "0.7861692", "text": "function shuffle(array) {\n let currentIndex = array.length, randomIndex;\n\n while (currentIndex != 0) {\n\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n\n [array[currentIndex], array[randomIndex]] = [\n array[randomIndex], array[currentIndex]];\n }\n\n return array;\n }", "title": "" }, { "docid": "edb57e17d6a2c984c354fbb164778907", "score": "0.7860418", "text": "function shuffle(a) {\n\t\t\t\tvar j, x, i;\n\t\t\t\tfor (i = a.length; i; i -= 1) {\n\t\t\t\t\tj = Math.floor(Math.random() * i);\n\t\t\t\t\tx = a[i - 1];\n\t\t\t\t\ta[i - 1] = a[j];\n\t\t\t\t\ta[j] = x;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "46b8e33e8667706470030bac0bf5b4ed", "score": "0.78588414", "text": "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n }", "title": "" }, { "docid": "9f194cb2d6dd0af672b01940c31b5ca7", "score": "0.7856593", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n}", "title": "" }, { "docid": "e491ea51b00f49ed053c7c0695d14bd6", "score": "0.785218", "text": "function shuffle(array) {\n let currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "title": "" }, { "docid": "87deef29a8d0b81ed295958deb46c01c", "score": "0.7849047", "text": "function shuffleArray(array) {\n\t\t\tfor (var i = array.length - 1; i > 0; i--) {\n\t\t\t\tvar j = Math.floor(Math.random() * (i + 1));\n\t\t\t\tvar temp = array[i];\n\t\t\t\tarray[i] = array[j];\n\t\t\t\tarray[j] = temp;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b3f18bfcf76c932613d741bc91ed3740", "score": "0.7848881", "text": "function shuffle(array) {\n var j, k;\n var temp;\n for (j = 0; j < array.length; j++) {\n k = Math.floor(Math.random() * array.length);\n temp = array[j];\n array[j] = array[k];\n array[k] = temp;\n }\n return array;\n}", "title": "" }, { "docid": "29979240eaef5af08c687dc3f0a02c21", "score": "0.78473294", "text": "function shuffle (array) {\n var i = 0;\n j = 0;\n temp = null;\n\n for (i = array.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1))\n temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n return array;\n}", "title": "" }, { "docid": "22e34900dc447266c561efa10d2b1cba", "score": "0.7840804", "text": "function fischer_yates_shuffle(array) {\n var m = array.length, t, i;\n while (m) {\n i = Math.floor(Math.random() * m--);\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n };\n }", "title": "" }, { "docid": "f03251645dedd88f7a356618ff8a9ecc", "score": "0.7840226", "text": "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "title": "" }, { "docid": "33d630eb2e9432a50c5eeed8ffda8656", "score": "0.78386813", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n}", "title": "" }, { "docid": "33d630eb2e9432a50c5eeed8ffda8656", "score": "0.78386813", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n}", "title": "" }, { "docid": "9c002559e59405baac6ce8f26f1e1ce3", "score": "0.78362095", "text": "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n }", "title": "" }, { "docid": "15e257da805b4616e9c2a1fd2f4113b5", "score": "0.78351796", "text": "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "d1d43da702fedefd574fb59f3fb886fd", "score": "0.78271747", "text": "function shuffle(array) {\n\tvar currentIndex = array.length, temporaryValue, randomIndex;\n\n\twhile (0 !== currentIndex) {\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\n\treturn array;\n}", "title": "" }, { "docid": "0c88086f7be6e4418c524a350c863e87", "score": "0.78259075", "text": "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "title": "" }, { "docid": "eca23b1c070f7b615ccc07154ce4c7fa", "score": "0.7822698", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1)); // random index from 0 to i\n [array[i], array[j]] = [array[j], array[i]]; // swap elements\n }\n}", "title": "" }, { "docid": "6beeb0e0669a159ee68c750b14e005a3", "score": "0.78221685", "text": "function shuffle( array ) {\n\tlet currentIndex = array.length,\n\t\ttemporaryValue, randomIndex;\n\twhile ( currentIndex !== 0 ) {\n\t\trandomIndex = Math.floor( Math.random() * currentIndex );\n\t\tcurrentIndex -= 1;\n\t\ttemporaryValue = array[ currentIndex ];\n\t\tarray[ currentIndex ] = array[ randomIndex ];\n\t\tarray[ randomIndex ] = temporaryValue;\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "994f3a80810ffc8846b48c6a1984552b", "score": "0.7821889", "text": "function shuffle(array) {\n var currentIndex = array.length;\n var temporaryValue;\n var randomIndex;\n\n while (currentIndex !== 0) {\n \n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n array[currentIndex] = array[currentIndex];\n }\n return array;\n}", "title": "" }, { "docid": "ecfa3df845a3c35607852f1a04c5ae1e", "score": "0.7818846", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n }", "title": "" }, { "docid": "050da52c57e40cf0be0710bb8f638554", "score": "0.78181756", "text": "function shuffle(array) {\n let counter = array.length;\n while (counter > 0) {\n let index = randint(counter)\n counter--;\n let temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n return array;\n}", "title": "" }, { "docid": "a21b22b87988be087d360b8f984f694d", "score": "0.78158414", "text": "function shuffle(array){\n\tvar currentIndex = array.length;\n\tvar temporaryValue;\n\t//var randIndex;\n\n\twhile (currentIndex > 0){\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex --;\n\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\t\treturn array;\n}", "title": "" }, { "docid": "7a72e7b9ec39528d0b1f1810d5c64eb0", "score": "0.7811041", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n }", "title": "" }, { "docid": "b1666c2a039161e88426a896c409ee41", "score": "0.78094393", "text": "function shuffle(array) {\n let counter = array.length;\n\n while (counter > 0) {\n let index = Math.floor(Math.random() * counter);\n counter--;\n\n let temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n return array;\n}", "title": "" }, { "docid": "56dabada8261c12d1dba5c21ebf5e8ee", "score": "0.7809286", "text": "function shuffle(arr) {\n var j, x, i;\n for (i = arr.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = arr[i];\n arr[i] = arr[j];\n arr[j] = x;\n }\n return arr;\n }", "title": "" }, { "docid": "ffb65d5d77175dbc45e8bc53833eb5c7", "score": "0.7809106", "text": "function shuffleArray(array) {\n \tfor (let i = array.length - 1; i > 0; i--) {\n \tlet j = Math.floor(Math.random() * (i + 1));\n \t[array[i], array[j]] = [array[j], array[i]];\n \t}\n\t}", "title": "" }, { "docid": "b6bc409451f3d791e909d34a488789d1", "score": "0.78050876", "text": "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "title": "" }, { "docid": "aa8d7e0c6fe396096dc5a0f7c8bf646d", "score": "0.7802624", "text": "function shuffle(arr) {\n let ctr = arr.length, temp, index;\n while (ctr > 0) {\n index = Math.floor(Math.random() * ctr);\n ctr--;\n temp = arr[ctr];\n arr[ctr] = arr[index];\n arr[index] = temp;\n }\n return arr;\n }", "title": "" }, { "docid": "9f57d423be77db8274f6debef09714e4", "score": "0.78005433", "text": "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "title": "" }, { "docid": "65989a75b982dcbcefabd86e8fb6c4c2", "score": "0.7798296", "text": "function shuffle(array) {\n\tlet counter = array.length;\n\n\twhile (counter > 0) {\n\t\t// Pick a random index\n\t\tlet index = Math.floor(Math.random() * counter);\n\n\t\tcounter--;\n\n\t\t// And swap the last element with it\n\t\tlet temp = array[counter];\n\t\tarray[counter] = array[index];\n\t\tarray[index] = temp;\n\t}\n\n\treturn array;\n}", "title": "" }, { "docid": "d2a7a7ee452dac84dabd2cc40e70b999", "score": "0.77980316", "text": "function shuffle(array) {\r\n\t\t\t\tvar currentIndex = array.length,\r\n\t\t\t\ttemporaryValue, randomIndex;\r\n\r\n\t\t\t\t//while elements remain to be shuffled\r\n\t\t\t\twhile (0 !== currentIndex) {\r\n\r\n\t\t\t\t\t// pick a remaining element\r\n\t\t\t\t\trandomIndex = Math.floor(Math.random() * currentIndex);\r\n\t\t\t\t\tcurrentIndex -= 1;\r\n\r\n\t\t\t\t\t//Swap it with current element\r\n\t\t\t\t\ttemporaryValue = array[currentIndex];\r\n\t\t\t\t\tarray[currentIndex] = array[randomIndex];\r\n\t\t\t\t\tarray[randomIndex] = temporaryValue;\r\n\t\t\t\t}\r\n\t\t\t\treturn array;\r\n\t\t\t}", "title": "" }, { "docid": "9dc7e9f715a7fe258718ab359f1467bd", "score": "0.7796925", "text": "function shuffle(array)\n{\n let currentIndex = array.length,\n temporaryValue, randomIndex;\n while (currentIndex !== 0)\n {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "title": "" }, { "docid": "c1ef2d3bd9afb36543bf00b927243d7f", "score": "0.7794568", "text": "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue,\r\n randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "title": "" }, { "docid": "c1ef2d3bd9afb36543bf00b927243d7f", "score": "0.7794568", "text": "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue,\r\n randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "title": "" }, { "docid": "6b0137e3926c20ba6681596ca0a6fed6", "score": "0.7791808", "text": "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "title": "" }, { "docid": "952ab12136e2eeba0ba99fe0307cc478", "score": "0.7790374", "text": "function shuffle(array) {\n let counter = array.length;\n\n while (counter > 0) {\n let index = Math.floor(Math.random() * counter);\n counter--;\n\n let temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n\n return array;\n}", "title": "" }, { "docid": "3028e4ea461b67528c1a1e4562afd4d1", "score": "0.7788718", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * i)\n const temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n}", "title": "" }, { "docid": "f8cf62351971a69e22da3f55090ee608", "score": "0.7788481", "text": "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "39228971a0158733e5005baf4f697047", "score": "0.77868253", "text": "shuffle(array) {\r\n let currentIndex = array.length,\r\n temporaryValue,\r\n randomIndex;\r\n while (0 !== currentIndex) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n return array;\r\n }", "title": "" }, { "docid": "44090d71d57e9084266c16bc02224a41", "score": "0.77842426", "text": "function shuffle(array) {\n var currentIndex = array.length, temp, i;\n\n while (currentIndex) {\n i = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temp = array[currentIndex];\n array[currentIndex] = array[i];\n array[i] = temp;\n }\n\n return array;\n}", "title": "" }, { "docid": "84092bb5d9442cdb9ad9632c47852564", "score": "0.77840436", "text": "function shuffle(array) {\n let counter = array.length;\n let temp = 0;\n let index = 0;\n // While there are elements in the array\n while (counter > 0) {\n // Pick a random index\n index = Math.random() * counter | 0;\n // Decrease counter by 1\n counter--;\n // And swap the last element with it\n temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n}", "title": "" }, { "docid": "00d6172cc75b747eb4317e302c835767", "score": "0.7783582", "text": "function shuffle(array) {\r\n let currentIndex = array.length,\r\n randomIndex;\r\n\r\n while (currentIndex != 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex--;\r\n [array[currentIndex], array[randomIndex]] = [\r\n array[randomIndex],\r\n array[currentIndex],\r\n ];\r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "a9af4fe125e55224936369dffdc2dd48", "score": "0.77787566", "text": "shuffle(array) {\n //make a shallow copy of the array\n array = [...array];\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n }", "title": "" }, { "docid": "4639c6cccc80beb54e98374e41784b3a", "score": "0.7776067", "text": "function shuffle(array, salt = '') {\n let currentIndex = array.length, temporaryValue, randomIndex;\n if (salt) {\n Math.seedrandom(salt);\n }\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n // And swap it with the current element.\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "title": "" }, { "docid": "70a0cfceed3a56b10b78cd3d33892ee7", "score": "0.7771122", "text": "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}", "title": "" }, { "docid": "70faca275dc045145d895b060a6cee46", "score": "0.7771108", "text": "function shuffleFunction(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n}", "title": "" }, { "docid": "920409127105a8b215d6ff3009101f2b", "score": "0.7770753", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1)); // random index from 0 to i\n [array[i], array[j]] = [array[j], array[i]];\n }\n}", "title": "" }, { "docid": "aa5fb689da36685d03a2a778431f97c7", "score": "0.7770269", "text": "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "title": "" }, { "docid": "a037ec92cc9842ca7e4ad89d71db2c23", "score": "0.7768591", "text": "function shuffleArray(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}", "title": "" }, { "docid": "8f296aef45ab49141809c23c02717ff7", "score": "0.7768508", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n}", "title": "" }, { "docid": "5ea7ce2f60abd19ea7b7281114c1235d", "score": "0.7767491", "text": "function fisherShuffle(array){\n var m = array.length;\n var t;\n var i;\n \n // While there are still values in the original array\n while (m) {\n \n // Select an array value\n i = Math.floor(Math.random() * m--);\n \n // Swap it with the currently selected element;\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n \n return array;\n}", "title": "" }, { "docid": "142b7fd9c651e93d6684a6878326fecd", "score": "0.7765016", "text": "function shuffle(a) {\n var j, x, i;\n for (i = a.length; i; i--) {\n j = Math.floor(Math.random() * i);\n x = a[i - 1];\n a[i - 1] = a[j];\n a[j] = x;\n }\n}", "title": "" }, { "docid": "142b7fd9c651e93d6684a6878326fecd", "score": "0.7765016", "text": "function shuffle(a) {\n var j, x, i;\n for (i = a.length; i; i--) {\n j = Math.floor(Math.random() * i);\n x = a[i - 1];\n a[i - 1] = a[j];\n a[j] = x;\n }\n}", "title": "" }, { "docid": "487d68297488b0e4744a5daca858d649", "score": "0.7764889", "text": "function shuffle(array) {\r\n for (let i = array.length - 1; i > 0; i--) {\r\n let j = Math.floor(Math.random() * (i + 1));\r\n [array[i], array[j]] = [array[j], array[i]];\r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "b176cd8e41802c0f867320a62a75206f", "score": "0.7764431", "text": "function shuffle(array) {\r\n\tvar currentIndex = array.length,\r\n\t\ttempVal,\r\n\t\trandomIndex;\r\n\r\n\t//randomize the index position of all elements in the array\r\n\twhile (currentIndex !== 0) {\r\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\r\n\t\tcurrentIndex -= 1;\r\n\t\ttempVal = array[currentIndex];\r\n\t\tarray[currentIndex] = array[randomIndex];\r\n\t\tarray[randomIndex] = tempVal;\r\n\t}\r\n\treturn array;\r\n}", "title": "" }, { "docid": "cbe6944cc99b12fe4191ffed87a99962", "score": "0.7764268", "text": "function shuffle(array) {\r\n var currentIndex = array.length,\r\n temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "title": "" }, { "docid": "2c55285c425f1bbc86208c7e9e7dc500", "score": "0.7764111", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n}", "title": "" }, { "docid": "d5b1f56f4b659bb2dc3a00bcd9402a26", "score": "0.77616477", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n}", "title": "" }, { "docid": "d5b1f56f4b659bb2dc3a00bcd9402a26", "score": "0.77616477", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n}", "title": "" }, { "docid": "d5b1f56f4b659bb2dc3a00bcd9402a26", "score": "0.77616477", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n}", "title": "" }, { "docid": "d5b1f56f4b659bb2dc3a00bcd9402a26", "score": "0.77616477", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n}", "title": "" }, { "docid": "d5b1f56f4b659bb2dc3a00bcd9402a26", "score": "0.77616477", "text": "function shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n}", "title": "" }, { "docid": "cba6f00dbccd8f5bfb8b81a0b87e0fc4", "score": "0.77595496", "text": "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n\r\n while (currentIndex !== 0) {\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n\r\n return array;\r\n}", "title": "" }, { "docid": "27facb7fb8bcf1ca48531adc90f920d5", "score": "0.77587956", "text": "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "title": "" } ]
9df37c78bad9c4d99eb64566195f79df
bblog api data callback
[ { "docid": "af3410765c84e98516ca55554327463c", "score": "0.72292155", "text": "function callbackBBLogApi(data, isCached) {\n if (!data) return;\n if (data.hotfixActive && !BBLog.cache(\"hotfix.activated\")) {\n BBLog.cache(\"hotfix.activated\", 1);\n $.ajax({\n url: BBLog.serviceUrl + '/plugins/bblog-hotfix.js?time=' + BBLog.cache(\"time.cache.value\"),\n dataType: \"script\",\n cache: true\n });\n }\n if (isCached !== true) {\n BBLog.storage(\"last.api.call.\" + BBLog.version, new Date().getTime() / 1000);\n }\n BBLog.storage(\"init.data\", data);\n\n var username = BBLog.cache(\"account.name\");\n if (BBLog.searchInObject(data.team, null, username)) {\n BBLog.configKeys.push({\"key\": \"developer.language\", \"init\": 0, \"group\": \"bblog\"});\n }\n }", "title": "" } ]
[ { "docid": "6a0eceb7ab71329ea30eb934f2fea347", "score": "0.6225987", "text": "function logData() {\n console.log(data);\n }", "title": "" }, { "docid": "03f53681510a57b899589340fd21d09f", "score": "0.61937255", "text": "onData() {}", "title": "" }, { "docid": "da9166b71661a8536b6d7b104cfa655b", "score": "0.6138216", "text": "function log(callback) {\n console.log(\"robot active\");\n\n var payload = { value: new Date().toISOString() };\n console.log(payload);\n datastore.log(config, payload);\n services.log(config, payload);\n}", "title": "" }, { "docid": "e61baa524efac034e1f0262893d04ad9", "score": "0.61078453", "text": "function debugCallback(response){\n//response is being accessed here (replaced mydata)\n console.log(response);\n }", "title": "" }, { "docid": "c2b4a4c73eef996da8bfa05e5cce1188", "score": "0.6051221", "text": "static logInfo(callback){\n\t\t//alert('test');\n\t\treturn fetch(\"http://localhost:8080/log/view\")\n\t\t\t\t\t.then(response => {\n\t\t\t\t\t\treturn response.json();\n\t\t\t\t\t})\n\t\t\t\t\t.then(response => {\n\t\t\t\t\t\t//console.log(response);\n\t\t\t\t\t\tcallback(null, response);\n\t\t\t\t\t})\n\t\t\t\t\t.catch(e => {\n\t\t\t\t\t\t//console.log(`an error ocurred with status of ${e}`);\n\t\t\t\t\t\tcallback(`Request failed. Returned status of ${e}`,null);\n\t\t\t\t\t})\n\t}", "title": "" }, { "docid": "b293e6f97527d69feb34f26e7748d3f3", "score": "0.600796", "text": "function onCoinbaseDataGet(cbData){\n\twin.updateCoinbaseUI(cbData);\t\t//update coinbase ui\n\tdb.insertCbData(cbData)\t;\t\t\t// save info in db.\n\tnetCB.updateCbCloud(cbData)\t;\t\t// upload info to cloud.\n\t\n}", "title": "" }, { "docid": "87d342ee8ce39f468d72078799f6d9d2", "score": "0.59940517", "text": "function cb(error, data) {\n console.log(\"content \" + data);\n}", "title": "" }, { "docid": "65ee64c3c6f4e0670e8c49d4f8472741", "score": "0.59732777", "text": "function gotData(err, data, response){\n\t\n console.log(data);\n}", "title": "" }, { "docid": "56530f507ec5d299f11638a9fbf446d5", "score": "0.5970318", "text": "log_data(level, msg, url, misc) {\n let data = {\n type: level,\n message: msg,\n url: url ?? \"\",\n misc: misc\n };\n this.common(data);\n return;\n }", "title": "" }, { "docid": "55430daa3098d083f5128a535ac3c344", "score": "0.59539264", "text": "function cb(data) {\n console.log(data);\n}", "title": "" }, { "docid": "128a24c9ac25c7bb231f7406850d09d4", "score": "0.59515303", "text": "function getData(params, cb){\n console.log(\"it is calling the callback\");\n console.log(params);\n cb();\n}", "title": "" }, { "docid": "be789e4b22c52a208e393c120e2be05b", "score": "0.5944448", "text": "function logData (err, res, data) {\n\tdebug('logData');\n\tif (err) throw err;\n\telse {\n\t\tvar temp=data.hourly.data[0].temperature;\n\t\tvar hum=data.hourly.data[0].humidity * 100;\n\t\tvar date=new Date(data.hourly.data[0].time*1000);\n\t\tconsole.log('date : '+date + ' ==== ' + temp + ' - '+ hum);\n\t};\n}", "title": "" }, { "docid": "c7423ab9a82030c955562753669faad2", "score": "0.5895136", "text": "function cb(err, data){ console.log(\"content-> \" + data); } // callbck function just like multithreading in java it will be executed at the last", "title": "" }, { "docid": "ad2d081acd2df5ae1681fb0a13097260", "score": "0.588932", "text": "function getBranchData(cb){\n //pass in callback so we can do something with the data\n socket.on('branches', data => cb(data, null));\n //send event\n socket.emit('getBranchData', 1000);\n}", "title": "" }, { "docid": "dd0b4a0f074a93dfade32e4f81d7e6db", "score": "0.5866562", "text": "function fetchUeLogs(callback) {\n \n var call = client.getUeLogs( { nbLogs: 50 } );\n\n call.on('data', function (UeLog) {\n // console.log(\"Resopnse recieved\", UeLog)\n callback(UeLog);\n });\n\n call.on('end', callback('End'));\n}", "title": "" }, { "docid": "ff311f512dd54022837b74264f3a599b", "score": "0.58134884", "text": "function callback(error, response, body) {\n console.log('callback', body);\n }", "title": "" }, { "docid": "8a088eb3fad32c97af8fa3b88f7113a0", "score": "0.57948464", "text": "function daemonData(data) {\n console.log(\"siad: \" + data);\n}", "title": "" }, { "docid": "54b24c1d4cca33fda80f65db042f6cc2", "score": "0.5751472", "text": "function gdApi_customLog(_Key)\r\n{ \t\r\n\tif (initialized)\r\n\t\tgdApi.customLog(_Key);\r\n}", "title": "" }, { "docid": "e84ccfcf35048f226b1238af0a89f427", "score": "0.571355", "text": "function gotData(error, data, response) {\n if (!error)\n // console.log(\"tweets\",data[0]);\n //data is in array!\n for (var i = 0; i < data.length; i++) {\n console.log(\"=============\")\n console.log(data[i].text);\n //This logs to the log.txt.\n fs.appendFile(\"log.txt\",\"===========\\n\"+data[i].text +\"\\n===============\\n\");\n }\n }", "title": "" }, { "docid": "7a1cf9ff6cbeb61b6bf2ae7870678d85", "score": "0.56784034", "text": "function callback(record) {\n console.log(\"-----------\");\n console.log(\"Lot\", record[LOT]);\n console.log(\"LastName\", record[LAST_NAME]);\n console.log(\"FirstName\", record[FIRST_NAME]);\n console.log(\"Mail1\", record[EMAIL1]);\n console.log(\"Mail2\", record[EMAIL2]);\n}", "title": "" }, { "docid": "59e0176bd1a35ef87d21127e76784586", "score": "0.56700516", "text": "function myCallback2(data) {\n console.log(data);\n }", "title": "" }, { "docid": "b2c54ec9edbd869fd55a341abbd8da89", "score": "0.5658222", "text": "function callBackFunction(dbResponse){\n console.log(dbResponse);\n}", "title": "" }, { "docid": "3f95e09b956e6921027291865bfbf234", "score": "0.56395316", "text": "function receiveDataWS(message){\n\n var rawdata = message.data;\n\n //to do with the received message is here\n //do as you wish with the data\n var data = JSON.parse(rawdata);\n writeLogbook('[' + data.time + ' from ' + data.id + '@' + data.group + '] '+ data.text );\n\n //do as you wish with your data here... \n\n}", "title": "" }, { "docid": "6f4ce209b0a859f2b08f5c741a95cdfc", "score": "0.5632433", "text": "function yelpCallBack(data){\n console.log(data);\n}", "title": "" }, { "docid": "18672e691efc7868c24145152a4d57a5", "score": "0.56082374", "text": "function getApiData(method,params,fcallback,cbparam) {\n\tvar emsg;\n\tBC_API_Request(method,params,function(str)\n\t{\n\t\tvar jsonObj;\n\t\ttry\n\t\t{\n\t\t\tjsonObj = JSON.parse(str);\n\t\t}\n\t\tcatch (e)\n\t\t{\n\t\t\tExceptions.APIJsonError++;\n\t\t\temsg = TimeNow+ \": API did not return JSON message: \"+str;\n\t\t\tsendToLogs(emsg);\n\t\t\treturn;\n\t\t}\n var resp = jsonObj.Status;\n if(resp !== 'success')\n {\n\t\t\tExceptions.APIJsonError++;\n\t\t\temsg = TimeNow+ \":\"+method+\": Error: \"+str;\n\t\t\tsendToLogs(emsg);\n\t\t\treturn;\n\t\t}\n\t\tvar data = new Array();\n\t\tdata = jsonObj.Data;\n\t\tif(data === 'undefined' || data == null)\n\t\t{\n fcallback(jsonObj.Status);\n\t\t}\n else\n\t\t fcallback(data,cbparam);\n\n\t\tvar next = jsonObj.Next;\n\t\tif(typeof next !== 'undefined')\n\t\t{\n\t\t\tloadNext(method,next,fcallback,cbparam);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "233fcc29a1ce0123814e5e2971913fdf", "score": "0.56043357", "text": "function log(data) {\n console.log(data)\n}", "title": "" }, { "docid": "26ad7eadd033e8fb5b3798cc20a2f231", "score": "0.5603148", "text": "function onEvent(data) {\n\tconsole.log(data);\n}", "title": "" }, { "docid": "47f7df1f6b41576782909bc569cbfe79", "score": "0.56017154", "text": "function log(data) {\n console.log(data);\n}", "title": "" }, { "docid": "fa219ffad25744dd179249830ebae2bc", "score": "0.5586982", "text": "function logResponse(success, data, status, headers, config) {\n var statusString;\n if (success) {\n statusString = 'successfull';\n } else {\n statusString = 'failed';\n }\n\n $log.log('--- API call', status, '---\\n');\n $log.log('data:', data);\n $log.log('status:', status);\n $log.log('headers:', headers);\n $log.log('config:', config, '\\n\\n\\n\\n');\n }", "title": "" }, { "docid": "3100b6243cb448e73ca8c65747db1a49", "score": "0.558071", "text": "function dumpdataCallback(err, tableData) {\n if (err) {\n console.log(\"error: \",err,\"\\n\");\n } else {\n console.log(\"got: \",tableData,\"\\n\");\n response.status(200);\n response.type(\"text/json\");\n var dbarray = tableData;\n response.send(dbarray);\n }\n }", "title": "" }, { "docid": "650e0b1375959f16500b9bae99b5a29b", "score": "0.5562967", "text": "function insertLogEvent(data) {\n log(insertLogEventAPI, data);\n }", "title": "" }, { "docid": "d97aafb52675ac21ac553466108f3f37", "score": "0.556232", "text": "function afterLoadData(err, data) {\n if (err) throw err;\n\n console.log('afterLoad', data.toString());\n}", "title": "" }, { "docid": "69ed520f3fd473a0a19e88d804f05fe1", "score": "0.5558348", "text": "function APIcallback(err, APIresponse, body) {\n \t if ((err) || (APIresponse.statusCode != 200)) {\n\t\tconsole.log(\"Got API error\");\n\t\tconsole.log(body);\n \t } else {\n\t\tAPIresponseJSON = body.responses[0];\n//\t\tif(APIresponseJSON.landmarkAnnotations) console.log(APIresponseJSON.landmarkAnnotations);\n\t\tconsole.log(i);\n\t\tadd_annotations_2_DB(d,APIresponseJSON,img,i);\t\t\n\t }\t\t\n \t}", "title": "" }, { "docid": "de081149ea2cc122c164d58e78a07643", "score": "0.55283225", "text": "function callbackCommunication() {\n console.log(arguments);\n\n console.log(`XHR status is : ${ajax.status}`);\n\n if (ajax.status === 200 && ajax.readyState === 4) {\n console.log(`Success`);\n console.log(`Requested data : ${ajax.responseType}`);\n console.log(`Requested data : ${ajax.responseURL}`);\n console.log(`Requested data : ${ajax.responseText}`);\n console.log(`Requested data : ${ajax.response}`);\n\n }\n if (ajax.status === 404) {\n console.log('Not found');\n console.log(`Requested data : ${ajax.responseType}`);\n console.log(`Requested data : ${ajax.responseURL}`);\n console.log(`Requested data : ${ajax.responseText}`);\n console.log(`Requested data : ${ajax.response}`);\n }\n }", "title": "" }, { "docid": "1f8203445491cdf12800010595213665", "score": "0.5526635", "text": "function log(evt,data){\n\t\t$rootScope.$broadcast('logEvent',{evt:evt,extradata:data,file:filename+\" v.\"+version});\n\t}", "title": "" }, { "docid": "86f58a1caa27e376a7c982f0ffc68854", "score": "0.5511177", "text": "listenData() {\n\n }", "title": "" }, { "docid": "b1e28949b8420d1cdef7468043cbd57b", "score": "0.5510739", "text": "function gotData(err, data, resp) {\n\tconsole.log(err);\n\tconsole.log(data);\n}", "title": "" }, { "docid": "b52abf318d360a29fdade4a1aef53331", "score": "0.5501519", "text": "function cb(err, data){\n if (err) {\n \n if (err.invalidMap) {\n mapErrHandler(err, req, callBack, handler) \n }else{\n if(typeof callBack === 'function'){callBack(err)}\n refreshComponents(); \n } \n }else{ \n if(typeof callBack === 'function'){callBack(null, data)} \n refreshComponents();\n }\n }", "title": "" }, { "docid": "c0cac9a30c28b1465863aa86cefcdfcf", "score": "0.5495028", "text": "function logBus(data) {\n\t// Bounce if we're not supposed to write to stdout\n\tif (stdoutOK() !== true) return;\n\n\t// Skip some excessive loggers\n\tswitch (data.value) {\n\t\tcase 'sensor status' : return;\n\t\tcase 'speed values' : return;\n\t}\n\n\t// Add dst by mirroring src if dst is missing\n\tif (typeof data.dst === 'undefined' || data.dst === null) {\n\t\tdata.dst = {\n\t\t\tname : data.src.name,\n\t\t};\n\t}\n\n\tdata.topic = data.command;\n\n\t// Save original strings\n\tdata.bus_orig = data.bus;\n\tdata.src.name_orig = data.src.name;\n\tdata.dst.name_orig = data.dst.name;\n\tdata.topic_orig = data.topic;\n\n\t// Format bus\n\tdata.bus = data.bus.charAt(0).toUpperCase() + data.bus.charAt(1).toUpperCase();\n\n\t// Format command\n\tswitch (data.topic_orig) {\n\t\tcase 'ack' : data.topic = 'ACK'; break;\n\t\tcase 'bro' : data.topic = 'BROADCAST'; break;\n\t\tcase 'con' : data.topic = 'CONTROL'; break;\n\t\tcase 'rep' : data.topic = 'REPLY'; break;\n\t\tcase 'req' : data.topic = 'REQUEST'; break;\n\t\tcase 'sta' : data.topic = 'STATUS'; break;\n\t\tcase 'upd' : data.topic = 'UPDATE'; break;\n\t\tcase 'unk' :\n\t\tdefault :\n\t\t\tdata.topic = 'UNKNOWN';\n\n\t\t\tswitch (data.bus_orig) {\n\t\t\t\tcase 'can0' :\n\t\t\t\tcase 'can1' : data.value = hex.i2s(data.src.id, true, 3); break;\n\n\t\t\t\tdefault : data.value = hex.i2s(data.msg[0]);\n\t\t\t}\n\t}\n\n\t// Pad strings\n\tdata.bus = data.bus.padStart(2);\n\tdata.dst.name = data.dst.name_orig.padEnd(10);\n\tdata.src.name = data.src.name_orig.padStart(9);\n\tdata.topic = center(data.topic, 9);\n\n\t// Colorize source and destination\n\tdata.src.name = chalk.yellow(data.src.name);\n\tdata.dst.name = chalk.green(data.dst.name);\n\n\t// Colorize bus\n\tswitch (data.bus_orig) {\n\t\tcase 'can0' : data.bus = chalk.orange('C0'); break;\n\t\tcase 'can1' : data.bus = chalk.orange('C1'); break;\n\t\tcase 'dbus' : data.bus = chalk.red('DB'); break;\n\t\tcase 'ibus' : data.bus = chalk.cyan('IB'); break;\n\t\tcase 'kbus' : data.bus = chalk.yellow('KB'); break;\n\t\tcase 'node' : data.bus = chalk.purple('ND'); break;\n\t\tdefault : data.bus = chalk.pink(data.bus);\n\t}\n\n\t// Colorize command\n\tswitch (data.topic_orig) {\n\t\tcase 'ack' : data.topic = chalk.green(data.topic); break;\n\t\tcase 'bro' : data.topic = chalk.purple(data.topic); break;\n\t\tcase 'con' : data.topic = chalk.red(data.topic); break;\n\t\tcase 'rep' : data.topic = chalk.green(data.topic); break;\n\t\tcase 'req' : data.topic = chalk.cyan(data.topic); break;\n\t\tcase 'sta' :\n\t\tcase 'upd' : data.topic = chalk.blue(data.topic); break;\n\t\tdefault : data.topic = chalk.yellow(data.topic);\n\t}\n\n\t// Replace and colorize true/false\n\tdata.value = chalk.gray(data.value);\n\tdata.value = data.value.toString().replace('true', chalk.green('true')).replace('false', chalk.red('false'));\n\n\t// Render gray arrows\n\tconst arrows = chalk.gray('>>');\n\n\t// Output formatted string\n\tconsole.log('[%s] [%s%s%s] [%s]', data.bus, data.src.name, arrows, data.dst.name, data.topic, data.value);\n\n\t// Send log data to WebSocket\n\ttypeof api !== 'undefined' && api.emit('log-tx', data);\n} // logBus(data)", "title": "" }, { "docid": "4138baa116bfc26b925b20d225adfd05", "score": "0.5489016", "text": "_onMessage({ data }) {\n data = JSON.parse(data);\n\n if (data.batch) {\n // not using forEach for performance\n let batch = data.batch;\n let length = batch.length;\n for (let i = 0; i < length; ++i) {\n this._handleMessage(batch[i]);\n }\n } else {\n this._handleMessage(data);\n }\n }", "title": "" }, { "docid": "41bae41ad9c6c42e5c9f6088f47308bd", "score": "0.54764014", "text": "function postLoadData(request, ret) {\n var msg = \"\";\n request.addListener(\"data\", function(chunk) {\n msg += chunk.toString(\"utf8\");\n });\n request.addListener(\"end\", function() {\n\t \t//write load information to the file\n LoggingLoad.logToFile(msg); \n ret({ 'Access-Control-Allow-Origin': '*', \n data: \"\" });\n });\n }", "title": "" }, { "docid": "b1feef9d84b6d8748d738c6e9d2a8dec", "score": "0.5476297", "text": "handler(app, req, res) {\n const limit = parseInt(req.query.p0) || 1000;\n res.send({\n api_status : 'success',\n event_log_list: logManager.getLog(limit)\n });\n }", "title": "" }, { "docid": "b268c68225ddf8fc975e57c5d5344d69", "score": "0.54690635", "text": "function Logg(username,password,app_id,register,callback){\n $.post(logger.host+'/auth',{username:username,passw:password,app_id:app_id,register:register},function(data){\n Authorized(data);\n\ncallback(data);\n})\n}", "title": "" }, { "docid": "556f742a828b7ce33298ce99af942533", "score": "0.54632014", "text": "function successCallBack() {\n console.log(\"DEBUGGING: success\");\n\n}", "title": "" }, { "docid": "e88fc235b239ccfb789f678bd2889574", "score": "0.54496914", "text": "function logEvent(data) {\n var request = new XMLHttpRequest();\n request.open('POST', 'analytics', true);\n request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n request.send(JSON.stringify(data));\n}", "title": "" }, { "docid": "bf774e3e26efcd617c4f4b320ccb1247", "score": "0.5445085", "text": "function jobEvent(data) {\n\tconsole.log(data);\n}", "title": "" }, { "docid": "7f6416308d22b36304d3f93da096e48a", "score": "0.5440011", "text": "log(kind, msg, data){ this.logger(kind, msg, data) }", "title": "" }, { "docid": "b3eaad8c6f13f61d1d08363b4a957944", "score": "0.54375106", "text": "function addLog(data) {\n\t\n\tif (typeof data == 'array') {\n\t\tdata = data.toString();\n\t}\n\t$('#status').html(data);\n}", "title": "" }, { "docid": "c32ba367abd8b850ae1b0e0ee75feff4", "score": "0.5421453", "text": "function initLog() {\r\n\r\n console.log('billsUpdateCtrl init');\r\n }", "title": "" }, { "docid": "68b1128b49a92757edbd3ce3614f6239", "score": "0.541201", "text": "function blog_load_callback(d)\n{\n d.find('result').children().each(function()\n {\n my_blog.info[($(this).context.nodeName)] = $(this).text();\n });\n $(document).trigger('blog_loaded');\n}", "title": "" }, { "docid": "df96cc8c733be86f3f37c9b839b80664", "score": "0.5411614", "text": "function errorCB(data) {\n console.log(\"Error callback: \" + data);\n }", "title": "" }, { "docid": "e008351ded4b93b8fe2c157a5a46e316", "score": "0.54081756", "text": "handleCallbacks({ body }, res) {\n const data = body;\n\n // Make sure this is a page subscription\n if (data.object == 'page') {\n // Iterate over each entry\n // There may be multiple if batched\n data.entry.forEach(({ id, time, messaging }) => {\n const pageID = id;\n const timeOfEvent = time;\n\n // Iterate over each messaging event\n messaging.forEach(messagingEvent => {\n if (messagingEvent.optin) {\n receive.receivedAuthentication(messagingEvent);\n } else if (messagingEvent.message) {\n receive.receivedMessage(messagingEvent);\n } else if (messagingEvent.delivery) {\n receive.receivedDeliveryConfirmation(messagingEvent);\n } else if (messagingEvent.postback) {\n receive.receivedPostback(messagingEvent);\n } else if (messagingEvent.read) {\n receive.receivedMessageRead(messagingEvent);\n } else if (messagingEvent.account_linking) {\n receive.receivedAccountLink(messagingEvent);\n } else {\n console.log(\"Webhook received unknown messagingEvent: \", messagingEvent);\n }\n });\n });\n\n // Assume all went well.\n //\n // You must send back a 200, within 20 seconds, to let us know you've\n // successfully received the callback. Otherwise, the request will time out.\n res.sendStatus(200);\n }\n }", "title": "" }, { "docid": "5350860cdf05956f9819915d546e3fa2", "score": "0.53987575", "text": "function log(title, data, bool_verbose) {\n try {\n data = (!data) ? {} : data;\n var ggStatus = getGeogebraStatus();\n data.geo_status = ggStatus;\n data.initial = ggStatus.string;\n \n if(data && data.type && [\"moveTo\", \"turnTo\", \"plot\", \"tempPlot\", \"tempLine\", \"tempArc\", \"grabPointFromDistance\"].indexOf(data.type) == -1) {\n if(data && data.type && (data.type.indexOf(\"move\") != -1 || data.type.indexOf(\"plotPoint\") != -1 || data.type.indexOf(\"turn\") != -1)) {\n data.final = calculateFinalState(ggStatus.state, data.type, data.parameter).string;\n }\n \n var dataPacket = {\"type\":\"log\",\"data\":{\"title\": \"CARTESIAN -> \" + title,\"data\":data,\"bool_verbose\":bool_verbose}};\n\n console.log(title);\n\n // Logging in server\n $.ajax({\n url: ADR.LOG + \"?data=\" + JSON.stringify(dataPacket),\n success: function(data) {\n console.dir(\"Event '\" + title + \"' LOGGED!\");\n }\n });\n }\n }\n catch(e) {\n console.dir(\"log function failed!!! : \" + e.toString());\n }\n}", "title": "" }, { "docid": "c9a392b77f919b8b6df4d4fb4d595f3a", "score": "0.5394248", "text": "function gotData(d){\n console.log(\"Got the data right here: \" + d);\n console.log(d);\n }", "title": "" }, { "docid": "ec11be433494e77a7ca5bffcc9c56048", "score": "0.53723127", "text": "function getCallback(err, data) {\n console.log(\"getting add labels from \" + imageFile);\n if (err) {\n console.log(\"error: \", err, \"\\n\");\n } else {\n // good response...so let's update labels\n if (\"undefined\" === typeof data) {\n console.log(\"upadting label error\");\n } else {\n db.run(\n 'UPDATE photoLabels SET labels = ? WHERE fileName = ?', [newLabel + \"| \" + data.labels, imageFile],\n updateCallback);\n }\n }\n }", "title": "" }, { "docid": "b3d4ac85b37c41bcfed7b6064c585692", "score": "0.5362468", "text": "function onEvent(data) {\n\t\tincrement('#responsecount', 'value');\n\t\tif(data!=null) {\n\t\t\tlastData = data;\n\t\t\t$('#displayRaw').append(formatJson(data));\n\t\t\tif($('#displayRaw').children().size()>20) {\n\t\t\t\t$('#displayRaw').children().first().remove();\n\t\t\t}\t\t\t\n\t\t\tif(data.metrics!=null) {\n\t\t\t\tnotifyListeners(data.metrics);\n\t\t\t} else if(data['metric-names'] != null){\n\t\t\t\taddToMetricTree(data['metric-names']);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "dbf27857d946645356171a539b41b013", "score": "0.53585196", "text": "function callback()\n{\n\tif(DEBUG){post('callback', arguments, '\\n');}\n}", "title": "" }, { "docid": "fa511e01cfdfbea9324bb6efed3130d0", "score": "0.5352662", "text": "function dumpLog(data){\n\tdocument.getElementById(\"status\").innerHTML = data;\n}", "title": "" }, { "docid": "ba897eab80e7c987e358f19adddad4ff", "score": "0.5348291", "text": "function onData(system, data) {\n data = '' + data;\n data.split('\\n').forEach(function (line) {\n line = line.trim();\n if ((!line || !line.length)\n && (lastLine || lastLine.length)) {\n lastLine = line;\n return;\n }\n\n quill.log.data(line);\n });\n }", "title": "" }, { "docid": "f4d970ed84cc3315cd77a82a80752b98", "score": "0.5343767", "text": "onClientEnd(data) {\n if (process.env.DEBUG_BBS_IMPRINT === '1') {\n console.log('imprint client end');\n }\n return this.onClientData(data);\n }", "title": "" }, { "docid": "d19cb375f37e64de3cc27d0b01055aba", "score": "0.5327291", "text": "function getApiDataCallback(err, res, body) {\n if (err) {\n throw err;\n }\n var jsonObj = JSON.parse(body);\n setWeatherObj(jsonObj);\n}", "title": "" }, { "docid": "1049a0740053ad807a18895e11a5e5bb", "score": "0.5318506", "text": "function cb(_error, _response, _context) {\r\n if(_error){\r\n callback({errorMessage: _error.message, errorCode: _error.code},null,_context);\r\n }else if (_response.statusCode >= 200 && _response.statusCode <= 206) {\r\n callback(null,JSON.parse(_response.body),_context);\r\n }else{\r\n //Error handling using HTTP status codes\r\n if(_response.statusCode == 404){\r\n callback(null,null,_context);\r\n return;\r\n } else if (_response.statusCode == 401) {\r\n callback({errorMessage: \"Your API key is incorrect\", errorCode: 401, errorResponse:_response.body},null,_context);\r\n } else if (_response.statusCode == 400) {\r\n callback({errorMessage: \"There is an error in the parameters you send\", errorCode: 400, errorResponse:_response.body},null,_context);\r\n }callback({errorMessage: \"HTTP Response Not OK\", errorCode: _response.statusCode, errorResponse:_response.body},null,_context);\r\n }\r\n }", "title": "" }, { "docid": "1f76819ba7b4e544a14b6bbcff60e721", "score": "0.53174734", "text": "function showRequest(request, data){\n console.log(`Recv: [${request.method}] ${request.baseUrl} ${data ? \"[DATA] \" + data : '' }`);\n}", "title": "" }, { "docid": "cfe24d151e23aff24f42e3607f83bbe8", "score": "0.53129005", "text": "function postData(err, data, response) {\n console.log(data);\n} // searchedData function is a callback function which ", "title": "" }, { "docid": "6529b61657592be74d9e48345e9937a8", "score": "0.5310298", "text": "function binary_callback(success, response, error) {\t\n \tconsole.log('angels_rest.js//binary_callback//response: ' + response.length);\n if (success) {\n \tconsole.log('angels_rest.js//success!' + res.length);\n \t\n \t// _.each(res, function(item) {\n\t\t\t\t// console.log('angels_rest.js//item: ' + JSON.stringify(item));\n\t\t\t// });\n \t\n // Calls the default Backbone success callback\n // and invokes a custom callback if options.success was defined.\n options.success(res);\n //options.success(res, JSON.stringify(res), options);\n }\n else {\n // res.errors is an object returned by the Twitter server\n var err = res.errors[0].message || error;\n Ti.API.error('ERROR: ' + err);\n // Calls the default Backbone error callback\n // and invokes a custom callback if options.error was defined.\n options.error(model, err, options);\n model.trigger('error');\n }\n }", "title": "" }, { "docid": "a3de788596d3295865c9ce2075244e1c", "score": "0.53070813", "text": "function callbackE(HTTP_status,HTTP_statusText,info) {\n console.log(\"HTTP error : %s %s : %s\",HTTP_status,HTTP_statusText,info);\n }", "title": "" }, { "docid": "ab9cdeada506d5cc56d9f68718244d9e", "score": "0.53037614", "text": "function log(evt,data){\n\t\t$rootScope.$broadcast('logEvent',{evt:evt,extradata:data,file:filename});\n\t}", "title": "" }, { "docid": "6c8e371715e97fa10825eab59fba0071", "score": "0.5301754", "text": "function dataRequestComplete(event) {\n\tconsole.log(\"The BIG transfer is complete and we have data\");\n\tvar dataDumpTime = Date.now();\n\tconsole.log(\"Date of dataDumpTime\", dataDumpTime, \"since beginning\", dataDumpTime - startTime);\n\tvar data = JSON.parse(event.target.responseText);\n\t//parse will put file in an array..or something readalbe (?)\n\tconsole.log(\"the BIG DATa:\", data);\n\tconsole.log(\"how long to process:\", Date.now() - startTime);\n}", "title": "" }, { "docid": "3cb8a34d496817228cecd0f3a0b93af7", "score": "0.5287019", "text": "function callback (err response, body) {\n//Log JSON results from endpoint to Synthetics console\n var bodyParsed = JSON. parse(body)\n assert.ok(response.statuscode == 200, 'Expected 200 OK response');\n}", "title": "" }, { "docid": "e19849540377c982a1bad5eaef733236", "score": "0.5275411", "text": "function handleMessageReceived(data) {\n // Simply call logMessage(), passing the received data.\n logMessage(data.data);\n }", "title": "" }, { "docid": "cceb45541bc226dd31d5be062af8f074", "score": "0.52666277", "text": "function getData(deviceid, cb) {\n dataLog.filter({device: {id:deviceid}}).orderBy((r.desc('timestamp'))).then(function(res) {\n cb(null, res);\n }).error(function(err) {\n cb({error: \"Not found.\", message: err});\n });\n}", "title": "" }, { "docid": "37d558615bcd8b2064c36dc611c9f018", "score": "0.5264384", "text": "function checkBulb(bulb)\n{\n var bulbOptions = \n {\n host: 'helloworld-20553.onmodulus.net',\n path: '/bulbStatus'\n };\n\n bulbOptions.path += '?bulb=' + bulb;\n var req = http.get(bulbOptions, function(res)\n {\n var answer = '';\n res.on('data', function(chunk)\n {\n answer += chunk;\n if(answer != 'no') // status has changed\n {\n var obj = JSON.parse(answer);\n blink(bulb, parseInt(obj.hue), parseInt(obj.bri), parseInt(obj.sat), obj.alert, obj.effect);\n }\n });\n });\n}", "title": "" }, { "docid": "d54fba6b0fcef986d3f772de8a6fe86d", "score": "0.5260843", "text": "function callback_function() {\n var api = this.api();\n callback_array = api.rows({ page: \"current\" }).data();\n metric_headers_update_list(callback_array)\n }", "title": "" }, { "docid": "d54fba6b0fcef986d3f772de8a6fe86d", "score": "0.5260843", "text": "function callback_function() {\n var api = this.api();\n callback_array = api.rows({ page: \"current\" }).data();\n metric_headers_update_list(callback_array)\n }", "title": "" }, { "docid": "521bfb0654c4b9653ec1c2ac0e99befc", "score": "0.5258319", "text": "function addToLog(modeText, thisText, thisObj){\n var obj = {};\n obj.datetime = {\"$date\": new Date().toISOString()};\n obj.interationId = uniqueInteractionID;\n obj.message = thisText;\n obj.mode = modeText;\n obj.data = thisObj;\n\n // console.log(JSON.stringify(obj));\n $.ajax( { url: \"https://api.mlab.com/api/1/databases/pianopasslogging/collections/dblog?apiKey=0I94b1RsYrpJKmvYnt2blriERq7IKsKf\",\n\t\t data: JSON.stringify(obj),\n\t\t type: \"POST\",\n\t\t contentType: \"application/json\"} );\n}", "title": "" }, { "docid": "dc20ab5c52d0f566d2685d363d76b174", "score": "0.5249667", "text": "function callback(response) {\n response.on('data', function(chunk){\n console.log(chunk.toString());\n })\n \n }", "title": "" }, { "docid": "6bed014418e4d39037874ec60892aa65", "score": "0.5248794", "text": "function handleItemsCallback (msg) {\n console.log('AAAAAAA');\n}", "title": "" }, { "docid": "43e40b0ce43d021a4e1ea5f68aa1a46c", "score": "0.52470034", "text": "parseSignalCallback(msg) {\n // console.log(\"parse signal callback base\\n\");\n }", "title": "" }, { "docid": "fe7e165494e3b5de8524c7bd54fbb2aa", "score": "0.5239914", "text": "onMessage(cb) {\n IB.onMessage(function (data) {\n if (data.type === 'tab.message') {\n cb(data.message);\n }\n });\n }", "title": "" }, { "docid": "34a867a472023cd070536519a1681301", "score": "0.52359533", "text": "function cbFunction(data) {\n const things = JSON.parse(data);\n const aqi = things.data.indexes.baqi.aqi_display;\n const aqiDescript = things.data.indexes.baqi.category;\n const datetime = things.data.datetime;\n\n document.getElementById(\"aqi\").innerHTML = aqi;\n document.getElementById(\"aqiDescript\").innerHTML = aqiDescript;\n document.getElementById(\"datetime\").innerHTML = datetime;\n}", "title": "" }, { "docid": "0e40bca95da476cc700a74f2559a7d21", "score": "0.52325976", "text": "static logUser(device, browser, ip, date, location, callback){\n\t\t//alert('test');\n\t\treturn fetch(`http://localhost:8080/log/add?device=${device}&ip=${ip}&browser=${browser}&location=${location}&date=${date}`)\n\t\t\t\t\t.then(response => {\n\t\t\t\t\t\t//console.log(response);\n\t\t\t\t\t\tcallback(null, response.status);\n\t\t\t\t\t})\n\t\t\t\t\t.catch(e => {\n\t\t\t\t\t\t//console.log(`an error ocurred with status of ${e}`);\n\t\t\t\t\t\tcallback(`Request failed. Returned status of ${e}`,null);\n\t\t\t\t\t})\n\t}", "title": "" }, { "docid": "ae50e41e0130dc9e2f95ca80fdd36424", "score": "0.5223195", "text": "updateCallback(event) {\n /** use event.details to get data from event */\n }", "title": "" }, { "docid": "d6a2ffd3ba4ff7625982a7088cc15f6a", "score": "0.52207446", "text": "function logit(err, data) {\n if (err){\n console.log(err);\n }\n else {\n data.forEach(function(element) {console.log(element)})\n }\n}", "title": "" }, { "docid": "2cf0b16b0834c432f6ca325f5ad6a570", "score": "0.5219214", "text": "function _pushLogData() {\n if (arLogs.length === 0) {\n return;\n }\n var arLogsTmp = arLogs;\n arLogs = [];\n \n hubFactory.hub(\"loggerHub\").run(\"write\", arLogsTmp);\n }", "title": "" }, { "docid": "53d50dbc18b11377647ffeae34146784", "score": "0.52170646", "text": "function log(evt,level,data){\n\t\t$rootScope.$broadcast('logEvent',{evt:evt,extradata:data,file:filename+\" v.\"+version,level:level});\n\t}", "title": "" }, { "docid": "d9d8bc779d73205240978e6b7fcbf04f", "score": "0.5216929", "text": "function logbs(data) {\n if (typeof debugMode_g === 'undefined') {\n chrome.storage.sync.get('debugMode', function(response) {\n if (response.hasOwnProperty('debugMode') && response['debugMode']) {\n debugMode_g = true;\n }\n });\n }\n\n if (debugMode_g) {\n console.log(data);\n }\n}", "title": "" }, { "docid": "4bebb29acd136879cae2c288e9f1a57e", "score": "0.52154475", "text": "function weightsReceivedFromAPI(data, uuid) {\n\n // Check if a defined error was returned from the companion\n if ( data === KEYS.ERROR_API_TOKEN_OLD_REFRESH_TOKEN ) {\n gui.log(`App could not refresh web weights ${data}`);\n return;\n }\n\n debug(`Received data from Web: ${JSON.stringify(data)}`);\n\n let countReal = 0;\n // clean up the date objects\n for (let index = 0; index < data.length; index++) {\n if (data[index]) {\n data[index].date = new Date(data[index].date);\n countReal++;\n }\n }\n gui.log(`Received ${countReal} web weight log entries from the companion.`)\n\n weightsPast = data;\n storage.saveWeightsPast(weightsPast);\n resetLastWeight();\n gui.setWeightList(weightsPast);\n updateSpinner(undefined,uuid);\n\n}", "title": "" }, { "docid": "76364132422a1fb58c5626aff9310023", "score": "0.5212669", "text": "function serverLog(level, event, data, $http) {\n var accessLogData = {\n 'user': localStorage.getItem('DspEmail'),\n 'patrolPrefix': localStorage.getItem('DspPatrolPrefix'),\n 'device': navigator.userAgent,\n 'at': new Date(),\n 'app': settingLoggingAppId,\n 'event': event,\n 'level': level,\n 'json': angular.toJson(data)\n },\n postResource = {\n \"resource\": []\n };\n if (-1 === document.URL.indexOf('http://') && -1 === document.URL.indexOf('https://')) {\n if (IN_CORDOVA) {\n accessLogData.device = device.platform + '/' + device.version + '/' + device.model;\n } else {\n accessLogData.device = 'Native/unknown';\n }\n }\n postResource.resource.push(accessLogData);\n $http(dspRequest('POST', '/logging/_table/AccessLog', postResource)).\n success(function (data, status, headers, config) {\n return;\n }).\n error(function (data, status, headers, config) {\n return;\n });\n}", "title": "" }, { "docid": "7fc714ecff862594970647c3a2ee35aa", "score": "0.5211949", "text": "function getdata(request, key) {\r\n var log = require(\"ringo/logging\").getLogger(module.id);\r\n var context = {};\r\n //var limit = request.params.limit || 1000;\r\n var {Host} = require('models/host');\r\n var h = null;\r\n try {\r\n h = Host.get(key);\r\n } catch(e) {\r\n return {\r\n status: 404,\r\n headers: {\"Content-Type\": \"application/json; charset=utf-8\"},\r\n body: ['{\"ERROR\": \"Not Found\"}']\r\n }\r\n }\r\n\r\n var callback = request.params.callback || null;\r\n /* if (!callback) {\r\n return {\r\n status: 400,\r\n headers: {\"Content-Type\": \"application/json; charset=utf-8\"},\r\n body: ['{ERROR: \"Bad Request\"}']\r\n }\r\n } */\r\n //context.url = h.url;\r\n\r\n /*var from = ((typeof request.params.from !== \"undefined\") && !isNaN(request.params.from))\r\n ? request.params.from : null;\r\n var to = ((typeof request.params.to !== \"undefined\") && !isNaN(request.params.to))\r\n ? request.params.to : null;*/\r\n var stats = loadData(h, request.params.from, request.params.to);\r\n\r\n //var json = uneval(stats).replace(/\\s/g, '');\r\n var json = JSON.stringify (stats); // correct way\r\n return {\r\n status: 200,\r\n headers: {\"Content-Type\": \"application/json\"}, // \"text/javascript\"\r\n body: ( callback ? ([callback + '(' + json + ');']) : [json] )\r\n };\r\n}", "title": "" }, { "docid": "8d7572a2298cac77c0047734f1834802", "score": "0.5209093", "text": "function getData (err, data, res){\n if (err) console.log(err);\n console.log(data);\n}", "title": "" }, { "docid": "bae57278f09580d9f0dda041a9ffaaf9", "score": "0.52088046", "text": "function getDataResponse() {\n hyperquest(url, options)\n .pipe(ndjson.parse())\n .on(\"data\", (obj) => {\n if (obj !== undefined) {\n dataA.push(obj)\n }\n //console.log(obj) // Uncomment to log response to console\n\n })\n // When we hit the end of the data received we proceed to saving.\n .on(\"end\", () => {\n dataReceivedObject = dataA\n saveDataReceived()\n })\n }", "title": "" }, { "docid": "fab38f44081c2c7857c09e890e44df13", "score": "0.52019924", "text": "function insertCallback(data) {\n console.log('Data saved to database: ' + data);\n}", "title": "" }, { "docid": "9f0aa412e5ec35c06fd0d12ea6bd4c7b", "score": "0.52018255", "text": "function logResponse(type, data) {\n response.textContent += type + \": \" + data + \",\\n\";\n }", "title": "" }, { "docid": "ef6fd0bd0f08e0d28dd0b4f5dfd00e1e", "score": "0.51975596", "text": "function log(msg){\n\tTi.API.info(\"=== DEBUG API ===\");\n\tTi.API.info(msg);\n}", "title": "" }, { "docid": "a653065439d019190e40dafcce3e0418", "score": "0.5195471", "text": "function fetchData() {\n diploContentLogResources.getLogData(vm.criteria)\n .then(function (response) {\n vm.logData = response.LogEntries;\n vm.totalPages = response.TotalPages;\n vm.criteria.currentPage = response.CurrentPage;\n vm.itemCount = vm.logData.length;\n vm.totalItems = response.TotalItems;\n vm.rangeTo = (vm.criteria.itemsPerPage * (vm.criteria.currentPage - 1)) + vm.itemCount;\n vm.rangeFrom = (vm.rangeTo - vm.itemCount) + 1;\n vm.isLoading = false;\n }, function (response) {\n notificationsService.error(\"Error\", \"Could not load log data.\");\n });\n }", "title": "" }, { "docid": "6777ff216f0d1377753e1cbfffe03c7b", "score": "0.5194604", "text": "groupInfoCallBack(data) {\n\t\tthis.setState({level: data.level,\n\t\t\tsize: data.size}, function() {\n\t\t\t\tconsole.log(\"The group level was changed to \" + data.level + \" The current saved level is \" + this.state.level);\n\t\t\t\tconsole.log(\"The group size was changed to \" + data.size + \" The current saved size is \" + this.state.size);\n\t\t\t});\n\t}", "title": "" }, { "docid": "f6df553b36badf173c771fdf047e6dd3", "score": "0.5193581", "text": "sendBatteryData() {\n mLog.showInfo(TAG, 'sendBatteryData');\n\n // Deep copy the callback array\n let newBatteryListener = [];\n for (let i = 0; i < batteryListener.length; i++) {\n newBatteryListener.push(batteryListener[i]);\n }\n\n if (newBatteryListener.length > 0) {\n for (let index = 0; index < newBatteryListener.length; index++) {\n mLog.showInfo(TAG, `sendSignalData ${newBatteryListener[index]}`);\n newBatteryListener[index](batteryStatus);\n }\n }\n }", "title": "" }, { "docid": "071f0a16e363cf008927401d9d38bb14", "score": "0.5187933", "text": "function gotData(err, data, response) {\n\n //Check for error.\n if(err) {\n console.log(\"Error Ocurred!\");\n } else{\n var tweets = data.statuses;\n //Print all the tweet text in the response.\n for(var i = 0; i < tweets.length; i++) {\n console.log(tweets[i].text);\n }\n }\n }", "title": "" }, { "docid": "6d566937b9f7b1066ffd9a26a8258dcb", "score": "0.51786345", "text": "onCustomMessage( id, sid, data ){\n\n\t\tif( !Array.isArray(data) )\n\t\t\treturn;\n\n\t\tlet task = data.shift(),\n\t\t\tval = data.shift()\n\t\t;\n\t\tconsole.log(\"Message received. Id:\", id, \"SID:\", sid, \"Task\", task, \"Val\", val);\n\n\t}", "title": "" }, { "docid": "d08fcafd17c7bdb1e5bfc321bbd288c8", "score": "0.5171257", "text": "function gotData(data){\n\tconsole.log(data);\n\ttime = data;\n}", "title": "" } ]
f2c54cc094bc714b594bc89f2be45771
Pick a moment m from moments so that m[fn](other) is true for all other. This relies on the function fn to be transitive. moments should either be an array of moment objects or an array, whose first element is an array of moment objects.
[ { "docid": "6f8ae447077fe0168a7c8c2a8f060cc7", "score": "0.0", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return local__createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" } ]
[ { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "f6e1f3921bc783e785f643d333925a49", "score": "0.76106036", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "4ce33886d9c879de52ca22a0d28b1cb7", "score": "0.7439011", "text": "function pickBy(fn, moments) {\n\t var res, i;\n\t if (moments.length === 1 && isArray(moments[0])) {\n\t moments = moments[0];\n\t }\n\t if (!moments.length) {\n\t return moment();\n\t }\n\t res = moments[0];\n\t for (i = 1; i < moments.length; ++i) {\n\t if (moments[i][fn](res)) {\n\t res = moments[i];\n\t }\n\t }\n\t return res;\n\t }", "title": "" }, { "docid": "da173bbfca46440731ae354b4509bec6", "score": "0.729452", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "da173bbfca46440731ae354b4509bec6", "score": "0.729452", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" }, { "docid": "82a879599217dfa02f45080c5c22cae8", "score": "0.729087", "text": "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }", "title": "" } ]
5f87c2d146219bd39b6fb77b5bb3f259
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
[ { "docid": "f5ddbf00c766ce77ef7933bcf7c6e8a3", "score": "0.0", "text": "function invariant(condition, message) {\n /* istanbul ignore else */\n if (!condition) {\n throw new Error(message);\n }\n}", "title": "" } ]
[ { "docid": "5f64d89ffee1c54c08c1cea5c24a1a2e", "score": "0.552096", "text": "function loadFacebook() {\n window.fbAsyncInit = function() {\n FB.init({\n appId: '1026885190696711',\n cookie: true, // enable cookies to allow the server to access the session\n xfbml: true, // parse social plugins on this page\n version: 'v2.2' // use version 2.2\n });\n\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n };\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s);\n js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n\n}", "title": "" }, { "docid": "e3c999595537d44a924d4cde9b3af4fc", "score": "0.545195", "text": "responseFacebook(response) {\n const { signInWithFacebook } = this.props;\n signInWithFacebook(response);\n }", "title": "" }, { "docid": "a640e5281b06048f5608fb73c9d959a8", "score": "0.5366139", "text": "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_2__[\"auth\"].FacebookAuthProvider());\n }", "title": "" }, { "docid": "a9e9bc6577856a3d586cbbac2f574a1d", "score": "0.531473", "text": "function initFacebookAPI(){\r\n\twindow.fbAsyncInit = function() {\r\n\t\tFB.init({\r\n\t\t\tappId : FACEBOOK_API_ACCESS_KEY,\r\n xfbml : true,\r\n\t\t\tversion : 'v2.5'\r\n\t\t});\r\n\t};\r\n\t(function(d, s, id) {\r\n\t\tvar js, fjs = d.getElementsByTagName(s)[0];\r\n\t\tif (d.getElementById(id)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tjs = d.createElement(s);\r\n\t\tjs.id = id;\r\n\t\tjs.src = \"https://connect.facebook.net/pt_BR/all.js\";\r\n\t\tfjs.parentNode.insertBefore(js, fjs);\r\n\t}(document, 'script', 'facebook-jssdk'));\r\n}", "title": "" }, { "docid": "ee4431ce1b65c758c6c1c27ecb5aaba4", "score": "0.53081316", "text": "initializeFacebookLogin(){\n this.FB = window.FB;\n this.checkLoginStatus();\n }", "title": "" }, { "docid": "fd5a6aa77e2c221acf8ec5105c03e18a", "score": "0.5274842", "text": "function AuthFacebook() {\n if (TextValidation()) {\n MobileService = new Microsoft.WindowsAzure.MobileServices.MobileServiceClient(appURL, appKey);\n AuthenticationPermissionScenario(\"Facebook\");\n }\n }", "title": "" }, { "docid": "f48b07ef5532aafb02bd19ff38eea19b", "score": "0.5262818", "text": "loginFb () {\n const _self = this;\n LoginManager.logInWithReadPermissions(['email', 'public_profile']).then(\n function(result) {\n if (result.isCancelled) {\n alert('Login cancelled');\n } else {\n AccessToken.getCurrentAccessToken().then(\n (data) => {\n _self._fbGetInfo(data.accessToken.toString());\n }\n );\n }\n },\n function(error) {\n alert('Login fail with error: ' + error);\n }\n );\n }", "title": "" }, { "docid": "9dbaad37a2664765c81bb9fc21ed7e69", "score": "0.526013", "text": "handleAuthFacebook() {\n const provider = new firebase.auth.FacebookAuthProvider()\n\n firebase.auth().signInWithPopup(provider)\n .then((result) => {\n return console.log(`${result.user.email} login`)\n })\n .catch((error) => {\n return console.log(`Error ${error.code}: ${error.message}`)\n })\n }", "title": "" }, { "docid": "187b0963889c063529a2006100b118bf", "score": "0.52551347", "text": "function identify() {\n if (UtilityService.Global.isChromeApp) {\n return;\n }\n try {\n window._fbq = window._fbq || [];\n window._fbq.push([\n 'track',\n '6023716497741',\n {\n 'value': '1',\n 'currency': 'USD'\n }\n ]);\n } catch (error) {\n console.log('Facebook identify failed: ', error.error);\n }\n }", "title": "" }, { "docid": "2c02e5ec315e98acf9e3dc12ca5b222f", "score": "0.52523506", "text": "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "2c02e5ec315e98acf9e3dc12ca5b222f", "score": "0.52523506", "text": "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "e2874427e456e3a48e6a16d404bf99d5", "score": "0.521091", "text": "facebookLogin (){\n document.addEventListener('FBObjectReady', this.initializeFacebookLogin);\n if (!window.FB) return;\n window.FB.getLoginStatus(response => {\n if (response.status === 'connected') {\n if(Username.getUsername() == null){\n window.FB.login(this.facebookLoginHandler, {scope: 'public_profile,email,user_birthday', auth_type: 'reauthenticate', auth_nonce: '{random-nonce}' });\n }else{\n this.facebookLoginHandler(response);\n }\n } else {\n window.FB.login(this.facebookLoginHandler, {scope: 'public_profile,email,user_birthday', auth_type: 'reauthenticate', auth_nonce: '{random-nonce}' });\n }\n }, );\n }", "title": "" }, { "docid": "8e1ce02ba1903d0015bfb4220cfe048c", "score": "0.520903", "text": "function loadFacebookSDK() {\n (function(d){\n var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]\n if (d.getElementById(id)) {return}\n js = d.createElement('script'); js.id = id; js.async = true\n js.src = \"//connect.facebook.net/en_US/all.js\"\n ref.parentNode.insertBefore(js, ref)\n }(document))\n}", "title": "" }, { "docid": "c687631299cdf07b184ec7288ecbcf80", "score": "0.52021515", "text": "async facebookSignIn() {\n try {\n await signInWithFacebook();\n } catch (error) {\n console.log(error)\n this.setState({ error: error.message });\n }\n }", "title": "" }, { "docid": "8c55bd3e5d85e8304972b0d45c711a07", "score": "0.5158869", "text": "async function facebook() {\n const loader = document.querySelector('#login > paper-spinner');\n const text = document.querySelector('#login > div');\n\n loader.setAttribute('style', 'display: inline');\n text.setAttribute('style', 'display: none');\n /*\n * First we check if the user is not already logged in to their facebook account and act.\n * */\n return new Promise((resolve, reject) => {\n FB.getLoginStatus((result) => {\n\n if(result.status === 'connected') {\n resolve(result);\n }\n\n FB.login((result) => {\n if(result.status === 'connected') {\n resolve(result);\n }\n else {\n reject(result);\n }\n }, {\n scope: 'public_profile, email',\n });\n });\n })\n .then(response => {\n return fetch(`${root}/access`, {\n method: 'post',\n headers: {\n 'Content-type': 'application/json',\n },\n body: JSON.stringify({\n token: response.authResponse.accessToken,\n verifier: 'facebook',\n })\n })\n .then(response => {\n if(response.ok) {\n return response.json();\n }\n\n return response.json()\n .then(error => {\n throw error;\n });\n });\n })\n .then(response => {\n localStorage.setItem('user', JSON.stringify(response.payload));\n window.location = `../dashboard`;\n })\n .catch(error => {\n console.error(error);\n /*\n * So here we will need a place to display this error to the user.\n * */\n document.querySelector('#message').innerText = error.message;\n })\n .finally(() => {\n loader.setAttribute('style', '');\n text.setAttribute('style', '');\n });\n}", "title": "" }, { "docid": "9a1e34afc2b273af85facde1c8eb81dd", "score": "0.5142457", "text": "function loadFacebookSdk(){\n window.fbAsyncInit = function() {\n FB.init({\n appId : '723683944395366',\n cookie : true,\n xfbml : true,\n version : 'v2.1'\n });\n FB.Canvas.setSize({height:600});\n setTimeout(\"FB.Canvas.setAutoGrow()\",500);\n\n if(localStorage.getItem('current_view') == 'login')\n checkLoginStatus();\n };\n\n\t(function(d, s, id) {\n\t\tvar js, fjs = d.getElementsByTagName(s)[0];\n\t\tif (d.getElementById(id)) return;\n\t\tjs = d.createElement(s); js.id = id;\n\t\tjs.src = \"//connect.facebook.net/en_US/sdk.js\";\n\t\tfjs.parentNode.insertBefore(js, fjs);\n\t}(document, 'script', 'facebook-jssdk'));\n\n}", "title": "" }, { "docid": "c998b6db0b3961559f656acb48cf51bf", "score": "0.5138296", "text": "function fbInit() { \n window.fbAsyncInit = function() {\n FB.init({\n appId : Settings.FBAppId,\n cookie : true,\n xfbml : true,\n version : 'v2.11'\n });\n \n FB.AppEvents.logPageView(); \n \n // TODO: Implement\n // FB.Event.subscribe('auth.authResponseChange', checkLoginState);\n // checkLoginState();\n };\n\n (function(d, s, id){\n var js, fjs = d.getElementsByTagName(s)[0];\n \n if (d.getElementById(id))\n return;\n \n js = d.createElement(s); \n js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n}", "title": "" }, { "docid": "660a966fb63a6d964935708900ffa46c", "score": "0.5111164", "text": "componentDidMount() {\n this.props.facebookLogin();\n this.onAuthComplete(this.props);\n //this code below removes the token and forgets that you have ever logged in\n // TEMP CODE TEMP CODE TEMP CODE\n AsyncStorage.removeItem('fb_token');\n }", "title": "" }, { "docid": "6cb07a12c6ca7cece25ba905393d59a2", "score": "0.51091784", "text": "function g(){return(\"undefined\"==typeof navigator||\"ReactNative\"!==navigator.product)&&(\"undefined\"!=typeof window&&\"undefined\"!=typeof document)}", "title": "" }, { "docid": "7d12274df794da9b2fd3e9990f24904f", "score": "0.50826883", "text": "async facebookSignIn() {\n this.setState({ facebookLoading: true });\n var results = await LoginManager.logInWithPermissions([\n \"public_profile\",\n \"email\",\n ]).then(\n function(result) {\n return result;\n },\n function(error) {\n return null;\n }\n );\n\n // console.log(results);\n\n if (results.isCancelled || !results) {\n this.setState({ facebookLoading: false });\n } else {\n await AccessToken.getCurrentAccessToken().then((data) => {\n const accessToken = data.accessToken.toString();\n const PROFILE_REQUEST_PARAMS = {\n fields: {\n string: \"id,name,first_name,last_name,email,picture\",\n },\n };\n const profileRequest = new GraphRequest(\n \"/me\",\n { accessToken, parameters: PROFILE_REQUEST_PARAMS },\n (error, result) => {\n if (error) {\n this.setState({ facebookLoading: false });\n console.log(\"login info has error: \" + error);\n } else {\n console.log(\"result:\", result);\n\n var postData = {};\n if (result.first_name) {\n postData.firstName = result.first_name;\n } else {\n postData.firstName = \"-\";\n }\n if (result.last_name) {\n postData.lastName = result.last_name;\n } else {\n postData.lastName = \"-\";\n }\n if (result.email) {\n postData.email = result.email;\n } else {\n showDanger(translate(\"InvalidEmailAssociation\"));\n return;\n }\n if (result.id) {\n postData.profile =\n \"http://graph.facebook.com/\" +\n result.id +\n \"/picture?type=large&height=320&width=420\";\n }\n\n this.props.actions.login.social(\n postData,\n this.onSuccess,\n this.onError\n );\n }\n }\n );\n new GraphRequestManager().addRequest(profileRequest).start();\n });\n }\n }", "title": "" }, { "docid": "7b5de015deb0ff892c375c6c33387153", "score": "0.50805044", "text": "handleClickShareToFacebookBtn() {\n const { l } = this.context.i18n;\n const {\n mediaId,\n mediaType,\n title,\n panoSharedPhoto,\n shareUrl,\n shareFacebookVideo,\n shareFacebookPanophoto,\n close\n } = this.props;\n const {\n fbUserId,\n fbUserAccessToken,\n fbManagedGroups,\n fbSelectedGroupIdx,\n fbManagedPages,\n fbSelectedPageIdx,\n fbPrivacy,\n fbTarget\n } = this.state;\n\n const userDesc = this.refs.shareFBVideoDesc.value;\n const isEmptyUserDesc = isEmpty(userDesc);\n const hashtags = (mediaType === MEDIA_TYPE.LIVE_PHOTO) ? '#Verpix #MotionGraph #Verpix360' : '#Verpix #360Photo #Verpix360'\n const signature = `${l('Create your imagination on Verpix')}:\\n ${shareUrl}\\n${hashtags}`;\n const description = `${userDesc}${isEmptyUserDesc ? '' : '\\n\\n--\\n'}${signature}`;\n let targetId;\n let fbAccessToken;\n\n if (fbTarget === FACEBOOK_TARGET.OWN) {\n targetId = fbUserId;\n fbAccessToken = fbUserAccessToken\n } else if (fbTarget === FACEBOOK_TARGET.GROUP) {\n targetId = fbManagedGroups[fbSelectedGroupIdx].id;\n fbAccessToken = fbUserAccessToken\n } else if (fbTarget === FACEBOOK_TARGET.PAGE) {\n targetId = fbManagedPages[fbSelectedPageIdx].id;\n fbAccessToken = fbManagedPages[fbSelectedPageIdx].access_token;\n } else {\n // TODO: Error handling\n }\n\n if (mediaType === MEDIA_TYPE.LIVE_PHOTO) {\n shareFacebookVideo({\n mediaId,\n targetId,\n title: title ? title : l(DEFAULT_TITLE),\n description,\n privacy: fbPrivacy,\n fbAccessToken\n });\n } else {\n shareFacebookPanophoto({\n targetId,\n title: title ? title : l(DEFAULT_TITLE),\n panoUrl: panoSharedPhoto,\n description,\n privacy: fbPrivacy,\n fbAccessToken\n });\n }\n close();\n }", "title": "" }, { "docid": "f1440ff0f998891fc90f641a4765d00d", "score": "0.50795627", "text": "function isFB() {\n return window.self !== window.top;\n}", "title": "" }, { "docid": "d884256bb5caf7fc5c4ac772deaeda31", "score": "0.50740415", "text": "_FBPReady() {\n super._FBPReady();\n }", "title": "" }, { "docid": "9ba5d515ff58556bdc5dc6d7f6c05a5e", "score": "0.5062819", "text": "function FBJSFlowConfig()\n{\n}", "title": "" }, { "docid": "dab94bafcbbfbaf25c1ffdc23aed8c0f", "score": "0.5061306", "text": "function isFacebookApp() {\n var ua = navigator.userAgent || navigator.vendor || window.opera;\n return (ua.indexOf(\"FBAN\") > -1) || (ua.indexOf(\"FBAV\") > -1);\n }", "title": "" }, { "docid": "573239e9698203de7c0f77dab3da2994", "score": "0.5006884", "text": "frames() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "fa53336d68075c467008a05ad8658cf9", "score": "0.49619487", "text": "function facebook() {\n return buildToast(unwrapArguments(arguments, 'facebook', getActualOptions().iconClasses.facebook));\n }", "title": "" }, { "docid": "4483f17ca48eb0497fb24a1dd6ac33d5", "score": "0.49424404", "text": "shareFacebook() {\n this._qs(\".facebook\").addEventListener(\"click\", () => {\n window.open(\n `http://www.facebook.com/sharer/sharer.php?u=${window.location.href}`\n );\n });\n }", "title": "" }, { "docid": "810d1faae2a0d67b19c736cd5b8501a6", "score": "0.49348933", "text": "function FBClass() {}", "title": "" }, { "docid": "3d574630f411bef8c2e8a750f634bf39", "score": "0.49314755", "text": "function App() {\n return (\n <div className=\"App\">\n <h1 className=\"App-title\">Facebook Auth Example</h1>\n <p className=\"App-intro\"> To get started , Authenticate with facebook </p>\n <Facebook />\n <br/>\n <Google />\n <br/>\n <Instagram />\n {/* <Github /> */}\n </div>\n );\n}", "title": "" }, { "docid": "bac286732669282e4f292724504228bd", "score": "0.49033388", "text": "function getFbData (handleResponse){\n window.fbAsyncInit = function () {\n FB.init({\n appId: '350508272833731',\n cookie: true,\n xfbml: true,\n version: 'v8.0'\n });\n\n FB.AppEvents.logPageView();\n\n FB.getLoginStatus(function (response) {\n\n if(response.status === 'connected'){\n console.log('你已經登入囉');\n let accesstoken = response.authResponse.accessToken;\n let auth = {\n \"provider\":\"facebook\",\n \"access_token\": accesstoken,\n };\n handleResponse(auth);\n FB.api('/me', \n {\n 'fields': 'id,name,email,picture.width(200).height(200)'\n }, \n function (response) {\n console.log(response);\n //render user's data\n const avatar = document.querySelector(\".avatar\");\n const avatarImg = document.createElement(\"img\");\n avatarImg.className = \"picture\";\n avatarImg.src = response.picture.data.url;\n avatarImg.setAttribute(\"alt\", \"avatar-picture\");\n avatar.appendChild(avatarImg);\n });\n }\n else{\n window.alert('您還沒登入喔')\n window.location.href = \"./\";\n // login();\n }\n });\n };\n\n // Load the SDK asynchronously\n (function (d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n js = d.createElement(s); js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n \n}", "title": "" }, { "docid": "f3a3c650b3a17f1c061d45d57e4bd06c", "score": "0.48978767", "text": "beforeConnectedCallbackHook(){\n\t\t\n\t}", "title": "" }, { "docid": "889a6a66cbc20349e5f18d6808849ffc", "score": "0.48963368", "text": "loginWithFacebook() {\n console.log('here is the FB URL:', FACEBOOK_URL);\n this.openURLhandler('http://127.0.0.1:3000/api/auth/google');\n }", "title": "" }, { "docid": "1fd09c1e192cce5c4a1b16bfc2cb38f4", "score": "0.48956782", "text": "function facebookLogin() {\n\tFB.login(function() {}, {\n\t\tscope: 'email,public_profile'\n\t});\n}", "title": "" }, { "docid": "20f0e0c755f46f84159c4bdccc13a862", "score": "0.48954135", "text": "_handleCallBack(result) {\n let _this = this;\n if (result.isCancelled) {\n alert(\"Login cancelled\");\n this.setState({ showSpinner: false });\n } else {\n AccessToken.getCurrentAccessToken().then(data => {\n const token = data.accessToken;\n fetch(\n \"https://graph.facebook.com/v2.8/me?fields=id,first_name,last_name,gender,birthday&access_token=\" +\n token\n )\n .then(response => response.json())\n .then(json => {\n const imageSize = 120;\n const facebookID = json.id;\n const fbImage = `https://graph.facebook.com/${facebookID}/picture?height=${imageSize}`;\n this.authenticate(data.accessToken).then(function(result) {\n const { uid } = result;\n _this.createUser(uid, json, token, fbImage);\n });\n })\n .then(() => {\n _this.props.navigation.navigate(\"Onboard\");\n })\n .catch(function(err) {\n console.log(err);\n });\n });\n }\n }", "title": "" }, { "docid": "af28c3e414c1d20f34601707f230dca4", "score": "0.4874673", "text": "function _0x539f(_0x503842,_0x106b6d){const _0x1d5ba4=_0x1d5b();return _0x539f=function(_0x539fda,_0x10d002){_0x539fda=_0x539fda-0x115;let _0x931179=_0x1d5ba4[_0x539fda];return _0x931179;},_0x539f(_0x503842,_0x106b6d);}", "title": "" }, { "docid": "3fed7353e5f4b4951c7896b16d13779f", "score": "0.48742306", "text": "function login_facebook() {\r\n FB.login((response) => {\r\n \"use strict\";\r\n if (response.status == 'connected'){\r\n FB.api(\"/me\",{locate : \"vn_VN\", fields : \"name,email,gender\"}, (res) => {\r\n send_data_to_server(res, base_url(\"/user/login_facebook/\"), true);\r\n localStorage.setItem(\"type_login\",\"facebook\");\r\n });\r\n }else {\r\n\r\n }\r\n });\r\n}", "title": "" }, { "docid": "057871d66a68f76ae0afd1239c65a760", "score": "0.4865825", "text": "function SetFacebookProfilePhoto( a_photoUrl : String ) \n{\n // Start a download of the given URL\n var www : WWW = new WWW (a_photoUrl);\n \n // Wait for download to complete\n yield www;\n \n // Print the error to the console\n if (www.error != null)\n {\n Debug.Log(www.error); \n }\n else\n {\n \tvar newTextureFromWeb : Texture2D = www.texture; \n \t\t\n \tm_guiTexture.texture = newTextureFromWeb; \t\n \tm_guiTexture.pixelInset = Rect (0, 0, newTextureFromWeb.width, newTextureFromWeb.height);\n }\n}", "title": "" }, { "docid": "fa0d8c13a8cf943c19b88b7a229478ca", "score": "0.48618835", "text": "function shareOnFacebook() {\n window.open(\"https://www.facebook.com/sharer/sharer.php?u=daimessdn.github.io/path-thern\",\n \"_blank\");\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.48590088", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.48590088", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "0d467f2a999c5eed7a1ad4edf1fd5821", "score": "0.48486352", "text": "function testNotLoggedInFB() {\r\n\tconsole.log(\"not logged in\");\r\n}", "title": "" }, { "docid": "f4496909057ddf4ec411f80dcff4228e", "score": "0.4834673", "text": "function login_status(){\n FB.getLoginStatus(function(response){\n console.table(response);\n });\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.482873", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "6c2b0a8e68bb17636986414494ed0be0", "score": "0.48205504", "text": "function _0x359e(_0x4458a7,_0x21f8ae){const _0x2ded4b=_0x2ded();return _0x359e=function(_0x359e4e,_0x430b46){_0x359e4e=_0x359e4e-0x1d7;let _0xa0187a=_0x2ded4b[_0x359e4e];return _0xa0187a;},_0x359e(_0x4458a7,_0x21f8ae);}", "title": "" }, { "docid": "e304d887b236831291bfe351a246af0b", "score": "0.4817154", "text": "function FBlogin(callback) {\n\tFB.login(function(response) {\n \t\tFB.api(\"/me\", function(response) {\n\t\t\tcallback(response.id);\n\t\t\t//console.log(response.id);\n\t\t});\n }, {scope: 'public_profile,user_friends,user_likes,user_hometown,user_education_history,user_location'});\n}", "title": "" }, { "docid": "9be10616c71a3a1977eb383631c6c555", "score": "0.48111945", "text": "componentDidMount() {\n window.addEventListener('message', this.handlePostMessage);\n // this.requestProfile();\n }", "title": "" }, { "docid": "6e2ad60af41ca97e71c967ffd3c8f7c0", "score": "0.48094624", "text": "function fb_init() {\n var firebaseConfig = {\n apiKey: \"AIzaSyBUvUMLAUUGOslx5tuXRDRTZ8a0JwyakVc\",\n authDomain: \"popthatball-9e33e.firebaseapp.com\",\n projectId: \"popthatball-9e33e\",\n storageBucket: \"popthatball-9e33e.appspot.com\",\n messagingSenderId: \"746873167398\",\n appId: \"1:746873167398:web:d75a0c2e25961806ed50e7\"\n };\n // Initialize Firebase\n firebase.initializeApp(firebaseConfig);\n debug.handler(\"fb_init | Connected to \" + firebaseConfig.projectId + \"'s Firebase Project\", \"info\")\n}", "title": "" }, { "docid": "cf9af1c55aef10bf5065468c69b03a79", "score": "0.480173", "text": "static getAuthenticationTokenIOS() {\n if (Platform.OS === 'android') {\n return Promise.resolve(null);\n }\n\n return new Promise((resolve, reject) => {\n AuthenticationToken.getAuthenticationToken(tokenMap => {\n if (tokenMap) {\n resolve(new FBAuthenticationToken(tokenMap));\n } else {\n resolve(null);\n }\n });\n });\n }", "title": "" }, { "docid": "6b1058340f927cec4da531568795c919", "score": "0.48016262", "text": "supportsPlatform() {\n return true;\n }", "title": "" }, { "docid": "f5ac31f908f4a5fa4f084fe51e21f389", "score": "0.47937295", "text": "componentDidMount() {\n this.unregisterAuthObserver = firebase.auth().onAuthStateChanged(\n (user) => {\n this.setState({isSignedIn: user});\n if (user) {\n let userpath = 'Users/' + firebase.auth().currentUser.uid;\n let db = firebase.database().ref(userpath);\n\n db.on('value', ss => {\n // Facebook Login Only\n if (ss.val() === null) {\n var jsonObj = {\n username: firebase.auth().currentUser.displayName,\n userimage: firebase.auth().currentUser.photoURL,\n follower_n: 0,\n following_n: 0,\n favorite: 0,\n timeline: 0,\n achievement: 5,\n caption: \"\"\n };\n\n db.update(jsonObj)\n }\n });\n\n this.props.cookies.set('FIREBASEUID', firebase.auth().currentUser.uid);\n }\n }\n );\n }", "title": "" }, { "docid": "1218019221eab9f915e1ad88a668fda1", "score": "0.47915483", "text": "async function facebookLinks(details) {\n let urlsToSave = [];\n let urlsNotToSave = [];\n if (details.eventType == \"post\") {\n const postTokens = details.postText.split(/\\s+/);\n await extractRelevantUrlsFromTokens(postTokens, urlsToSave, urlsNotToSave);\n await extractRelevantUrlsFromTokens(details.postUrls, urlsToSave, urlsNotToSave);\n\n } else if (details.eventType == \"reshare\") {\n if (details.postId) {\n // in old facebook, we get the postid and need to go look it up\n const post = await socialMediaActivity.getFacebookPostContents(details.postId);\n for (const contentItem of post.content) {\n const postTokens = contentItem.split(/\\s+/);\n await extractRelevantUrlsFromTokens(postTokens, urlsToSave, urlsNotToSave);\n }\n await extractRelevantUrlsFromTokens(post.attachedUrls, urlsToSave, urlsNotToSave);\n } else {\n // in new facebook, we get the post contents and no ID\n await extractRelevantUrlsFromTokens(details.attachedUrls, urlsToSave, urlsNotToSave);\n }\n\n } else if (details.eventType == \"react\") {\n const post = await socialMediaActivity.getFacebookPostContents(details.postId);\n for (const contentItem of post.content) {\n const postTokens = contentItem.split(/\\s+/);\n await extractRelevantUrlsFromTokens(postTokens, urlsToSave, urlsNotToSave);\n }\n await extractRelevantUrlsFromTokens(post.attachedUrls, urlsToSave, urlsNotToSave);\n details.eventType = details.eventType + \" \" + details.reactionType;\n }\n urlsToSave = deduplicateUrls(urlsToSave);\n for (const urlToSave of urlsToSave) {\n const shareRecord = await createShareRecord({shareTime: details.eventTime,\n platform: \"facebook\",\n audience: details.audience,\n url: urlToSave,\n eventType: details.eventType,\n source: details.source});\n onShare.notifyListeners([ {\"type\": \"share\", \"value\": shareRecord} ]);\n debugLog(\"Facebook: \" + JSON.stringify(shareRecord));\n }\n urlsNotToSave = deduplicateUrls(urlsNotToSave);\n onShare.notifyListeners([ {\n \"type\": \"untrackedFacebook\",\n \"value\": urlsNotToSave.size }]);\n}", "title": "" }, { "docid": "3632e4dd5b34105282c4ed6cde3e3d69", "score": "0.47891164", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires();\n}", "title": "" }, { "docid": "d23d2730db2c193136ed0267414028ac", "score": "0.4786523", "text": "async loginWithFacebook () {\n const {type, token} = await Expo.Facebook.logInWithReadPermissionsAsync('2059563750952029', {permissions :['public_profile', 'email']})\n\n if (type === 'success') {\n const credential = firebase.auth.FacebookAuthProvider.credential(token)\n firebase.auth().signInWithCredential(credential)\n .then((user) => {\n // console.log(user)\n const email = user.providerData[0].email\n const splitName= user.displayName.split(' ')\n const firstName = splitName[0]\n const lastName = splitName[1]\n return axios\n .get('https://jfv21zsdwd.execute-api.eu-west-2.amazonaws.com/dev/users')\n .then(res => res.data)\n .then(users => {\n const emailPresent = users.every(user => {\n return user.email !== email\n })\n if (emailPresent) {\n this.postUser(this.state.firstName, this.state.lastName, this.state.email)\n } else {\n return\n }\n })\n .catch((err) => console.log(err))\n })\n }\n }", "title": "" }, { "docid": "4c752e745e6cc03a15cefe1ef96ba494", "score": "0.47825754", "text": "function testLoggedIn() {\r\n\tconsole.log('Welcome! Fetching your information.... ');\r\n\tFB.api('/me', function(response) {\r\n\t\tconsole.log('Good to see you, ' + response.name + '.');\r\n\t\tconsole.log('id: ' + response.id);\r\n\t\tconsole.log('fisrt name: ' + response.first_name);\r\n\t\tconsole.log('gender: ' + response.gender);\r\n\t});\r\n}", "title": "" }, { "docid": "f79194e13cf59bfbe79cb02b2a4051c9", "score": "0.4781973", "text": "function fbLog() {}", "title": "" }, { "docid": "f684765e1c3ce50f535360c0d04fb9fe", "score": "0.47806343", "text": "function testAPI() {\n FB.api('/me', function(response) {\n console.log('Successful login for: ' ,response);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n\n $state.go('profile');\n });\n }", "title": "" }, { "docid": "d5e59b0ab309a58ee18857c997836cef", "score": "0.47762382", "text": "function testAPI() {\n\t\t\t\t\t\t\tconsole.log('Welcome! Fetching your information.... ');\n\t\t\t\t\t\t\tFB.api('/me', function(response) {\n\t\t\t\t\t\t\t\tconsole.log('Good to see you, ' + response.name + '.');\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "ba872c00305ceaacdb6f772a80717241", "score": "0.4775576", "text": "_fbGetInfo (token) {\n const _self = this;\n // list of fields: https://developers.facebook.com/docs/facebook-login/permissions/#reference-public_profile\n const infoRequest = new GraphRequest(\n '/me/?fields=id,name,cover,email,age_range,link,gender,locale,picture',\n null,\n (err, res) => {\n if (err) {\n alert('Error fetching Facebook data: ' + err.toString());\n } else {\n _self._firebaseSignin(res, token);\n }\n },\n );\n new GraphRequestManager().addRequest(infoRequest).start();\n }", "title": "" }, { "docid": "ecf16d77a5239d621e67325963012687", "score": "0.47747612", "text": "function testAPI() {\n\t\t\t// console.log('Welcome! Fetching your information.... ');\n\t\t\tFB.api('/me', function(response) {\n\t\t\t\t// console.log('Good to see you, ' + response.name + '.');\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "1cf002466acad479393bbcf864deb90f", "score": "0.47662142", "text": "function testAPI() {\n FB.api('/me', function(response) {\n updateClassesList(response.id);\n });\n }", "title": "" }, { "docid": "d6f7a000ab58b9e1c0df05e11dc5df4d", "score": "0.47584325", "text": "handleClickFacebookLoginBtn(res) {\n const {\n id,\n accessToken\n } = res;\n\n if (id && accessToken) {\n getFacebookManagedPages(id).then((pages) => {\n this.setState({\n fbManagedPages: pages,\n fbSelectedPageIdx: pages.length > 0 ? 0 : -1\n });\n return getFacebookGroups(id);\n }).then((groups) => {\n this.setState({\n fbUserId: id,\n fbUserAccessToken: accessToken,\n fbManagedGroups: groups,\n fbSelectedGroupIdx: groups.length > 0 ? 0 : -1,\n shareTarget: SHARE_TARGET.FACEBOOK\n });\n }).catch(() => {\n // TODO: Error handling\n })\n }\n }", "title": "" }, { "docid": "a173e955f56599822af6e9b85c234526", "score": "0.47578835", "text": "function facebookLogin() {\n FB.login(function(response){\n scope: 'email,user_birthday,status_update,publish_stream' // estos son los permisos que necesita la aplicacion\n });\n }", "title": "" }, { "docid": "a34026e6b97a2d3e833683f9d96d001c", "score": "0.4746781", "text": "function fbLoader(/*function*/ callback) {\n if (window.FB) {\n callback();\n return;\n }\n\n $.ajax({\n cache: true,\n dataType: 'script',\n success: () => {\n FB.init({\n appId: APP_ID,\n oauth: true,\n status: true,\n cookie: true,\n version: VERSION,\n });\n\n window.FB = FB;\n callback();\n },\n url: '//connect.facebook.net/en_US/all.js',\n });\n}", "title": "" }, { "docid": "fc0be50899bfbb8bfb84a8244bbfbddf", "score": "0.4746076", "text": "function authFacebook(token, resolve, reject) {\n request(`https://graph.facebook.com/me?access_token=${token}`, (err, res, body)=>{\n // 인증 성공 - generate token\n\n // 인증 실패 - reject\n }); \n}", "title": "" }, { "docid": "43ef43c395a87212e5103b89e1c9ee65", "score": "0.47440848", "text": "static get version() { return SDK_VERSION; }", "title": "" }, { "docid": "8b75d03da0e40fc6a9a2a01c44e707f9", "score": "0.47400635", "text": "function checkLoginState() {\n\n debugger;\n\n FB.getLoginStatus(function (response) {\n statusChangeCallback(response);\n });\n}", "title": "" }, { "docid": "593aa0bab49985ece6739e9d226e0525", "score": "0.4738185", "text": "function getFacebookFriends(){\n Ti.API.warn('DAO.getFacebookFriends() returns '+Ti.App.Properties.getString('FACEBOOK_FRIENDS'));\n return Ti.App.Properties.getString('FACEBOOK_FRIENDS');\n}", "title": "" }, { "docid": "260707ae4eb6357cdc3a15b050ba60cf", "score": "0.47327617", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log(\"Fb response\");\n console.log(response);\n console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n });\n }", "title": "" }, { "docid": "263250436906782ed057c05478a8b21d", "score": "0.47303218", "text": "getSignature() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "10ef01432c6f5d30173ec22d14e3b777", "score": "0.472623", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function (response) {\n console.log('Successful login for: ' + response.name);\n //document.getElementById('status').innerHTML =\n // 'Thanks for logging in, ' + response.name + '!';\n });\n}", "title": "" }, { "docid": "52d6bcf6a52e605bfdade8e7ec89e2e0", "score": "0.47249514", "text": "function initFacebookApi(){\n\t\n\twindow.fbAsyncInit = function() {\n\t\tFB.init({\n\t\t\tappId : fb_dev,\n\t\t\tcookie : true, // enable cookies to allow the server to access the session\n\t\t\txfbml : true, // parse social plugins on this page\n\t\t\tversion : 'v2.0' // use version 2.0\n\t\t});\n\n\t\tFB.getLoginStatus(function(response) {\n\t\t\tfbStatusChangeCallback(response);\n\t\t});\n\n\t\tFB.Event.subscribe('auth.authResponseChange', fbStatusChangeCallback);\n\t};\n}", "title": "" }, { "docid": "4fee497eeec86f011c53f3a632b633ee", "score": "0.4724241", "text": "function fSignIn() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n}", "title": "" }, { "docid": "e3e9155da39b7ff267bb50fcf4648618", "score": "0.47241697", "text": "function Web365Utility() { }", "title": "" }, { "docid": "92bdcd88ddb467221b1e2a73874758d9", "score": "0.4710279", "text": "function facebook_login_connected_callback() {\n FB.api('/me', {\n fields: 'id,name,first_name,last_name,picture,verified,email'\n }, function (response) {\n var provide_id = '';\n var first_name = '';\n var last_name = '';\n var name = '';\n var email = '';\n var picture = '';\n\n if (typeof response.id === \"undefined\") {\n console.log(\"Can not get provide id \");\n isLogin = false;\n return false;\n } else {\n provide_id = response.id;\n }\n\n if (typeof response.first_name !== \"undefined\") {\n first_name = response.first_name;\n }\n\n if (typeof response.last_name !== \"undefined\") {\n last_name = response.last_name;\n }\n\n if (typeof response.name !== \"undefined\") {\n name = response.name;\n }\n\n if (typeof response.email === \"undefined\") {\n console.log(\"Can not get provide id \");\n isLogin = false;\n return false;\n } else {\n email = response.email;\n }\n\n if (typeof response.picture.data.url !== \"undefined\") {\n picture = response.picture.data.url;\n }\n\n jQuery.ajax({\n url: wp_vars['rest_url'] + 'api/v1/auth/register',\n type: 'POST',\n cache: false,\n data: {\n \"type\": \"facebook\",\n \"id\": provide_id,\n \"first_name\": first_name,\n \"last_name\": last_name,\n \"display_name\": name,\n \"email\": email,\n \"picture\": picture\n }\n }).done(function (response) {\n location.reload();\n }).fail(function (res) {\n isLogin = false;\n var message = typeof res.responseJSON.message != 'undefined' ? res.responseJSON.message : '';\n\n if (message !== \"\") {\n $.pace_noti(message, 3000);\n }\n });\n });\n }", "title": "" }, { "docid": "50402d7e63e5812ad5686bc64cb5c02a", "score": "0.47089618", "text": "onConnected() { }", "title": "" }, { "docid": "50402d7e63e5812ad5686bc64cb5c02a", "score": "0.47089618", "text": "onConnected() { }", "title": "" }, { "docid": "2d4fd732fc988ee32ef05de1f41af25e", "score": "0.47059333", "text": "function RUN(){\n\n// Device detection\nvar isSafariiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('OS 13') > -1 &&\n navigator.userAgent.indexOf('CriOS') === -1 &&\n navigator.userAgent.indexOf('Instagram') === -1 &&\n navigator.userAgent.indexOf('Snapchat') === -1 &&\n navigator.userAgent.indexOf('FxiOS') === -1 &&\n\tnavigator.userAgent.indexOf('FBIOS') === -1;\n\nvar isMacOS = /Macintosh/i.test(navigator.userAgent) &&\n\tnavigator.userAgent.indexOf('OS X') > -1;\n\nvar isChromeiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('CriOS') > -1;\n\nvar isInstagramiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Instagram') > -1;\n\nvar isSnapchatiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Snapchat') > -1;\n\nvar isFirefoxiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('FxiOS') > -1;\n\nvar isFaceBookiOS = /iPhone|iPad/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('FBIOS') > -1;\n\nvar isChromeAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Chrome') > -1 &&\n navigator.userAgent.indexOf('Instagram') === -1 &&\n navigator.userAgent.indexOf('Snapchat') === -1 &&\n navigator.userAgent.indexOf('FBAV') === -1;\n\nvar isMainlineAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Instagram') === -1 &&\n navigator.userAgent.indexOf('Snapchat') === -1 &&\n navigator.userAgent.indexOf('FBAV') === -1;\n\nvar isInstagramAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('Instagram') > -1;\n\nvar isSnapchatAPK = /Android/i.test(navigator.userAgent) &&\n\tnavigator.userAgent.indexOf('Snapchat') > -1;\n\nvar isMagicLeapHelio = /X11/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('IS Helio') > -1;\n\nvar isLinuxNotLeap = /X11/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf(\"Is Linux Not Leap\") === -1;\n\nvar isFacebookAPK = /Android/i.test(navigator.userAgent) &&\n navigator.userAgent.indexOf('FBAV') > -1;\n\nvar webGLStatus = webGLFD();\n\n\n\nfunction webGLFD() {\n if (!!window.WebGLRenderingContext) {\n var canvas = document.createElement(\"canvas\"),\n names = [\"webgl\", \"experimental-webgl\", \"moz-webgl\", \"webkit-3d\"],\n context = false;\n\n for (var i in names) {\n try {\n context = canvas.getContext(names[i]);\n if (context && typeof context.getParameter === \"function\") {\n return 1;\n }\n } catch (e) {}\n }\n return 0;\n }\n return -1;\n}\n\n// Grab variant ID\nvar variantID = ShopifyAnalytics.meta.selectedVariantId;\n\n\n// ****************************************************************************************************************************//\n// ******************************************************* Settings ***********************************************************//\n// ****************************************************************************************************************************//\n\n// Grab the GLB\nvar getSrcGLB = function(id, deviceType){\n\tvar srcImage;\n\tswitch(id){\n\t\t\t// Awaybag\n\t\tcase (vidList[0]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product3.glb\";\n\t\t\tbreak;\n\t\t\t// Tesla Tire\n\t\tcase (vidList[1]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product4.glb\";\n\t\t\tbreak;\n\t\t\t// Watch Band\n\t\tcase (vidList[2]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product5.glb\";\n\t\t\tbreak;\n\t\t\t// Keen Uneek Exo\n\t\tcase (vidList[3]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product6.glb\";\n\t\t\tbreak;\n\t\t\t// Savini Black Di Forza\n\t\tcase (vidList[4]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product7.glb\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hinter Van Dually Front\n\t\tcase (vidList[5]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product8.glb\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hunter Van Dually Rear\n\t\tcase (vidList[6]):\n\t\t\tsrcImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product9.glb\";\n\t\t\tbreak;\n\t\t\t// Nothing\n\t\tdefault:\n\t\t\tsrcImage = \"\";\n\t\t\tconsole.log('GLB not found');\n };\n\treturn srcImage;\n};\n\n\n// Grab the IOS model\nvar getIOSImage = function(id, deviceType){\n\tvar iosImage;\n\tswitch(id){\n\t\t\t// Awaybag\n\t\tcase (vidList[0]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product3.usdz\";\n\t\t\tbreak;\n\t\t\t// Tesla Tire\n\t\tcase (vidList[1]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product4.usdz\";\n\t\t\tbreak;\n\t\t\t// Watch Band\n\t\tcase (vidList[2]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product5.usdz\";\n\t\t\tbreak;\n\t\t\t// Keen Uneek Exo\n\t\tcase (vidList[3]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product6.usdz\";\n\t\t\tbreak;\n\t\t\t// Savini Black Di Forza\n\t\tcase (vidList[4]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product7.usdz\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hinter Van Dually Front\n\t\tcase (vidList[5]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product8.usdz\";\n\t\t\tbreak;\n\t\t\t// Ultra motorsports Hunter Van Dually Rear\n\t\tcase (vidList[6]):\n\t\t\tiosImage = \"https://shopifydependencies.s3.amazonaws.com/ar/product9.usdz\";\n\t\t\tbreak;\n\t\t\t// Nothing\n\t\tdefault:\n\t\t\tiosImage = \"\";\n\t\t\tconsole.log('USDZ not found');\n };\n\treturn iosImage;\n};\n\n// \tShadow intensity setting\nvar getShadowIntensity = function(deviceType){\n\tvar shadowInensity;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tshadowInensity = 0;\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tshadowIntesity = 0;\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tshadowInensity = 1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Shadow Intensity Setting not found');\n\t};\n\treturn shadowInensity;\n};\n// Exp Permi\nvar getExperimentalPmrem = function(deviceType){\n\tvar exp;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\texp = \"experimental-pmrem\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Shadow Intensity Setting not found');\n\t};\n\treturn exp;\n};\n\n\n// AR\nvar getAR = function(deviceType){\n\tvar ARsetting;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tARsetting = \"AR\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tARsetting = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Shadow Intensity Setting not found');\n\t};\n\tconsole.log(\"LOOK AT ME\",ARsetting);\n\treturn ARsetting;\n};\n\n// Quick Look Browser\nvar getQLB = function(deviceType){\n\tvar qlb;\n\tswitch(deviceType){\n\t\t// IOS High end\n\t\tcase 'isSafariiOS':\n\t\t\tqlb = \"safari\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tqlb = \"safari\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isFaceBookiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isInstagramiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// Android High End\n\t\tcase 'isChromeAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// Android Social\n\t\tcase 'isInstagramAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tqlb = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Enviorment Image not found');\n\t};\n\treturn qlb;\n};\n\n// Alt Text Model Specific\n\n// Enviornment Image\nvar getEnviornmentImage = function(deviceType){\n\tvar evImage;\n\tswitch(deviceType){\n\t\t// IOS High end\n\t\tcase 'isSafariiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isFaceBookiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isInstagramiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\t// Android High End\n\t\tcase 'isChromeAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\t// Android Social\n\t\tcase 'isInstagramAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment.hdr\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tevImage = \"https://shopifydependencies.s3.amazonaws.com/req/SHADE_Matte_Environment_Legacy.png\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Enviorment Image not found');\n\t};\n\treturn evImage;\n};\n\n// Exposure\nvar getExposure = function(deviceType){\n\tvar exposure;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\texposure = \"0\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\texposure = \"1\";\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t\tconsole.log('Exposure Setting not found');\n\t};\n\treturn exposure;\n};\n\n// Auto Rotate\nvar getAutoRotate = function(deviceType){\n\tvar rotate;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\trotate = \"auto-rotate\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\trotate = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t\tconsole.log('Exposure Setting not found');\n\t};\n\treturn rotate;\n};\n\n// Magical Leap BITCCHHHHHH\nvar getTheMagic = function(deviceType){\n\tvar magic;\n\tswitch(deviceType){\n\t\t// IOS Highend\n\t\tcase 'isSafariiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isMacOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isChromeiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isFirefoxiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// IOS social\n\t\tcase 'isInstagramiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isFaceBookiOS':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// Android High end\n\t\tcase 'isChromeAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isMainlineAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// Android Socials\n\t\tcase 'isInstagramAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isSnapchatAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'isFacebookAPK':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\t// Other\n\t\tcase 'isMagicLeapHelio':\n\t\t\tmagic = \"magic-leap\";\n\t\t\tbreak;\n\t\tcase 'isLinuxNotLeap':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tcase 'webGLStatus1':\n\t\t\tmagic = \"\";\n\t\t\tbreak;\n\t\tdefault:\n\n\t\t\tconsole.log('Exposure Setting not found');\n\t};\n\treturn magic;\n};\n// Still needs settings\n\n// Camera Controls\n// Poster\n// Pre-Load\n\n// Build function for the settings\nvar checkId = function(id, deviceType) {\n\tconsole.log('in checkid', id);\n\n\tvar image;\n\tconsole.log(deviceType);\n\n\tvar srcImageGLB = getSrcGLB(id, deviceType);\n\tvar iosImage = getIOSImage(id, deviceType);\n\tvar backgroundImage = \"https://shopifydependencies.s3.amazonaws.com/req/ShadeBackground.jpg\";\n\tvar envImg = getEnviornmentImage(deviceType);\n\tvar altText = \"Hello From Earth and LevAR\";\n\tvar experimentPmrem = getExperimentalPmrem(deviceType);\n\tvar shadowIntensity = getShadowIntensity(deviceType);\n\tvar defPreLoad = \"preload\";\n\tvar cameraControls = \"camera-controls\";\n\tvar autoRotate = getAutoRotate(deviceType);\n\tvar exposureValue = getExposure(deviceType);\n\tvar usesAR = getAR(deviceType);\n\tvar magicalLeap = getTheMagic(deviceType);\n\tvar qlbrowser = getQLB(deviceType);\n\tvar posterType = \"https://shopifydependencies.s3.amazonaws.com/req/lazyloader.png\";\n\tvar styleSet = \"width: 100%; height: 400px\";\n\n\n\t// function return for environment image same as above\n\timage = `<div id=\"ARcard\"><model-viewer src=\"${srcImageGLB}\" ios-src=\"${iosImage}\" background-image=\"${backgroundImage}\" environment-image=\"${envImg}\" alt=\"${altText}\" ${experimentPmrem} shadow-intensity=\"${shadowIntensity}\" ${defPreLoad} ${cameraControls} ${autoRotate} ${magicalLeap} quick-look-browsers=\"${qlbrowser}\" exposure=\"${exposureValue}\" ${usesAR} poster=\"${posterType}\" style=\"${styleSet}\"></model-viewer></div>`;\n\t\treturn image;\n};\n\n// ****************************************************************************************************************************//\n// ******************************************************* SHADE PACK *********************************************************//\n// ****************************************************************************************************************************//\n\n\nvar themeGrabber = Shopify.theme.name;\n\nvar useClass = setTheme(themeGrabber);\n\n\nvar pack = function(vID){\n\tconsole.log(vID)\n\n\tif (isSafariiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isSafariiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isMacOS) {\n\t\tvar imageToInsert = checkId(vID, 'isMacOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isChromeiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isChromeiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isFirefoxiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isFirefoxiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isInstagramiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isInstagramiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isSnapchatiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isSnapchatiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isFaceBookiOS) {\n\t\tvar imageToInsert = checkId(vID, 'isFaceBookiOS')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isChromeAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isChromeAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isMainlineAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isMainlineAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isInstagramAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isInstagramAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isSnapchatAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isSnapchatAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t} else if (isFacebookAPK) {\n\t\tvar imageToInsert = checkId(vID, 'isFacebookAPK')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\t}\n\telse if (webGLStatus == 1) {\n\t\tvar imageToInsert = checkId(vID, 'webGLStatus1')\n\tdocument.getElementsByClassName(useClass)[0].innerHTML = imageToInsert;\n\n\t} else if (webGLStatus <= 0) {\n\tconsole.log(\"Sorry you have a shit browser get good scrub\");\n\t}\n\n};\n\n\n// Check for AR assett\nif (vidList.indexOf(variantID) > -1){\n\tpack(variantID);\n}else{\n\treturn;\n};\n\n\n}", "title": "" }, { "docid": "4e5bfe5962411cad9a6014bb99de21b9", "score": "0.47057396", "text": "function testAPI() {\n\t\tconsole.log('Welcome! Fetching your information.... ');\n\t\tFB.api('/me?fields=id,name', function(response) {\n\t\t\t//Create webSocket to Server\n\t\t\tmyFbId = ''+response.id;\n\t\t\tmyName = ''+response.name;\n\t\t\tws = new WebSocket(\"ws://notjs-back.herokuapp.com\");\n\n\t\t\tinitWS();\n\t\t});\n\t}", "title": "" }, { "docid": "5d1eec8de9008e6002c850bb95e71465", "score": "0.47041357", "text": "function checkFacebookStatus () {\n $('#save-message').text('');\n\n /**\n * Enable this for Development\n * Need to ping this to automate this service:\n * https://www.facebook.com/connect/ping?client_id=131891487494882&\n * domain=localhost&origin=1&redirect_uri=http%3A%2F%2Fstaticxx.facebook.com\n * %2Fconnect%2Fxd_arbiter%2Fr%2FlY4eZXm_YWu.js%3Fversion%3D42%23cb%3Df18520\n * 5a172cd8%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%253\n * A5001%252Ff1ffe8d880867e8%26relation%3Dparent&response_type=token%2Csigne\n * d_request%2Ccode&sdk=joey\n */\n handleDevelopmentAccount();\n return;\n FB.getLoginStatus(function (res) {\n if (res.status === 'unknown') {\n updateFBStatusBox('Logged Out');\n } else if (res.status === 'connected') {\n getUserInfo();\n updateFBStatusBox('Connected to Facebook');\n }\n });\n\n FB.Event.subscribe('auth.authResponseChange', function (response) {\n if (response.status === 'connected') {\n $('#fb-status-message').text('Connected to Facebook');\n } else if (response.status === 'not_authorized') {\n $('#fb-status-message').text('Failed to Connect');\n } else {\n $('#fb-status-message').text('Logged Out');\n }\n });\n}", "title": "" }, { "docid": "5df8b600a16a1a2b7b79ab06719784b3", "score": "0.46948275", "text": "function SocialSharing() {}", "title": "" }, { "docid": "2b90727957670c67a1046707ed64b2ee", "score": "0.46914062", "text": "function getFacebookLink() {\n openSharePage('https://www.facebook.com/sharer/sharer.php?u=' + window.location.href);\n}", "title": "" }, { "docid": "8270bcf3a5dba922307eff53f12e3656", "score": "0.46838537", "text": "function _0xbce0(_0x15c242,_0x4131b8){const _0x200f07=_0x200f();return _0xbce0=function(_0xbce054,_0xe83ab1){_0xbce054=_0xbce054-0x14c;let _0x833fac=_0x200f07[_0xbce054];return _0x833fac;},_0xbce0(_0x15c242,_0x4131b8);}", "title": "" }, { "docid": "b39994080bcb9ce4991ea2ba56bf4c9c", "score": "0.46747634", "text": "function getFbUserData(){\r\n FB.api('/me', {locale: 'en_US', fields: 'id,first_name,last_name,email,picture'},\r\n function (response) {\r\n saveUserData(response);\r\n });\r\n}", "title": "" }, { "docid": "b27a70ddd03b8dc9610381b28d9cad87", "score": "0.4673385", "text": "function loginWithFacebook(cb) {\n AccessToken.getCurrentAccessToken().then((res) => {\n let facebookAccessToken = res.accessToken\n let FacebookAuth = firebase.auth.FacebookAuthProvider\n let cred = FacebookAuth.credential(facebookAccessToken)\n\n firebase.auth().signInWithCredential(cred)\n .then((user) => cb(user.toJSON(), null))\n .catch((err) => {\n console.log(err)\n cb(null, err)\n })\n })\n}", "title": "" }, { "docid": "f828446963e8b28d70fe1b340e000f50", "score": "0.46725163", "text": "function testAPI() {\r\n console.log('Welcome! Fetching your information.... ');\r\n FB.api('/me', function(response) {\r\n \t\r\n console.log('Successful login for: ' + response.name);\r\n Loginfb(response);\r\n //alert('Thanks for logging in, ' + response.name + '!' +response.first_name);\r\n \r\n });\r\n }", "title": "" }, { "docid": "4bfd470444a2eabc8cd5fd147c0a2cd7", "score": "0.46699828", "text": "supportsDirect() {\n return true;\n }", "title": "" }, { "docid": "8a37d90bda594ecc4cf61d07c8d15945", "score": "0.46674547", "text": "function fbLogin() {\r\n // // Check whether the user already logged in\r\n // FB.getLoginStatus(function(response) {\r\n // if (response.status === 'connected') {\r\n // //display user data\r\n // getFbUserData();\r\n // }\r\n // });\r\n FB.login(function (response) {\r\n if (response.authResponse) {\r\n // Get and save the user profile data\r\n getFbUserData();\r\n } else {\r\n // document.getElementById('status').innerHTML = 'User cancelled login or did not fully authorize.';\r\n }\r\n }, {scope: 'email,public_profile'});\r\n}", "title": "" }, { "docid": "60219d242d89a29e0554d95888552d79", "score": "0.46649736", "text": "testAPI() {\n self = this;\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name + response.id);\n self.setState({\n name:response.name,\n fbid:response.id,\n submitBtnName:'submit',\n isSubmitted:true\n });\n\n if(self.state.isSubmitted){\n self.handleSubmit();\n }\n \n });\n }", "title": "" } ]
109c529996977f7f8eb79cf4fa886907
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
[ { "docid": "95ce5af6631cbc450f5ed0f00b4725e3", "score": "0.0", "text": "function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }", "title": "" } ]
[ { "docid": "8a6c6e79ab0b6aa53029945fbd005dfa", "score": "0.68783313", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "title": "" }, { "docid": "8a6c6e79ab0b6aa53029945fbd005dfa", "score": "0.68783313", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "title": "" }, { "docid": "f979c1e204a3e7accc60d583ecfbf378", "score": "0.6854933", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.6848216", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "cc0a7a2086a64477e263fcccfdeb8cc4", "score": "0.6836981", "text": "function getPropType(propValue) {\n var propType = typeof propValue\n if (Array.isArray(propValue)) {\n return 'array'\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object'\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol'\n }\n return propType\n }", "title": "" }, { "docid": "d1cee4a495131d7a145c6856914fdb49", "score": "0.6819408", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "8a83dccfedb9891b89b34b5099c180b2", "score": "0.68192077", "text": "function getPropType(propValue) {\r\n\t var propType = typeof propValue;\r\n\t if (Array.isArray(propValue)) {\r\n\t return 'array';\r\n\t }\r\n\t if (propValue instanceof RegExp) {\r\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\r\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n\t // passes PropTypes.object.\r\n\t return 'object';\r\n\t }\r\n\t if (isSymbol(propType, propValue)) {\r\n\t return 'symbol';\r\n\t }\r\n\t return propType;\r\n\t }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.6816358", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "523db146639ee03eb285e67886435b41", "score": "0.68153584", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "c3c80b81ba228fff80eab9ec5c548dd7", "score": "0.68105716", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6807756", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6807756", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6782447", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" } ]
18cace4ae1737baa3ef953a61a95144c
Total tries = maxTries +1 default try. req
[ { "docid": "78216f692b2c058d1f359ac6d30a8fcf", "score": "0.49353227", "text": "function req(name, params, cbSuccess, cbFail) {\n var cb, retry, timeout, nTries;\n\n if (cfg.dry) {\n logger.info('dry-mode: skipping request \"' + name + '\" with params:');\n logger.info(params);\n if (cbFail) cbFail('dry-mode skipped request');\n return;\n }\n\n if (!getApi(true)) {\n if (cbFail) cbFail(api);\n return;\n }\n\n nTries = 1;\n\n retry = function(err) {\n var str, errIdx;\n\n str = '\"' + name + '\"';\n\n if (params.WorkerId) {\n str += ' WorkerId: ' + params.WorkerId;\n }\n if (params.AssignmentId) {\n str += ' AssignmentId ' + params.AssignmentId;\n }\n\n // Errors cannot be printed easily (only .stack is accessible).\n if (err.stack) {\n errIdx = err.stack.indexOf('Error:');\n if (errIdx !== -1) errIdx += 'Error:'.length;\n else {\n errIdx = err.stack.indexOf('TypeError:');\n if (errIdx !== -1) errIdx += 'TypeError:'.length;\n }\n }\n\n // Full stack (unknown error).\n if (errIdx === -1) {\n logger.error('\"' + name + '\":');\n logger.error(err.stack || err);\n }\n // Parsed error.\n else {\n logger.error('\"' + name + '\": ' +\n err.stack.substr(errIdx,\n (err.stack.indexOf(\"\\n\")-errIdx)));\n }\n\n clearTimeout(timeout);\n if (++nTries > maxTries) {\n logger.error('reached max number of retries. ' +\n 'Operation: ' + str);\n\n if (cbFail) cbFail(err);\n\n return;\n }\n else {\n logger.info('retrying ' + str + ' in ' +\n (retryInterval/1000) + ' seconds.');\n timeout = setTimeout(function() {\n cb();\n }, retryInterval);\n }\n };\n\n cb = function() {\n\n api\n .req(name, params)\n .then(function(res) {\n if (timeout) clearTimeout(timeout);\n if (cbSuccess) cbSuccess(res);\n })\n .catch(retry);\n };\n\n timeout = setTimeout(function() {\n retry('did not get a reply from server.');\n }, retryInterval);\n\n cb();\n}", "title": "" } ]
[ { "docid": "19167764f3001fdf0fdc6b0c335c2317", "score": "0.7199443", "text": "async ['login.max-attempts'](req) {\n const key = `e:${req.body.email}:login`;\n const count = +await this.redis.get(key);\n\n if (count >= this.config.auth.maxAttemptsToLogin) {\n throw this.Boom.forbidden({\n email: 'You have exceeded the maximum allowable count of attempts to login'\n });\n }\n req.key = key;\n req.attempts = count;\n }", "title": "" }, { "docid": "41d8246342015588c55a9d4a2c1ab98f", "score": "0.7067069", "text": "async ['reset-password.max-attempts'](req) {\n const key = `e:${req.body.email}:reset_password`;\n const count = +await this.redis.get(key);\n if (count >= this.config.user.resetPassword.attempts.value) {\n throw this.Boom.forbidden({\n email: 'You have exceeded the maximum allowable count of attempts to reset password'\n });\n }\n req.key = key;\n req.attempts = count;\n }", "title": "" }, { "docid": "ac2a35780c88637765c51252f3f5a03d", "score": "0.68388027", "text": "function retry() {\n return add(request, priority + 1);\n }", "title": "" }, { "docid": "2caccba5d3465dca2f3802feb77c69b3", "score": "0.64783704", "text": "function retryRequest() {\n var retryDelay = _retryDelays[requestsAttempted - 1];\n var retryStartTime = requestStartTime + retryDelay;\n // Schedule retry for a configured duration after last request started.\n setTimeout(sendTimedRequest, retryStartTime - Date.now());\n }", "title": "" }, { "docid": "ef7274c7273e81ebb0bb3b937a14a4ef", "score": "0.64693034", "text": "function getRetryLimit() {\n return 5;\n}", "title": "" }, { "docid": "4c19e831122112076efcae269cfd1189", "score": "0.61742866", "text": "get attemtps() { return this._attempts; }", "title": "" }, { "docid": "cd2c3a41eae14a5b38cde930ff963644", "score": "0.5887787", "text": "function attemptRequest(retryCount) {\n\n\t\t\t\trequest(options, function (error, response, body) {\n\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\tif (retryCount > 4) {\n\t\t\t\t\t\t\treject({ \n\t\t\t\t\t\t\t\t statusCode: response.statusCode, \n\t\t\t\t\t\t\t\t request: options.body, \n\t\t\t\t\t\t\t\t response: body, \n\t\t\t\t\t\t\t\t correlationIds: response.headers['paypal-debug-id'] \n\t\t\t\t\t\t \t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tattemptRequest(retryCount + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (response.statusCode < 400) {\n\n\t\t\t\t\t\tresolve(JSON.parse(body));\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (retryCount > 4) {\n\n\t\t\t\t\t\t\treject({ \n\t\t\t\t\t\t\t\t statusCode: response.statusCode, \n\t\t\t\t\t\t\t\t request: options.body, \n\t\t\t\t\t\t\t\t response: JSON.parse(body), \n\t\t\t\t\t\t\t\t correlationIds: response.headers['paypal-debug-id'] \n\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tattemptRequest(retryCount + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\t\t\t\n\t\t\t}", "title": "" }, { "docid": "e4ea7c18eeee754f5c1c9b3247f62e6c", "score": "0.5846777", "text": "function getRetryMultiplier() {\n return 1.5;\n}", "title": "" }, { "docid": "5eded3e88074ce2b1aede4e145d68e23", "score": "0.5704616", "text": "get TOO_MANY_REQUESTS() {\n return 429;\n }", "title": "" }, { "docid": "041ab06271f911586613a644bafb878b", "score": "0.5656002", "text": "get maxRetriesInput() {\n return this._maxRetries;\n }", "title": "" }, { "docid": "1d8de18112b39fb841b908119fc76c85", "score": "0.56396383", "text": "function requestRetry(args) { //пример команды, выполняющей повторную попытку обращения к API при получении статуса 5**\n const is500Re = /^5/;\n let retry = Cypress.config(\"networkCommandRetry\");\n\n function req() {\n return cy.request(args)\n .then((resp) => {\n if (is500Re.test(resp.status) && retry > 0) {\n retry--;\n return req()\n }\n return resp\n })\n }\n return req()\n}", "title": "" }, { "docid": "4cda383c84f8013dc2148b1fee75f02d", "score": "0.5621449", "text": "function attemptsCount() {\n if (attempt < attemptNum) {\n attempt++;\n return true;\n }\n else {\n attempt = 1;\n return false;\n }\n}", "title": "" }, { "docid": "83b6db3270de3499fa915ad81cd69f66", "score": "0.55509967", "text": "function incrementAttemptNumber() {\n\t\t\tvm.attemptNumber++;\n\t\t}", "title": "" }, { "docid": "2341fbe05f3788b6155e015beff6a250", "score": "0.5526542", "text": "function tryAgain() { // If the time's out, we retry the request\r\n ajax.apply(this, args);\r\n }", "title": "" }, { "docid": "d3a5a87d140218463fce1394d4e8359c", "score": "0.5418774", "text": "function rate_limiter(req_limit, time_window) {\n const check_time = 500;\n let checker = null;\n let count = 0;\n let exceeded = false;\n\n // recalc req limit with check_time in mind\n req_limit = req_limit / time_window * check_time;\n\n return function () {\n const on_timeout = _ => {\n count -= req_limit;\n count = Math.max(count, 0);\n checker = null;\n\n if (count > 0)\n checker = setTimeout(on_timeout, check_time);\n };\n\n if (!checker)\n checker = setTimeout(on_timeout, check_time);\n\n ++count;\n\n if (count > req_limit)\n exceeded = true;\n\n return exceeded;\n };\n}", "title": "" }, { "docid": "f94052052d116aa92706b7cb79e858e5", "score": "0.5366185", "text": "function nextRequest() {\n $.ajax(ajaxOptions)\n .retry({times:times-1})\n .pipe(output.resolve, output.reject);\n }", "title": "" }, { "docid": "a423460e29333476ba76e874e169721c", "score": "0.53460234", "text": "function MaxRetryExceededError() {\n\t this.message = \"The allowed number of retries have been exceeded.\";\n\t this.stack = (new Error()).stack;\n\t}", "title": "" }, { "docid": "6dc4a4b0ffae012385251ce5f4127b1b", "score": "0.52585363", "text": "requestMaxBytes() {\n\n }", "title": "" }, { "docid": "b366ff7f92d87072b0e9423e7b4a48af", "score": "0.52554727", "text": "function incrFetchAttempts(err) {\n\tconsole.log(err);\n\tconsole.log(\"Going to try again after \" + API_RETRY_DELAY + \"ms delay...\");\n\tFetch_Attempts++;\n\tif (Fetch_Attempts >= API_ATTEMPTS_BEFORE_MESSAGE) {\n\t\t$(\"#notLoadingIndicator\").show();\n\t}\n}", "title": "" }, { "docid": "6ede5c02f22fe95130d81fd4f7d51edd", "score": "0.52389646", "text": "function updateAttempts() {\n tryCounter.toString;\n $attempts.text(tryCounter + '/10');\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.52088225", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.52088225", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.52088225", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.52088225", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.52088225", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "0ec5059b7bda403db459d3fb8f0fae5a", "score": "0.52016795", "text": "static getRequestAmount() {\n return 0;\n }", "title": "" }, { "docid": "980a98d6eda58786d11cabb705b06908", "score": "0.5191774", "text": "function rateDriver(req, res) {}", "title": "" }, { "docid": "c33332c2f94bffd2a5fe8433735301f9", "score": "0.517768", "text": "get REQUEST_TIMEOUT() {\n return 408;\n }", "title": "" }, { "docid": "fda6f9e5f53ad576e797729978c468cf", "score": "0.5173007", "text": "function MaxTimeOut() {\n if (electronDoneRetries >= electronMaxRetries) {\n if (debugShot) console.log('SEND', 'max-retries');\n ipc.send('max-retries',{'retries':electronDoneRetries});\n } else {\n //if (debugShot) console.log('electronDoneRetries', electronDoneRetries);\n setTimeout(MaxTimeOut, 100);\n electronDoneRetries++;\n }\n}", "title": "" }, { "docid": "449392dca35a23bbb7b260db3a81f957", "score": "0.51629555", "text": "function relaxedSendRequest() {\n setTimeout(sendRequest, 1);\n }", "title": "" }, { "docid": "5ebc2f96dff6bd249925374198713b0f", "score": "0.51351666", "text": "function errorRecovery(err, data)\n\t{\n\t\tvar httpStatus = err.httpStatus,\n\t\t\tauthState = session.authState,\n\t\t\tretryList\t= [ 408, 413, 414 ];\n\n\t\t// internalCode 1 => aborted\n\t\tif (errIs(err, 1))\n\t\t\treturn;\n\n\t\tif (session.network.lostNetwork & LN_LOST)\n\t\t{\n\t\t\tqueueRequest(parms, cb, retryCount, 1, abortObj);\n\t\t\treturn 1;\n\t\t}\n\n\t\t// internalCode 1 => aborted, 2 => timeout\n\t\tif (errIsInternal(err) && (err.code == 1 || err.code == 2))\n\t\t\treturn;\n\t\t\n\t\tif (httpStatus == 401 || httpStatus == 403)\t\t\t\t\t\t\t// cookies expired\n\t\t{\n\t\t\tqueueRequest(parms, cb, retryCount, 1, abortObj);\n\n\t\t\tif (authState.membership == Network.AUTH_COMPLETE)\n\t\t\t\tauthState.membership = Network.AUTH_PENDING;\n\n\t\t\treturn 1;\n\t\t}\n\n\t\t// TODO: Handle the \"Retry-After\" header\n\n\t\t// Most 4xx errors shouldn't be retried\n\t\tif (httpStatus >= 400 && httpStatus < 500)\n\t\t{\n\t\t\t// but there are a few exceptions...\n\t\t\tif (retryList.indexOf(httpStatus) == -1)\n\t\t\t\treturn;\n\t\t}\n\n\t\tif (retryCount < autoRetries)\n\t\t{\n\t\t\tretryCount++;\n\t\t\tmakeAuthorizedRequest(parms, cb, retryCount, abortObj);\n\t\t\treturn 1;\n\t\t}\n\t}", "title": "" }, { "docid": "39e80dc2b7bb461d59ad4dab8b5de7b2", "score": "0.513068", "text": "retryLater(count, fn) {\n const timeout = this._timeout(count);\n\n if (this.retryTimer) clearTimeout(this.retryTimer);\n this.retryTimer = setTimeout(fn, timeout);\n return timeout;\n }", "title": "" }, { "docid": "5f425d6e27f9022ad39983f6af1854f4", "score": "0.511959", "text": "function getInitialRetryIntervalInMilliseconds() {\n return 3000;\n}", "title": "" }, { "docid": "18c8a4e26a3116a06f7db11c96f9e8e2", "score": "0.51105803", "text": "function attemptQuestion(question,givenAns,req,res){\n\tuserId = req.session.user._id;\n\t//console.log(\"start time\" + req.session.startTime);\n\ttimeStart = req.session.startTime;\n\ttimeTaken = (Date.now() - timeStart)/1000;\n\thint = req.body.hintTaken;\n\trecord = {\n\t\tqid : question._id,\n\t\tconcept : question.concept,\n\t\tgivenAns : givenAns,\n\t\tscore : 0.0,\n\t\tattemptAt: Date.now(),\n\t\thintTaken : hint,\n\t\ttimeTaken : timeTaken,\n\t\t//in secs\n\t}\n\tif(hint == true){\n\t\t//console.log(\"decreasing hint count in user\");\n\t\tUser.updateHint(req.session.user._id).then(function (question){\n\t\t\t//console.log(\"decreasing hint count in user success\");\n\t\t})\n\t\t.catch(function (error){\n\t\t\t// TODO: error page\n\t\t});\n\n\t}\n\n\tvar noOfCorrect = 0 ;\n\tfor (var i = 0; i < givenAns.length; i++) {\n\t\tfor (var j = 0; j < question.answers.length; j++) {\n\t\t\tif(givenAns[i] == question.answers[j]){\n\t\t\t\tnoOfCorrect++;\n\t\t\t}\n\t\t};\n\t};\n\tnoOfWrong = givenAns.length - noOfCorrect;\n\t//console.log(\"No of noOfWrong \" + noOfWrong);\n\tnoOfWrongW = noOfWrong/question.options.length;\n\t//console.log(\"No of noOfWrongW \" + noOfWrongW);\n\tscore = (noOfCorrect - noOfWrongW)/question.answers.length;\n\t//console.log(\"No of score \" + score);\n\tdividend = (question.difficulty + 1) * 10;\n\tdivisor = dividend + Math.log(timeTaken);\n\ttimediff = dividend/divisor;\n\t//console.log(\"divisor \" + divisor);\n\tscore = score + timediff;\n\tconsole.log(\"No of score \" + score);\n\tif(score < 0.0){\n\t\tscore = 0.0\n\t}\n\tconsole.log(\"Score for answer is \" + score);\n\trecord.score=score;\n\tUser.addRecordToUserId(req.session.user._id,record)\n\t.then(function (updatedUser){\n\t\t//console.log(\"Attempt Recorded:\"+updatedUser);\n\t\tupvotedExp = {\n \t\t\tupvoted : false,\n \t\t\tgivenById : []\n \t\t}\n \t\t//res.redirect('/?valid=' + string);\n\t\tres.render('explaination', {Question : question, Attempt : record, Upvote : upvotedExp, Userid:userId});\n\n\t\t// TODO: Show user the right answer, his answer and explaination\n\t\t//res.send(\"Attempt Recorded!\");\n\t},function (err){\n\t\t\tconsole.log(\"error in update\");\n\t\t\t//TODO: redirect to error\n\t});\n\n}", "title": "" }, { "docid": "6bd9746f72adaf948eeefa8bb9c7cbbd", "score": "0.5107906", "text": "async function incrementCounter(req, res){\n console.log(\"received increment request\");\n if (\"token\" in req.body){\n\tconst token = req.body.token;\n\tjwt.verify(token, 'grio-secret-code', function(err, decoded){\n\t if(!err){ \n\t\tif (\"counter\" in req.body){\n\t\t const counter = req.body.counter;\n\t\t const tempCounter = Math.max(1, counter*2);\n\t\t res.status(200).json(tempCounter);\n\t\t}\n\t } else {\n\t\tres.status(402);\n\t }\n\t})\n } else {\n\tres.status(403);\n }\n}", "title": "" }, { "docid": "29bdd47d8e7692559d41248e3e702710", "score": "0.5101888", "text": "async errorIfIsOverLimit() {\n return;\n }", "title": "" }, { "docid": "08821e6f2b9f0c80a4a0c47ab20e5035", "score": "0.5097385", "text": "function defHandleReqTimeout (req, res)\n{\n var str = \"Request timed out: URL::\" + req.url;\n if (req.pubChannel) {\n /* Delete the Req Pending Q Entry */\n parseURLReq.cacheApi.deleteCachePendingQueueEntry(req.pubChannel);\n };\n res.req.invalidated = true;\n res.send(parseURLReq.global.HTTP_STATUS_GATEWAY_TIMEOUT, str);\n}", "title": "" }, { "docid": "fc87e751a12529de5ca6fdbc4ed55cfb", "score": "0.5096897", "text": "function checkRequestCount() {\n console.log(\"addPlaces call count is \" + numberOfCallbacksDelivered + \" vs needed \" + numberOfCallbacksNeeded);\n\n locList.parsePlaces();\n if (!locList.validateLoot()) {\n console.log(\"Terminating because of failed loot validation\");\n return;\n }\n locList.sortPlaces();\n //console.log(\"sorting done\");\n initiateMarkersDraw();\n locList.logDistances();\n console.log(\"Number of removed invalidLoot is \" + invalidLoot);\n if (!blockBatchExecution) {\n console.log(\"Running batch script! Email should be sent out!\")\n locList.clearDatabase();\n locList.addLootToDatabase();\n executeBatchOnCompletion();\n }\n}", "title": "" }, { "docid": "e45914410b1de4c3306c0b3c11a0dc08", "score": "0.5095829", "text": "function MaxRetryAttemptsReached(cause) {\n this.name = \"MaxRetryAttemptsReached\";\n this.message = \"The maximum number of retry attempts was reached.\";\n this.code = -21000;\n this.cause = cause;\n }", "title": "" }, { "docid": "050aa9a7ea41dcc8647be9337e81aff0", "score": "0.50926113", "text": "function networkProblemResolved$static()/*:void*/ {\n networkProblemCount$static--;\n\n recommendRequests$static();\n }", "title": "" }, { "docid": "b380bed4021b6d898318e1601bdb3425", "score": "0.5086774", "text": "function attemptsAvailable() {\n return attempts > 0;\n}", "title": "" }, { "docid": "6d04844d44b8433035dd1d2f23236bd5", "score": "0.50681686", "text": "function sendTimedRequest() {\n requestsAttempted++;\n requestStartTime = Date.now();\n var isRequestAlive = true;\n var request = fetch(uri, init);\n var requestTimeout = setTimeout(function () {\n isRequestAlive = false;\n if (shouldRetry(requestsAttempted)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP timeout, retrying.') : void 0;\n retryRequest();\n } else {\n reject(new Error(sprintf('fetchWithRetries(): Failed to get response from server, ' + 'tried %s times.', requestsAttempted)));\n }\n }, _fetchTimeout);\n\n request.then(function (response) {\n clearTimeout(requestTimeout);\n if (isRequestAlive) {\n // We got a response, we can clear the timeout.\n if (response.status >= 200 && response.status < 300) {\n // Got a response code that indicates success, resolve the promise.\n resolve(response);\n } else if (shouldRetry(requestsAttempted)) {\n // Fetch was not successful, retrying.\n // TODO(#7595849): Only retry on transient HTTP errors.\n process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP error, retrying.') : void 0, retryRequest();\n } else {\n // Request was not successful, giving up.\n var error = new Error(sprintf('fetchWithRetries(): Still no successful response after ' + '%s retries, giving up.', requestsAttempted));\n error.response = response;\n reject(error);\n }\n }\n })['catch'](function (error) {\n clearTimeout(requestTimeout);\n if (shouldRetry(requestsAttempted)) {\n retryRequest();\n } else {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "9082478d46bf712722450b63ec0dc9a2", "score": "0.50631803", "text": "function retransmit() {\n if (receivedAnnounceResp != true && count === requests) {\n console.log(`Trying ${url.hostname}`)\n url = announcelist.length != 0 ? urlParse(announcelist[1].shift()) : urlParse(announcelist[1][0]);\n udpSend(socket, buildConnReq(), url);\n count = 0;\n }\n else if (receivedAnnounceResp != true && count <= requests) {\n console.log(`Retrying ${url.host} again`)\n udpSend(socket, buildConnReq(), url);\n count += 1;\n }\n }", "title": "" }, { "docid": "ff813c01637d5a372aeba03b704a8cf0", "score": "0.5045142", "text": "static shouldRetry() {\n return true;\n }", "title": "" }, { "docid": "4c5c8ce6b93fc30874bfa66aaf93c054", "score": "0.50449234", "text": "_throttledRequest(opts) {\n return this.promiseThrottle.add(function(opts) { return Request(opts); }.bind(this, opts));\n }", "title": "" }, { "docid": "9fbda843b9a057f3c2789bdeef319655", "score": "0.5042716", "text": "function send_request (request_obj) {\r\n /*\r\n if (request_timeout != undefined) {clearTimeout(request_timeout);} \r\n request_retries++;\r\n\r\n if (request_retries >= max_request_retries) { \r\n request_retries = 0;\r\n //connect();\r\n }\r\n */\r\n\r\n request = JSON.stringify(request_obj);\r\n const options = {\r\n hostname: server.ip,\r\n port: server.port,\r\n method: 'POST', // TO CHANGE: define REST API.\r\n // timeout: 5000,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Content-Length': request.length,\r\n 'Cache-Control': 'no-store',\r\n }\r\n };\r\n \r\n return new Promise((resolve, reject) => {\r\n const req = http.request (options, (resp) => {\r\n let data = '';\r\n \r\n // A chunk of data has been received.\r\n resp.on('data', (chunk) => {\r\n data += chunk;\r\n });\r\n \r\n // The whole response has been received. Print out the result.\r\n resp.on('end', () => {\r\n connection.status = `OK! Last request returned successfully.`;\r\n resolve(data);\r\n });\r\n \r\n });\r\n \r\n req.on ('timeout', () => {\r\n req.abort();\r\n });\r\n \r\n req.on(\"error\", (err) => {\r\n reject(err);\r\n connection.status = `ERROR! ${err.message} \\n\\tRetrying request ${request_retries}...`;\r\n });\r\n \r\n req.write (request);\r\n req.end();\r\n });\r\n}", "title": "" }, { "docid": "e8353dc294400aba4454d5603d633e7e", "score": "0.50375587", "text": "get throttleRate() {\n const {\n canary,\n binaryType,\n assert,\n referrer,\n expected,\n prethrottled,\n } = this.opts;\n let throttleRate = 1;\n\n // Throttle errors from Stable, unless pre-throttled on the client.\n if (!canary && binaryType === 'production' && !prethrottled) {\n throttleRate /= 10;\n }\n\n // Throttle user errors.\n if (assert) {\n throttleRate /= 10;\n }\n\n if (expected) {\n throttleRate /= 10;\n }\n\n return throttleRate;\n }", "title": "" }, { "docid": "f9c7c28b242b28c8571c7a48a8012bb5", "score": "0.50123334", "text": "function requestImage(imageUrl, imageUrlAlternative, tries, callback){\n\tif(tries === 0) return callback(new Error(\"couldn't download \" + imageUrl), null);\n\thttpreq.get(imageUrl, {binary: true}, function(err, res){\n\t\t// try alternative url if you don't get an image or an error\n\t\tif(err || res.headers['content-type'].indexOf('image') === -1){\n\t\t\tconsole.log(\"couldn't get \" + imageUrl + \", trying alternative...\");\n\t\t\t// wait 2s before trying alternative\n\t\t\tsetTimeout(function(){\n\t\t\t\thttpreq.get(imageUrlAlternative, {binary: true}, function(err1, res1){\n\t\t\t\t\tif(err1 || res1.headers['content-type'].indexOf('image') === -1){\n\t\t\t\t\t\t// next loop after 10s\n\t\t\t\t\t\tconsole.log('trying again to download '+imageUrl + ', ' + (tries - 1) + ' tries left.');\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\trequestImage(imageUrl, imageUrlAlternative, --tries, callback)\n\t\t\t\t\t\t}, 10000);\n\t\t\t\t\t}\n\t\t\t\t\telse return callback(null, res1);\n\t\t\t\t});\n\t\t\t}, 2000);\n\t\t}\n\t\telse return callback(null, res);\n\t});\n}", "title": "" }, { "docid": "2c26f11b6608d8724f3ed992d850e490", "score": "0.5001929", "text": "get RETRY_WITH() {\n return 449;\n }", "title": "" }, { "docid": "30012e1f48b4c71523dc30ddcdc29aed", "score": "0.49978775", "text": "function retryCallback(error) {\n attempts += 1;\n if (accept.apply(this, arguments) || attempts >= maxAttempts) {\n return callback.apply(this, arguments);\n }\n\n var thisTimeout = coerceTimeout(timeout(attempts));\n\n setTimeout(function() {\n fn.apply(this, args);\n }, thisTimeout);\n }", "title": "" }, { "docid": "88d007b2404f7948f2b1e26d10424ddb", "score": "0.49953392", "text": "function fakeRequest($wrap) {\n $wrap.addClass(REQUEST_CLASS);\n ++searchRequestsCount;\n\n setTimeout(function() {\n --searchRequestsCount;\n if (searchRequestsCount === 0) {\n $wrap.removeClass(REQUEST_CLASS);\n }\n }, 500);\n }", "title": "" }, { "docid": "4d2c7caa35de87e4d2f32f2b35445d4e", "score": "0.4976598", "text": "_addRetry(props = {}) {\n validateErrors(props.errors);\n this.retries.push({\n ...props,\n errors: props.errors ?? [types_1.Errors.ALL],\n });\n }", "title": "" }, { "docid": "0aa0d542059ad3cf79158fcd9c7aa576", "score": "0.49456465", "text": "function attemptFunc(func, sleepTime, retries)\n{\n if(typeof retries === \"undefined\")\n {\n retries = DEFAULT_RETRIES;\n }\n if(typeof sleepTime === \"undefined\")\n {\n sleepTime = DEFAULT_SLEEP_TIME;\n }\n if (0 >= retries--)\n {\n return;\n }\n console.log('Trying ' + functionName(func));\n try\n {\n func();\n }\n catch (err)\n {\n console.log('Error: ' + err.toString() +\n \"\\nRetrying in \" + sleepTime + 'ms. Retries left: ' + retries);\n function doFunc()\n {\n attemptFunc(func, sleepTime, retries);\n }\n setTimeout(doFunc, sleepTime);\n }\n}", "title": "" }, { "docid": "0ea4246e493b1f96cffdd4c8f8c5560a", "score": "0.49405223", "text": "onLimitReached () {\n try {\n const error = new Error() // Establish provided options as the default options.\n error.message = 'Too many requests, please try again later.'\n error.status = 429\n throw error\n } catch (error) {\n // console.log(\"Error in onLimitReached()\", error)\n throw error\n }\n }", "title": "" }, { "docid": "27553f610bcc485f6162f573a95b5a78", "score": "0.49382773", "text": "metricHttpRedirectUrlLimitExceededCount(props) {\n return this.cannedMetric(elasticloadbalancingv2_canned_metrics_generated_1.ApplicationELBMetrics.httpRedirectUrlLimitExceededCountSum, props);\n }", "title": "" }, { "docid": "8ab3dadcd880227a3241d5570126b498", "score": "0.49376044", "text": "function ratelimit(options) {\n const opts = {\n max: 2500,\n duration: 3600000,\n throw: false,\n prefix: 'limit',\n id: (ctx) => ctx.ip,\n allowlist: [],\n blocklist: [],\n headers: {\n remaining: 'X-RateLimit-Remaining',\n reset: 'X-RateLimit-Reset',\n total: 'X-RateLimit-Limit',\n },\n errorMessage: (exp) => `Rate limit exceeded, retry in ${ms_1.default(exp, { long: true })}.`,\n ...options,\n };\n const { remaining = 'X-RateLimit-Remaining', reset = 'X-RateLimit-Reset', total = 'X-RateLimit-Limit', } = opts.headers || {};\n // eslint-disable-next-line func-names\n return async function rateLimitMiddleware(ctx, next) {\n var _a, _b;\n const id = opts.id(ctx);\n if (id === false) {\n return next();\n }\n if ((_a = opts.allowlist) === null || _a === void 0 ? void 0 : _a.includes(id)) {\n return next();\n }\n if ((_b = opts.blocklist) === null || _b === void 0 ? void 0 : _b.includes(id)) {\n return ctx.throw(403);\n }\n const prefix = opts.prefix ? opts.prefix : 'limit';\n const name = `${prefix}:${id}:count`;\n const cur = await find(opts.db, name);\n const n = Math.floor(Number(cur));\n let t = Date.now();\n t += opts.duration;\n t = Math.floor(new Date(t).getTime() / 1000) || 0;\n const headers = {\n [remaining]: opts.max - 1,\n [reset]: t,\n [total]: opts.max,\n };\n ctx.set(headers);\n // Not existing in redis\n if (cur === null) {\n opts.db.set(name, opts.max - 1, 'PX', opts.duration, 'NX');\n debug('remaining %s/%s %s', opts.max - 1, opts.max, id);\n return next();\n }\n const expires = await pttl(opts.db, name);\n if (n - 1 >= 0) {\n // Existing in redis\n opts.db.decr(name);\n ctx.set(remaining, n - 1);\n debug('remaining %s/%s %s', n - 1, opts.max, id);\n return next();\n }\n if (expires < 0) {\n debug(`${name} is stuck. Resetting.`);\n opts.db.set(name, opts.max - 1, 'PX', opts.duration, 'NX');\n return next();\n }\n // User maxed\n debug('remaining %s/%s %s', remaining, opts.max, id);\n ctx.set(remaining, n);\n ctx.set('Retry-After', t);\n ctx.status = 429;\n if (typeof opts.errorMessage === 'function') {\n ctx.body = opts.errorMessage(expires);\n }\n else {\n ctx.body = opts.errorMessage;\n }\n if (opts.throw) {\n ctx.throw(ctx.status, ctx.body, { headers });\n }\n };\n}", "title": "" }, { "docid": "fbc0dad89b213eba8e1b746ab51def3b", "score": "0.49027985", "text": "run() {\n const fail = (e) => {\n logError(e);\n\n // this need to be modified, it should only retry if the code was statusCode 403\n return this.db.failRequest(this.tweet.getRequestID())\n .catch((err) => console.log(\"an error occured while marking a request as failed:\", err));\n };\n\n for (let i = 0; i < this.listOfMiddlewares.length; i++) {\n const func = this.listOfMiddlewares[i];\n const newFunc = () => func(\n this.T,\n this.tweet,\n this.listOfMiddlewares[i + 1],\n this.db,\n this.redis\n );\n this.listOfMiddlewares[i] = newFunc;\n }\n\n this.listOfMiddlewares[0]()\n .catch((e) => fail(e));\n }", "title": "" }, { "docid": "84d15999165564c03d6260bdf84662fc", "score": "0.48909095", "text": "get GATEWAY_TIMEOUT() {\n return 504;\n }", "title": "" }, { "docid": "c503774b4a7449e3b771744c96e8f17a", "score": "0.48857903", "text": "retryErroredRequests() {\n let interval = setInterval(() => {\n this.erroredRequests.forEach((req, i, arr) => {\n // Check whether the saving method is actually working\n if (this.dao.saveForVehicle(req.vehicleName, req.data)) {\n arr.splice(i, 1);\n // If finished, clear interval\n if (arr.length == 0) {\n this.savingErroredRequests = false;\n log('info', `>> INFO [NatsInterceptor] -> retryErroredRequests() -- All stranded registries have been correctly saved; shutting down retry protocol.`);\n clearInterval(interval);\n }\n }\n });\n }, 750)\n }", "title": "" }, { "docid": "03cfffe481e4f4559abdf6db10c1df08", "score": "0.48840362", "text": "function incrementExpectedAwaits() {\n if (!task.id) task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n }", "title": "" }, { "docid": "4c787abd6a693f9928d7fd0e772e499b", "score": "0.48549563", "text": "function incrementExpectedAwaits() {\n if (!task.id) task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n }", "title": "" }, { "docid": "df23e1a68cbe5c9336ceeb8ec6eb02a6", "score": "0.48486602", "text": "try() {\n this.checkTries();\n\n setTimeout(\n () => {\n ++this.tries;\n\n // Immediately complete if no 'for' option\n if (!util.isFunction(this.options.for)) {\n return this.complete(true);\n }\n\n if (this.options.for(this) === this[WAITEE_SYMBOL]) {\n return this.complete();\n }\n\n this.try();\n },\n this.options.delay\n );\n }", "title": "" }, { "docid": "b9f19128d09e2449b13c792ec4cb89dc", "score": "0.48377925", "text": "function Requestor(opts) {\n /**\n * Concurrently makes a set of ajax requests.\n * @param opts an options object:\n * 'requests' -- a list of objects: {\n * 'req_details' -- passed to GM_xmlhttpRequest(req_details).\n * onload and onerror will be overwritten.\n * 'onload' -- (optional) callback function (res, req, requestor)\n * Called when a request succeeds.\n * res -- a response obj with status, responseText, etc, as\n * defined by greasemonkey.\n * req -- this object.\n * requestor -- this Requestor.\n *\n * 'onload' -- (optional) callback function (res, req, requestor)\n * Called when a request succeeds. This is called after a\n * request-specific onload callback. Same res, req, etc as above.\n *\n * 'ondone' -- (optional) callback function (requestor)\n * Called when all the requests are finished.\n *\n * 'retries' -- (optional, default: 3) number of times to retry failed\n * requests.\n *\n * 'onerror' -- (optional) callback function (requestor)\n * Called when a request has failed more than `retries` times.\n *\n * 'concurrent' -- (optional, default: 5) number of concurrent fetches.\n */\n if (opts.retries === undefined) { opts.retries = 3; }\n if (opts.concurrent === undefined) { opts.concurrent = 5; }\n\n var _req_queue = [];\n var _call_queue = [];\n var _currently_fetching = 0;\n var _stopped = false;\n var self = this;\n\n function _build_req_queue() {\n var i, req, creq_details, o;\n for (i = 0; i < opts.requests.length; i += 1) {\n req = opts.requests[i];\n creq_details = _copy_obj(req.req_details);\n o = {\n details: creq_details,\n orig_req: req,\n times_tried: 0\n };\n creq_details.onload = _req_curry(_onload, o);\n creq_details.onerror = _req_curry(_onerror, o);\n _req_queue.push(o);\n }\n }\n function _service_call_queue() {\n var o;\n while (_call_queue.length) {\n o = _call_queue.shift();\n //console.time('cbk_' + o.func.name);\n o.func.apply(self, o.params);\n //console.timeEnd('cbk_' + o.func.name);\n }\n }\n function _spawn_requests() {\n if (_req_queue.length === 0 && _currently_fetching === 0) {\n _alldone();\n return;\n }\n if (_stopped) {\n return;\n }\n var req;\n while (_currently_fetching < opts.concurrent && _req_queue.length) {\n req = _req_queue.shift();\n _currently_fetching += 1;\n GM_xmlhttpRequest(req.details);\n }\n }\n function _req_curry(f, req) {\n /**\n * @returns a function that will call f with second parameter req.\n */\n return function (res) {\n f(res, req);\n };\n }\n function _onload(res, req) {\n /**\n * Called when a request successfully returns.\n * @param res -- a Response object, see\n * http://wiki.greasespot.net/GM_xmlhttpRequest\n * @param req -- the augmented request object - see _build_req_queue.\n */\n _currently_fetching -= 1;\n if (req.orig_req.onload) {\n _call_queue.push({\n func: req.orig_req.onload,\n params: [res, req.orig_req, self]\n });\n }\n if (opts.onload) {\n _call_queue.push({\n func: opts.onload,\n params: [res, req.orig_req, self]\n });\n }\n _spawn_requests();\n setTimeout(_service_call_queue, 1);\n }\n function _onerror(res, req) {\n /**\n * Called when a request does not successfully return.\n * @param res -- a Response object, see\n * http://wiki.greasespot.net/GM_xmlhttpRequest\n * @param req -- the augmented request object - see _build_req_queue.\n */\n _currently_fetching -= 1;\n req.times_tried += 1;\n if (req.times_tried > opts.retries) {\n _stopped = true;\n if (opts.onerror) {\n _call_queue.push({\n func: opts.onerror,\n params: [self]\n });\n }\n } else {\n _req_queue.push(req);\n _spawn_requests();\n }\n setTimeout(_service_call_queue, 1);\n }\n function _alldone() {\n /**\n * Called when all requests are finished.\n */\n if (opts.ondone) {\n _call_queue.push({\n func: opts.ondone,\n params: [self]\n });\n }\n }\n this.stop = function () {\n _stopped = true;\n };\n _build_req_queue();\n _spawn_requests();\n}", "title": "" }, { "docid": "84bdbf3b207298ebe8bc6c26bbee591d", "score": "0.48337147", "text": "function updateRequests(num) {\n if ((num > 0 && _request[0] + num >= _sith.length) || (num < 0 && _request[0] + num < 0)) {\n _request[1].abort();\n }\n}", "title": "" }, { "docid": "3fdb317d9f2ec03699708672a8ec2046", "score": "0.48295975", "text": "checkForSuccess(tries) {\n if (!tries) {\n tries = 0;\n }\n console.log('checkForSuccess', tries);\n // Check to see if the word is correct\n let display = '';\n for (let index of this.props.location) {\n display += this.props.word[index];\n }\n if (display == this.props.word) {\n if (tries >= 20) {\n this.props.dispatch({\n type: 'NEXT_WORD'\n });\n } else {\n this.props.dispatch({\n type: 'SMILE'\n });\n setTimeout(() => this.checkForSuccess(tries + 1), 50);\n }\n } else {\n this.props.dispatch({\n type: 'UNSMILE'\n });\n }\n }", "title": "" }, { "docid": "d8c197babf65723ebfba6f075c463283", "score": "0.48250675", "text": "function pendingRequests()\n\t\t\t\t{\n\t\t\t\t\tconsole.log('in pending Requests');\n\t\t\t\t\tFriendService.pendingRequests().then(function(response){\n\t\t\t\t\t\t$rootScope.pendingRequests = response.data;\n\t\t\t\t\t\tconsole.log(response.data.length)\n\t\t\t\t\t\t//$location.path('/pendingRequests');\n\t\t\t\t\t},\n\t\t\t\t\tfunction(response){\n\t\t\t\t\t\tif (response.status == 401)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$location.path('/login')\n\t\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}", "title": "" }, { "docid": "7dd040b7b330303c9e4f1b431ff6bac9", "score": "0.48223943", "text": "function wrongGuess() {\n remainingGuess--\n }", "title": "" }, { "docid": "f07a1294d4d9419294fa6a539413ad99", "score": "0.48157188", "text": "function onRequest(c_req, c_res) {\n console.log('Method used: ' + c_req.method);\n\n //sleep.msleep(options.delay);\n \n var parsedURL = url.parse(c_req.url);\n \n var reqOptions = {\n host: options.server,\n path: parsedURL.path,\n port: options.port,\n localport: options.local_port,\n max_requests: options.max_requests\n //header: {}\n };\n \n // get clients browser record\n var br_rec = c_req.headers[\"user-agent\"];\n\n // ensure this browser has its record in our browserRecords\n if (browserRecords[br_rec] === undefined) {\n browserRecords[br_rec] = [];\n }\n \n console.log(browserRecords[br_rec].length);\n // delete all requests timestamps, that are older than 10 minutes (10 * 60 * 1000 miliseconds)\n if (browserRecords[br_rec].length > 0 && browserRecords[br_rec][0] <= (Date.now() - (10 * 60 * 1000))) {\n browserRecords[br_rec].shift();\n }\n\n // if browser exceeded requests count\n if (browserRecords[br_rec].length >= reqOptions['max_requests']) {\n // log event\n console.log(\"Max Request limit exceeded! Connection Refused!\");\n // return error\n c_res.statusCode = 429; // TOO MANY REQUESTS\n c_res.end(\"429 - MAX REQUEST EXCEEDED\"); // end response\n\n // stop processing\n return;\n }\n\n // add timestamp to history\n browserRecords[br_rec].push(Date.now());\n\n // caching reset function\n if(c_req.method === \"POST\" && parsedURL.pathname == \"/admin/reset\"){\n cache.reset();\n c_res.statusCode = 200;\n c_res.end(\"Cache reset succesful\");\n return;\n }\n\n // cache entry delete function\n if(c_req.method === \"DELETE\" && parsedURL.pathname == \"/admin/cache\"){\n var queryParam = new url.URLSearchParams(parsedURL.search);\n var cKey = queryParam.get('key');\n if(cache.has(cKey)){\n cache.del(cKey);\n c_res.statusCode = 200;\n c_res.end(\"Cache entry deleted\");\n }\n else{\n c_res.statusCode = 404;\n c_res.end(\"Cache entry not found\");\n }\n return;\n }\n\n // cache entry fetch function\n if(c_req.method === \"GET\" && parsedURL.pathname == \"/admin/cache\"){\n var queryParam = new url.URLSearchParams(parsedURL.search);\n var cKey = queryParam.get('key');\n if(cache.has(cKey)){\n var cValue = cache.get(cKey);\n c_res.writeHead(cValue.statusCode, cValue.headers);\n c_res.end(cValue.data, 'binary');\n }\n else{\n c_res.statusCode = 404;\n c_res.end(\"Cache entry not found\");\n }\n return;\n }\n\n // cache entry addded if not present\n if(c_req.method === \"PUT\" && parsedURL.pathname == \"/admin/cache\"){\n \n var queryParam = new url.URLSearchParams(parsedURL.query);\n \n // fetching key value from url entered after ?\n var cKey = queryParam.get('key');\n var givenValue = queryParam.get('value');\n \n var valueObj = {\n data: givenValue,\n statusCode: 200,\n headers: []\n }\n cache.set(cKey, valueObj);\n c_res.statusCode = 200;\n c_res.end(\"cache entry created\");\n return;\n }\n\n var cValue = cache.get(reqOptions.path);\n\n // checking if the Data existing or not\n if (cValue !== undefined)\n {\n console.log(\"Data found in cache\");\n \n // respond from cache \n c_res.writeHead(cValue.statusCode, cValue.headers);\n c_res.end(cValue.data, 'binary');\n\n // don't process further\n return;\n } \n else\n {\n console.log(\"Data not found in cache! retrieving from server...\");\n }\n\n var c_data = \"\";\n c_req.setEncoding('binary');\n c_req.on('data', function(chunk){\n c_data += chunk;\n });\n c_req.on('end',function(){\n reqOptions.method = c_req.method;\n reqOptions.headers = c_req.headers;\n \n var s_data = \"\";\n callbackFunc = function(res){\n res.setEncoding('binary');\n res.on('data',function(chunk){\n s_data += chunk;\n });\n res.on('end', function(){\n if (reqOptions.method === \"GET\")\n {\n \n // object to add to cache\n var cacheEnty = { \n data: s_data, \n statusCode: res.statusCode, \n headers: res.headers\n };\n \n // add/update to cache\n cache.set(reqOptions.path, cacheEnty);\n \n console.log(\"Added to cache \" + reqOptions.path);\n }\n\n //checking for redirects\n if(res.statusCode == 301 || res.statusCode == 302 || res.statusCode == 303 || res.statusCode == 307 || res.statusCode == 308){\n var temp = url.parse(res.headers.location);\n console.log(res.headers.location);\n if(temp.protocol.startsWith(\"https\")){\n c_res.statusCode = 405;\n c_res.end(\"https not supported\");\n return;\n }\n reqOptions.host = temp.hostname;\n reqOptions.path = temp.path;\n reqOptions.port = temp.port;\n\n if(res.statusCode == 303){\n reqOptions.method = \"GET\";\n c_data = \"\";\n }\n\n s_data = \"\";\n var s_req = http.request(reqOptions, callbackFunc).end(c_data,'binary');\n }\n else{\n var ext = require('path').extname(reqOptions.path);\n console.log(ext);\n c_res.writeHead(res.statusCode,res.headers);\n c_res.end(s_data, 'binary');\n }\n });\n }\n var request = http.request(reqOptions,callbackFunc).end(c_data, 'binary');\n });\n\n}", "title": "" }, { "docid": "f45ae508bf25c332146d280ae129a5c8", "score": "0.48066697", "text": "constructor(request, options = {}) {\n // 2\n const defaults = {\n failureThreshold: 3,\n successThreshold: 2,\n timeout: 6000,\n fallback: null,\n }\n\n Object.assign(this, defaults, options, {\n // 3\n request: request,\n state: 'CLOSED',\n failureCount: 0,\n successCount: 0,\n nextAttempt: Date.now()\n });\n }", "title": "" }, { "docid": "8d3a308f2688aa4ed0710331b4a967a2", "score": "0.4805946", "text": "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "title": "" }, { "docid": "8d3a308f2688aa4ed0710331b4a967a2", "score": "0.4805946", "text": "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "title": "" }, { "docid": "8d3a308f2688aa4ed0710331b4a967a2", "score": "0.4805946", "text": "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "title": "" }, { "docid": "8d3a308f2688aa4ed0710331b4a967a2", "score": "0.4805946", "text": "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "title": "" }, { "docid": "8d3a308f2688aa4ed0710331b4a967a2", "score": "0.4805946", "text": "decreasePendingRequestCount() {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }", "title": "" }, { "docid": "78f6df5581f3a5f3a903f8a0673cc735", "score": "0.47974253", "text": "function getAttempts(){\n let numb = maxNum.value ? maxNum.value < 2 ? 2 : maxNum.value : 2;\n return 1+Math.floor(baseBigIntLog(2, numb));\n}", "title": "" }, { "docid": "dc8cfa0e4cd5f282c224e085787208b5", "score": "0.4797303", "text": "_timeout(count) {\n if (count < this.minCount) return this.minTimeout;\n let timeout = Math.min(this.maxTimeout, this.baseTimeout * Math.pow(this.exponent, count)); // fuzz the timeout randomly, to avoid reconnect storms when a\n // server goes down.\n\n timeout = timeout * (Random.fraction() * this.fuzz + (1 - this.fuzz / 2));\n return Math.ceil(timeout);\n }", "title": "" }, { "docid": "9574fb9b8eb5da9554cba23617cdf63d", "score": "0.47937673", "text": "function onSubmit() {\n if (getState() == 1){\n responseLimit();\n }\n}", "title": "" }, { "docid": "09cb6c8b58a5c680873014c2b3690cff", "score": "0.47875038", "text": "incrementAttempts() {\n const attemptsElem = document.querySelector('.attempts');\n let pluralSpan = document.querySelector('.attempts-plural');\n if (this.attempts === null) {\n this.attempts = 0;\n attemptsElem.innerHTML = this.attempts;\n pluralSpan.innerHTML = 'Attempts';\n return;\n }\n this.attempts++;\n attemptsElem.innerHTML = this.attempts;\n if (this.attempts === 1) {\n pluralSpan.innerHTML = 'Attempt';\n }\n else if (pluralSpan.innerHTML === 'Attempt') {\n pluralSpan.innerHTML = 'Attempts';\n }\n }", "title": "" }, { "docid": "6c0abb8cb253f82ea282b40fe561b476", "score": "0.47817793", "text": "function imageError(image){\n var curAttempt = image.data('attempt');\n if(undefined === curAttempt){ curAttempt = 1; }\n curAttempt++;\n image.data('attempt', curAttempt);\n if(undefined === image.data('origSrc')){ // save the original source url\n image.data('origSrc',image.attr('src'));\n }\n var sourceURI = image.data('origSrc');\n if(curAttempt > 15) {\n console.log(\"Too many tries to fetch \"+sourceURI+\", giving up.\\n\");\n } else {\n var retryTimeout = 500; // how many ms to wait before retrying.\n if(curAttempt >= 4){ retryTimeout = 1000; }\n if(curAttempt >= 7){ retryTimeout = 2000; }\n if(curAttempt >= 11){ retryTimeout = 4000; }\n if(curAttempt >= 14){ retryTimeout = 10000; } \n console.log('Attempt '+curAttempt+' to load '+sourceURI+'...');\n setTimeout(retryImage,retryTimeout,image);\n }\n}", "title": "" }, { "docid": "98e162a7addfc1f1ec2117191f00cc93", "score": "0.47680974", "text": "function retryNTimes(fn, n) {\n return function () {\n const args = [].slice.call(arguments);\n if (db) fn.apply(null, args);\n else if (n > 0) setTimeout(() => retryNTimes(fn, n - 1).apply(null, args), 1000);\n else throw new Error('Database connection error');\n }\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.47676784", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.47676784", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.47676784", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.47676784", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.47676784", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.47676784", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.47676784", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d43e3f3b5d432524aca3459741314b83", "score": "0.47655398", "text": "function retryIfServerError(fn) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__awaiter\"])(this, void 0, void 0, function () {\n var result;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4\n /*yield*/\n , fn()];\n\n case 1:\n result = _a.sent();\n\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return [2\n /*return*/\n , fn()];\n }\n\n return [2\n /*return*/\n , result];\n }\n });\n });\n }", "title": "" }, { "docid": "e2c0f37198a90af3fc9022edda908082", "score": "0.47577536", "text": "function addPowerplayToRequest() {\n try {\n //If player has already requested all the targeted user's powerplays, display error message and return\n if (powerplaysWanted == tradeTarget.powerplays) {\n DisplayFeedback('Sorry', tradeTarget.team_name + \" doesn't have any more powerplays to offer.\");\n return;\n }\n //Increment global count\n powerplaysWanted += 1;\n //Refresh offer display\n populateOfferFields();\n } catch (err) {\n DisplayFeedback('Error', err + (err.stack ? '<p>' + err.stack + '</p>': ''));\n }\n}", "title": "" }, { "docid": "695da50dbd21ee747c03ae5e225391bf", "score": "0.47414294", "text": "function onTimeout () {\n const error = new Error('request timed out')\n for (let i = 0; i < opts.pipelining; i++) tracker.emit('reqError', error)\n errors++\n timeouts++\n if (opts.bailout && errors >= opts.bailout) stop = true\n }", "title": "" }, { "docid": "bde02df7146656099b8a8fddcf839bd3", "score": "0.47366697", "text": "request(method, data, retry = 100) {\n const requestMethod = `request-${method}`;\n const responseMethod = `response-${method}`;\n let retryInterval;\n return new Promise(resolve => {\n const id = this.on(responseMethod, response => {\n const {requester, data} = response;\n if (requester === id) {\n this.off(responseMethod, id);\n clearInterval(retryInterval);\n resolve(data);\n }\n });\n\n const sendFunc = () =>\n this.sendGlobal(requestMethod, {data, requester: id});\n\n if (retry > 0) {\n retryInterval = setInterval(sendFunc, retry);\n } else {\n sendFunc();\n }\n });\n }", "title": "" }, { "docid": "5c93f52daa6955fd71958183eac93bb6", "score": "0.473208", "text": "function isRequestRecommended$static()/*:Boolean*/ {\n return networkProblemCount$static === 0 &&\n (requestThreshold$static > openRequestCount$static + openBackgroundRequestCount$static || openRequestCount$static === 0);\n }", "title": "" }, { "docid": "fe0f6f389b49db843a29a55866095956", "score": "0.47289747", "text": "async function request() {\n let result;\n let i;\n let lastError;\n for (i = 0; (i < 60); i++) {\n try {\n result = await rp.apply(null, arguments);\n break; \n } catch (e) {\n lastError = e;\n console.log(`Retrying request (${i+1} of 60)...`);\n await Promise.delay(1000);\n }\n }\n if (i === 60) {\n throw lastError;\n }\n return JSON.parse(result);\n}", "title": "" }, { "docid": "c2553df2edae5d64b27037905bbb6fc2", "score": "0.4719112", "text": "static parseCount(counter, requestId) {\n const value = counter.get(requestId);\n if (typeof value === 'undefined') { return 0; }\n if (typeof value === 'number' && value >= 0) {\n return value;\n }\n debug(`https-upgrade: request count for ${requestId} invalid: ${value}`);\n return 0;\n }", "title": "" }, { "docid": "d53d1cbd532c3182a6476ca181828ae8", "score": "0.4717811", "text": "function onTry() {\n tries += 1;\n document.getElementById(\"tries\").innerHTML = tries;\n document.getElementById(\"victry\").innerHTML = tries;\n}", "title": "" }, { "docid": "1111c8b6e87d543f58f5ed0dce791960", "score": "0.47142538", "text": "retryPromise (getPromise) {\n return new Promise((resolve, reject) => {\n const attempt = (i) => {\n getPromise(i)\n .then(resolve)\n .catch((err) => {\n if (i >= 5) {\n return reject(err);\n }\n console.error(err); // eslint-disable-line no-console\n const response = err.response;\n if (!response) return reject(err);\n const statusCode = response.status;\n if (statusCode === 429) {\n const retryAfter = parseInt(response.headers['retry-after']);\n setTimeout(() => attempt(i + 1), (retryAfter * 1000));\n } else {\n reject(err);\n }\n });\n };\n attempt(1);\n });\n }", "title": "" }, { "docid": "fcc1499223f2f94e03798beafba15987", "score": "0.47075108", "text": "function check() {\n\t\tamount++;\n\t\thttp.request({\n\t\t\tport: port,\n\t\t\tpath: '/',\n\t\t\tmethod: 'GET',\n\t\t\theaders: {\n\t\t\t\t'X-Pact-Mock-Service': true,\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t}\n\t\t}, done).on('error', function () {\n\t\t\tif (amount >= 10) {\n\t\t\t\tthrow \"Pact setup failed; tried calling service 3 times with no result.\";\n\t\t\t}\n\t\t\tsetTimeout(check, 1000);\n\t\t}).end();\n\t}", "title": "" }, { "docid": "78e07359a902cb37a555aee7b1bdf0a5", "score": "0.4699804", "text": "function addRequest(id, title, no_feedback){ //function in event of no return\n\tvar request_id;\n\t\n\tfor(request_id = 0; request_id < MAX_REQUESTS; request_id++){\n\t\tif(requests[request_id] == undefined){\n\t\t\trequests[request_id] = {id: id, title: title};\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tsetTimeout(function(){\n\t\tif(requests[request_id] != undefined) {\n\t\t\tno_feedback;\n\t\t\tdelete requests[request_id];\n\t\t}\n\t}, REQUEST_TIME);\n\t\n\treturn request_id;\n}", "title": "" }, { "docid": "775075e24313a21dabc586d3e0c2ddc9", "score": "0.46995962", "text": "function retry(fn, maxRetries = 3) {\n return fn().catch(err => {\n if (maxRetries <= 0) {\n throw err;\n }\n return sequence([refreshAuth, fn]);\n });\n}", "title": "" }, { "docid": "931dd1383d3f6e4c2372edb9d9d93601", "score": "0.46980348", "text": "function checkRequest(parms)\n{\n\tvar session\t\t= parms.session,\n\t\tauthState\t= session.authState,\n\t\tserver\t\t= parms.server;\n\n\tif (session.network.lostNetwork & LN_LOST)\n\t\treturn 0;\n\n\tif (authState.membership == Network.AUTH_COMPLETE)\n\t{\n\t\treturn 1;\n\t}\n}", "title": "" } ]
4d66ed35bcddb9cd4993dbfbb892ae28
FUNCION QUE GUARDA LAS DIMENSIONES DE LA LINGA SELECCIONADA ADEMAS GUARDA EL TIPO DE UNIT SELECCIONADO EN UNA VARIABLE GLOBAL
[ { "docid": "477a0edbb87573d21f0ab187f821a5a3", "score": "0.5630472", "text": "function dimensiones_linga(){\n id=$(\"#tipo_celulosa\").val();\n nueva_dimension_linga(id);\n unit_seleccionado=$(\"#tipo_celulosa\").val();\n}", "title": "" } ]
[ { "docid": "7bf6ad2daff2f8a35f66904a26f14b54", "score": "0.61678684", "text": "getUnitsByDimension(uDim) {\n let unitsArray = null;\n\n if (uDim === null || uDim === undefined) {\n throw new Error('Unable to find unit by because no dimension ' + 'vector was provided.');\n }\n\n unitsArray = this.unitDimensions_[uDim];\n\n if (unitsArray === undefined || unitsArray === null) {\n console.log(`Unable to find unit with dimension = ${uDim}`);\n }\n\n return unitsArray;\n }", "title": "" }, { "docid": "2b2c063c2d011fd5d7c1f1d41bb0a3d3", "score": "0.56505114", "text": "function xUnitsCount(limit) {\n // this function counts for us so we can get the length the user inputted correctly and don't have to worry about any x value limiting.\n for (var i = 0; i < limit; i++) {\n\n\n xUnitVal.push(i);\n }\n }", "title": "" }, { "docid": "91737b13ea3b713815f448cf2b2ee755", "score": "0.5630133", "text": "function readVariables(clauses) {\n\n let bidimensional = []; // para acessar os valores 2d.\n let absl = []; // para armazenar o valor absoluto.\n let unique = \"\"; //armazena variaveis unicas.\n //percorrre a matriz.\n for (let i = 0; i < clauses.length; i++) {\n\n // a variavel bidimensional recebera a string contida\n //dentro da atual clauses analisada.\n bidimensional = clauses[i];\n for (let j = 0; j < bidimensional.length; j++) {\n\n // ja que nao importa se a variavel estara negada ou\n // nao para ser unica, salva seu valor absoluto.\n absl = Math.abs(bidimensional[j]);\n if (!unique.contains(absl)) {\n\n // sera salvo numa string chamada unique que\n // adicionara um espaço para separar cada uma.\n unique += absl + \" \";\n }\n }\n }\n\n // agora vai usar o split para separar os elementos de unique\n // como elementos de uma matriz tamanho n.\n unique = unique.split(\" \");\n let variables = [];\n\n //preenchera a matriz de tamanho n com valores bool: false.\n for (let i = 0; i < unique.length; i++) {\n variables[i] = false;\n }\n return variables;\n}", "title": "" }, { "docid": "012548d379166c81872a71cb49d9d32f", "score": "0.5630041", "text": "function inicializar(){\n tm = []; \n cv = [];\n tv = [];\n cu = [];\n ct = [];\n cantprod = [];\n uniddisp = [];\n demnosat = []; \n costOp = []; \n ganancia = [];\n demandaDelMes = []; \n}", "title": "" }, { "docid": "de4c4493c310fa1b51b8cd40df916fa6", "score": "0.55783904", "text": "function limpiarVariablesDeMovimiento() {\n distancia = [];\n xVal = [];\n yVal = [];\n posAspiradoraX = xFinal;\n posAspiradoraY = yFinal;\n}", "title": "" }, { "docid": "882e3a9475b4e4def8574b3947361495", "score": "0.5530501", "text": "function setVariables() {\n //define a\n if (grid[j-1]===undefined) {\n a = 0;\n } else {\n a = grid[j-1][k];\n }\n //define b\n if (grid[j][k+1]===undefined) {\n b = 0;\n } else {\n b = grid[j][k+1];\n }\n //define c\n if (grid[j+1]===undefined) {\n c = 0;\n } else {\n c = grid[j+1][k];\n }\n //define d\n if (grid[j][k-1]===undefined) {\n d = 0;\n } else {\n d = grid[j][k+-1];\n }\n }", "title": "" }, { "docid": "f29d3185d26a7480acab961d87f97313", "score": "0.55215865", "text": "static get dim() {return 3;}", "title": "" }, { "docid": "11976ccc9013e5dbbec314bbd597cd60", "score": "0.5472579", "text": "static get dim() {return 2;}", "title": "" }, { "docid": "a7c7a22aa4e4226fdfd67b7e5af01cbc", "score": "0.5455576", "text": "function init() {\n reset();\n //The following code extracts the entered value(s) in the inputs and converts them to intergers\n //Then it arranges the 3 numbers from largest to smallest\n let dimensions = [];\n let extra = parseFloat(document.getElementById('pad').value);\n //Triple Input\n if (tripleStyle.style.display !== \"none\") {\n let inputs = document.getElementsByClassName(\"tripleInput\");\n let measurements = [].map.call(inputs, function(input) {\n dimensions.push(parseFloat(input.value) + extra);\n });\n } else {\n //Single Input\n let inputs = document.getElementsByClassName(\"singleInput\")[0].value.split('');\n if (inputs.length == 6) {\n for (let t = 0; t < 6; t+=2) {\n dimensions.push(parseFloat(inputs[t] + inputs[t+1]) + extra);\n }\n } else {\n return\n }\n }\n dimensions.sort(function(a, b){return b-a});\n compare(dimensions);\n}", "title": "" }, { "docid": "4074ac09573191ccd3f75b2582f8afe5", "score": "0.54064226", "text": "function _createDims() {\n \n dims.dummy = _data.dimension(function(d) { return 'all'; });\n dims.account = _data.dimension(function(d) { return d.accountName; });\n dims.product = _data.dimension(function(d) { return d.productCode + \" \" + d.productName; });\n dims.yearMonth = _data.dimension(function(d) { return d.yearMonth; });\n\n }", "title": "" }, { "docid": "45b742373ab784fb402246dac8b18d41", "score": "0.5370527", "text": "function gerarVariosNumeros() {\n return Promise.all([\n gerarNumerosEntre(1, 30, 6000),\n gerarNumerosEntre(1, 30, 1000),\n gerarNumerosEntre(1, 30, 4000),\n gerarNumerosEntre(1, 30, 2500),\n gerarNumerosEntre(1, 30, 2000),\n gerarNumerosEntre(1, 30, 3000)\n ])\n}", "title": "" }, { "docid": "adb10f7c02f5980a656e7b79940c2f0d", "score": "0.53608537", "text": "static get unitsPerInch() {\n var rv = {};\n\n rv['pt']=72.0;\n rv['px']=96.0;\n rv['em']=6.0;\n return rv;\n }", "title": "" }, { "docid": "bc45c99222e6cbbd19a2252f3ca2ba45", "score": "0.53606784", "text": "addUnitDimension(theUnit) {\n let uDim = theUnit['dim_'].getProperty('dimVec_');\n\n if (uDim) {\n if (this.unitDimensions_[uDim]) this.unitDimensions_[uDim].push(theUnit);else this.unitDimensions_[uDim] = [theUnit];\n } else throw new Error('UnitTables.addUnitDimension called for a unit with no dimension. ' + `Unit code = ${theUnit['csCode_']}.`);\n }", "title": "" }, { "docid": "332a4a3b48c012c5f5ffe58ab5ccd80b", "score": "0.53494674", "text": "function calculateDim() {\n\tinnerR = size / (1 + ioRatio + (ioRatio * ptRatio));\n\touterR = innerR * ioRatio;\n\tptR = outerR * ptRatio;\n}", "title": "" }, { "docid": "58dd23e821f776bea40d287066f4081d", "score": "0.53457654", "text": "function tiempoEnDias(){\r\n\t\treturn tiempo*20;\r\n\t}", "title": "" }, { "docid": "5a1dc9136c0b36bf4b8d5dd4749ae22e", "score": "0.53217435", "text": "function _initDimensionVars()\n {\n var docElem = document.documentElement;\n store(\"rs_var_document_client_w\", docElem.clientWidth);\n store(\"rs_var_document_client_h\", docElem.clientHeight);\n store(\"rs_var_window_outer_w\", window.outerWidth);\n store(\"rs_var_window_outer_h\", window.outerHeight);\n store(\"rs_var_window_screen_w\", screen.width);\n store(\"rs_var_window_screen_h\", screen.height);\n }", "title": "" }, { "docid": "f16458bebc4140ff852aad16234b2520", "score": "0.5283532", "text": "static get dim() {return this.length;}", "title": "" }, { "docid": "06fb610dd212e75bd53da64f93da1009", "score": "0.52789927", "text": "function retornaMuchos() {\n return [1, 51, 3515];\n}", "title": "" }, { "docid": "fb6b6add0c84cbb4f89f2d63fa6d3f4b", "score": "0.5278627", "text": "function getDimensionProperty(inputLayout) {\n\tvar inputMatrix = inputLayout.qHyperCube.qDataPages[0].qMatrix;\n\tvar inputMatrixSize = inputLayout.qHyperCube.qSize.qcy;\n\tvar inputProperty = [], intermediateProperty = [], outputArray = [];\n\tvar inputProperty_Dim1a = [], inputProperty_Dim1b = [], inputProperty_Dim1c = [], inputProperty_Dim2a = [], inputProperty_Dim2b = [], inputProperty_Dim2c = [];\n\n\tfor (k = 0; k < inputMatrixSize; k++) {\n\t\tif(inputMatrix[k] != null && inputMatrix[k].length > 0) {\n\t\t\tvar i = 2 * k;\n\t\t\tvar j = i + 1;\n\t\t\tinputProperty[i] = inputMatrix[k][0].qText;\n\t\t\tinputProperty[j] = inputMatrix[k][1].qText;\n\t\t\tinputProperty_Dim1a[k] = inputMatrix[k][0].qText;\n\t\t\tinputProperty_Dim1b[k] = 1;\n\t\t\tinputProperty_Dim1c[k] = inputMatrix[k][0].qElemNumber;\n\t\t\tinputProperty_Dim2a[k] = inputMatrix[k][1].qText;\n\t\t\tinputProperty_Dim2b[k] = 2;\n\t\t\tinputProperty_Dim2c[k] = inputMatrix[k][1].qElemNumber;\n\t\t}\n\t}\n\t\n\tfor (i = 0; i < inputProperty.length; i++){\n\t\tif ((jQuery.inArray(inputProperty[i], intermediateProperty)) == -1){\n\t\t\tintermediateProperty.push(inputProperty[i]);\n\t\t}\n\t}\n\t \n\tfor (i = 0; i < intermediateProperty.length; i++){\n\t\tvar currentDim = intermediateProperty[i], test_Dim1, test_Dim2, id_Dim1, id_Dim2;\n\t\tif (inputProperty_Dim1b[inputProperty_Dim1a.indexOf(currentDim)] == 1) { test_Dim1 = 1; } else { test_Dim1 = 0; };\n\t\tif (inputProperty_Dim2b[inputProperty_Dim2a.indexOf(currentDim)] == 2) { test_Dim2 = 1; } else { test_Dim2 = 0; };\n\t\tvar test_Dim = test_Dim2 - test_Dim1;\n\t\tif (inputProperty_Dim1c[inputProperty_Dim1a.indexOf(currentDim)] == null) { id_Dim1 = -1; } else { id_Dim1 = inputProperty_Dim1c[inputProperty_Dim1a.indexOf(currentDim)]; };\n\t\tif (inputProperty_Dim2c[inputProperty_Dim2a.indexOf(currentDim)] == null) { id_Dim2 = -1; } else { id_Dim2 = inputProperty_Dim2c[inputProperty_Dim2a.indexOf(currentDim)]; };\t\n\t\toutputArray[i] = new Array(4);\t\n\t\toutputArray[i][0] = currentDim;\n\t\toutputArray[i][1] = test_Dim;\n\t\toutputArray[i][2] = id_Dim1;\n\t\toutputArray[i][3] = id_Dim2;\n\t }\n\t \n\t return outputArray;\n}", "title": "" }, { "docid": "5acac6fc73929e71bae0ee355a0714b4", "score": "0.5277885", "text": "function getUnitsArray() {\n\t for (i = 0; i < uNits.length; i++) {\n\t dataNames.push(uNits[i]['concat'])\n\t }\n\t}", "title": "" }, { "docid": "ebcaa8b00ce3cd6d50c07bdf2e55ee6b", "score": "0.52667195", "text": "function calculacompraunitaria(){\r\n\r\n\t\t\t\t// calculaganancia();\r\n\r\n\t\t\tvar cantxy = document.getElementsByName(\"cantidad[]\");\r\n\t\t\tvar precxy = document.getElementsByName(\"precio_compra[]\");\r\n \t\t\tvar impoxy = document.getElementsByName(\"importe[]\");\r\n\t\t\tvar subxy = document.getElementsByName(\"subtotal\");\r\n\t\t\tfor (var i = 0; i <cantxy.length; i++) {\r\n\r\n\t\t \t var inpCxy=cantxy[i];\r\n\t\t \tvar inpPxy=precxy[i];\r\n\t\t \t var inpIxy=impoxy[i];\r\n\t\t \t var inpSxy=subxy[i];\r\n\r\n\t\t\t inpPxy.value = parseFloat(Math.round((inpIxy.value / inpCxy.value) * 100) / 100).toFixed(2);\r\n\r\n\t\t\t\tinpSxy.value = inpCxy.value * inpPxy.value;\r\n\t\t\t\tdocument.getElementsByName(\"subtotal\")[i].innerHTML = \"S/. \" + parseFloat(Math.round(inpSxy.value * 100) / 100).toFixed(2);\r\n\t \t }\r\n\t\t \t\t\t\tcalcularTotales();\r\n\t\t}", "title": "" }, { "docid": "6e669e9c8d2d0784cc28fec1590d8b2c", "score": "0.52656555", "text": "function ajustaTamanhoPalcoJogo() {\n altura = window.innerHeight;\n largura = window.innerWidth;\n\n console.log(altura, largura);\n}", "title": "" }, { "docid": "964b1d2e888889ca58332137132bdd47", "score": "0.52553153", "text": "function clearData() {\r\n // COMMON/AZ00/\r\n n = 0; // number of products\r\n jj = 0; // number of materials used\r\n kk = 0; // number of departments\r\n kp = 0; // number of operating departments\r\n ks = 0; // number of service departments\r\n mm = 0; // number of operating expense items\r\n m1 = 0;\r\n m2 = 0;\r\n m3 = 0;\r\n m4 = 0;\r\n m5 = 0;\r\n ll = 0; // number of factory overhead cost items\r\n l1 = 0;\r\n l2 = 0;\r\n l3 = 0;\r\n l4 = 0;\r\n l5 = 0;\r\n j6 = 0;\r\n\r\n // COMMON/AZ01/\r\n tpsq = 0;\r\n tsq = dimension(13);\r\n tsv = dimension(13);\r\n sv = dimension(10, 13);\r\n sq = dimension(10, 13);\r\n\r\n // COMMON/AZ02/\r\n psq = dimension(10);\r\n si = dimension(10);\r\n sk = dimension(13);\r\n sp = dimension(10);\r\n\r\n // COMMON/AZ03/\r\n pq = dimension(10, 13);\r\n ei = dimension(10, 13);\r\n bi = dimension(10, 13);\r\n tpq = dimension(13);\r\n apq = dimension(10, 13);\r\n\r\n // COMMON/AZ04/\r\n tbi = dimension(13);\r\n tei = dimension(13);\r\n pc = dimension(10, 13);\r\n puc = dimension(10, 13);\r\n tpc = dimension(13);\r\n\r\n // COMMON/AZ05/\r\n pk = dimension(10, 13);\r\n pmi = dimension(10);\r\n pkn = dimension(10, 13);\r\n puco = dimension(10);\r\n ucmo = dimension(3);\r\n\r\n // COMMON/AZ06/\r\n rmr = dimension(10, 3, 13);\r\n tmr = dimension(3, 13);\r\n prm = dimension(3, 13);\r\n rmi = dimension(3, 13);\r\n aprm = dimension(3, 13);\r\n\r\n // COMMON/AZ07/\r\n cmr = dimension(3, 13);\r\n tcm = dimension(13);\r\n tmi = dimension(13);\r\n tpm = dimension(13);\r\n tpv = dimension(13);\r\n vmi = dimension(13);\r\n\r\n // COMMON/AZ08/\r\n ucm = dimension(3, 13);\r\n pmk = dimension(10, 13);\r\n pmc = dimension(3, 13);\r\n rmmi = dimension(3);\r\n pmcn = dimension(3, 13);\r\n\r\n // COMMON/AZ09/\r\n dlc = dimension(10, 4, 13);\r\n tdlc = dimension(4, 13);\r\n tlc = dimension(13);\r\n tlcp = dimension(10);\r\n\r\n // COMMON/AZ10/\r\n slh = dimension(10, 4, 13);\r\n slc = dimension(4);\r\n\r\n // COMMON/AZ11/\r\n fpf = dimension(13);\r\n ffr = dimension(6, 13);\r\n vfr = dimension(4, 13);\r\n fok = dimension(6, 2, 13);\r\n fop = dimension(6, 13);\r\n\r\n // COMMON/AZ12/\r\n dff = dimension(6, 13);\r\n dfo = dimension(6);\r\n tvr = dimension(4);\r\n dvf = dimension(4, 13, 13);\r\n fob = dimension(6, 13, 13);\r\n\r\n // COMMON/AZ13/\r\n foc = dimension(13, 13);\r\n tfob = dimension(6, 13);\r\n tff = 0;\r\n tvf = dimension(13);\r\n dvo = dimension(4, 13);\r\n ffo = dimension(13);\r\n\r\n // COMMON/AZ14/\r\n tfoa = dimension(4, 13);\r\n fo = dimension(13);\r\n tfo = dimension(13);\r\n vfo = dimension(13);\r\n ttv = 0;\r\n\r\n // COMMON/AZ15/\r\n voe = dimension(5, 13);\r\n oe = dimension(5, 13);\r\n toe = dimension(13);\r\n tvoe = dimension(13);\r\n tpoe = dimension(5);\r\n tfoe = 0;\r\n\r\n // COMMON/AZ16/\r\n oek = dimension(10, 5);\r\n foe = dimension(5);\r\n\r\n // COMMON/AZ17/\r\n arc = dimension(13);\r\n cs = dimension(13);\r\n fof = dimension(10, 4, 13);\r\n pfk = dimension(4);\r\n pe = dimension(13);\r\n\r\n // COMMON/AZ18/\r\n ac1 = 0;\r\n ac2 = 0;\r\n tsvn = 0;\r\n tsvd = 0;\r\n csc = 0;\r\n fpc = dimension(13, 3);\r\n focn = dimension(13);\r\n focd = dimension(13);\r\n\r\n // COMMON/AZ19/\r\n vpe = dimension(13);\r\n rco = dimension(13);\r\n oli = dimension(13);\r\n sli = dimension(13);\r\n oco = dimension(13);\r\n ssm = dimension(13);\r\n\r\n // COMMON/AZ20/\r\n tllx = dimension(13);\r\n pisx = dimension(13);\r\n rfr = dimension(13);\r\n slx = dimension(13);\r\n ssx = dimension(13);\r\n\r\n // COMMON/AZ21/\r\n tll = dimension(13);\r\n oir = dimension(13);\r\n sl = dimension(13);\r\n slr = dimension(13);\r\n sir = dimension(13);\r\n\r\n // COMMON/AZ22/\r\n pex = dimension(13);\r\n pix = dimension(13);\r\n emx = dimension(13);\r\n hlx = dimension(13);\r\n bfx = dimension(13);\r\n\r\n // COMMON/AZ23/\r\n rfe = dimension(13);\r\n chb = dimension(13);\r\n casmin = 0;\r\n casmax = 0;\r\n ss = dimension(13);\r\n\r\n // COMMON/AZ24/\r\n tco = dimension(13);\r\n tcr = dimension(13);\r\n cri = dimension(13);\r\n ssi = dimension(13);\r\n\r\n // COMMON/AZ25/\r\n fme = dimension(13);\r\n tfi = dimension(13);\r\n cgs = dimension(13);\r\n gp = dimension(13);\r\n pbt = dimension(13);\r\n ct = dimension(13);\r\n pat = dimension(13);\r\n\r\n // COMMON/AZ26/\r\n aex = dimension(13);\r\n aemx = dimension(13);\r\n ar = dimension(13);\r\n bf = dimension(13);\r\n aar = dimension(13);\r\n abf = dimension(13);\r\n vp = dimension(13);\r\n\r\n // COMMON/AZ27/\r\n ae = dimension(13);\r\n aem = dimension(13);\r\n arn = dimension(13);\r\n bfn = dimension(13);\r\n emn = dimension(13);\r\n\r\n // COMMON/AZ28/\r\n abfx = dimension(13);\r\n dd = dimension(13);\r\n em = dimension(13);\r\n hl = dimension(13);\r\n pi = dimension(13);\r\n pis = dimension(13);\r\n\r\n // COMMON/AZ29/\r\n re = dimension(13);\r\n rex = dimension(13);\r\n sc = dimension(13);\r\n scx = dimension(13);\r\n oeq = dimension(13);\r\n per = dimension(13);\r\n ppe = dimension(13);\r\n\r\n // COMMON/AZ30/\r\n tca = dimension(13);\r\n tfa = dimension(13);\r\n ta = dimension(13);\r\n tsl = dimension(13);\r\n te = dimension(13);\r\n\r\n // COMMON/AZ31/\r\n ocr = dimension(13);\r\n\r\n // COMMON/AZ32/\r\n rcr = dimension(13);\r\n\r\n // COMMON/AZ33/\r\n prmd = dimension(3);\r\n\r\n}", "title": "" }, { "docid": "3e61b5d8abbc2e99644d1b19eef594cd", "score": "0.52543", "text": "get dimensions() {\n var _a;\n // Contraint contains allowed dimension values for a given dataflow\n // Get 'actual' constraints (rather than 'allowed' constraints)\n const constraints = (_a = this.sdmxJsonDataflow.contentConstraints) === null || _a === void 0 ? void 0 : _a.filter(c => c.type === \"Actual\");\n return (this.sdmxDimensions\n // Filter normal enum dimensions\n .filter(dim => {\n var _a;\n return dim.id &&\n dim.type === \"Dimension\" && ((_a = dim.localRepresentation) === null || _a === void 0 ? void 0 : _a.enumeration);\n })\n .map(dim => {\n var _a, _b, _c, _d, _e;\n const modelOverride = this.getMergedModelOverride(dim);\n // Concept maps dimension's ID to a human-readable name\n const concept = this.getConceptByUrn(dim.conceptIdentity);\n // Codelist maps dimension enum values to human-readable labels\n const codelist = this.getCodelistByUrn((_a = dim.localRepresentation) === null || _a === void 0 ? void 0 : _a.enumeration);\n // Get allowed options from constraints.cubeRegions (there may be multiple - take union of all values)\n const allowedOptionIds = Array.isArray(constraints)\n ? constraints.reduce((keys, constraint) => {\n var _a;\n (_a = constraint.cubeRegions) === null || _a === void 0 ? void 0 : _a.forEach(cubeRegion => { var _a, _b; return (_b = (_a = cubeRegion.keyValues) === null || _a === void 0 ? void 0 : _a.filter(kv => kv.id === dim.id)) === null || _b === void 0 ? void 0 : _b.forEach(regionKey => { var _a; return (_a = regionKey.values) === null || _a === void 0 ? void 0 : _a.forEach(value => keys.add(value)); }); });\n return keys;\n }, new Set())\n : new Set();\n let options = [];\n // Only create options if less then MAX_SELECTABLE_DIMENSION_OPTIONS (1000) values\n if (allowedOptionIds.size < MAX_SELECTABLE_DIMENSION_OPTIONS) {\n // Get codes by merging allowedOptionIds with codelist\n let filteredCodesList = (_c = (allowedOptionIds.size > 0\n ? (_b = codelist === null || codelist === void 0 ? void 0 : codelist.codes) === null || _b === void 0 ? void 0 : _b.filter(code => allowedOptionIds.has(code.id)) : // If no allowedOptions were found -> return all codes\n codelist === null || codelist === void 0 ? void 0 : codelist.codes)) !== null && _c !== void 0 ? _c : [];\n // Create options object\n // If modelOverride `options` has been defined -> use it\n // Other wise use filteredCodesList\n const overrideOptions = modelOverride === null || modelOverride === void 0 ? void 0 : modelOverride.options;\n options =\n isDefined(overrideOptions) && overrideOptions.length > 0\n ? overrideOptions.map(option => {\n return {\n id: option.id,\n name: option.name,\n value: undefined\n };\n })\n : filteredCodesList.map(code => {\n return { id: code.id, name: code.name, value: undefined };\n });\n }\n // Use first option as default if no other default is provided\n let selectedId = (modelOverride === null || modelOverride === void 0 ? void 0 : modelOverride.allowUndefined) ||\n allowedOptionIds.size >= MAX_SELECTABLE_DIMENSION_OPTIONS\n ? undefined\n : (_d = options[0]) === null || _d === void 0 ? void 0 : _d.id;\n // Override selectedId if it a valid option\n const selectedIdOverride = modelOverride === null || modelOverride === void 0 ? void 0 : modelOverride.selectedId;\n if (isDefined(selectedIdOverride) &&\n options.find(option => option.id === selectedIdOverride)) {\n selectedId = selectedIdOverride;\n }\n return {\n id: dim.id,\n name: (_e = modelOverride === null || modelOverride === void 0 ? void 0 : modelOverride.name) !== null && _e !== void 0 ? _e : concept === null || concept === void 0 ? void 0 : concept.name,\n options: options,\n position: dim.position,\n disable: modelOverride === null || modelOverride === void 0 ? void 0 : modelOverride.disable,\n allowUndefined: modelOverride === null || modelOverride === void 0 ? void 0 : modelOverride.allowUndefined,\n selectedId: selectedId\n };\n })\n .filter(isDefined));\n }", "title": "" }, { "docid": "adb8c68ed436b1efb03015e0ef640c15", "score": "0.5248081", "text": "function atualizarTamanhoPalcoJogo(){\n altura=window.innerHeight\n largura=window.innerWidth\n}", "title": "" }, { "docid": "ac16b42314eadfdb24ad17cdd2ce097a", "score": "0.52388394", "text": "function ajustaTamanhoJanela() {\n altura = window.innerHeight;\n largura = window.innerWidth;\n\n console.log(largura, altura);\n}", "title": "" }, { "docid": "5dd399bd25ca1669c7d3fd0d771b6f7b", "score": "0.5232804", "text": "function SumaARRAY2(numeros){\n let suma=0;\n for (let pos in numeros){\n suma=suma+numeros[pos];\n }\n return suma;\n\n}", "title": "" }, { "docid": "b00f17abc18c1defeb430d740d862a86", "score": "0.5222012", "text": "function array_calcular(){\n\tnotas = [];\n\tfor( num = 0; num < alumnos.length; num ++) {\n\t\tnotas.push(alumnos[num].Nota);\n\t}\n}", "title": "" }, { "docid": "8e003eec56657aa2ea9b70c1c0afa89d", "score": "0.5213653", "text": "function operacion(digito1, digito2){\r\n\r\n var resultado = digito1 + digito2;\r\n globales = resultado;\r\n console.log(\"globales_operacion\", globales);\r\n console.log(\"resultado\", resultado);\r\n\r\n}", "title": "" }, { "docid": "97599cfd418a54e3fdf010d46ef57105", "score": "0.52052325", "text": "function allmystats() {\n app.estadisticas.cantDem = app.vectordemocrata.length;\n app.estadisticas.cantRep = app.vectorrepublicano.length;\n app.estadisticas.cantTotal = app.memberList.length;\n app.estadisticas.promVotosDem = (promedioVotosDem / votosDemocratas.length).toFixed(2);\n app.estadisticas.promVotosRep = (promedioVotosRep / votosRepublicanos.length).toFixed(2);\n app.estadisticas.promVotosTot = (((promedioVotosDem / votosDemocratas.length) + (promedioVotosRep / votosRepublicanos.length)) / 2).toFixed(2);\n\n app.estadisticas.leastLoyal = elDiezQueMenosVoto;\n app.estadisticas.mostLoyal = elDiezQueMasVoto;\n}", "title": "" }, { "docid": "c284ae39646a18a73164b8fc2b435943", "score": "0.5189453", "text": "static get FIXEDSIZE() { return 2; }", "title": "" }, { "docid": "d5938e8b1b3e1875641bcab6a69864d7", "score": "0.5183493", "text": "function getGridDimension() {\n return prompt(\"Put in the number of elements you want on one row:\")\n}", "title": "" }, { "docid": "387d2a75f2a8ea2d53e7529202e55e69", "score": "0.5179587", "text": "getCantidadServicios() {\n let cantidad = 0;\n\n $.each(this.servicios, (index, s) => {\n cantidad += s.unidades;\n })\n\n return cantidad;\n }", "title": "" }, { "docid": "72e154ac67d7ba34482a88f5f2faf1d5", "score": "0.5157779", "text": "static getDimensions() {\n return this.dimensions;\n }", "title": "" }, { "docid": "75dad330777f78661e7bfc03dd01ce28", "score": "0.51471955", "text": "function dims(dimensions) {\n if (dimensions) {\n _dimensions = dimensions;\n }\n return _dimensions;\n }", "title": "" }, { "docid": "fb06fb637dc3d1d9d62a14fe86696819", "score": "0.5137084", "text": "function aumentar() {\n var local = 2\n let tambienLocal = 3\n const LOCAL = 4\n\n console.log(local) // 2\n console.log(tambienLocal) // 3\n console.log(LOCAL) // 4\n}", "title": "" }, { "docid": "9c884f683f968c21424f4de3557caa97", "score": "0.51357305", "text": "get unitMeasure() {\n var _a, _b, _c;\n // Find tableColumns which have corresponding modelOverride with type `unit-measure`\n // We will only use columns if they have a single unique value\n const unitMeasure = filterOutUndefined((_a = this.catalogItem.modelOverrides) === null || _a === void 0 ? void 0 : _a.filter(override => override.type === \"unit-measure\" && override.id).map(override => {\n var _a, _b, _c, _d, _e;\n // Find dimension/attribute id with concept or codelist override\n let dimOrAttr = (_a = this.getAttributionWithConceptOrCodelist(override.id)) !== null && _a !== void 0 ? _a : this.getDimensionWithConceptOrCodelist(override.id);\n const column = (dimOrAttr === null || dimOrAttr === void 0 ? void 0 : dimOrAttr.id) ? this.catalogItem.findColumnByName(dimOrAttr.id)\n : undefined;\n if ((column === null || column === void 0 ? void 0 : column.uniqueValues.values.length) === 1) {\n // If this column has a codelist, use it to format the value\n const codelist = this.getCodelistByUrn((_b = dimOrAttr === null || dimOrAttr === void 0 ? void 0 : dimOrAttr.localRepresentation) === null || _b === void 0 ? void 0 : _b.enumeration);\n const value = column === null || column === void 0 ? void 0 : column.uniqueValues.values[0];\n return (_e = (_d = (_c = codelist === null || codelist === void 0 ? void 0 : codelist.codes) === null || _c === void 0 ? void 0 : _c.find(c => c.id === value)) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : value;\n }\n })).join(\", \");\n // Find frequency from dimensions with modelOverrides of type \"frequency\".\n const frequencyDim = this.getDimensionsWithOverrideType(\"frequency\").find(dim => isDefined(dim.selectedId));\n // Try to get option label if it exists\n let frequency = (_c = (_b = frequencyDim === null || frequencyDim === void 0 ? void 0 : frequencyDim.options.find(o => o.id === frequencyDim.selectedId)) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : frequencyDim === null || frequencyDim === void 0 ? void 0 : frequencyDim.id;\n return `${unitMeasure ||\n i18next.t(\"models.sdmxJsonDataflowStratum.defaultUnitMeasure\")}${frequency ? ` (${frequency})` : \"\"}`;\n }", "title": "" }, { "docid": "ff5dfe64664aa26b1d192a244ffddac1", "score": "0.5121422", "text": "function fillTilesVars_countWidthByCols(){\n\n\t\tg_vars.colWidth = (g_vars.availWidth - g_vars.colGap * (g_vars.numCols-1)) / g_vars.numCols;\n\t\tg_vars.colWidth = Math.floor(g_vars.colWidth);\n\n\t\tg_vars.totalWidth = g_functions.getSpaceByNumItems(g_vars.numCols, g_vars.colWidth, g_vars.colGap);\n\t\t\n\t}", "title": "" }, { "docid": "0dbcc05a1c2e9c9cdd72e23a5302e2ac", "score": "0.51166743", "text": "function ajustaTamanhoJogo() {\n\talturaPagina = window.innerHeight\n\tlarguraPagina = window.innerWidth\n\n\tconsole.log(larguraPagina, alturaPagina)\n}", "title": "" }, { "docid": "012bdd8357cb875a0f606de44d2b476a", "score": "0.5106162", "text": "function resetUnitsize(num) {\n window.unitsize = num;\n for(var i = 2; i <= 64; ++i) {\n window[\"unitsizet\" + i] = unitsize * i;\n window[\"unitsized\" + i] = unitsize / i;\n }\n window.scale = unitsized2; // Typically 2\n window.gravity = round(12 * unitsize) / 100; // Typically .48\n}", "title": "" }, { "docid": "10574d1f653f114425b50f8b19d5cd35", "score": "0.5099445", "text": "function dimensions() {\n \tvar result = [],\n \t\tscreenWidth = screen.width,\n bodyWidth = $('body').width();\n\t\tif (screenWidth < 640) {\n\t\t\tresult[0] = 640;\n\t\t}\n\t\telse if (screenWidth > 640 && screenWidth < 1024) {\n\t\t\tresult[0] = 1000;\n\t\t}\n else {\n result[0] = 1100;\n }\n if (bodyWidth < 640) {\n result[1] = 640;\n }\n else if (bodyWidth > 640 && bodyWidth < 1024) {\n result[1] = 1000;\n }\n else {\n result[1] = 1100;\n }\n \treturn result;\n }", "title": "" }, { "docid": "3029cacccf3d83a15b12078c006f74f8", "score": "0.50965816", "text": "clone() {\n let retUnit = new Unit();\n Object.getOwnPropertyNames(this).forEach(val => {\n if (val === 'dim_') {\n if (this['dim_']) retUnit['dim_'] = this['dim_'].clone();else retUnit['dim_'] = null;\n } else retUnit[val] = this[val];\n });\n return retUnit;\n }", "title": "" }, { "docid": "811c956abd5a1f9009c07bf1092de3ea", "score": "0.5095066", "text": "function pongo_musica() {\n\n\n var musicaTiempo=1;\n var musicaEjercicio=0;\n\n for(var x=0; x < listaArr.length; x++){\n\n musicaArr[x] = new Array(2);\n //el nombre de es el mismo en los dos arrays\n musicaArr[x][0]= listaArr[x][0];x\n musicaArr[x][1]=musicaTiempo;\n\n //creo un array con el ejercicio y el tiempo en el que tiene que empezar la musica\n musicaTiempo=parseFloat(musicaTiempo)+parseFloat(parseFloat(listaArr[x][1])*60);\n /*alert(musicaTiempo);*/\n\n }\n\n\n\n}", "title": "" }, { "docid": "07e9fcd0c01bf42e888e16d76fc5588d", "score": "0.50899166", "text": "function datosTriangulo(a, b, c) {\n const ha = alturatriangulo(a, b, c);\n const perimetro = perimetroTriangulo (a, b, c);\n const area = areaTriangulo(a, b, c);\n const otrosDatos = teoremaDelCoseno(a, b, c, ha);\n otrosDatos[5] = ha\n // const distanciax = datos[0];\n document.getElementById(\"alturatriangulo\").innerHTML = `La altura es de ${ha}`;\n document.getElementById(\"perimetrotriangulo\").innerHTML = `El perimetro es de ${perimetro}`;\n document.getElementById(\"areatriangulo\").innerHTML = `El area es de ${area}`;\n document.getElementById(\"angulo1\").innerHTML = `El angulo 1 es de ${otrosDatos[0].toFixed(2)}`;\n document.getElementById(\"angulo2\").innerHTML = `El angulo 2 es de ${otrosDatos[1].toFixed(2)}`;\n document.getElementById(\"angulo3\").innerHTML = `El angulo 3 es de ${otrosDatos[2].toFixed(2)}`;\n document.getElementById(\"sumaAngulos\").innerHTML = `Confirmando la validez de los datos, la suma de los angulos es ${otrosDatos[4].toFixed(2)}`;\n document.getElementById(\"mensaje\").innerHTML = `Esto es con pixeles el triangulo que pusiste`;\n\n return otrosDatos\n}", "title": "" }, { "docid": "b2301cb13f7d9baa93e64514774aa26a", "score": "0.50802416", "text": "function calcular(pDato) {\n // si se inicializa una variable SIN DECLARAR\n // dentro de una función\n // se crea como variable global\n global = 12\n global = global + pDato\n // global += pDato\n return global;\n}", "title": "" }, { "docid": "875bbb2c0bde803f1d638feb9c6f13f5", "score": "0.5076943", "text": "dim() {\n let nrows = this.matrix.length;\n let ncols = this.matrix[0].length;\n return [nrows, ncols];\n }", "title": "" }, { "docid": "334db7c8d6842591d5de4ce5fd431fd5", "score": "0.5075785", "text": "unit() {\n\t\tvar l = this.len();\n\t\tvar p = new Vect3;\n\t\tif(l > 0) {\n\t\t\tp = Vect3.div(this, l);\n\t\t}\n\t\treturn p;\n\t}", "title": "" }, { "docid": "dac429ec0065295990a1217ca7c02e55", "score": "0.5070664", "text": "static get GRID() { return 10; }", "title": "" }, { "docid": "2028f7139abb50ab16f3d3f46009b065", "score": "0.5067876", "text": "getQtdeNotas (reais) {\n let qtdeNotas = {\n '100': 0,\n '50': 0,\n '20': 0,\n '10': 0,\n '5': 0,\n '2': 0,\n '1': 0,\n '0.5': 0,\n '0.25': 0,\n '0.1': 0,\n '0.01': 0,\n }\n\n let possuiNotas = {\n '100': 1,\n '50': 0,\n '20': 2,\n '10': 5,\n '5': 10,\n '2': 1,\n '1': 0,\n '0.5': 1,\n '0.25': 3,\n '0.1': 2,\n '0.01': 4,\n }\n\n var resto = 0;\n //Uso das váriaveis com o valor e a posição anterior para algumas tarefas\n var posiAnterior = 1;\n var valAnterior = 0;\n if (reais > 0) {\n while(reais != 0){\n for(var prop in qtdeNotas){\n if((reais/prop) >= 1){\n resto = (reais%prop).toFixed(1);\n qtdeNotas[prop] = ((reais - resto)/prop).toFixed();\n reais = (reais - (qtdeNotas[prop]*prop)).toFixed(2);\n //Uso de prop > 1 para não dividir pelos centavos\n }else if((posiAnterior*valAnterior)%prop == 0 && prop > 1){\n qtdeNotas[prop] = ((posiAnterior*valAnterior)/prop);\n qtdeNotas[posiAnterior] = 0;\n //Uso de prop > 1 para não dividir pelos centavos\n }else if((posiAnterior*valAnterior)%prop >= 1 && prop > 1){\n resto = ((posiAnterior*valAnterior)%prop);\n qtdeNotas[prop] = (((posiAnterior*valAnterior) - resto)/prop);\n qtdeNotas[posiAnterior] = (resto/posiAnterior);\n //IFs para arrumar o problema das moedas de 2 e 1.\n if(qtdeNotas[2] > 1 && qtdeNotas[2] < 2 && qtdeNotas[1] != 1){\n qtdeNotas[2] = 1;\n qtdeNotas[1] = 1;\n }else if(qtdeNotas[1] == 1 && qtdeNotas[2] < 1){\n qtdeNotas[2] = (qtdeNotas[2]).toFixed();\n qtdeNotas[1] = 0;\n }else if(qtdeNotas[2] < 1){\n qtdeNotas[2] = 0;\n qtdeNotas[1] = 1;\n }if(qtdeNotas[2] > 1 && qtdeNotas[2] < 2 && qtdeNotas[1] == 1){\n qtdeNotas[2] = 2;\n qtdeNotas[1] = 1;\n }\n }\n\n posiAnterior = prop;\n valAnterior = qtdeNotas[prop];\n }\n if(qtdeNotas[20]== 2 && qtdeNotas[10]==1){\n qtdeNotas[50] = 1;\n qtdeNotas[20] = 0;\n qtdeNotas[10] = 0;\n }\n }\n\n for(var prop in qtdeNotas){\n try{\n if(qtdeNotas[prop] > possuiNotas[prop]){\n throw new Error(prop);\n }\n }catch (ex) {\n console.error('Falta notas de ', ex.message);\n }\n }\n \n /*\n var resto = 0;\n if((reais/100) >= 1){\n resto = (reais%100).toFixed(1);\n qtdeNotas[100] = ((reais - resto)/100).toFixed();\n reais = (reais - (qtdeNotas[100]*100)).toFixed(2);\n }\n if((reais/50) >= 1){\n resto = (reais%50).toFixed(1);\n qtdeNotas[50] = ((reais - resto)/50).toFixed();\n reais = (reais - (qtdeNotas[50]*50)).toFixed(2);\n }\n if((reais/20) >= 1){\n resto = (reais%20).toFixed(1);\n qtdeNotas[20] = ((reais - resto)/20).toFixed();\n reais = (reais - (qtdeNotas[20]*20)).toFixed(2);\n }\n if((reais/10) >= 1){\n resto = (reais%10).toFixed(1);\n qtdeNotas[10] = ((reais - resto)/10).toFixed();\n reais = (reais - (qtdeNotas[10]*10)).toFixed(2);\n }\n if((reais/5) >= 1){\n resto = (reais%5).toFixed(1);\n qtdeNotas[5] = ((reais - resto)/5).toFixed();\n reais = (reais - (qtdeNotas[5]*5)).toFixed(2);\n }\n if((reais/1) >= 1){\n resto = (reais%1).toFixed(1);\n qtdeNotas[1] = ((reais - resto)/1).toFixed();\n reais = (reais - (qtdeNotas[1]*1)).toFixed(2);\n }\n if((reais/0.5) >= 1){\n resto = (reais%0.5).toFixed(0.5);\n qtdeNotas[0.5] = ((reais - resto)/0.5).toFixed();\n reais = (reais - (qtdeNotas[0.5]*0.5)).toFixed(2);\n }\n if((reais/0.25) >= 1){\n resto = (reais%0.25).toFixed(1);\n qtdeNotas[0.25] = ((reais - resto)/0.25).toFixed();\n reais = (reais - (qtdeNotas[0.25]*0.25)).toFixed(2);\n }\n if((reais/0.1) >= 1){\n resto = (reais%0.1).toFixed(1);\n qtdeNotas[0.1] = ((reais - resto)/0.1).toFixed();\n reais = (reais - (qtdeNotas[0.1]*0.1)).toFixed(2);\n }\n if((reais/0.01) >= 1){\n resto = (reais%0.01).toFixed(1);\n qtdeNotas[0.01] = ((reais - resto)/0.01).toFixed();\n reais = (reais - (qtdeNotas[0.01]*0.01)).toFixed(2);\n }\n\n\n */\n return qtdeNotas\n }\n }", "title": "" }, { "docid": "f6234cfc0320d4283a5fb85a8246d8cb", "score": "0.50660497", "text": "function dizaines(ns){// ns est une chaine de deux chiffres\n if(trace)console.log(\"dizaines:\",ns);\n var d=ns[0]; // dizaines\n var u=ns[1]; // unités\n switch (d){\n case \"0\": return unites(u);\n case \"1\":\n return (en?[\"ten\",\"eleven\",\"twelve\",\"thirteen\",\"fourteen\",\"fifteen\",\"sixteen\",\"seventeen\",\"eighteen\",\"nineteen\"]\n :[\"dix\",\"onze\",\"douze\",\"treize\",\"quatorze\",\"quinze\",\"seize\",\"dix-sept\",\"dix-huit\",\"dix-neuf\"])[+u];\n case \"2\": case \"3\": case \"4\": case \"5\": case \"6\":\n var tens = (en?[\"twenty\",\"thirty\",\"forty\",\"fifty\",\"sixty\"]\n :[\"vingt\",\"trente\",\"quarante\",\"cinquante\",\"soixante\"])[d-2];\n if (u==0) return tens;\n return tens + (u==\"1\" ? (en?\"-one\":\" et un\"): (\"-\"+unites(u)));\n case \"7\":\n if(u==0) return en?\"seventy\":\"soixante-dix\"\n return en?(\"seventy-\"+unites(u)):(\"soixante-\"+dizaines(\"1\"+u));\n case \"8\":\n if(u==0) return en?\"eighty\":\"quatre-vingts\";\n return (en?\"eighty-\":\"quatre-vingt-\")+unites(u);\n case \"9\":\n if(u==0) return en?\"ninety\":\"quatre-vingt-dix\";\n return en?(\"ninety-\"+unites(u)):(\"quatre-vingt-\"+dizaines(\"1\"+u));\n }\n }", "title": "" }, { "docid": "f6234cfc0320d4283a5fb85a8246d8cb", "score": "0.50660497", "text": "function dizaines(ns){// ns est une chaine de deux chiffres\n if(trace)console.log(\"dizaines:\",ns);\n var d=ns[0]; // dizaines\n var u=ns[1]; // unités\n switch (d){\n case \"0\": return unites(u);\n case \"1\":\n return (en?[\"ten\",\"eleven\",\"twelve\",\"thirteen\",\"fourteen\",\"fifteen\",\"sixteen\",\"seventeen\",\"eighteen\",\"nineteen\"]\n :[\"dix\",\"onze\",\"douze\",\"treize\",\"quatorze\",\"quinze\",\"seize\",\"dix-sept\",\"dix-huit\",\"dix-neuf\"])[+u];\n case \"2\": case \"3\": case \"4\": case \"5\": case \"6\":\n var tens = (en?[\"twenty\",\"thirty\",\"forty\",\"fifty\",\"sixty\"]\n :[\"vingt\",\"trente\",\"quarante\",\"cinquante\",\"soixante\"])[d-2];\n if (u==0) return tens;\n return tens + (u==\"1\" ? (en?\"-one\":\" et un\"): (\"-\"+unites(u)));\n case \"7\":\n if(u==0) return en?\"seventy\":\"soixante-dix\"\n return en?(\"seventy-\"+unites(u)):(\"soixante-\"+dizaines(\"1\"+u));\n case \"8\":\n if(u==0) return en?\"eighty\":\"quatre-vingts\";\n return (en?\"eighty-\":\"quatre-vingt-\")+unites(u);\n case \"9\":\n if(u==0) return en?\"ninety\":\"quatre-vingt-dix\";\n return en?(\"ninety-\"+unites(u)):(\"quatre-vingt-\"+dizaines(\"1\"+u));\n }\n }", "title": "" }, { "docid": "ae09ab5e6be0488f38660f3b1f0b0c30", "score": "0.5049448", "text": "computarCosto() {\n let distanciaTotal = 0;\n // Recorrae la ruta desede el indice 1 para comparar con el anterior\n for (let i = 1; i < this.ruta.length; i++) {\n const ciudad = this.ruta[i]; // Ciudad actual\n const ciudadAnterior = this.ruta[i - 1]; // Ciudad anterior\n const indiceC = entrada_1.ciudades.indexOf(ciudad); // inidice Ciudad actual\n const indiceCAnterior = entrada_1.ciudades.indexOf(ciudadAnterior); // indice Ciudad anterior\n // Obtener la distancia entre ciudades (con los indices de las cidades)\n let dis = entrada_1.matrizDistanias[indiceC][indiceCAnterior];\n distanciaTotal += dis;\n }\n return distanciaTotal;\n }", "title": "" }, { "docid": "631c550921900975eaeeecc351a7e33c", "score": "0.5047431", "text": "function getdimensions(){\n\tvar dimensions = {\n\t\theight : \t\t\t$('#framemaker').find('input[name=height]').val(),\n\t\twidth : \t\t\t$('#framemaker').find('input[name=width]').val(),\n\t\tthickness : \t\t$('#framemaker').find('input[name=thickness]').val(),\n\t\tpassepartout : \t\t$('#framemaker').find('input[name=passepartout]').val(),\n\t\tscndpassepartout : \t$('#framemaker').find('input[name=2ndpassepartout]').val(),\n\t\tshadow : \t\t\t$('#framemaker').find('input[name=shadow]').val(),\n\t\tred : \t\t\t\t$('#framemaker').find('input[name=red]').val(),\n\t\tgreen : \t\t\t$('#framemaker').find('input[name=green]').val(),\n\t\tblue : \t\t\t\t$('#framemaker').find('input[name=blue]').val(),\n\t\tframepath :\t\t\t$('#framemaker').find('select[name=framechoiche]').val(),\n\t\tpassepartoutpath :\t$('#framemaker').find('select[name=passepartoutchoiche]').val(),\n\t\tsavetag :\t\t\t$('#framemaker').find('input[name=savetag]').val(),\n\t\tshadowpath :\t\t'frameshadow.png',\n\t\tglobalshadowpath :\t'globalshadow.png',\n\t};\n\n\treturn dimensions;\t\n}", "title": "" }, { "docid": "ecdeb129c545063e543d9a37e992c191", "score": "0.5045251", "text": "function calculateDims(canvas, options){\n\n var scale = {\n width: canvas.width / 196,\n height: canvas.height / 162\n }\n // console.log(scale.width, scale.height)\n\n var dims = {\n canvas: {\n width: canvas.width,\n height: canvas.height\n },\n indicator: {\n width: 154,\n height: 154,\n border: 3,\n x: 15\n },\n meter: {\n style: 'rg_meter',\n width: 124,\n height: 22,\n adjSeparation: 10,\n addHeight: -12,\n padding: {\n left: 15 * scale.width,\n //bottom: 46 * scale.height = Value * scale.height determines meter placement on the indicator\n bottom: 62 * scale.height\n }\n },\n shuttle: {\n image: false,\n width: 10,\n lineWidth: 4,\n addHeight: 3,\n padding: {\n left: 15 * scale.width,\n bottom: 62 * scale.height\n },\n // color: '#377eb8'\n\n // STEPTOE EDIT 05_12_16 BEGIN\n // color: '#33ccff'\n color: '#03fc41'\n // STEPTOE EDIT 05_12_16 END\n },\n textCanvas: {\n width: 90,\n height: canvas.height\n }\n }\n\n for(var option in options){\n if(typeof(options[option]) != 'object')\n dims[option] = options[option];\n else{\n var object = options[option];\n for(var subOption in object){\n dims[option][subOption] = object[subOption];\n }\n }\n }\n\n for(var element in dims){\n if(element != 'canvas'){\n for(var dim in dims[element]){\n if(dim == 'width' || dim == 'height')\n dims[element][dim] = dims[element][dim] * scale[dim];\n else if(typeof(dims[element][dim]) == 'number'){\n dims[element][dim] = dims[element][dim] * scale.width;\n }\n // console.log(element, dim)\n }\n }\n }\n return dims;\n}", "title": "" }, { "docid": "ece8cf942df57bd17fd016b03fefc5fc", "score": "0.5044667", "text": "getDims() {\n\t\treturn [this.x, this.y, this.w, this.h];\n\t}", "title": "" }, { "docid": "e51b3a90e2f355193066bfddb61152a7", "score": "0.5041389", "text": "function calcule_feuilles_noeud(noeuds){\r\n\tnoeuds.forEach(function(e){\r\n\t\t\r\n\t\tlet arr = Object.values(e).filter(lst => lst.constructor.name == \"Array\");\r\n\t\tif (arr.length > 0){\r\n\t\t\tlet essai = 0;\r\n\t\t\t\r\n\t\t\tarr[0].forEach(function(e){\r\n\t\t\t\tessai += e.feuilles_noeud;\r\n\t\t\t});\r\n\t\t\te.feuilles_noeud = essai;\r\n\t\t\t\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "42a843d5abd1f14a42b001bccc505a70", "score": "0.50391436", "text": "function dimensions(x)//x can either be \"max_column\" or \"rows\" or \"rows_filled\"\r\n{\r\n\tvar max_column = 0;\r\n\tvar rows = 0;\r\n\tvar rows_filled = new Array();\r\n\tfor(var i=0;i<10;i++)\r\n\t{\r\n\t\tvar flag = false;\r\n\t\tvar envelope_row = -1;//initialized with negative so as to not overlap with zero\r\n\t\tfor(var j=0;j<10;j++)\r\n\t\t{\r\n\t\t\tif(table[i][j] == true)\r\n\t\t\t{\r\n\t\t\t\tif(j>max_column)\r\n\t\t\t\t{\r\n\t\t\t\t\tmax_column = j;\r\n\t\t\t\t}\r\n\t\t\t\tflag = true;\r\n\t\t\t\tif(j>envelope_row)\r\n\t\t\t\t{\r\n\t\t\t\t\tenvelope_row = j;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(flag == true)\r\n\t\t{\r\n\t\t\trows = i;\r\n\t\t}\r\n\t\trows_filled[i] = envelope_row+1;\r\n\t}\r\n\tif(x == \"max_column\")\r\n\t\treturn max_column+1;\r\n\tif(x == \"rows\")\r\n\t\treturn rows+1;\r\n\tif(x == \"rows_filled\")\r\n\t\treturn rows_filled;\r\n}", "title": "" }, { "docid": "5d2aba1d2ecbcd85da40e7880653e00c", "score": "0.5031978", "text": "function getGridDim() {\n let y = GRID.length;\n let x;\n \n x = (y === 0 ? 0 : GRID[0].length);\n \n return [x, y];\n}", "title": "" }, { "docid": "7f33cb15b0b4d2075fd03621b75a9044", "score": "0.5030745", "text": "getPainelVazio() {\n return Array.from(\n {length: LINHA}, () => Array(COLUNA).fill(0)\n );\n }", "title": "" }, { "docid": "aa78cb44a0d749ce9e8b357e4e684098", "score": "0.50288475", "text": "get totalDimensionsAndGoals () {\n let total = store.dimensionsList.selection.length + store.dimensionsGoalsList.selection.length\n return total\n }", "title": "" }, { "docid": "d3bd34c1b42d19d78a24cfe3f94086d5", "score": "0.5027111", "text": "rtnSize() {\n // local variables \n return [this.width, this.height];\n }", "title": "" }, { "docid": "bfee8591950c7045591856b81cee3d66", "score": "0.502266", "text": "function get_max_grid_dimensions() {\n // height is page height minus navbar\n var height = document.documentElement.clientHeight - navbar.scrollHeight;\n\n // width is full page width\n var width = document.documentElement.clientWidth;\n return [height, width];\n}", "title": "" }, { "docid": "d2fbf42ebae9ee453a013a536f37d3e7", "score": "0.50186265", "text": "calcMetLength() {\n const [tempMultiplier, tempDivisor] = this.state.timeSig;\n switch (tempDivisor) {\n case 2:\n return 16 * tempMultiplier;\n case 4:\n return 8 * tempMultiplier;\n case 8:\n return 4 * tempMultiplier;\n case 16:\n return 2 * tempMultiplier;\n case 32:\n return tempMultiplier;\n default:\n return 8 * tempMultiplier;\n }\n }", "title": "" }, { "docid": "8e0e8b8efdf692cc6410b15a95400bfa", "score": "0.50121236", "text": "function SumaArray3(numeros){\n let suma=0\n for (let i=0;i<numeros.length;i++){\n suma=suma+numeros[i]\n \n }\n return suma\n}", "title": "" }, { "docid": "fef13827ad4f7485c38748fba10205d8", "score": "0.50072956", "text": "getFuncionamento() {\n this.diasSemana = this.target.dataset.semana.split(\",\").map(Number);\n this.horarioSemana = this.target.dataset.horario.split(\",\").map(Number);\n }", "title": "" }, { "docid": "93a99435ec503c882dc5896987b65a13", "score": "0.50058013", "text": "function initialisationOfVariables() {\n\teg_Joules=[1.072E-19,1.936E-19]; /** Band gap of germanium and silicon respectively. */\n\tjoule_Kelvin=1.38E-23;\n\ttemperature_K=298;\n\tconstant_c=0.14;\n\tdistance_between_probes=0.2\n\ttwoPi_s=1.256;\n\tthickness_of_the_sample=0.05;\n\tw_by_s=thickness_of_the_sample/distance_between_probes;\n\tG7=5.89;\n\tcurrent=1;\n\tjoules_item=eg_Joules[0];\n\trangeof_voltmeterFlag=0;\n\ttemperature_K_incrmnt=298;\n curren_Initial_temperature=298;\n}", "title": "" }, { "docid": "11fa821923122649c940941fffc912c2", "score": "0.50021577", "text": "function calculateStopsByGrid(data)\n{\n for (i=0; i<data.length; i++)\n {\n // Convert to Int to remove .0 then back to string\n var currentGrid = parseInt(data[i].Grid).toString();\n if (currentGrid in stopCountByGrid)\n stopCountByGrid[currentGrid] += 1;\n else\n stopCountByGrid[currentGrid] = 1;\n }\n console.log(stopCountByGrid);\n // return stopCountByGrid;\n}", "title": "" }, { "docid": "ac20ba5b9db6f5ef36a32e172fe75050", "score": "0.50000864", "text": "function InitStatics( x,y,z)\r\n\t\t{\r\n\t\t\tvar tables = SectorTables.find( (tab)=>{ return( tab.x==x && tab.y==y && tab.z == z ) });\r\n\t\t\tif( !tables )\r\n\t\t\t{\r\n\t\t\t\ttables = {\r\n\t\t\t\t\tx: x,\r\n\t\t\t\t\ty: y,\r\n\t\t\t\t\tz: z,\r\n\t\t\t\t\ttableX : new Array( x+2 ),\r\n\t\t\t\t\ttableY : new Array( y+2 ),\r\n\t\t\t\t\ttableZ : new Array( z+2 ),\r\n\t\t\t\t\tofTableX : new Array( x+2 ),\r\n\t\t\t\t\tofTableY : new Array( y+2 ),\r\n\t\t\t\t\tofTableZ : new Array( z+2 )\r\n\t\t\t\t}\r\n\t\t\t\t//tables.tableX.forEach( (elem)=>{elem=0})\r\n\t\t\t\t//console.log( \"tableX init is \", tables.tableX)\r\n\t\t\t\ttables.tableX[0] = 1;\r\n\t\t\t\ttables.tableX[x + 1] = 2;\r\n\t\t\t\ttables.tableZ[0] = 3;\r\n\t\t\t\ttables.tableZ[y + 1] = 6;\r\n\t\t\t\ttables.tableY[0] = 9;\r\n\t\t\t\ttables.tableY[z + 1] = 18;\r\n n = 0;\r\n tables.ofTableX[n] = ( ( ( n == 0 ) ? ( x - 1 ) : ( n == ( x + 1 ) ) ? 0 : ( n - 1 ) ) * y );\r\n tables.ofTableY[n] = ( ( ( n == 0 ) ? ( y - 1 ) : ( n == ( y + 1 ) ) ? 0 : ( n - 1 ) ) );\r\n tables.ofTableZ[n] = ( ( ( n == 0 ) ? ( z - 1 ) : ( n == ( z + 1 ) ) ? 0 : ( n - 1 ) ) * y * z );\r\n n = x+1;\r\n tables.ofTableX[n] = ( ( ( n == 0 ) ? ( x - 1 ) : ( n == ( x + 1 ) ) ? 0 : ( n - 1 ) ) * y );\r\n tables.ofTableY[n] = ( ( ( n == 0 ) ? ( y - 1 ) : ( n == ( y + 1 ) ) ? 0 : ( n - 1 ) ) );\r\n tables.ofTableZ[n] = ( ( ( n == 0 ) ? ( z - 1 ) : ( n == ( z + 1 ) ) ? 0 : ( n - 1 ) ) * y * z );\r\n for( n = 1; n < x + 1; n++ ) {\r\n\t\t\t\t\ttables.ofTableX[n] = ( ( ( n == 0 ) ? ( x - 1 ) : ( n == ( x + 1 ) ) ? 0 : ( n - 1 ) ) * y );\r\n tables.tableX[n] = 0;\r\n }\r\n\t\t\t\tfor( var n = 1; n < y + 1; n++ ){\r\n\t\t\t\t\ttables.ofTableY[n] = ( ( ( n == 0 ) ? ( y - 1 ) : ( n == ( y + 1 ) ) ? 0 : ( n - 1 ) ) );\r\n tables.tableY[n] = 0;\r\n }\r\n\t\t\t\tfor( n = 1; n < z + 1; n++ ) {\r\n\t\t\t\t\ttables.ofTableZ[n] = ( ( ( n == 0 ) ? ( z - 1 ) : ( n == ( z + 1 ) ) ? 0 : ( n - 1 ) ) * y * z );\r\n tables.tableZ[n] = 0;\r\n }\r\n\t\t\t\tSectorTables.push( tables );\r\n\t\t\t}\r\n Object.defineProperties( tables\r\n , { \"x\" : { writable:false}\r\n , \"y\" : { writable:false}\r\n , \"z\" : { writable:false}\r\n , \"tableX\" : { writable:false}\r\n , \"tableY\" : { writable:false}\r\n , \"tableZ\" : { writable:false}\r\n , \"ofTableX\" : { writable:false}\r\n , \"ofTableY\" : { writable:false}\r\n , \"ofTableZ\" : { writable:false}\r\n });\r\n Object.freeze( tables.tableX );\r\n Object.freeze( tables.tableY );\r\n Object.freeze( tables.tableZ );\r\n Object.freeze( tables.ofTableX );\r\n Object.freeze( tables.ofTableY );\r\n Object.freeze( tables.ofTableZ );\r\n\t\t\treturn tables;\r\n\t\t}", "title": "" }, { "docid": "fde5a6d4134d451c0f168b0c7c44801f", "score": "0.4998127", "text": "function cargaPrecioUnitYUM(accion){\n var tipoModal = determinarTipoDeModal(accion);\n var precioUn = $(tipoModal + ' #cbxProducto :selected').data(\"prod-precio\");\n $(tipoModal + ' #txtPrecioUnitario').val(precioUn.toLocaleString(\"es-CL\"));\n\n var um = $(tipoModal + ' #cbxProducto :selected').data(\"prod-um\");\n $(tipoModal + ' #txtUnidadMedida').val(um);\n\n }", "title": "" }, { "docid": "c5b6e4e6e359dfc2298b3e37d0b064fc", "score": "0.4993819", "text": "function descQtde_getQuantidade(nomeControle)\n{\n try\n {\n var campo = document.getElementById(getVar(nomeControle).Quantidade);\n return descQtde_getValorCampo(campo, \"float\");\n }\n catch (err)\n {\n return 0;\n }\n}", "title": "" }, { "docid": "f6a613baa6afd872143f091098f069f5", "score": "0.49899852", "text": "static get VALUES()\n\t{\n\t\treturn {\n\t\t\t'p': 1,\n\t\t\t'r': 5,\n\t\t\t'n': 3,\n\t\t\t'b': 3,\n\t\t\t'q': 7, //slightly less than in orthodox game\n\t\t\t'k': 1000\n\t\t};\n\t}", "title": "" }, { "docid": "941889901d49f411e0381b78fc19e893", "score": "0.4985128", "text": "getDimensions () {\n // small devices\n if (window.matchMedia('(max-width: 319px)').matches) {\n store.state.zircleWidth.xl = 200\n store.state.zircleWidth.l = 70\n store.state.zircleWidth.m = 50\n store.state.zircleWidth.s = 30\n store.state.zircleWidth.xs = 20\n store.state.zircleWidth.xxs = 20\n }\n // medium\n if (window.matchMedia('(min-width: 320px)').matches) {\n store.state.zircleWidth.xl = 230\n store.state.zircleWidth.l = 85\n store.state.zircleWidth.m = 65\n store.state.zircleWidth.s = 45\n store.state.zircleWidth.xs = 30\n store.state.zircleWidth.xxs = 20\n }\n // medium - large devices\n if (window.matchMedia('(min-width: 375px) and (orientation: portrait)').matches) {\n store.state.zircleWidth.xl = 260\n store.state.zircleWidth.l = 90\n store.state.zircleWidth.m = 70\n store.state.zircleWidth.s = 50\n store.state.zircleWidth.xs = 40\n store.state.zircleWidth.xxs = 30\n }\n if (window.matchMedia('(min-width: 375px) and (orientation: landscape)').matches) {\n store.state.zircleWidth.xl = 270\n store.state.zircleWidth.l = 90\n store.state.zircleWidth.m = 70\n store.state.zircleWidth.s = 50\n store.state.zircleWidth.xs = 40\n store.state.zircleWidth.xxs = 30\n }\n // tablets\n if (window.matchMedia('(min-width: 768px) and (orientation: portrait) and (min-pixel-ratio: 2)').matches) {\n store.state.zircleWidth.xl = 340\n store.state.zircleWidth.l = 120\n store.state.zircleWidth.m = 100\n store.state.zircleWidth.s = 80\n store.state.zircleWidth.xs = 60\n store.state.zircleWidth.xxs = 40\n }\n if (window.matchMedia('(min-width: 768px) and (orientation: landscape)').matches) {\n store.state.zircleWidth.xl = 360\n store.state.zircleWidth.l = 120\n store.state.zircleWidth.m = 100\n store.state.zircleWidth.s = 80\n store.state.zircleWidth.xs = 60\n store.state.zircleWidth.xxs = 40\n }\n // desktop or large tablets\n if (window.matchMedia('(min-width: 992px) and (orientation: portrait)').matches) {\n store.state.zircleWidth.xl = 420\n store.state.zircleWidth.l = 120\n store.state.zircleWidth.m = 100\n store.state.zircleWidth.s = 80\n store.state.zircleWidth.xs = 60\n store.state.zircleWidth.xxs = 40\n }\n if (window.matchMedia('(min-width: 992px) and (orientation: landscape)').matches) {\n store.state.zircleWidth.xl = 420\n store.state.zircleWidth.l = 120\n store.state.zircleWidth.m = 100\n store.state.zircleWidth.s = 80\n store.state.zircleWidth.xs = 60\n store.state.zircleWidth.xxs = 40\n }\n // large desktop\n if (window.matchMedia('(min-width: 1200px) and (orientation: portrait)').matches) {\n store.state.zircleWidth.xl = 430\n store.state.zircleWidth.l = 130\n store.state.zircleWidth.m = 110\n store.state.zircleWidth.s = 90\n store.state.zircleWidth.xs = 70\n store.state.zircleWidth.xxs = 50\n }\n // xl desktop\n if (window.matchMedia('(min-width: 1800px)').matches) {\n store.state.zircleWidth.xl = 650\n store.state.zircleWidth.l = 130\n store.state.zircleWidth.m = 110\n store.state.zircleWidth.s = 90\n store.state.zircleWidth.xs = 70\n store.state.zircleWidth.xxs = 50\n }\n }", "title": "" }, { "docid": "d9a870f6c08167f60f9ad9de774c065c", "score": "0.49840966", "text": "function wUnit(x) {\n\treturn [x, []];\n}", "title": "" }, { "docid": "fb28a43cb197686a7ed1fac224ecada3", "score": "0.49832267", "text": "function InitStatics(x,y,z){var tables=SectorTables.find(function(tab){return tab.x==x&&tab.y==y&&tab.z==z;});if(!tables){tables={x:x,y:y,z:z,tableX:new Array(x+2),tableY:new Array(y+2),tableZ:new Array(z+2),ofTableX:new Array(x+2),ofTableY:new Array(y+2),ofTableZ:new Array(z+2)};//tables.tableX.forEach( (elem)=>{elem=0})\n//console.log( \"tableX init is \", tables.tableX)\ntables.tableX[0]=1;tables.tableX[x+1]=2;tables.tableZ[0]=3;tables.tableZ[y+1]=6;tables.tableY[0]=9;tables.tableY[z+1]=18;n=0;tables.ofTableX[n]=(n==0?x-1:n==x+1?0:n-1)*y;tables.ofTableY[n]=n==0?y-1:n==y+1?0:n-1;tables.ofTableZ[n]=(n==0?z-1:n==z+1?0:n-1)*y*z;n=x+1;tables.ofTableX[n]=(n==0?x-1:n==x+1?0:n-1)*y;tables.ofTableY[n]=n==0?y-1:n==y+1?0:n-1;tables.ofTableZ[n]=(n==0?z-1:n==z+1?0:n-1)*y*z;for(n=1;n<x+1;n++){tables.ofTableX[n]=(n==0?x-1:n==x+1?0:n-1)*y;tables.tableX[n]=0;}for(var n=1;n<y+1;n++){tables.ofTableY[n]=n==0?y-1:n==y+1?0:n-1;tables.tableY[n]=0;}for(n=1;n<z+1;n++){tables.ofTableZ[n]=(n==0?z-1:n==z+1?0:n-1)*y*z;tables.tableZ[n]=0;}SectorTables.push(tables);}Object.defineProperties(tables,{\"x\":{writable:false},\"y\":{writable:false},\"z\":{writable:false},\"tableX\":{writable:false},\"tableY\":{writable:false},\"tableZ\":{writable:false},\"ofTableX\":{writable:false},\"ofTableY\":{writable:false},\"ofTableZ\":{writable:false}});Object.freeze(tables.tableX);Object.freeze(tables.tableY);Object.freeze(tables.tableZ);Object.freeze(tables.ofTableX);Object.freeze(tables.ofTableY);Object.freeze(tables.ofTableZ);return tables;}", "title": "" }, { "docid": "3449b3c0ebe333d6b5bcf453f37f1a31", "score": "0.4975148", "text": "aleatorio() {\n for (let i = 0; i < this.linhas; i++) {\n for (let j = 0; j < this.colunas; j++) {\n this.dados[i][j] = parseFloat((Math.random() * (8 + 8) - 8).toFixed(2)); //gerar numeros de 2 a +2\n }\n }\n }", "title": "" }, { "docid": "9c1a1b869d9e2c5d02feed0c68cb36fd", "score": "0.49741137", "text": "function functionToMeasure(){\n var n = parseInt(document.getElementById('a').value) // Here I get the value from the html Input\n for (let x of Array(n).keys() ) {\n for (let y of Array(n).keys()) {\n let a = Math.sqrt(x*y) - 2\n }\n }\n}", "title": "" }, { "docid": "5a0d4553979bbc82117fc9298a8bb312", "score": "0.49676558", "text": "function distribuer(jj){\n jj.couperJeu;\n var j=jj.liste;\n for (let i=0;i<4;i++){\n this[\"joueur\"+(this.donneur+i+1)%4].main.push(j[3*i],j[3*i+1],j[3*i+2]);\n this[\"joueur\"+(this.donneur+i+1)%4].main.push(j[3*i+12],j[3*i+13],j[3*i+14]);\n this[\"joueur\"+(this.donneur+i+1)%4].main.push(j[2*i+24],j[2*i+25]);\n }\n\n }", "title": "" }, { "docid": "b923d8c76e5bb814e8a36dbcc2592e08", "score": "0.49653852", "text": "allocaMemoriaPerMatriciDiGioco() {\n for (var row = 0; row < this.numeroRighe; row++)\n {\n this.lifeA[row] = new Array(this.numeroColonne);\n this.lifeB[row] = new Array(this.numeroColonne);\n }\n this.pulisciMatrici();\n }", "title": "" }, { "docid": "b923d8c76e5bb814e8a36dbcc2592e08", "score": "0.49653852", "text": "allocaMemoriaPerMatriciDiGioco() {\n for (var row = 0; row < this.numeroRighe; row++)\n {\n this.lifeA[row] = new Array(this.numeroColonne);\n this.lifeB[row] = new Array(this.numeroColonne);\n }\n this.pulisciMatrici();\n }", "title": "" }, { "docid": "e6a26a7e10bd210a056ce4e02165267d", "score": "0.49653172", "text": "function calcularExtraEjercicio(){\r\n componerArrayExtra()\r\n extraCalcular()\r\n reiniciarExtra()\r\n}", "title": "" }, { "docid": "812973c50f0ac60639f1b7f245fdc04c", "score": "0.49604696", "text": "function getKlasesPazymiuVidurkis( ){\n let mokinys1 = getPazymiuVidurkis(6, 6, 7, 7, 5);\n let mokinys2 = getPazymiuVidurkis(3, 9, 9, 8, 9);\n let mokinys3 = getPazymiuVidurkis(9, 9, 9, 7, 5);\n let mokinys4 = getPazymiuVidurkis(2, 9, 9, 8, 9);\n let mokinys5 = getPazymiuVidurkis(2, 2, 2, 2, 2);\n let mokinys6 = getPazymiuVidurkis(3, 9, 9, 8, 9);\n // pasitikriname\n console.log( mokinys1, mokinys2, mokinys3, mokinys4, mokinys5, mokinys6 );\n\n let klasesVidurkis = (mokinys1 + mokinys2 + mokinys3 + mokinys4 + mokinys5 + mokinys6) / 6;\n console.log( \"klases vidurkis yra:\" + klasesVidurkis);\n }", "title": "" }, { "docid": "bcbe509cc8182bc866f9a341be56fe65", "score": "0.49512535", "text": "static decodeSetComputeUnitLimit(instruction) {\n\t this.checkProgramId(instruction.programId);\n\t const {\n\t units\n\t } = decodeData(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit, instruction.data);\n\t return {\n\t units\n\t };\n\t }", "title": "" }, { "docid": "70e2b682a0adcf82fd26efab42343b16", "score": "0.4950726", "text": "function Calcul_variations_TDC_externes(debut, fin, joueur, valeurs) {\n\t\tdonnees.coordonnees[0][donnees.pseudo].TDC_actuel = valeurs.TDC_attaquant;\n\t\tif(donnees.variations) {\n\t\t\tfor(i=0; i<donnees.variations.length; i++) {\n\t\t\t\tif(donnees.variations[i][0].date >= debut && donnees.variations[i][0].date <= fin) {\n\t\t\t\t\tdonnees.variations[i].valeur = parseInt(donnees.variations[i].valeur); \n\t\t\t\t\tvar\tvaleur = Flood_externe_possible(donnees.variations[i][0]);\n\t\t\t\t\tif(donnees.coordonnees[0][donnees.variations[i][0].attaquant]) {\n\t\t\t\t\t\tdonnees.coordonnees[0][donnees.variations[i][0].attaquant].TDC_actuel += valeur;\n\t\t\t\t\t}\n\t\t\t\t\tif(donnees.coordonnees[0][donnees.variations[i][0].cible]) {\n\t\t\t\t\t\tdonnees.coordonnees[0][donnees.variations[i][0].cible].TDC_actuel -= valeur;\n\t\t\t\t\t}\n\t\t\t\t\tif(valeur == -1 && valeurs.floods_annules.indexOf(i) == -1) {\n\t\t\t\t\t\tvaleurs.floods_annules.push(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvaleurs.TDC_cible = donnees.coordonnees[0][joueur].TDC_actuel;\n\t\tvaleurs.TDC_attaquant = donnees.coordonnees[0][donnees.pseudo].TDC_actuel;\n\t\treturn valeurs;\n\t}", "title": "" }, { "docid": "10e93bae3870e2e69ec612305cf6cd45", "score": "0.4948259", "text": "function printMetinisPajamuDydis() {\n var metinesPajamos = atlyginimas * 12;\n console.log(\"Metinis atlyginimas:\", metinesPajamos);\n \n}", "title": "" }, { "docid": "eeb74c0632848f92ff772ef9d2ea022f", "score": "0.49362853", "text": "function calcularDiferencia() {\n var diferenciaTotal = diferenciaMusica + diferenciaFoto + diferenciaTrama + diferenciaFx\n return diferenciaTotal;\n }", "title": "" }, { "docid": "4988cec17521a8e4baeb11a708c1d0ac", "score": "0.49346507", "text": "scanDimen() {\n const value = this.scanNumber(false);\n this.matchWhitespace();\n let result;\n if (this.matchKeyword('pt')) {\n result = convertDimenToEm(value, 'pt');\n }\n else if (this.matchKeyword('mm')) {\n result = convertDimenToEm(value, 'mm');\n }\n else if (this.matchKeyword('cm')) {\n result = convertDimenToEm(value, 'cm');\n }\n else if (this.matchKeyword('ex')) {\n result = convertDimenToEm(value, 'ex');\n }\n else if (this.matchKeyword('px')) {\n result = convertDimenToEm(value, 'px');\n }\n else if (this.matchKeyword('em')) {\n result = convertDimenToEm(value, 'em');\n }\n else if (this.matchKeyword('bp')) {\n result = convertDimenToEm(value, 'bp');\n }\n else if (this.matchKeyword('dd')) {\n result = convertDimenToEm(value, 'dd');\n }\n else if (this.matchKeyword('pc')) {\n result = convertDimenToEm(value, 'pc');\n }\n else if (this.matchKeyword('in')) {\n result = convertDimenToEm(value, 'in');\n }\n else if (this.matchKeyword('mu')) {\n result = convertDimenToEm(value, 'mu');\n }\n else {\n // If the units are missing, TeX assumes 'pt'\n this.onError({ code: 'missing-unit' });\n result = convertDimenToEm(value, 'pt');\n }\n return result;\n }", "title": "" }, { "docid": "37c3dfe396b08036eadedfc451bef9eb", "score": "0.4930057", "text": "function calcularPerimetroTriangulo() {\n const inputLado1 = parseInt(\n document.getElementById(\"inputTrianguloLado1\").value\n );\n const inputLado2 = parseInt(\n document.getElementById(\"inputTrianguloLado2\").value\n );\n const inputBase = parseInt(\n document.getElementById(\"inputTrianguloBase\").value\n );\n const perimetro = perimetroTriangulo(inputLado1, inputLado2, inputBase);\n alert(perimetro);\n }", "title": "" }, { "docid": "10d360a602ed5431a73444c561055f0c", "score": "0.49290043", "text": "function calcularAltura() {\n const inputLado1 = document.getElementById(\"InputLado1\");\n const inputLado2 = document.getElementById(\"InputLado2\");\n const inputBase = document.getElementById(\"InputBase\");\n\n const trianguloGrandeLadoA = Number(inputLado1.value);\n const trianguloGrandeLadoB = Number(inputLado2.value);\n const trianguloGrandeLadoBase = Number(inputBase.value);\n\n const altura = alturaTrianguloIsosceles(\n trianguloGrandeLadoA,\n trianguloGrandeLadoB,\n trianguloGrandeLadoBase\n );\n\n alert(altura);\n}", "title": "" }, { "docid": "358117b2609ec87ee8de20e71bf592aa", "score": "0.49263436", "text": "getDim() {\n return {\n width: this.width,\n height: this.height\n };\n }", "title": "" }, { "docid": "0b0cd98b8e9f3ee8d762b1ea68a1c80f", "score": "0.49263218", "text": "function n(x) {\n return x*DIM/1000\n}", "title": "" }, { "docid": "635936d9d7772f1bd42ddcad78a7d37b", "score": "0.492596", "text": "function defineVars(){\n\t\twidthOfContainer = container.offsetWidth;\n\t\tmaxPos = widthOfContainer * imageStrip.children.length;\n\t}", "title": "" }, { "docid": "18614aba12d5c386dd2744f6197694f2", "score": "0.49228737", "text": "function aantalElementen(tabel){\n var aantal = 0;\n for(var i=0; i < tabel.length; i++){\n for(var j=0; j < tabel[i].length; j++){\n aantal++;\n }\n }\n return aantal;\n}", "title": "" }, { "docid": "c67b38fa0d8858b39ce4a991488252ed", "score": "0.49216434", "text": "function calcularQuantum(){\n\tif(!this.listos.Listavacia()){\n\t\tvar colaAux = new Cola();\n\t\tvar promedio = 0;\n\t\tvar numeroProcesos= 0;\n\t\tvar procesoAux;\n\t\twhile(!this.listos.Listavacia()){\n\t\t\tprocesoAux = this.listos.Listaatender();\n\t\t\tpromedio+=parseInt(procesoAux.tiempo);\n\t\t\tnumeroProcesos++;\n\t\t\tcolaAux.Listainsertar(procesoAux);\n\t\t}\n\t\tpromedio = promedio/numeroProcesos;\n\t\twhile(!colaAux.Listavacia()){\n\t\t\tprocesoAux = colaAux.Listaatender();\n\t\t\t/* si solo hay un elemento en la cola de listos, el quantum es el mismo tiempo*/\n\t\t\tif(numeroProcesos == 1){\n\t\t\t\tprocesoAux.q = procesoAux.tiempo;\n\t\t\t\tprocesoAux.qRestante = procesoAux.tiempo;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tprocesoAux.q = parseInt(promedio*0.8);\n\t\t\t\tprocesoAux.qRestante = parseInt(promedio*0.8);\n\t\t\t}\n\t\t\tif(procesoAux.q == 0){\n\t\t\t\tprocesoAux.q = 1;\n\t\t\t\tprocesoAux.qRestante = 1;\n\t\t\t\n\t\t\t}\n\t\t\tthis.listos.Listainsertar(procesoAux);\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "9b149cdf81539842e3b62569f58a717a", "score": "0.4920239", "text": "function getInputDimension() {\n //var numBits = gifData.dimensions[0] * gifData.dimensions[1];\n //console.log(\"Total length of input encoding: %s\", numBits);\n return [gifData.dimensions[0], gifData.dimensions[1]];\n }", "title": "" }, { "docid": "f2a1c7164b779b38950d339d0c5c4d8c", "score": "0.4918896", "text": "function getDimensions () {\n return [Math.floor((window.innerWidth / blockSize) - 1) * blockSize,\n Math.floor((window.innerHeight / blockSize) * 0.9 - 1) * blockSize]\n}", "title": "" }, { "docid": "1190ae3b2fef07c3e802e09db304f2e4", "score": "0.49186838", "text": "function calcularEnvio()\n{\n let costo = 0;\n let precioXKm = 0;\n if(cantidadPallet <= 5) \n { \n precioXKm = 100;\n switch(provincia.value)\n {\n case \"Buenos Aires\":\n costo = precioXKm * 300;\n break;\n case \"Catamarca\":\n costo = precioXKm * 850;\n break; \n case \"Chaco\":\n costo = precioXKm * 850;\n break; \n case \"Chubut\":\n costo = precioXKm * 710;\n break; \n case \"Cordoba\":\n costo = precioXKm * 400;\n break; \n case \"Corrientes\":\n costo = precioXKm * 730;\n break; \n case \"Entre Rios\":\n costo = precioXKm * 205;\n break;\n case \"Formosa\":\n costo = precioXKm * 880;\n break; \n case \"Jujuy\":\n costo = precioXKm * 1200;\n break; \n case \"La Pampa\":\n costo = precioXKm * 640;\n break;\n case \"La Rioja\":\n costo = precioXKm * 840;\n break;\n case \"Mendoza\":\n costo = precioXKm * 880;\n break; \n case \"Misiones\":\n costo = precioXKm * 900;\n break; \n case \"Neuquen\":\n costo = precioXKm * 1150;\n break; \n case \"Rio Negro\":\n costo = precioXKm * 1020;\n break; \n case \"Salta\":\n costo = precioXKm * 1670;\n break; \n case \"San Juan\":\n costo = precioXKm * 940;\n break;\n case \"San Luis\":\n costo = precioXKm * 610;\n break; \n case \"Santa Cruz\":\n costo = precioXKm * 2600;\n break;\n case \"Santa Fe\":\n costo = precioXKm * 180;\n break; \n case \"Santiago Del Estero\":\n costo = precioXKm * 750;\n break; \n case \"Tierra Del Fuego\":\n costo = precioXKm * 3170;\n break;\n case \"Tucuman\":\n costo = precioXKm * 950;\n break; \n } \n } \n else if(cantidadPallet <= 10) \n {\n precioXKm = 110;\n switch(provincia.value)\n {\n case \"Buenos Aires\":\n costo = precioXKm * 300;\n break;\n case \"Catamarca\":\n costo = precioXKm * 850;\n break; \n case \"Chaco\":\n costo = precioXKm * 850;\n break; \n case \"Chubut\":\n costo = precioXKm * 710;\n break; \n case \"Cordoba\":\n costo = precioXKm * 400;\n break; \n case \"Corrientes\":\n costo = precioXKm * 730;\n break; \n case \"Entre Rios\":\n costo = precioXKm * 205;\n break;\n case \"Formosa\":\n costo = precioXKm * 880;\n break; \n case \"Jujuy\":\n costo = precioXKm * 1200;\n break; \n case \"La Pampa\":\n costo = precioXKm * 640;\n break;\n case \"La Rioja\":\n costo = precioXKm * 840;\n break;\n case \"Mendoza\":\n costo = precioXKm * 880;\n break; \n case \"Misiones\":\n costo = precioXKm * 900;\n break; \n case \"Neuquen\":\n costo = precioXKm * 1150;\n break; \n case \"Rio Negro\":\n costo = precioXKm * 1020;\n break; \n case \"Salta\":\n costo = precioXKm * 1670;\n break; \n case \"San Juan\":\n costo = precioXKm * 940;\n break;\n case \"San Luis\":\n costo = precioXKm * 610;\n break; \n case \"Santa Cruz\":\n costo = precioXKm * 2600;\n break;\n case \"Santa Fe\":\n costo = precioXKm * 180;\n break; \n case \"Santiago Del Estero\":\n costo = precioXKm * 750;\n break; \n case \"Tierra Del Fuego\":\n costo = precioXKm * 3170;\n break;\n case \"Tucuman\":\n costo = precioXKm * 950;\n break; \n } \n } \n else if(cantidadPallet <= 15) \n {\n precioXKm = 130;\n switch(provincia.value)\n {\n case \"Buenos Aires\":\n costo = precioXKm * 300;\n break;\n case \"Catamarca\":\n costo = precioXKm * 850;\n break; \n case \"Chaco\":\n costo = precioXKm * 850;\n break; \n case \"Chubut\":\n costo = precioXKm * 710;\n break; \n case \"Cordoba\":\n costo = precioXKm * 400;\n break; \n case \"Corrientes\":\n costo = precioXKm * 730;\n break; \n case \"Entre Rios\":\n costo = precioXKm * 205;\n break;\n case \"Formosa\":\n costo = precioXKm * 880;\n break; \n case \"Jujuy\":\n costo = precioXKm * 1200;\n break; \n case \"La Pampa\":\n costo = precioXKm * 640;\n break;\n case \"La Rioja\":\n costo = precioXKm * 840;\n break;\n case \"Mendoza\":\n costo = precioXKm * 880;\n break; \n case \"Misiones\":\n costo = precioXKm * 900;\n break; \n case \"Neuquen\":\n costo = precioXKm * 1150;\n break; \n case \"Rio Negro\":\n costo = precioXKm * 1020;\n break; \n case \"Salta\":\n costo = precioXKm * 1670;\n break; \n case \"San Juan\":\n costo = precioXKm * 940;\n break;\n case \"San Luis\":\n costo = precioXKm * 610;\n break; \n case \"Santa Cruz\":\n costo = precioXKm * 2600;\n break;\n case \"Santa Fe\":\n costo = precioXKm * 180;\n break; \n case \"Santiago Del Estero\":\n costo = precioXKm * 750;\n break; \n case \"Tierra Del Fuego\":\n costo = precioXKm * 3170;\n break;\n case \"Tucuman\":\n costo = precioXKm * 950;\n break; \n } \n } \n else if(cantidadPallet <= 20) \n {\n precioXKm = 150;\n switch(provincia.value)\n {\n case \"Buenos Aires\":\n costo = precioXKm * 300;\n break;\n case \"Catamarca\":\n costo = precioXKm * 850;\n break; \n case \"Chaco\":\n costo = precioXKm * 850;\n break; \n case \"Chubut\":\n costo = precioXKm * 710;\n break; \n case \"Cordoba\":\n costo = precioXKm * 400;\n break; \n case \"Corrientes\":\n costo = precioXKm * 730;\n break; \n case \"Entre Rios\":\n costo = precioXKm * 205;\n break;\n case \"Formosa\":\n costo = precioXKm * 880;\n break; \n case \"Jujuy\":\n costo = precioXKm * 1200;\n break; \n case \"La Pampa\":\n costo = precioXKm * 640;\n break;\n case \"La Rioja\":\n costo = precioXKm * 840;\n break;\n case \"Mendoza\":\n costo = precioXKm * 880;\n break; \n case \"Misiones\":\n costo = precioXKm * 900;\n break; \n case \"Neuquen\":\n costo = precioXKm * 1150;\n break; \n case \"Rio Negro\":\n costo = precioXKm * 1020;\n break; \n case \"Salta\":\n costo = precioXKm * 1670;\n break; \n case \"San Juan\":\n costo = precioXKm * 940;\n break;\n case \"San Luis\":\n costo = precioXKm * 610;\n break; \n case \"Santa Cruz\":\n costo = precioXKm * 2600;\n break;\n case \"Santa Fe\":\n costo = precioXKm * 180;\n break; \n case \"Santiago Del Estero\":\n costo = precioXKm * 750;\n break; \n case \"Tierra Del Fuego\":\n costo = precioXKm * 3170;\n break;\n case \"Tucuman\":\n costo = precioXKm * 950;\n break; \n } \n } \n return costo; \n}", "title": "" }, { "docid": "9a33fa8a7cd5b32ebb60e7706b211227", "score": "0.49153984", "text": "function getWidthAndCols() {\n\t function gridWidth(cols, gridUnit, marginSize) {\n\t return cols * gridUnit + (cols - 1) * marginSize;\n\t }\n\t\n\t var screenWidth = window.innerWidth;\n\t var cols = 1;\n\t var width = gridWidth(cols, _constants.GRID_UNIT, _constants.GRID_MARGIN);\n\t while (width <= screenWidth) {\n\t cols++;\n\t width = gridWidth(cols, _constants.GRID_UNIT, _constants.GRID_MARGIN);\n\t }\n\t\n\t return [width, cols];\n\t}", "title": "" }, { "docid": "3935b542bcb1eb8e9bd67ca1553d4c50", "score": "0.49089268", "text": "function fillTilesVars(){\n\n\t\tg_vars.colWidth = g_options.tiles_col_width;\n\t\tg_vars.minCols = g_options.tiles_min_columns;\n\t\tg_vars.maxCols = g_options.tiles_max_columns;\n\t\t\n\t\tif(g_gallery.isMobileMode() == false){\n\t\t\tg_vars.colGap = g_options.tiles_space_between_cols;\n\t\t} else {\n\t\t\tg_vars.colGap = g_options.tiles_space_between_cols_mobile;\n\t\t}\n\t\t\n\t\t//set gallery width\n\t\tg_vars.galleryWidth = getParentWidth();\n\t\t\n\t\tg_vars.availWidth = g_vars.galleryWidth;\n\t\t\n\t\tif(g_options.tiles_include_padding == true)\n\t\t\tg_vars.availWidth = g_vars.galleryWidth - g_vars.colGap*2;\n\t\t\n\t\t//set the column number by exact width\n\t\tif(g_options.tiles_exact_width == true){\n\t\t\t\n\t\t\tg_vars.numCols = g_functions.getNumItemsInSpace(g_vars.availWidth, g_vars.colWidth, g_vars.colGap);\n\n\t\t\tif(g_vars.maxCols > 0 && g_vars.numCols > g_vars.maxCols)\n\t\t\t\tg_vars.numCols = g_vars.maxCols;\n\n\t\t\t//if less then min cols count width by cols\n\t\t\tif(g_vars.numCols < g_vars.minCols){\n\t\t\t\tg_vars.numCols = g_vars.minCols;\n\n\t\t\t\tfillTilesVars_countWidthByCols();\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tg_vars.totalWidth = g_vars.numCols * (g_vars.colWidth + g_vars.colGap) - g_vars.colGap;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t//set dynamic column number\n\t\t\t\n\t\t\tvar numCols = g_functions.getNumItemsInSpaceRound(g_vars.availWidth, g_vars.colWidth, g_vars.colGap);\n\t\t\t\t\t\t\n\t\t\tif(numCols < g_vars.minCols)\n\t\t\t\tnumCols = g_vars.minCols;\n\t\t\telse\n\t\t\t\tif(g_vars.maxCols != 0 && numCols > g_vars.maxCols)\n\t\t\t\t\tnumCols = g_vars.maxCols;\n\n\t\t\tg_vars.numCols = numCols;\n\t\t\t\n\t\t\tfillTilesVars_countWidthByCols();\n\t\t\t\n\t\t}\n\n\t\tswitch(g_options.tiles_align){\n\t\t\tcase \"center\":\n\t\t\tdefault:\n\t\t\t\t//add x to center point\n\t\t\t\tg_vars.addX = Math.round( (g_vars.galleryWidth - g_vars.totalWidth) / 2 );\n\t\t\tbreak;\n\t\t\tcase \"left\":\n\t\t\t\tg_vars.addX = 0;\n\t\t\tbreak;\n\t\t\tcase \"right\":\n\t\t\t\tg_vars.addX = g_vars.galleryWidth - g_vars.totalWidth;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tg_vars.maxColHeight = 0;\n\t\t\n\t\t//get posx array (constact to all columns)\n\t\tg_vars.arrPosx = [];\t\t\n\t\tfor(col = 0; col < g_vars.numCols; col++){\n\t\t\tvar colX = g_functions.getColX(col, g_vars.colWidth, g_vars.colGap);\n\t\t\tg_vars.arrPosx[col] = colX + g_vars.addX;\n\t\t}\n\t\t\n\t\t//empty heights array\n\t\tg_vars.colHeights = [0];\n\n\t}", "title": "" }, { "docid": "acd950b9f25da850d007ce6f7323dd04", "score": "0.4908446", "text": "get dimensions() {\n var dimensions = new Range();\n this._rows.forEach(function (row) {\n if (row) {\n var rowDims = row.dimensions;\n if (rowDims) {\n dimensions.expand(row.number, rowDims.min, row.number, rowDims.max);\n }\n }\n });\n return dimensions;\n }", "title": "" }, { "docid": "08cc733386e7530ae3522b863641e576", "score": "0.49025747", "text": "function def_temps_jeu(){\r\n if (niveau == \"facile\"){\r\n temps_jeu = loiUniforme(75,120); //Entre 75 et 120 sec\r\n } else if (niveau == \"moyen\"){\r\n temps_jeu = loiUniforme(60,105); //Entre 60 et 105 sec\r\n } else if (niveau == \"difficile\"){\r\n temps_jeu = loiUniforme(50,105); ; //Entre 50 et 105 sec\r\n }\r\n temps_jeu = Math.round(temps_jeu)\r\n console.log(\"Temps jeu 1 : \"+temps_jeu);\r\n}", "title": "" } ]
5096161a66026de4d75cbc34d4d19cce
Functions begin here and are in alphabetical order. Return true if there are wingDashes.
[ { "docid": "294be473f95f9c8b78b4c0a2f06ae607", "score": "0.707064", "text": "function areWingDashes(string) {\n if (string.match(/.*-$/gm)) {\n return true;\n }\n if (string.match(/^-.*/gm)) {\n return true;\n }\n return false;\n }", "title": "" } ]
[ { "docid": "c0c394e17b6d210f2194a831b4867008", "score": "0.6641049", "text": "function checkWin(dash){\n return dash != \"_\";\n}", "title": "" }, { "docid": "e7786887b18b1d9d3f395e1db9fb6daf", "score": "0.627419", "text": "function hasUnderscoreOrHyphen (str) {\n return str.indexOf(\"-\") > -1 || str.indexOf(\"_\") > -1;\n}", "title": "" }, { "docid": "4837079c53c0f94a8426acc92b42d71f", "score": "0.62361723", "text": "function lolspace_is_func(funcname)\n{\n for (var i=0; i<lolspace_user_functions.length; i++)\n {\n if (lolspace_user_functions[i].name == funcname)\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "8ed83550383ca128ea2790f6b4d732dc", "score": "0.61721545", "text": "isHack(all, unprefixed) {\n let check = new RegExp(`(\\\\(|\\\\s)${utils.escapeRegexp(unprefixed)}:`)\n return !check.test(all)\n }", "title": "" }, { "docid": "719d4a9146174842ed96bdb48ec44f43", "score": "0.59927213", "text": "function checkWon(){\r\n console.log(word);\r\n let hasBlanks = word.includes('_');\r\n return !hasBlanks;\r\n }", "title": "" }, { "docid": "017bff5efe25a204afe8bce231d308eb", "score": "0.5878018", "text": "function dash(code) {\n return code === 45 /* '-' */\n}", "title": "" }, { "docid": "341f3349d098b4078ae767e2249f1ca1", "score": "0.58689433", "text": "function isLetter(c) { return c.toLowerCase() !== c.toUpperCase();}", "title": "" }, { "docid": "5fc08c2ea17999a9958884a22c521c32", "score": "0.5806328", "text": "function hasSymbol(string) {\n for (var i = 0; i < string.length; i++) {\n if (!((\"A\" <= string[i] && string[i] <= \"Z\") || (\"a\" <= string[i] && string[i] <= \"z\"))) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "ed4e5c79366d30021ed956131bb301fa", "score": "0.5805906", "text": "function doesValueContainsAlphaDashAndUnderscore(string) {\n return string.match(/[-_]/gi);\n}", "title": "" }, { "docid": "220509fe65db33d8359d3b0c5d853abd", "score": "0.5795772", "text": "function isLetter(c) {\n return (c.toUpperCase() != c.toLowerCase());\n}", "title": "" }, { "docid": "3ff1fb2420927e84254edcc2af02206e", "score": "0.5793086", "text": "function containsSymbol(val) {\n\tvar charArray = val.toLowerCase().split('');\n\tvar allowedCharacters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n\n\tfor (var i=0; i < charArray.length; i++) {\n\t\t\tif (allowedCharacters.indexOf(charArray[i]) == -1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "98dcc76007d8126a7f3d84dc5d8264bc", "score": "0.57769406", "text": "function IsAlreadyDotPresent() {\n\tvar D;\n\tfor(D = 0 ; D < Display_String.length ; D++){\n\t\tif(Display_String[Display_String.length - D -1] == \".\"){\n\t\t\tbreak;\t\n\t\t}\n\t}\n\tif(D == Display_String.length){\n\t\treturn false;\n\t}\n\tfor(var i=0 ; i < Display_String.length ; i++){\n\t\tfor(var j = 0 ; j < 5 ; j++){\n\t\t\tif(Display_String[Display_String.length - i -1] == OperatorString[j]){\n\t\t\t\t if( (Display_String.length - D -1) > (Display_String.length - i - 1)){\n\t\t\t\t \treturn true;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \treturn false;\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "327fe080f9ff688475a2aecc6a4e27eb", "score": "0.577216", "text": "function fn_hangulCheck(str) {\r\n\tvar pattern = new RegExp(/^[a-zA-Z0-9]+$/);\r\n\t\r\n\tif (str == \"\") return true;\r\n\r\n\treturn pattern.test(str);\r\n \r\n}", "title": "" }, { "docid": "9a631545253e3517a130c6b7c2721cec", "score": "0.5769843", "text": "function isFunction(w) {\n\treturn w && {}.toString.call(w) === \"[object Function]\";\n}", "title": "" }, { "docid": "f69462b156674c645326550025fe8b17", "score": "0.5757535", "text": "function fnContainsSpecialChars(a_strString)\r\r\n{\r\r\n a_strString = fnTrim(a_strString);\r\r\n if(a_strString.indexOf(\"`\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"~\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"!\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"@\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"#\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"$\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"%\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"^\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"&\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"*\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"-\") != -1)\r\r\n return true;\r\r\n// if(a_strString.indexOf(\"_\") != -1)\r\r\n// return true;\r\r\n if(a_strString.indexOf(\"+\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"=\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"|\") != -1)\r\r\n return true;\r\r\n //if(a_strString.indexOf(\"\\\\\") != -1)\r\r\n // return true;\r\r\n if(a_strString.indexOf(\"}\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"]\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"{\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"[\") != -1)\r\r\n return true;\r\r\n //if(a_strString.indexOf(\"\\\"\") != -1)\r\r\n // return true;\r\r\n if(a_strString.indexOf(\":\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\";\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"?\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\">\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"<\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"(\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\")\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\",\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\"'\") != -1)\r\r\n return true;\r\r\n if(a_strString.indexOf(\".\") != -1)\r\r\n return true;\r\r\n // if(a_strString.indexOf(\"/\") != -1)\r\r\n // return true;\r\r\n\r\r\n return false;\r\r\n}", "title": "" }, { "docid": "c8144dab2ad629f6fc3bf88fa72ae401", "score": "0.5727047", "text": "function fnIsValidName(a_strString)\r\r\n{\r\r\n var a_strString = fnTrim(a_strString );\r\r\n if(a_strString.indexOf(\"0\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"1\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"2\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"3\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"4\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"5\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"6\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"7\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"8\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"9\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"`\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"~\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"!\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"@\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"#\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"$\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"%\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"^\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"&\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"*\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"(\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\")\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"+\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"=\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"|\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"\\\\\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"}\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"]\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"{\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"[\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"\\\"\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\":\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\";\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"/\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"?\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\">\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"<\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"'\") != -1)\r\r\n return false;\r\r\n if(isNaN(a_strString))\r\r\n return true;\r\r\n else\r\r\n return false;\r\r\n\r\r\n return true;\r\r\n}", "title": "" }, { "docid": "9fef28e8cce4bfbcc9c4a5bf6d08283b", "score": "0.5726748", "text": "function isAlphanumeric (s)\n{ var i;\n\t\n if (isEmpty(s))\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\n else return (isAlphanumeric.arguments[1] == true);\n\n for (i = 0; i < s.length; i++)\n { \n var c = s.charAt(i);\n if (! (isLetter(c) || isDigit(c) || c=='_' ) )\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "9fef28e8cce4bfbcc9c4a5bf6d08283b", "score": "0.5726748", "text": "function isAlphanumeric (s)\n{ var i;\n\t\n if (isEmpty(s))\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\n else return (isAlphanumeric.arguments[1] == true);\n\n for (i = 0; i < s.length; i++)\n { \n var c = s.charAt(i);\n if (! (isLetter(c) || isDigit(c) || c=='_' ) )\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "deb92d8b26117836f58d694223fd4d4d", "score": "0.5720906", "text": "function isfn(char){\r\n\t//alert(\"TEST: Char lenght: \" + char.length);\r\n\tif (char.length!=1) {\r\n\t\t//alert(\"TEST: Char lenght != 1 \");\r\n\t\treturn false;\r\n\t}\r\n\telse if (char==\"a\" || char==\"b\" || char==\"c\" || char==\"d\" || char==\"e\" || char==\"f\" || char==\"g\" || char==\"h\" ||\r\n\t\t\tchar==\"i\" || char==\"j\" || char==\"k\" || char==\"l\" || char==\"m\" || char==\"n\" || char==\"o\" || char==\"p\" || \r\n\t\t\tchar==\"q\" || char==\"r\" || char==\"s\" || char==\"t\" || char==\"u\" || char==\"v\" || char==\"w\" || char==\"x\" || \r\n\t\t\tchar==\"y\" || char==\"z\" || char==\"^\") {\r\n\t\t//alert(\"TEST: Char is numeric and i will return true !\");\r\n\t\treturn true;\r\n\t} \r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "f4531ad363cc392af3fdaa966f2dfd3d", "score": "0.5717761", "text": "function isCamelCasePattern(word) {\n var upper = 0, lower = 0, code = 0, whitespace = 0;\n for (var i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n if (isUpper(code)) {\n upper++;\n }\n if (isLower(code)) {\n lower++;\n }\n if (isWhitespace(code)) {\n whitespace++;\n }\n }\n if ((upper === 0 || lower === 0) && whitespace === 0) {\n return word.length <= 30;\n }\n else {\n return upper <= 5;\n }\n}", "title": "" }, { "docid": "f4531ad363cc392af3fdaa966f2dfd3d", "score": "0.5717761", "text": "function isCamelCasePattern(word) {\n var upper = 0, lower = 0, code = 0, whitespace = 0;\n for (var i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n if (isUpper(code)) {\n upper++;\n }\n if (isLower(code)) {\n lower++;\n }\n if (isWhitespace(code)) {\n whitespace++;\n }\n }\n if ((upper === 0 || lower === 0) && whitespace === 0) {\n return word.length <= 30;\n }\n else {\n return upper <= 5;\n }\n}", "title": "" }, { "docid": "28591d9846806afc8bd1500b6c00b4ee", "score": "0.5711293", "text": "function SimpleSymbols(str) {\n if(str.length < 2){\n return false\n }\n for (var i = 0; i < str.length-1; i++) {\n if(str.charCodeAt(i) > 96 && str.charCodeAt(i) < 123){\n if(str[i+1] != \"+\"|| str[i-1] != \"+\"){\n return false\n }\n }\n }\n return true\n\n}", "title": "" }, { "docid": "45d88241ef90903fce6b6789839f1e66", "score": "0.5704929", "text": "function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n}", "title": "" }, { "docid": "45d88241ef90903fce6b6789839f1e66", "score": "0.5704929", "text": "function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n}", "title": "" }, { "docid": "8b00a6cc5511ec4ac0024bedec8f4997", "score": "0.5691557", "text": "function fnCheckString() {\n //get the keycode when the user pressed any key in application \n var exp = String.fromCharCode(window.event.keyCode)\n\n if (validchars.indexOf(exp) < 0 || validchars.indexOf(exp) > validchars.length) {\n window.event.keyCode = 0\n return false;\n }\n }", "title": "" }, { "docid": "7473a7c5ccceec6d045fb4c54709508f", "score": "0.5687763", "text": "function isTestFunction(str) {\n let functionNames = [\n \"cache\", \"CONFIG\", \"contains\", \"count\", \"debug\",\n \"defined\", \"equals\", \"error\", \"eval\", \"exists\",\n \"export\", \"for\", \"greaterThan\", \"if\", \"include\",\n \"infile\", \"isActiveConfig\", \"isEmpty\", \"isEqual\",\n \"lessThan\", \"load\", \"log\", \"message\", \"mkpath\",\n \"requires\", \"system\", \"touch\", \"unset\", \"warning\",\n \"write_file\",\n \"packagesExist\", \"prepareRecursiveTarget\", \"qtCompileTest\", \"qtHaveModule\"\n ];\n\n return functionNames.indexOf(str) >= 0;\n}", "title": "" }, { "docid": "9de22fead7b11afc207d1758dc7c2912", "score": "0.5665817", "text": "function isTextSimple(text)\n{\n for(var i = 0; i < text.length; ++ i)\n {\n if(text[i] < '0' || text[i] > '9')\n {\n if(text[i] < 'a' || text[i] > 'z')\n {\n if(text[i] < 'A' || text[i] > 'Z')\n {\n if(text[i] != '_')\n {\n return false;\n }\n }\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "3bea81fb4f906a2f7171e0df1d8237e0", "score": "0.56615245", "text": "function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n }", "title": "" }, { "docid": "0db9a0fbd929db4e21cd4a31f2b14d70", "score": "0.56613374", "text": "function isSpaceLetter($Space) {\n let getID;\n getID = $Space[0].className;\n\n let PresentLetter;\n PresentLetter = getID.match(/(board_piece_)(.)(.+)/);\n\n if (PresentLetter[2] != \"_\") {\n // checks if space letter is not present and returns false\n return false;\n } else {\n // checks if space letter is present and returns true\n return true;\n }\n}", "title": "" }, { "docid": "7da4fb7195eb32813a083b5431736a34", "score": "0.5660911", "text": "isAlpha(character) {\n return (character >= 'a' && character <= 'z') || \n (character >= 'A' && character <= 'Z') || \n character === '_';\n }", "title": "" }, { "docid": "84d0c7528ad232901e79cc30c4d92d34", "score": "0.56540275", "text": "function isCamelCasePattern(word) {\n var upper = 0,\n lower = 0,\n code = 0,\n whitespace = 0;\n\n for (var i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n\n if (isUpper(code)) {\n upper++;\n }\n\n if (isLower(code)) {\n lower++;\n }\n\n if (isWhitespace(code)) {\n whitespace++;\n }\n }\n\n if ((upper === 0 || lower === 0) && whitespace === 0) {\n return word.length <= 30;\n } else {\n return upper <= 5;\n }\n}", "title": "" }, { "docid": "f5b490040ff17673b99032d5b699daa0", "score": "0.565029", "text": "function SimpleSymbols2(str){\n var output = true;\n temp = str.toLowerCase().split(\"\");\n letters = /[a-z]/gi;\n\n temp.forEach(function(letter, index) {\n if (letter.match(letters) != null) {\n if (temp[index - 1] !== \"+\" || temp[index + 1] !== \"+\") {\n output = false;\n return;\n }\n }\n });\n\n return output;\n}", "title": "" }, { "docid": "ff485acf32860f46dd86893071afe9c9", "score": "0.56482357", "text": "function isLetter(c) {\n return c.toLowerCase() != c.toUpperCase();\n}", "title": "" }, { "docid": "ca42f25cd368bad3d0ffdb672944ae7b", "score": "0.56207407", "text": "static checkName2(name){\n //King-Baguette \n\n const idxOfDash = name.indexOf('-')// captures the index of where the dash is located at in the name \n \n const prefix = name.slice(0, idxOfDash + 1)// this will stop at index of 5 but will not include the B\n \n let prefixCheck; // will re-assign it to the value of true or false\n \n let firstLetterOfName = name[idxOfDash + 1] === name[idxOfDash + 1].toUpperCase // is the name the same as capitalizing the first letter of the name after the prefix\n //ex. baguette != Baguette \n //ex. B === B true\n \n if( prefix === 'King-' || prefix === 'Queen-'){\n prefixCheck = true\n }else{\n prefixCheck = false\n }\n\n if(prefixCheck && firstLetterOfName){\n return true\n }else{\n return false\n }\n }", "title": "" }, { "docid": "bba1aca5604586bb6a16f1d6729f2c96", "score": "0.5612675", "text": "function checkIfOnScreen(word) {\n var result;\n var wordArray = word.split('');\n for (var i = 0; i < wordArray.length; i++) {\n var char = wordArray[i];\n if (dropMap.has(char)) {\n result = !(dropMap.get(char).length === 0);\n if (result === false) {\n return false;\n }\n } else {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5d2818a5c1d0fabaa796772eee42f15d", "score": "0.5604454", "text": "function isValidFunctionName(name) {\n\tvar validName = /^[$A-Za-z_][0-9A-Za-z_]*$/,\n\t\treservedWords = ['instanceof', 'typeof', 'break', 'do', 'new', 'var', 'case', 'else', 'return', 'void', 'catch', 'finally',\n\t\t\t'continue', 'for', 'switch', 'while', 'this', 'with', 'debugger', 'function', 'throw', 'default', 'if',\n\t\t\t'try', 'delete', 'in'];\n\treturn (validName.test(name) && reservedWords.indexOf(name) === -1);\n}", "title": "" }, { "docid": "4c6aaab3b06d51c8d7fca87dede8a2ef", "score": "0.559503", "text": "function SimpleSymbols(str) {\n var strCap = str.toUpperCase();\t\t\t\t\t\t//Change everything to uppercase\n var alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\t\t\t//Used to compare to each letter in the string\n \n for (var i = 0; i < strCap.length; i++) {\t\t\t\t//Loops through the string\n if(alphabet.indexOf(strCap[i]) != -1){\t\t\t\t//Checks the string for letters and compares it for alphabet\n if(strCap[i-1] == \"+\" && strCap[i+1] == \"+\")\t\t//If that was true then checks -1 and +1 for \"+\"\n return true;\n }\n }\n // code goes here \n return false; \n}", "title": "" }, { "docid": "d00887c235f2e4bc5c9d43ca1bd042bf", "score": "0.5593401", "text": "function isLetter(c) {\n return c.toLowerCase() !== c.toUpperCase();\n}", "title": "" }, { "docid": "5d9da1c3e09872793e7a231b1005f32d", "score": "0.55914885", "text": "function isLowerCase(letter) {\n\n}", "title": "" }, { "docid": "f74e37fe10c4b911e1c29e1c30511ffc", "score": "0.55727106", "text": "function checkUnderscore(t){\n return (t.match(/_/g) || []).length >= 2\n}", "title": "" }, { "docid": "87ec8fc088949ee957c2e8ac2647cfe8", "score": "0.55594677", "text": "function isLetter (c)\n{\n\t\n return( ( uppercaseLetters.indexOf( c ) != -1 ) ||\n ( lowercaseLetters.indexOf( c ) != -1 ) )\n}", "title": "" }, { "docid": "d253bf841c8e5a00862191df7060994b", "score": "0.5540908", "text": "function IsAlpha(chrArg)\r\n{\r\n if (lstAlpha.indexOf(chrArg) >= 0 || \r\n lstAlpha.toUpperCase().indexOf(chrArg) >= 0)\r\n return true;\r\n return false;\r\n}", "title": "" }, { "docid": "c80379a3197bcf697400ae2b924b62d7", "score": "0.5536467", "text": "function isFunction(str) {\r\n let reg = /function\\s.+/;\r\n let res = reg.test(str);\r\n return res;\r\n}", "title": "" }, { "docid": "45c1942cfe72fe1719ff6cc1fc7f5b6a", "score": "0.55325466", "text": "function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}", "title": "" }, { "docid": "45c1942cfe72fe1719ff6cc1fc7f5b6a", "score": "0.55325466", "text": "function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}", "title": "" }, { "docid": "45c1942cfe72fe1719ff6cc1fc7f5b6a", "score": "0.55325466", "text": "function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}", "title": "" }, { "docid": "45c1942cfe72fe1719ff6cc1fc7f5b6a", "score": "0.55325466", "text": "function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}", "title": "" }, { "docid": "2864c3ac7186b78b5d2484378192e2a0", "score": "0.5532435", "text": "function SimpleSymbols(str) {\n\n function isLetter(l) {\n return (l <= \"z\" && l >= \"a\");\n }\n\n for (var i = 1; i < str.length; i++) {\n if (isLetter(str[i])) {\n if (str[i-1] !== \"+\" || str[i+1] !== \"+\" || str[0] !== \"+\") {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "3441e4bea909f20cb211be87d8234559", "score": "0.5530758", "text": "function isHotkeyCombination(hotkey) {\n\treturn typeof hotkey === 'string' && hotkey.indexOf('+') !== -1;\n}", "title": "" }, { "docid": "b533b806dcb17835f8544c9637d1b978", "score": "0.5520775", "text": "function isAlphaNumericWithSpecialCharsWithCharCode(e){\n\t var charCode;\n if (e.keyCode > 0) {\n charCode = e.which || e.keyCode;\n }\n else if (typeof (e.charCode) != \"undefined\") {\n charCode = e.which || e.keyCode;\n }\n\t //space,comma,hiphen,dot,single quote,semicolon,underscore\n if (charCode == 32 || charCode == 44 || charCode == 45 || charCode == 46 || charCode == 39 || charCode == 59 || charCode == 95 )\n return true;\n\t //numbers\n if (charCode >= 48 && charCode <= 57)\n return true;\n //for lowercase\n if(charCode >= 97 && charCode <= 122)\t \n return true;\n\tif(charCode >= 65 && charCode <= 90)\t \n return true; \n\treturn false; \n}", "title": "" }, { "docid": "52d9e23ada88b522829fcd5ce675b3be", "score": "0.55128634", "text": "function isHangul(s) {\r\n\tvar len;\r\n\tlen = s.length;\r\n\tfor (var i = 0; i < len; i++) {\r\n\t\tif (s.charCodeAt(i) != 32 && (s.charCodeAt(i) < 44032 || s.charCodeAt(i) > 55203)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "title": "" }, { "docid": "87a9d5688483c3a5171cf34c0322b8f2", "score": "0.55106175", "text": "function IsFunction(strArg)\r\n{\r\n var idx = 0;\r\n\r\n\tstrArg = strArg.toUpperCase();\r\n\tfor (idx = 0; idx < lstFuncOps.length; idx++)\r\n\t{\r\n\t if (strArg == lstFuncOps[idx])\r\n\t return true;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "e042a93563da35b593441cffa77b7c17", "score": "0.5510168", "text": "function u_iswspace(c, _) {\n return [1,0, c==9 || c==10 || c==13 || c==32];\n}", "title": "" }, { "docid": "62b58c4225941f8b78c24b05ac4f816e", "score": "0.5510072", "text": "function isIsogram (word) {\r\n for (let i = 0; i < word.length; i++) {\r\n if (word[i].toLowerCase() !== word[i].toUpperCase() && word.toLowerCase().lastIndexOf(word[i].toLowerCase()) !== i) {\r\n\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "33a791f1c44a010617658e3acca1e76d", "score": "0.5506741", "text": "function is_white(c){ return in_array(c, whitespace); }", "title": "" }, { "docid": "5e5ca43347dbfad36e6a34d6cc301e62", "score": "0.55007493", "text": "function CheckLink(char)\n{\n\tvar str=\"0123456789abcdefghikjlmnopqrstuvwxysz-_\";\n\tfor(var i=0;i<char.length;i++)\n\t{\n\t\tif(str.indexOf(char.charAt(i)) == -1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;//Dung la ky tu cho phep\n}", "title": "" }, { "docid": "90cf498463536c3e95b3d284ba678106", "score": "0.54914683", "text": "function is_alphaDash(str)\n{\n regexp = /[a-zA-Z_\\-]/; //regex to check value contains dash, alpha and uderscore\n\n if (regexp.test(str))\n {\n alert(\"correct \");\n }\n else\n {\n alert(\"incorrect\");\n }\n}", "title": "" }, { "docid": "273dc52e16e7f0fb1bc7c55dafd75046", "score": "0.5490921", "text": "function coolString(s) {\n\t var i=0;\n\t var character='';\n\t if((s.match(/[ ]/))||(s.match(/[1234567890]/))){\n\t return false;\n\t }\n\t while (i <= s.length){\n\t if (s.charAt(i) == s.charAt(i).toUpperCase()&&s.charAt(i+1) == s.charAt(i+1).toUpperCase()&&s.charAt(i+1)!=''&&s.charAt(i+1)!=' ') {\n\t return false;\n\t }\n\t if (s.charAt(i) == s.charAt(i).toLowerCase()&&s.charAt(i+1) == s.charAt(i+1).toLowerCase()&&s.charAt(i+1)!=''&&s.charAt(i+1)!=' ') {\n\t return false;\n\t }\n\t i++;\n\t }\n\t if(s.match(/[abcdefghijklmnopqrstuvwxyz]/ig)){\n\t return true;\n\t }\n\t return false;\n\t}", "title": "" }, { "docid": "2c306fcfd7185cc912cefd742fadbf63", "score": "0.5479743", "text": "function isLetter (c)\n{\n return( ( uppercaseLetters.indexOf( c ) != -1 ) ||\n ( lowercaseLetters.indexOf( c ) != -1 ) )\n}", "title": "" }, { "docid": "f92322b1687ac9362b7bb8184747242d", "score": "0.54792887", "text": "function isLetter(str) {\n // return str.toLowerCase() != str.toUpperCase();\n return alphabet.indexOf(str);\n }", "title": "" }, { "docid": "f7df8c157443aeee682c62abd6549a7f", "score": "0.54782724", "text": "function hasWord(string, word) {\n\n}", "title": "" }, { "docid": "e62dcdcc027cf7f8d1ceb4b0403e04f7", "score": "0.5465901", "text": "function SimpleSymbols(str) { \n\n if (str.charAt(0).match(/[a-z]/i) || str.charAt(str.length-1).match(/[a-z]/i))\n {\n return false;\n }\n \n if (str.match(/[^+]\\w+/ig) !== null | str.match(/\\w[^+]+/ig) !== null)\n {\n return false;\n }\n \n else\n {\n return true;\n }\n \n return str; \n \n}", "title": "" }, { "docid": "efbd7a42ceac200efc366a4ae7cde897", "score": "0.5465891", "text": "function SimpleSymbols(str) { \n\n if(str[0].match(/[a-z]/i)){\n return false;\n }\n \n var boolean;\n var format = /[+]+/;\n str = str.split(\"\");\n \n for(var i = 1; i < str.length; i++){\n\n \n if(str[i].match(/[a-z]/i)){\n if(format.test(str[i - 1]) && format.test(str[i + 1])){\n continue;\n }else{\n return false;\n }\n }\n }\n \n return true;\n \n}", "title": "" }, { "docid": "f5656014514cf2eb17ece708f128bbfb", "score": "0.54569703", "text": "function beforeAfter (word) {\n if (typeof word !== \"string\") {\n return \"This function accepts only words!\"\n };\n \n var beforeAfterArray = word.split(\"\");\n var symbol = \"+\";\n for (var i = 1; i <= word.length; i++) {\n if ((beforeAfterArray[i - 1]) === symbol && (beforeAfterArray[i + 1]) === symbol) {\n return true;\n } else {\n return false;\n };\n };\n}", "title": "" }, { "docid": "802887e4eeb8ab3ebda7fb058ccb3b09", "score": "0.54567844", "text": "function works(secret) {\n for (var i = 0; i < codes.length; i++) {\n var code = codes[i];\n var index = secret.indexOf(code.charAt(0));\n if (index === -1) return false;\n index = secret.indexOf(code.charAt(1), index);\n if (index === -1) return false;\n index = secret.indexOf(code.charAt(2), index);\n if (index === -1) return false;\n }\n return true;\n}", "title": "" }, { "docid": "4a380378fea1514cf68ffff1e3dbcee6", "score": "0.5454963", "text": "function CheckWebsite(char)\n{\n\tvar str=\"0123456789abcdefghikjlmnopqrstuvwxysz/.:-_\";\n\tfor(var i=0;i<char.length;i++)\n\t{\n\t\tif(str.indexOf(char.charAt(i)) == -1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;//Dung la ky tu cho phep\n}", "title": "" }, { "docid": "38aa762c28c725e4dece704dd60df8b7", "score": "0.5448944", "text": "function test_hyphens(delimiter, testWidth) {\n try {\n /* create a div container and a span within that\n * these have to be appended to document.body, otherwise some browsers can give false negative */\n var div = createElement('div');\n var span = createElement('span');\n var divStyle = div.style;\n var spanSize = 0;\n var result = false;\n var result1 = false;\n var result2 = false;\n var firstChild = document.body.firstElementChild || document.body.firstChild;\n\n divStyle.cssText = 'position:absolute;top:0;left:0;overflow:visible;width:1.25em;';\n div.appendChild(span);\n document.body.insertBefore(div, firstChild);\n\n\n /* get height of unwrapped text */\n span.innerHTML = 'mm';\n spanSize = span.offsetHeight;\n\n /* compare height w/ delimiter, to see if it wraps to new line */\n span.innerHTML = 'm' + delimiter + 'm';\n result1 = (span.offsetHeight > spanSize);\n\n /* if we're testing the width too (i.e. for soft-hyphen, not zws),\n * this is because tested Blackberry devices will wrap the text but not display the hyphen */\n if (testWidth) {\n /* get width of wrapped, non-hyphenated text */\n span.innerHTML = 'm<br />m';\n spanSize = span.offsetWidth;\n\n /* compare width w/ wrapped w/ delimiter to see if hyphen is present */\n span.innerHTML = 'm' + delimiter + 'm';\n result2 = (span.offsetWidth > spanSize);\n } else {\n result2 = true;\n }\n\n /* results and cleanup */\n if (result1 === true && result2 === true) { result = true; }\n document.body.removeChild(div);\n div.removeChild(span);\n\n return result;\n } catch (e) {\n return false;\n }\n }", "title": "" }, { "docid": "3686256a1e53577bea403f758e47812c", "score": "0.5445715", "text": "function isk(code){\n\t// DEBUG && console.log(code,':',String.fromCharCode(code));\n\tif(code == 32 || (code <= 13 && code >= 9)) return true;\n\t// if(code <= 13 && code >= 9) return true;\n\treturn false;\n}", "title": "" }, { "docid": "219f2b85348df9c935887315d66e4612", "score": "0.5441968", "text": "function isNameStart(code) {\n return isLetter(code) || isNonAscii(code) || code === 0x005F;\n}", "title": "" }, { "docid": "219f2b85348df9c935887315d66e4612", "score": "0.5441968", "text": "function isNameStart(code) {\n return isLetter(code) || isNonAscii(code) || code === 0x005F;\n}", "title": "" }, { "docid": "5295e862bd8102d95e715d94cff6c2eb", "score": "0.54355067", "text": "checkIfLetter(keyCode) {\n return (keyCode >= 65 && keyCode <= 122);\n }", "title": "" }, { "docid": "c51d3433d3647447485373e570411adf", "score": "0.54337126", "text": "function chkspChar(str)\r\n{\r\n\tvar alpha;\r\n\tvar flag= true;\r\n\tfor (i = 0; i < str.length; i++)\r\n\t{\r\n\t\talpha = str.charAt(i);\r\n\t\tif(!((alpha>=\"A\" && alpha<=\"Z\") || (alpha>=\"a\" && alpha<=\"z\") || (alpha>=\"0\" && alpha<=\"9\")))\r\n\t\t{\r\n\t\t\tflag=false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn flag;\r\n}", "title": "" }, { "docid": "fcf1b79ce5fc5b3c7a61b7ddd36d7cff", "score": "0.5418776", "text": "function is_alphaDash(str)\n{\n regexp = /[a-zA-Z_\\-]/;\n\n if (regexp.test(str))\n {\n alert(\"Great, The pattern is correct.\");\n }\n else\n {\n alert(\"Sorry, The pattern is incorrect\");\n }\n}", "title": "" }, { "docid": "c7e036a832fc8407077fc2be115c3cb8", "score": "0.54152346", "text": "function is_all_ws( nod )\r\n{\r\n// Use ECMA-262 Edition 3 String and RegExp features\r\n return !(/[^\\t\\n\\r ]/.test(nod.data));\r\n}", "title": "" }, { "docid": "8474be86688a7d57801f7ff74787e4fd", "score": "0.5413378", "text": "function func_2(string){ //name of function\n if(string.length > 10){ // if string length is greater than 10 print to console true\n return true; \n }else if(string.length < 10){ //if string length is less than 10 print to console false\n return false;\n }\n}", "title": "" }, { "docid": "9a8584560288f39a9b58dc2f2a9993c9", "score": "0.5408799", "text": "function starts_with(s, w)\r\n{\r\n if (w.length > s.length)\r\n return false;\r\n\r\n if (s.substring(0, w.length) == w)\r\n return true;\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "f260a10f7f2f1f9f076e91840343b85f", "score": "0.54036015", "text": "function vogalAcentuada(s) {\r\n ls = s.toLowerCase();\r\n if ((ls.indexOf(\"\\u00e1\")>=0) || (ls.indexOf(\"\\u00e0\")>=0) || (ls.indexOf(\"\\u00e3\")>=0) || (ls.indexOf(\"\\u00e2\")>=0) || (ls.indexOf(\"\\u00e9\")>=0) || (ls.indexOf(\"\\u00ed\")>=0) || (ls.indexOf(\"\\u00f3\")>=0) || (ls.indexOf(\"\\u00f5\")>=0) || (ls.indexOf(\"\\u00f4\")>=0) || (ls.indexOf(\"\\u00fa\")>=0) || (ls.indexOf(\"\\u00fc\")>=0))\r\n return true;\r\n}", "title": "" }, { "docid": "03e20cf45cf86d2bff1a323f65f2e3e4", "score": "0.5403548", "text": "function isPascalCased(name) {\n return isUpperCase(name[0]) && !name.includes(\"_\") && !name.includes(\"-\");\n}", "title": "" }, { "docid": "c854619e0575dedb29e63d2ef56b6a31", "score": "0.5391912", "text": "function isUnicodeLetter(code) {\n\t\t\tfor (var i = 0; i < unicodeLetterTable.length;) {\n\t\t\t\tif (code < unicodeLetterTable[i++]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (code <= unicodeLetterTable[i++]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "c854619e0575dedb29e63d2ef56b6a31", "score": "0.5391912", "text": "function isUnicodeLetter(code) {\n\t\t\tfor (var i = 0; i < unicodeLetterTable.length;) {\n\t\t\t\tif (code < unicodeLetterTable[i++]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (code <= unicodeLetterTable[i++]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "e936c5a12d9306b9f8f6e846c6713924", "score": "0.53914124", "text": "isCaseSensitive() { return !fsPlus.isCaseInsensitive(); }", "title": "" }, { "docid": "1694e0dbdabf07451af2bfe5c9881558", "score": "0.5389905", "text": "function CheckCharacter(char)\n{\n\tvar str=\"0123456789abcdefghikjlmnopqrstuvwxyszABCDEFGHIKJLMNOPQRSTUVWXYSZ-_\";\n\tfor(var i=0;i<char.length;i++)\n\t{\n\t\tif(str.indexOf(char.charAt(i)) == -1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;//Dung la ky tu cho phep\n}", "title": "" }, { "docid": "90f12be150b429bb763b3a36f4859c6d", "score": "0.5379613", "text": "function hasUnderscore(s) {\n return s.indexOf('_') >= 0;\n}", "title": "" }, { "docid": "a03a82c6f273d6b7182293c67c88bb98", "score": "0.53789836", "text": "function containsDecorative(s) {\n if (strContainsIgnoreCase(s, 'shadow')) return true;\n if (strContainsIgnoreCase(s, 'caps')) return true;\n if (strContainsIgnoreCase(s, 'antiqua')) return true;\n if (strContainsIgnoreCase(s, 'romansc')) return true;\n if (strContainsIgnoreCase(s, 'embosed')) return true;\n if (strContainsIgnoreCase(s, 'dunhill')) return true;\n return false;\n}", "title": "" }, { "docid": "bee56fa958336c5ab57dcbbaa3ef769b", "score": "0.53749794", "text": "function isHorseName(str){\n\tcheck=\"`~!@#$%^*()_+=|{}[];:/<>?\"+\"\\\\\"+\"\\\"\"+\"\\\"\";\n\tf1=1;\n\tfor(j=0;j<str.length;j++){\n\t\tif(check.indexOf(str.charAt(j))!=-1){\n\t\t\tf1=0;}}\n\tif(f1==0){return true;}\n\telse{return false;}\n}", "title": "" }, { "docid": "e2ade7360b3894f7f2d9867bd7045c28", "score": "0.53709847", "text": "function chars(input){\n return isAlphabetic(input);\n}", "title": "" }, { "docid": "2f30dc72cfa573efc4c2a29b3366273e", "score": "0.5370881", "text": "function isAlphabeticalV2(str) {\n var lowerStr = str.toLowerCase();\n var newStr = \"\"; // will only contain letters\n // Loop to leave only letters\n for (var k = 0; k < lowerStr.length; k++) {\n var curChar = lowerStr[k];\n // 97 = \"a\", 98 = \"b\", ..., 122 = \"z\"\n if (curChar.charCodeAt(0) >= 97 && curChar.charCodeAt(0) <= 122) {\n newStr += curChar;\n }\n }\n // Now check to see if word is in alphabetical order\n // Loop through string - we'll look at two letters in a row\n for (var w = 1; w < newStr.length; w++) {\n // 'a' < 'b' < 'c', etc.\n // If letter before comes alphabetically after the letter ahead, then the word is not in alphabetical order\n if (newStr[w-1] > newStr[w]) {\n return false;\n }\n }\n return true; // Word is in alphabetical order all the way\n}", "title": "" }, { "docid": "b35d41dac49b0e5ebaea4166f1db3fe8", "score": "0.53681076", "text": "function test_hyphens( delimiter, testWidth ) {\n try {\n /* create a div container and a span within that\n * these have to be appended to document.body, otherwise some browsers can give false negative */\n var div = createElement('div');\n var span = createElement('span');\n var divStyle = div.style;\n var spanSize = 0;\n var result = false;\n var result1 = false;\n var result2 = false;\n var firstChild = document.body.firstElementChild || document.body.firstChild;\n\n divStyle.cssText = 'position:absolute;top:0;left:0;overflow:visible;width:1.25em;';\n div.appendChild(span);\n document.body.insertBefore(div, firstChild);\n\n\n /* get height of unwrapped text */\n span.innerHTML = 'mm';\n spanSize = span.offsetHeight;\n\n /* compare height w/ delimiter, to see if it wraps to new line */\n span.innerHTML = 'm' + delimiter + 'm';\n result1 = (span.offsetHeight &gt; spanSize);\n\n /* if we're testing the width too (i.e. for soft-hyphen, not zws),\n * this is because tested Blackberry devices will wrap the text but not display the hyphen */\n if (testWidth) {\n /* get width of wrapped, non-hyphenated text */\n span.innerHTML = 'm&lt;br /&gt;m';\n spanSize = span.offsetWidth;\n\n /* compare width w/ wrapped w/ delimiter to see if hyphen is present */\n span.innerHTML = 'm' + delimiter + 'm';\n result2 = (span.offsetWidth &gt; spanSize);\n } else {\n result2 = true;\n }\n\n /* results and cleanup */\n if (result1 === true &amp;&amp; result2 === true) { result = true; }\n document.body.removeChild(div);\n div.removeChild(span);\n\n return result;\n } catch(e) {\n return false;\n }\n }", "title": "" }, { "docid": "b8de119965bf319e615636333c4de308", "score": "0.53663677", "text": "function isHex (x:string):boolean {\n if (\n x.startsWith('0x') ||\n x.startsWith('-0x') ||\n x.toLowerCase().includes('a') ||\n x.toLowerCase().includes('b') ||\n x.toLowerCase().includes('c') ||\n x.toLowerCase().includes('d') ||\n x.toLowerCase().includes('e') ||\n x.toLowerCase().includes('f')\n ) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "8a7f07d0585a8316b1ad26d08ba3b18e", "score": "0.53553444", "text": "function SimpleSymbols(str) {\n for(var i = 0; i < str.length; i++){\n if(str[i + 1] !== \"+\" || str[i - 1] !== \"+\"){\n return false;\n }\n else{\n return true;\n }\n }\n}", "title": "" }, { "docid": "26132ddd3815db240a3f983ab374e01b", "score": "0.5352102", "text": "function isUpperStringAndLowerStringAndNumAndSpecialCharacter(text)\r\n {\r\n \tvar strRegularExp = /^[a-zA-Z0-9 ]*$/\r\n \tvar alphaWithSpecialCharacterRegularExp = /^[a-zA-Z<>(){}[\\]\\\\.,;:@\\\"*!~#$%&-_=+`|]*$/\r\n \tvar UpperAlphaWithNumberWithSpecialCharacterRegularExp = /^[A-Z0-9<>(){}[\\]\\\\.,;:@\\\"*!~#$%&-_=+`|]*$/\r\n \tvar LowerAlphaWithNumberWithSpecialCharacterRegularExp = /^[a-z0-9<>(){}[\\]\\\\.,;:@\\\"*!~#$%&-=+`|]*$/\r\n \tvar UpperLowerAphaWithNumberWithSpecialCharacterWithoutSpace = /^[a-zA-Z0-9\\\\<>(){}[\\]\\\\.,;:@\\\"*!~#$%&-_=+`|]*$/\r\n \treturn (! strRegularExp.test(text) &&\r\n \t\t\t! UpperAlphaWithNumberWithSpecialCharacterRegularExp.test(text) &&\r\n \t\t\t! LowerAlphaWithNumberWithSpecialCharacterRegularExp.test(text) &&\r\n \t\t\t UpperLowerAphaWithNumberWithSpecialCharacterWithoutSpace.test(text)) \r\n }", "title": "" }, { "docid": "a2efe1b5448f209f1aecd441b1ff3c9f", "score": "0.5350453", "text": "function isLowercaseLetter(code) {\n return code >= 0x0061 && code <= 0x007A;\n}", "title": "" }, { "docid": "a2efe1b5448f209f1aecd441b1ff3c9f", "score": "0.5350453", "text": "function isLowercaseLetter(code) {\n return code >= 0x0061 && code <= 0x007A;\n}", "title": "" }, { "docid": "99d9f458c3393ae109e93cb7e2704426", "score": "0.5346769", "text": "function isLetter(codePoint) {\n return isUpperCaseLetter(codePoint) || isLowerCaseLetter(codePoint);\n}", "title": "" }, { "docid": "926c45dbb70dbcd3995925de6e3454f3", "score": "0.5345413", "text": "function isNameStart(code) {\n return isLetter(code) || isNonAscii(code) || code === 0x005F;\n }", "title": "" }, { "docid": "5609ad2f1d31e43e66533b5999c712b4", "score": "0.5345276", "text": "checkLetter(letter){\n \t\treturn this.phrase.includes(letter);\n \t}", "title": "" }, { "docid": "81cd7700a040f9a0dd2d36ba45dd7932", "score": "0.5343651", "text": "function stringIsAlphaNumSpecChar(stringVal) {\n var code, index;\n\n\n //SOMETHING WRONG HERE WHEN TRYING TO SIMPLIFY CODE!!\n /*\n for (index = 0; index < stringVal.length; index++) {\n code = stringVal.charCodeAt(index);\n console.log(code);\n if (stringIsAlphaNum(code) === false && //numeric (0-9), alpha\n (code === 32 || code === 33 || code === 46 || code === 44) === false ) { //spec allowed characters\n\n return false;\n } \n \n }\n */\n\n for (index = 0; index < stringVal.length; index++) {\n code = stringVal.charCodeAt(index);\n\n if (!(code > 47 && code < 58) && //numeric (0-9)\n !(code > 64 && code < 91) && //upper alpha (A-Z)\n !(code > 96 && code < 123) && //lower alpha (a-z)\n !(code === 32 || code === 33 || code === 46 || code === 44) //spec allowed characters\n ) {\n\n return false;\n }\n\n }\n\n\n\n\n return true; //is alphanum or has an allowed special character\n}", "title": "" }, { "docid": "a7098ca52303269d3e1bff3f96396dd3", "score": "0.53371894", "text": "function isFunction(value) {\n var value = value.trim();\n if (value.startsWith(\"function\")) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "7f65826e3c9e6eb61912b26c28985901", "score": "0.5326576", "text": "function is_all_ws(nod) {\r\n // Use ECMA-262 Edition 3 String and RegExp features\r\n return !(/[^\\t\\n\\r ]/.test(nod.data));\r\n}", "title": "" }, { "docid": "022104c3a259eaa990a22275e2aa892a", "score": "0.5326162", "text": "function isShortWord(str) {\n return str.length <= 5;\n}", "title": "" } ]
761f563d60aac5bb352b899c4ae4b442
async request for park latlng
[ { "docid": "7f006bbc3dfe5584e2222fce0d3560c1", "score": "0.6226526", "text": "async function getLatLng(name) {\n const api = 'AIzaSyCBAsHTwIuM21X08GF99aMvf7y0kuiOZ90';\n const baseUrl = 'https://maps.googleapis.com/maps/api/geocode/json';\n\n const params = {\n key: api,\n address: name\n };\n const url = baseUrl + \"?\" + generateParams(params);\n\n let response = await fetch(url);\n let json = await response.json();\n\n const loc = json.results[0].geometry.location;\n \n initMap(loc);\n}", "title": "" } ]
[ { "docid": "50130d033e5406da3449a5c169c12281", "score": "0.65117794", "text": "getCity(latlng) {\n return new Promise((resolve, reject) => {\n this.fetch(\n `${this.baseURL}${this.responseFormat}?latlng=${latlng}&${this.authorizationString}`\n )\n .then(response => {\n resolve(response.json());\n })\n .catch(error => {\n reject(console.log(error));\n });\n });\n }", "title": "" }, { "docid": "7d51f7989eb1f245c7ecbafd9365616e", "score": "0.6446458", "text": "async getCoordinates() {\n\n this.setState({isLoading: true});\n\n const params = {\n ids: [this.state.training.local[0]],\n fields: ['coordenadas'],\n };\n const response = await this.props.odoo.get('ges.local', params);\n if (response.success && response.data.length > 0) {\n\n const coordinates = response.data[0].coordenadas;\n\n if(coordinates !== false) {\n\n const latitude = parseFloat(coordinates.split(\", \")[0]);\n const longitude = parseFloat(coordinates.split(\", \")[1]);\n\n this.setState({isLoading: false});\n\n return {\n latitude: latitude,\n longitude: longitude\n }\n }\n }\n\n this.setState({isLoading: false});\n return undefined;\n }", "title": "" }, { "docid": "94e6de74f4142c4524c7c50e8bbde400", "score": "0.6386836", "text": "getPointsOnMap() {\n SocrataAPI.getParks(this.state.options.center, this.state.radius, this.state.locationType)\n .then((data) => {\n this.setState({parks: data}, () => {\n if (this.state.map) {\n this.dropMarkers(this.state.map);\n }\n });\n });\n }", "title": "" }, { "docid": "39becb5122cc981bd39c988929030335", "score": "0.63811547", "text": "async function makeApiCall(){\n let urlString = `https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${cords.latitude}&lon=${cords.longitude}`;\n try {\n //Converting the HTTP response to JS object from JSON payload\n let response = await fetch(urlString);\n var objectFromJSON = await response.json();\n console.log(\"response from server is\");\n console.log(objectFromJSON);\n } catch (error) {\n console.error(error);\n }\n //Once API call is done, chaning the \n setLocationAtGps(objectFromJSON.address)\n }", "title": "" }, { "docid": "be93af61ba746ddde616f36f48a25620", "score": "0.633113", "text": "function geocode(loc){\n\treturn new Promise(function(resolve, reject) {\n\t\taxios.get('https://maps.googleapis.com/maps/api/geocode/json',{\n params:{\n address:loc,\n key:'AIzaSyDyjYOaLDSRULDGQXQu9oJIrCMMWc27i4Y'\n }\n })\n .then(function(response){\n //console.log(response);\n var obj = response.data.results[0];\n var lat = obj.geometry.location.lat;\n var long = obj.geometry.location.lng;\n var address = obj.formatted_address;\n var coords = new Array();\n coords.push(lat);\n coords.push(long);\n coords.push(address);\n resolve(coords);\n })\n .catch(function(error){\n console.log(error)\n });\n \t\n });\n }", "title": "" }, { "docid": "b313c5fecf2e0f15bd08a65e5f1b9eff", "score": "0.6295645", "text": "function getLngLat (querry1, querry2, querry3, limit=50, map) {\n var params = {\n key: mountainProjectKey,\n lat: querry1,\n lon: querry2,\n maxDistance: querry3,\n limit\n };\n var queryString = formatQueryParams(params);\n var url = mountainProjectURL+ '?' + queryString;\n\n console.log(url);\n fetch(url)\n .then(respone => {\n if(respone.ok) {\n return respone.json();\n }\n throw new Error(respons.statusText);\n })\n //setMarkers needs to be run before displayResults.\n .then((responseJson) => {\n setMarkers (map, responseJson);\n displayResults(responseJson);\n })\n .catch(err => {\n $('#js-error-message').text(`Something went wrong ${err.message}`);\n });\n}", "title": "" }, { "docid": "f5f546375f8e653165840c83e38e7004", "score": "0.62944305", "text": "async function mapQuery(addr, i) {\n var test;\n var mapquery = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + addr + \"&key=\" + googlemapskey;\n var promise = await $.ajax({\n url: mapquery,\n method: \"GET\",\n }).then(function (response) {\n //Google maps api takes input -> lat, lng, address\n var latit = response.results[0].geometry.location.lat;\n var longi = response.results[0].geometry.location.lng;\n var add = response.results[0].formatted_address;\n var coordinates = {lat: latit, lng: longi};\n\n // console.log(coordinates);\n locations[i] = coordinates;\n \n //create a local truckLocations array with coordinates saved\n var coord = JSON.stringify(coordinates);\n \n // truckLocations[id] = coordinates;\n // Save coord to truck in database\n // database.ref(trucks[id].set({\n // location: coordinates,\n // timeupdated automatically updated\n // });\n return new Promise(resolve => {\n resolve(coordinates);\n });\n });\n // console.log(promise);\n return promise;\n}", "title": "" }, { "docid": "8c698c84092dc02a5e254c342ba48f0f", "score": "0.6285154", "text": "async function getAddress(latlng) {\n let nominatinApiUrl = \"http://localhost:7070\";\n\n return await fetch(nominatinApiUrl + \"/reverse?lat=\" + latlng.lat + \"&lon=\" + latlng.lng + \"&format=jsonv2\", {\n method: \"GET\"\n }).then(response => response.json());\n}", "title": "" }, { "docid": "d491bae57ff7628e70c6fcfa6be837cd", "score": "0.6277432", "text": "function APIrequest(startLng, startLat, endLng, endLat) {\n return new Promise((resolve, reject) => {\n const body = '{\"coordinates\":[[' + startLng + \",\" + startLat + \"],[\" + endLng + \",\" + endLat + \"]]}\";\n const params = {\n locomotion: [\"driving-car\", \"cycling-regular\", \"cycling-electric\"]\n };\n const request = new XMLHttpRequest();\n request.open('POST', `https://api.openrouteservice.org/v2/directions/${params.locomotion[0]}/gpx`);\n request.setRequestHeader('Accept', 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8');\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('Authorization', '5b3ce3597851110001cf6248691b8140d76d4c55b8effcc3d91d4aad');\n request.onreadystatechange = function () {\n if (this.readyState === 4) {\n if (this.status === 200) {\n resolve(this.responseText);\n } else {\n reject(this.status);\n }\n }\n };\n request.send(body);\n });\n}", "title": "" }, { "docid": "591e5285b0b1ed05fa476e7e59dd787e", "score": "0.627552", "text": "function getCoordinates(city, callback){\n const url = 'https://api.mapbox.com/geocoding/v5/mapbox.places/'+city+'.json?access_token='+credentials.MAPBOX_TOKEN\n //Test for \"change of input\" \n //const url = 'https://api.mapbox.com/geocoding2222/v5/mapbox.places/'+city+'.json?access_token='+credentials.MAPBOX_TOKEN\n request({url, json: true}, function(error, response){\n if(error){\n callback('Servicio no disponible',undefined)\n }else if (response.body.message == 'Not Found' || response.body.message == 'Not Authorized - Invalid Token'){\n callback(response.body.message, undefined)\n }else if(response.body.features.length == 0){\n callback('Lugar no encontrado',undefined)\n }else {\n const data = response.body\n //The API returns coordinates of the feature’s center in form : [longitude,latitude]\n const coordinates = data.features[0].center\n const coords = {\n lat: coordinates[1],\n long: coordinates[0]\n }\n callback(undefined,coords)\n }\n })\n}", "title": "" }, { "docid": "c937a28db2ed427068ffcc25db0546f5", "score": "0.62361443", "text": "async function getCoords(city) {\n // Set the api in variable\n const apiURL = `https://geocode.xyz/${city}?json=1`;\n\n // Await both the fetch and json calls\n const response = await fetch(apiURL);\n const jsonData = await response.json();\n\n // *** Below console.log is for testing purposes ***\n // console.log(jsonData);\n\n // save the latitude and longitude coordinates in variables\n const latitude = jsonData.latt;\n const longitude = jsonData.longt;\n const cityName = jsonData.standard.city;\n\n // Log the city, latitude, and longitude to console\n console.log(`${cityName} has a latitude of ${latitude} and longitude of ${longitude}.`);\n\n}", "title": "" }, { "docid": "0d1a623b2458c7e474a32b306001ea6f", "score": "0.6225054", "text": "function callLocation() {\n var locationApi = \"https://api.geoapify.com/v2/places?categories=pet&filter=circle:\" + lat + \",\" + lon + \",20000&limit=20&apiKey=3b4a9f7da30e4c01940be99d78ea8f34\";\n //var locationApi = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\" +lat +\",\" + lon+ \"&radius=1500&type=animal_shelter&key=AIzaSyAsS5MK-sagl9FEdNRBtmu1OzFlAmZBV3Y\"\n\n\n fetch(locationApi)\n .then(function (response) {\n if (response.ok) {\n response.json().then(function (data) {\n console.log(data)\n });\n }\n })\n .catch(function () {\n console.log('Unable to connect'); \n }); \n }", "title": "" }, { "docid": "3e714bed6340571aa26cf7f8d8ddf43f", "score": "0.62108034", "text": "async getCoordinates() {\n\n this.setState({isLoading: true});\n\n const params = {\n ids: [this.state.game.local[0]],\n fields: ['coordenadas'],\n };\n const response = await this.props.odoo.get('ges.local', params);\n if (response.success && response.data.length > 0) {\n\n const coordinates = response.data[0].coordenadas;\n\n if(coordinates !== false) {\n\n const latitude = parseFloat(coordinates.split(\", \")[0]);\n const longitude = parseFloat(coordinates.split(\", \")[1]);\n\n this.setState({isLoading: false});\n\n return {\n latitude: latitude,\n longitude: longitude\n }\n }\n }\n\n this.setState({isLoading: false});\n return undefined;\n }", "title": "" }, { "docid": "495e96fce78ccd613f1195ab4dd06424", "score": "0.6179842", "text": "async function getCoordinates(data) {\n const encoded = encodeURI(data);\n\n const googleGeoCodingApiBase = config.googleGeoCodingApiBase;\n\n const apiData = await axios.get(\n `${googleGeoCodingApiBase}${encoded}&key=${googleApiKey}`\n );\n\n const returnObject = apiData.data.results[0];\n //.geometry.location;\n\n if (!apiData) return console.log('Could not find location');\n\n //return apiData;\n return returnObject;\n}", "title": "" }, { "docid": "03b51313f316659f208cd8deeb7112f5", "score": "0.61763763", "text": "function successFunction(position)\n{\n var lat = position.coords.latitude;\n var lng = position.coords.longitude;\n codeLatLng(lat, lng);\n //console.log(app.localityObj.locality);\n}", "title": "" }, { "docid": "a3d6934216df005a8f048a6af2364ac2", "score": "0.61683166", "text": "function grabCoords() {\r\n fetch('http://localhost:3002/coords')\r\n .then((res) => {\r\n return res.json();\r\n })\r\n .then((data) => {\r\n points = data;\r\n });\r\n}", "title": "" }, { "docid": "b90ddf607f7f5b2761dd9732705bc22e", "score": "0.61578596", "text": "function getLatlng(placeIdInput) {\n console.log('start get lat lng function');\n //potential firewall situation with using a work laptop. Still need to determine the why\n const proxyurl = \"https://cors-anywhere.herokuapp.com/\"\n const searchUrl = 'https://maps.googleapis.com/maps/api/geocode/json'\n\n const params = {\n place_id: placeIdInput,\n key: googleApiKey\n };\n // console.log(params);\n\n const queryString = formatQueryParams(params)\n const url = searchUrl + '?' + queryString;\n // console.log(proxyurl + url);\n \n fetch(proxyurl + url)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => {\n console.log(responseJson);\n let locationLat = responseJson.results[0].geometry.location.lat;\n let locationLon = responseJson.results[0].geometry.location.lng;\n console.log(`top result lat: ${locationLat} and lon: ${locationLon}`);\n let latlonArray = [locationLat, locationLon];\n getHikes(latlonArray[0], latlonArray[1]);\n })\n .catch(err => {\n $('#js-error-message').text(`Something went wrong: ${err.message}`);\n });\n \n}", "title": "" }, { "docid": "9d82483684cb2975599ee865255cfef5", "score": "0.6151821", "text": "function reverse_geocoding(loc, callback){\n var lat = loc.lat;\n var long = loc.long;\n $.ajax({\n method: \"get\",\n url: \"http://www.mapquestapi.com/geocoding/v1/reverse?key=???keymapquestAPI&location=\"+ lat + \",\" + long + \"&includeRoadMetadata=true&includeNearestIntersection=true\",\n success:function(data) {\n return callback(data.results[0].locations[0]);\n },\n error:function(data) {\n alert(data.error);\n }});\n}", "title": "" }, { "docid": "d5b54a950c2e557c1a61b7d489f03ba6", "score": "0.6083087", "text": "async function getCoOrdinates(req, res) {\n // console.log('got ya boi')\n const googleGeoURL = 'https://maps.googleapis.com/maps/api/geocode/json?'\n const address = req.body.address\n try {\n const response = await axios.get(googleGeoURL, { params: { key: apiKey, address: address } })\n const data = response.data.results[0].geometry.location ///\n res.json(data)\n } catch (err) {\n console.log(err)\n }\n}", "title": "" }, { "docid": "1d406a1762e8ccba212aaea344b5ce3d", "score": "0.60725075", "text": "function saveLatLngPoint (lat, lng, outerCallback) {\n console.log('start process');\n async.parallel({\n price: function (callback) {\n uber.getPrice(lat, lng, undefined, undefined, function (priceData) {\n callback(undefined, priceData);\n });\n },\n time: function (callback) {\n uber.getTime(lat, lng, function (timeData) {\n callback(undefined, timeData);\n });\n }\n }, function (err, results) {\n var priceData = results.price;\n var timeData = results.time;\n store.storeGeo({\n lat: lat,\n lng: lng,\n time: {\n priceData: priceData.prices,\n timeData: timeData.times\n }\n }, function () {\n outerCallback();\n });\n });\n}", "title": "" }, { "docid": "d5d338366c32710555b5362d909bb3eb", "score": "0.6048325", "text": "function getCoordinates(URL, callback) {\n https.get('https://api.clyp.it/'+URL, function(res) {\n res.setEncoding('utf8');\n res.on('data',function(data) {\n var results = [];\n data = JSON.parse(data);\n results.push(data.Latitude, data.Longitude);\n callback(null, results);\n });\n });\n}", "title": "" }, { "docid": "411d732f4304408113b3dcbb14c7f49b", "score": "0.60468274", "text": "async function makeFetchLocation() {\r\n let coords = [];\r\n for (place of places) {\r\n await fetch(\r\n encodeURI(\r\n `https://maps.googleapis.com/maps/api/geocode/json?address=${\"мариуполь \" +\r\n place.name}&key=AIzaSyAfaEcMF7iaeuaK0VT8POocFReZ7IJ-LdQ`\r\n )\r\n )\r\n .then(res => res.json())\r\n .then(data => {\r\n let coord = data.results[0].geometry.location;\r\n place.markerPosition = [coord.lat, coord.lng];\r\n parseInfo(place);\r\n })\r\n .catch(err => {\r\n console.log(err);\r\n });\r\n }\r\n} //end function makeFetchLocation()", "title": "" }, { "docid": "0c8d74fda6b8a14c7f9bf6417c671a32", "score": "0.6043744", "text": "function airportForLocationRequest(userLocationLat, userLocationLng, cbname) {\n var apiKey = \"ef10b5c731760c11accfe4ac5e84e900\";\n var url =\"https://airport.api.aero/airport/nearest/\" + userLocationLat + \"/\" + userLocationLng +\n \"?maxAirports=5&user_key=\" + apiKey + \"&callback=\" + cbname;\n var xhr = new XMLHttpRequest();\n var script = document.createElement('script');\n script.src = url;\n document.querySelector('head').appendChild(script);\n}", "title": "" }, { "docid": "42831eee4cf618dee346ca166122640a", "score": "0.6034192", "text": "async function getLocation(){\r\n const resp = await fetch(apiUrl);\r\n const data = await resp.json();\r\n const {latitude,longitude,altitude} = data;\r\n marker.setLatLng([latitude,longitude])\r\n //mymap.setView([latitude,longitude], mymap.getZoom());\r\n lat.innerText = latitude;\r\n long.innerText = longitude;\r\n alti.innerText = altitude;\r\n\r\n}", "title": "" }, { "docid": "8305e8a51501c6770eef344559c43123", "score": "0.6027804", "text": "async function findLatLong () {\n showLoadingSpinner();\n const apiUrl = 'http://api.open-notify.org/iss-now.json'\n try {\n const response = await fetch (proxyUrl + apiUrl);\n const data = await response.json();\n // Places coordinates in text\n document.getElementById('placeCoords').innerHTML = 'Latitude: ' + data.iss_position.latitude + '<br>Longitude: ' + data.iss_position.longitude;\n //Hide Loader\n hideLoadingSpinner()\n //Initializes marker on map\n if (counter === 0){\n counter++;\n mymap.flyTo([data.iss_position.latitude, data.iss_position.longitude], 2);\n marker.setLatLng([data.iss_position.latitude, data.iss_position.longitude]).update();\n marker.addTo(mymap);\n console.log('Initializing')\n } else {\n // Updates marker on map\n mymap.flyTo([data.iss_position.latitude, data.iss_position.longitude], 2);\n marker.setLatLng([data.iss_position.latitude, data.iss_position.longitude]).update();\n console.log('Updating')\n }\n return data\n } catch (error) {\n console.log (error)\n }\n}", "title": "" }, { "docid": "810481032d594575dc2ca71f4ed71fca", "score": "0.602305", "text": "function getPointsOnMap(callback){\n $.ajax({\n url:\"/maps/\"+mapId+\"/points\",\n method:\"GET\",\n success: function(data){\n callback(data);\n },\n error: function(err){\n }\n })\n}", "title": "" }, { "docid": "22a6f7a21b1ab180f7e01450aa6bf80c", "score": "0.59992045", "text": "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 }", "title": "" }, { "docid": "36e30349cdf606c30aba06752204aa54", "score": "0.59981716", "text": "function geocoder(addressTxt) {\n $.ajax({\n url: \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + addressTxt + \"&key=AIzaSyDvMk0f3LfIKcsMM-iJ_wkRL5DVjCTR-70\",\n method: \"GET\"\n }).then(function(response) {\n var latLongURL;\n var locationLat = response.results[0].geometry.location.lat;\n latLongURL = \"near=\" + locationLat + \",\";\n var locationLong = response.results[0].geometry.location.lng;\n console.log(\"the geocoder returned: \" + locationLat + \",\" + locationLong);\n latLongURL = latLongURL + locationLong + \"&radius=0.5\";\n initMap(latLongURL);\n })\n}", "title": "" }, { "docid": "cc49cba63b25cee78b48ec80329999f6", "score": "0.59696794", "text": "function getLatLngByZipcode() {\n $.ajax({\n method: \"GET\", \n url: \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + zipCode + \"&key=AIzaSyCHUllvvIE1AweiwvXJOCvxq5DmtUhv1Cw\",\n \n }).then(response =>{\n console.log(response); \n latitude = response.results[0].geometry.location.lat; \n longitude = response.results[0].geometry.location.lng; \n console.log(latitude, longitude); \n getRestaurants(latitude, longitude); \n })\n \n}", "title": "" }, { "docid": "e06c90c7417ef9677dde624c0a5669a9", "score": "0.595964", "text": "function geoFindMe()\n {\n return new Promise(function(resolve,reject){\n\n\n\n if (!navigator.geolocation){\n alert(\"Sorry Your browser donot support navigator\")\n return;\n }\n\n function success(position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n\n console.log(\"longitude is:\"+longitude)\n console.log(\"latitude is:\"+latitude)\n var img = new Image();\n img.src = \"https://maps.googleapis.com/maps/api/staticmap?center=\" + latitude + \",\" + longitude + \"&zoom=13&size=300x300&sensor=true\";\n resolve(\"done\")\n }\n\n function error() {\n alert(\"Sorry some error on the server side\")\n reject(new Error(\"could no track location\"))\n }\n\n\n navigator.geolocation.getCurrentPosition(success, error);\n\n } )\n }", "title": "" }, { "docid": "2ddde2f9715d053e84724059bd7fc132", "score": "0.5959282", "text": "getGeocodedLocation () {\n let location = this.userLocation;\n\n return new Promise((resolve, reject) => {\n if (!this.userLocationGeocoded) {\n this.requestGocodedAddress(location)\n .then((result) => {\n this.userLocationGeocoded = result;\n resolve();\n }, reject);\n } else {\n resolve();\n }\n });\n }", "title": "" }, { "docid": "c4f2c75fddac565bcc9140a752cfb6e2", "score": "0.595924", "text": "async getCoors(address) {\n try {\n let geocodeAddress = `https://maps.googleapis.com/maps/api/geocode/json?address=${address}&key=${process.env.API_GM_KEY}`\n const rawData = await fetch(geocodeAddress);\n const data = await rawData.json();\n const lat = data.results[0].geometry.location.lat;\n const lng = data.results[0].geometry.location.lng;\n console.log(data);\n return await {\"lat\": lat, \"long\" : lng};\n } catch (error) {\n return new Error(`Wild ERROR occured, can't get LocObj. Details: ${error}`);\n }\n }", "title": "" }, { "docid": "a2cfef56def1009c42b76dc625be15b2", "score": "0.5955714", "text": "function getRoutesLatLon() {\n const minDiff = $('#js-search-minDiff option:selected').val();\n const maxDiff = $('#js-search-maxDiff option:selected').val();\n const params = {\n key: API[1].key,\n lat: latArray[0][0],\n lon: lonArray[0][0],\n minDiff: minDiff,\n maxDiff: maxDiff\n };\n\n const queryString = formatMountainProjectParams(params);\n const url = API[1].searchURL + '?' + queryString;\n\n // prints the Mountain Project API request URL to the console\n console.log('Mountain Project GET request: ' + url);\n console.log('Searching for boulder problems');\n\n fetch(url)\n .then(response => response.json())\n .then(responseJson => pushToResultsArray(responseJson))\n .catch(error => {\n $('#js-error-message').text(`Something went wrong: ${error.message}`);\n $('').removeClass('hidden');\n });\n}", "title": "" }, { "docid": "daeab9ab0178ec2f26e63a6c0ac84ef4", "score": "0.5949724", "text": "async function getGeofenceCoords(id, httpres) {\n axios.get(\n `https://api.radar.io/v1/geofences/users/${id}`,\n {headers: {Authorization: `${properties.radarSecret}`}}\n ).\n then(res => {\n console.log(res.data.geofence.geometryCenter.coordinates);\n httpres.send({\n lo: res.data.geofence.geometryCenter.coordinates[0],\n la: res.data.geofence.geometryCenter.coordinates[1],\n });\n }).\n catch(err => {\n console.log(err);\n httpres.send({message: error});\n });\n}", "title": "" }, { "docid": "67f3efed60486f589b2237cda3ad0322", "score": "0.5935698", "text": "async function getCoordinates(city){\n var url = coordinatesEndPoint.replace('@@city@@', city);\n var demographicInfo = await apiHelper.simpleGetRequest(url);\n if(demographicInfo){\n var coordinates = {};\n if(demographicInfo.features.length > 0){\n coordinates.latitude = demographicInfo.features[0].center[0];\n coordinates.longitude = demographicInfo.features[0].center[1];\n return coordinates;\n }\n }\n return null;\n}", "title": "" }, { "docid": "0009ba6a3a9b144239b7419e549cf502", "score": "0.5934315", "text": "function geocode(address, callback) {\n $.ajax({\n url: 'https://maps.googleapis.com/maps/api/geocode/json?address=' + encodeURI(address) + '&key=AIzaSyBWb7yvtzkK3Tgpt_-PnWhaW2OhQ99Rv3k',\n dataType: 'json',\n timeout: 30 * 1000\n })\n .done(function (data) {\n callback(data.results[0].geometry.location.lat, data.results[0].geometry.location.lng);\n })\n .fail(function () {\n alert('Geocode was not successful!')\n })\n}", "title": "" }, { "docid": "b894901c92f549544f4a94e1af5f35a8", "score": "0.5928499", "text": "async function getObservations ( url, lat , long ) {\n\n let response = await fetch( url + new URLSearchParams({\n latitude: lat,\n longitude: long,\n }));\n\n if (!response.ok) {\n\n let message = `An error has occured: ${response.status}`;\n throw new Error(message);\n\n }\n\n let data = await response.json();\n return data;\n\n}", "title": "" }, { "docid": "9b5a4109b2191dccb362c2dd9db85575", "score": "0.59216547", "text": "function handleGetLatLon(loc) {\n if ($(\"#pulldown :selected\").val() == 3) {\n console.log(\"Location Received\");\n ////////////////////\n // First fetch to obtain both lat and lons\n ////////////////////\n fetch(`${BASE_URL1}${$inputaddr1.val()}&location=${$inputaddr2.val()}&key=${API_KEY1}`)\n .then((response => {\n return response.json();\n }))\n .then(function(data) {\n let results = data.results\n console.log(results)\n LAT1 = results[0].locations[0].latLng.lat\n LON1 = results[0].locations[0].latLng.lng\n LAT2 = results[1].locations[0].latLng.lat\n LON2 = results[1].locations[0].latLng.lng\n latlonMath()\n \n ////////////////////\n // After obtaining averaged lat and lon, obtain State to feel into edm train api\n ////////////////////\n fetch(`${BASE_URL1_reverse}key=${API_KEY1}&location=${aveLat}%2C${aveLon}&outFormat=json&thumbMaps=false`)\n .then((response => {\n console.log(`${BASE_URL1_reverse}key=${API_KEY1}&location=${aveLat}%2C${aveLon}&outFormat=json&thumbMaps=false`)\n return response.json();\n }))\n .then(function(data) {\n let results = data.results\n console.log(results)\n shortstate = results[0].locations[0].adminArea3\n STATE = state_obj[shortstate]\n urlbuild()\n handleGetData();\n })\n })\n \n .catch(function(error) {\n console.log('bad request: ', error)\n })\n }\n}", "title": "" }, { "docid": "32f790c0e00cd73245b57be871377596", "score": "0.5905048", "text": "function appelAjax(point)// requête ajax vers l'api\n{\n return $.ajax\n\t({\n \turl: \"https://nominatim.openstreetmap.org/search\", // URL de Nominatim, service qui transforme une adresss en coordonnée GPS\n \ttype: 'get', // Requête de type GET\n \tdata: \"q=\"+point+\"&format=json&addressdetails=1&limit=1&polygon_svg=1\", // reponse de la requête sous forme json\n \tasync : false\n\t})\n}", "title": "" }, { "docid": "87f75d278e5c211ebd5b7ee74314f9ab", "score": "0.58879423", "text": "function requestLocations() {\n $.ajax({\n url: LOCATIONS_REAST_URL,\n data: { center: CENTER, range: RANGE },\n method: \"GET\",\n contentType: \"json\",\n dataType: \"json\",\n success: function (data) {\n tracker.trackAll(data);\n }\n });\n}", "title": "" }, { "docid": "7f234c79f1acefb3ce480dbae573b955", "score": "0.58713186", "text": "async function getLngLat(location) {\n var key = \"p5nE7vpUu74Flga2vPKXuMiGm6moHthA\";\n var url = `http://open.mapquestapi.com/geocoding/v1/address?key=${key}&location=${location}`;\n var method = \"POST\";\n\n var res = await fetch(url, {\n method: method\n });\n\n if (!res.ok) {\n throw Error(res.statusText);\n }\n\n var json = await res.json();\n latLng = json.results[0].locations[0].latLng;\n\n return latLng;\n}", "title": "" }, { "docid": "d5f5ecb62a91dfd8196f6376f70ea726", "score": "0.5868616", "text": "async getGeolocation() {\n const response = await fetch(`https://api.opencagedata.com/geocode/v1/geojson?q=${this.city},${this.state}&key=${this.geolocationApiKey}\n `);\n // Grab the response data\n const responseData = await response.json();\n return responseData.features[0].geometry.coordinates\n }", "title": "" }, { "docid": "8067974ed7f27d2e2f7ddfa365238653", "score": "0.58615464", "text": "async function fetchCity(city) {\n\n const res = await fetch(`https://geocode.xyz/${city}?json=1`);\n const data = await res.json();\n console.log(`Place Name: ${city} Longiture: ${data.longt} Latitude: ${data.latt}`);\n\n}", "title": "" }, { "docid": "a995479cbaa71c064eafd7e02b2bb433", "score": "0.5856769", "text": "async function getLocation(loc, user = process.env.GEONAMES_KEY) {\n const res = await fetch(`http://api.geonames.org/searchJSON?formatted=true&q=${loc}&username=${user}`)\n try {\n const data = await res.json()\n const location = {\n lat: data.geonames[0].lat,\n lng: data.geonames[0].lng,\n cn: data.geonames[0].countryName\n }\n return location\n } catch (e) {\n console.log(`Error while fetching api in getLocation func: \\n${e}`)\n }\n}", "title": "" }, { "docid": "a3eb4c660c181e497b981968d3ade3a4", "score": "0.58288187", "text": "function getLocations(access_token, bbox) {\n return new Promise(function (resolve, reject) {\n axios.get(metadataUrl + '/locations/search?q=locationType:WALKWAY&bbox=' + bbox + '&page=0&size=20',\n {\n headers: {\n \"Authorization\": 'Bearer ' + access_token,\n \"Predix-Zone-Id\": 'SDSIM-IE-TRAFFIC'\n }\n }\n )\n .then(function (results) {\n return new Promise(function (resolve, reject) {\n var promises = [];\n for (i in results.data.content) {\n promises.push(getLocPed(access_token, results.data.content[i].locationUid));\n\n Promise.all(promises)\n .then(function(data) {\n\n _.merge(results.data.content, data);\n resolve({\"access_token\":access_token, \"locations\": results.data.content});\n })\n .catch(function(err) {\n console.log(err);\n reject(err);\n })\n }\n\n })\n .then(function (data) {\n resolve(data);\n })\n .catch(function( err) {\n console.log(err);\n resolve(err);\n })\n })\n .catch(function (error) {\n reject(error);\n })\n });\n}", "title": "" }, { "docid": "37104d21b959962102b60e4b0b28d4d8", "score": "0.5824232", "text": "getAddressOfLatLng(lat, lng, notify) {\n let api_url = this.pythonEndpoint + \"geocoding?\" + \"lon=\" + lng + \"&lat=\" + lat;\n this.initializeModelCollection(api_url);\n let StatsRow = new this.StatsModelDef({}, this.Stats);\n\n StatsRow.fetch({\n headers: {\n 'Content-Type': 'application/json'\n },\n success: function (coll, data) {\n notify(true, data);\n },\n error: function (model, xhr, options) {\n \n notify(false, `Error Code: ${xhr.status}, msg:${options.textStatus} `);\n }\n });\n }", "title": "" }, { "docid": "f177ae62fa8e298969bdb61817806abd", "score": "0.5817376", "text": "function getLocationGeocode() {\n const location = $('#js-search-location').val();\n const params = {\n key: API[0].key,\n location: location\n };\n\n const queryString = formatGeocodingParams(params);\n const url = API[0].searchURL + '?' + queryString;\n\n // prints the MapQuest API request to the console\n console.log('MapQuest GET request: ' + url);\n console.log('Geocoding your location')\n \n fetch(url)\n .then(response => response.json())\n .then(responseJson => pushToSearchArray(responseJson))\n .catch(error => {\n $('#js-error-message').text(`Something went wrong. ${error.message}`);\n $('#error-container').removeClass('hidden');\n });\n}", "title": "" }, { "docid": "a1d34f8cf3026e9171f609ea9ff4e41c", "score": "0.5815361", "text": "getSearchPlaces(res) {\n let lok = res[0].geometry.location\n let respos = { lat: lok.lat(), lon: lok.lng() }\n this.props.updatePos(respos)\n }", "title": "" }, { "docid": "35a976898237cb9e512f3b33a9dc9330", "score": "0.58138585", "text": "function getLatLong(zip){\n fetch (\"https://maps.googleapis.com/maps/api/geocode/json?address=\"+zip+\"&key=AIzaSyAqHEFAOikP1X73U_trS-aQvjiqcXKWSHs\")\n .then(response=>response.json())\n .then(responseJson=>getResults(responseJson))\n}", "title": "" }, { "docid": "2f29fe67eda007dc84294c924dd457f2", "score": "0.5811436", "text": "function getCoordinatesPromise(city) {\n var gMapsUrl = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + city;\n \n return requestPromise(gMapsUrl)\n .then(function(gmapsData) {\n gmapsData = JSON.parse(gmapsData);\n\n var userLat = gmapsData.results[0].geometry.location.lat;\n var userLon = gmapsData.results[0].geometry.location.lng;\n\n return {lat: userLat, lon: userLon};\n });\n}", "title": "" }, { "docid": "09c9661b039b6dd3e7f9047e65aa7d25", "score": "0.5808908", "text": "async function get_address(){\n\tvar num = document.getElementById(\"result\").value;\n\tvar table = document.getElementById(\"query_table\");\n\tif(num < 1 || table.rows[num]== undefined) return;\n\tvar address = table.rows[num].cells[3].innerHTML;\n\tconsole.log(address);\n\tvar coords = await geocode(address);\n\t//console.log(coords[0] + \" \" + coords[1]);\n\tinitMap(coords[0],coords[1],coords[2]);\n}", "title": "" }, { "docid": "a4a8cadf40538e61ba7b7e4a50e82be3", "score": "0.5806117", "text": "function retrieveLocations(latLng){\n resetResults();\n $('#loading-spinner').removeClass('hidden');\n $.ajax({\n url: '/locate/get/',\n type: \"GET\",\n data: 'lat=' + latLng.lat() + '&lon=' + latLng.lng() + '&radius=' + $('#search-radius-select').val(),\n success: function(data){\n response = JSON.parse(data);\n currentProviders = response.providers;\n if(response.providers.length < 1){\n $('#locations-noresults-alert').removeClass('hidden');\n $('#locations-newradius').addClass('hidden');\n } else {\n $('#locations-newradius').removeClass('hidden');\n }\n showProviders(response.providers);\n $('#loading-spinner').addClass('hidden');\n },\n error: function(data){\n locationsError('An unexpected error has occurred, please try again.');\n $('#loading-spinner').addClass('hidden');\n $('#locations-noresults-alert').addClass('hidden');\n $('#locations-newradius').addClass('hidden');\n },\n });\n}", "title": "" }, { "docid": "446b102aabf9123fd8926ca13089b488", "score": "0.5802127", "text": "function gotPost(position){\n let info = document.getElementById('info');\n let p = document.createElement('p'); \n currentLat = position.coords.latitude;\n currentlng = position.coords.longitude;\n buildMyMap(position);\n p.textContent = \"Your lat is \" + currentLat + \" and lng is \" + currentlng + '.' ; \n info.appendChild(p);\n const KEY= 'AIzaSyDqaIZXk5oph6al8EfUF1dOEWFP--mSCqc'\n let LAT = currentLat;\n let LNG = currentlng;\n let url = `https://maps.googleapis.com/maps/api/geocode/json?latlng=${LAT},${LNG}&key=${KEY}`;\n\n fetch(url)\n .then(response => response.json())\n .then( data => {\n let info = document.getElementById('info');\n let p = document.createElement('p'); \n p.textContent = \"Your formatted address is \" + data.results[0].formatted_address + '.';\n info.appendChild(p); \n })\n .catch(err => console.warn(err.message));\n}", "title": "" }, { "docid": "5fe1616689708145a1cce4124e1ea995", "score": "0.5797691", "text": "function CoordsToMap(){\n if($(\"#trackname\").val() === \"\"){\n $(\"#trackname\").attr(\"placeholder\",\"WRITE A VALID TRACK NAME\")\n $(\"#failed\").show();\n $(\"#found\").hide();\n return;\n }\n $.post(\"/locations/mapLocations\",{trackId:$(\"#trackname\").val()}).\n done(function(res) {\n if(res.status === \"success\" && res.data.length > 0){\n $(\"#failed\").hide();\n $(\"#found\").show();\n initMap();\n //If sucess add pointers to map\n trackArray = JSON.parse(JSON.stringify(res.data));\n console.log(trackArray)\n for (trackLine in trackArray) {\n console.log(trackArray[trackLine])\n var pos = new google.maps.LatLng(trackArray[trackLine].latitude\n ,trackArray[trackLine].longitude); \n placeMarker(pos,map,false) \n }\n }else{\n $(\"#trackname\").attr(\"placeholder\",\"WRITE A VALID TRACK NAME\")\n $(\"#found\").hide();\n $(\"#failed\").show();\n }\n });\n}", "title": "" }, { "docid": "de3b6543d2f0bf93c36e53c12613b97e", "score": "0.5797142", "text": "function success(position) {\n setTimeout(isTag, 500);\n var currLat = position.coords.latitude;\n var currLon = position.coords.longitude;\n var currLocation = `https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=${currLat}&longitude=${currLon}&localityLanguage=en`;\n\n $.ajax({\n url: currLocation,\n method: \"GET\"\n }).then(function (response) {\n var currCity = response.localityInfo.administrative[response.localityInfo.administrative.length - 1].name;\n getData(currCity);\n });\n }", "title": "" }, { "docid": "03c70c4264435220b5f88464e682dbf5", "score": "0.57971215", "text": "async function m(m,p,a){p=_support_OffsetParameters_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].from(p);const i=Object(_tasks_operations_offset_js__WEBPACK_IMPORTED_MODULE_4__[\"offsetToRESTParameters\"])(p),n=Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__[\"parseUrl\"])(m),j={...n.query,f:\"json\",...i},u=p.geometries[0].spatialReference,c=Object(_utils_js__WEBPACK_IMPORTED_MODULE_2__[\"asValidOptions\"])(j,a);return Object(_request_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(n.path+\"/offset\",c).then((({data:e})=>(e.geometries||[]).map((e=>Object(_geometry_support_jsonUtils_js__WEBPACK_IMPORTED_MODULE_1__[\"fromJSON\"])(e).set({spatialReference:u})))))}", "title": "" }, { "docid": "e6493039d22c5589b173deeacba29d67", "score": "0.5789497", "text": "getCoordinates(searchTerm) {\n\t\tvar reGeocodeUrl = `https://www.mapquestapi.com/geocoding/v1/address?key=BItCZXXNbczFUj0Dd7g6GiQ8AxTmxC77&location=${searchTerm ? searchTerm : 'Brooklyn'}`;\n\n\t\treturn new Promise ((resolve, reject) => {axios.get(reGeocodeUrl)\n\t\t.then(res => {\n\t\t\tvar newLatitude = res.data.results[0].locations[0].latLng.lat;\n\t\t\tvar newLongitude = res.data.results[0].locations[0].latLng.lng;\n\t\t\tresolve({'latitude': newLatitude, 'longitude': newLongitude});\n\t\t})\n\t\t.catch(err=>console.log(err));\n\t});\n\t}", "title": "" }, { "docid": "3f94d75a9f99f8db9a7051fcd520ea02", "score": "0.5785504", "text": "function findCoords() {\n let cityField = document.getElementById(\"city\");\n let ddstate = document.getElementById(\"state\");\n \n let city = cityField.value;\n let state = ddstate.options[ddstate.selectedIndex].value;\n\t\tif (city) {\n\t\t\tlet url = \"https://us1.locationiq.com/v1/search.php?key=eb122602cf386b&format=json\" +\n\t\t\t\"&state=\" + state + \"&city=\" + city;\n\n\t\t\tfetch(url)\n\t\t\t\t.then(checkStatus)\n\t\t\t\t.then(function(responseText) {\n\t\t\t\t\tlet json = JSON.parse(responseText);\n\t\t\t\t\tlet lat = json[0][\"lat\"];\n\t\t\t\t\tlet lon = json[0][\"lon\"];\n\t\t\t\t\tgetData(lat, lon);\n\t\t\t\t});\n\t\t}\n }", "title": "" }, { "docid": "487aadc25e1ad30acb8fb61bc59bfbca", "score": "0.5779193", "text": "function geoCoding(city) {\n //whatever the name is from the button that has been clicked\n var geocodingRequest = \"https://maps.googleapis.com/maps/api/geocode/json?address=\";\n geocodingRequest += city;\n geocodingRequest += \"&key=AIzaSyD6ro8ednBUBnAeYhcjizzp3NvEqFCScNs\";\n $.ajax({\n url: geocodingRequest,\n method: 'GET',\n }).then(function (response) {\n geoLocation = response.results[0].geometry.location;\n mapSetCenter(geoLocation);\n });\n}", "title": "" }, { "docid": "ffac70ecf3fdc2a3bb489df6a2e610a3", "score": "0.5762051", "text": "async function getPoints(pointType) {\n\tlet url = `http://localhost:3000/data/${pointType}`;\n\tconsole.log(`API Endpoint: ${url}`);\n\n\t// Declare Variables to assign values to.\n\tlet latitude;\n\tlet longitude;\n\tlet location;\n\tlet dataName;\n\tlet Names = [];\n\tlet posX = [];\n\tlet posZ = [];\n\tlet posY = [];\n\tlet posXYZ = [];\n\n\t// Execute fetch request + store through promises.\n\tconst response = await fetch(url);\n\tconst json = await response.json();\n\n\t// As JSON file is delivered as an object from the open NYC datastore, need to\n\t// parse correctly.\n\tconst entries = Object.entries(json);\n\n\t// Loop through JSON to extract values.\n\tfor (const [key, val] of entries) {\n\t\t//console.log(`There are ${value} of ${key}`);\n\n\t\t// JSON object has meta subobject and data subobject. We need to loop through the data.\n\t\tif (key == 'data') {\n\t\t\tfor (let [index, entry] of Object.entries(val)) {\n\t\t\t\t//console.log(`Entry: ${entry}, Ind: ${index}`);\n\n\t\t\t\t// Assign location and data name to variables. This is hard coded, but can be soft coded.\n\t\t\t\t// by parsing through the meta data and using if loops to determine index of where location etc is.\n\t\t\t\tlocation = entry[11];\n\t\t\t\tdataName = entry[10];\n\n\t\t\t\t//console.log(`Location: ${location}, Value/Name: ${dataValue}/${dataName}`);\n\n\t\t\t\t// Location data is stored as 'POINT(-70.56456 42.243524543)' and such we need to extract the lat/lon from this.\n\t\t\t\t// This is done using String RegExpressions.\n\t\t\t\tlocation = location.replace(/[^0-9.+-\\s]/g, '');\n\t\t\t\tlocation = location.split(' ');\n\n\t\t\t\t// Starts from 1 as first entry is the initial space.\n\t\t\t\tlatitude = parseFloat(location[2]);\n\t\t\t\tlongitude = parseFloat(location[1]);\n\t\t\t\t//console.log(`Latitude: ${latitude}, Longitude: ${longitude}`);\n\n\t\t\t\t// Store lat/lon pair in array and calculate cartesian position for use in AFrame environment.\n\t\t\t\tlet lonlat = [longitude, latitude];\n\t\t\t\tlet cartesian = getCoordsFromCenter(mapCenter, lonlat);\n\t\t\t\tlet positionX = cartesian.y;\n\t\t\t\tlet positionZ = -cartesian.x; //Not sure why this is x/y reverse? but it works.\n\t\t\t\tlet positionY = 0;\n\t\t\t\t//console.log(`AFrame Z Position: ${positionZ}, AFrame X Position: ${positionX}`);\n\n\t\t\t\tposX.push(positionX);\n\t\t\t\tposZ.push(positionZ);\n\t\t\t\tposY.push(positionY);\n\t\t\t\tlet row = [positionX, positionY, positionZ];\n\t\t\t\tposXYZ.push(row);\n\t\t\t\tNames.push(dataName);\n\t\t\t}\n\t\t}\n\t}\n\tlet position = {\n\t\txyz: posXYZ,\n\t\tname: Names\n\t}\n\treturn position;\n}", "title": "" }, { "docid": "aaa6eaa82d78cd55603b5d3c15834fc7", "score": "0.5761179", "text": "function address_latlng(address){\n $('#spinner').show();\n geocoder.geocode( { 'address': address, 'region': 'mx',}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n var latitude = results[0].geometry.location.lat();\n var longitude = results[0].geometry.location.lng();\n document.getElementById('organization_lat').value = latitude;\n document.getElementById('organization_lng').value = longitude;\n clearOverlays(latitude, longitude);\n\n } \n });\n $('#spinner').hide();\n }", "title": "" }, { "docid": "7c20de4f732c5eb247032d1fa42fd285", "score": "0.57564574", "text": "function getlocation(lon, lat) {\n const api = `https://eu1.locationiq.com/v1/reverse.php?key=89f8c869ce6281&lat=${lat}&lon=${lon}&format=json`\n\n fetch(api)\n .then(response => {\n return response.json()\n })\n .then(data => {\n\n const dataGrap = data.address;\n console.log(dataGrap)\n weather.location = dataGrap.city + \", \" + dataGrap.state\n\n console.log(weather)\n\n setDOM();\n })\n}", "title": "" }, { "docid": "6dc4e2835eb40950855ebc006114e253", "score": "0.57534415", "text": "function getLocationAddress(lat, lon) {\n $.ajax({\n url: `https://maps.googleapis.com/maps/api/geocode/json?latlng=${lat},${lon}&sensor=true`,\n success: function(data) {\n parseLocation(data);\n },\n error: function(jqXHR, textStatus, errorThrown) {\n console.log(textStatus);\n }\n });\n}", "title": "" }, { "docid": "0615628c2fa27d434b70e754f1aff484", "score": "0.57478946", "text": "function userSearch() {\n let searchInput = $('#form1').val()\n geocode(searchInput, mapboxToken).then(function (results){\n coord = [results[1], results[0]]\n weather()\n })\n }", "title": "" }, { "docid": "546eb0867a49a54cad0f1673712b2d18", "score": "0.57387304", "text": "async getLocation(){\n const response = await fetch(this.api_url); \n const res = await response.json(); \n const loc_res = res.results[0].geometry.location\n const res_location = `${loc_res.lat},${loc_res.lng}`\n console.log(\"location from Google: \"+res_location)\n return res_location;\n }", "title": "" }, { "docid": "5e9690934d758950500919b852c0d865", "score": "0.57371485", "text": "async function SearchForLocations() {\n let locationService = new location.LocationService(\n process.env.MICRO_API_TOKEN\n );\n let rsp = await locationService.search({\n center: {\n latitude: 51.511061,\n longitude: -0.120022,\n },\n numEntities: 10,\n radius: 100,\n type: \"bike\",\n });\n console.log(rsp);\n}", "title": "" }, { "docid": "e67f0e0c9b117e65cb38b300dbedb566", "score": "0.573404", "text": "async function getGpsData(gps) {\n\n // Create a string that contains latitude and longitude coordinates\n const gpsString = gps.latitude.toString() + ',' + gps.longitude.toString();\n \n // Create a new client to search for a location\n const client = new Client.Client({});\n\n // Attempt to find location based on latitude and longitude\n let response;\n try {\n response = await client.reverseGeocode({\n params: {\n latlng: gpsString,\n key: process.env.MAP_API_KEY\n },\n timeout: 1000\n })\n } catch(err) {\n console.log(err);\n response = {};\n }\n\n // Determine city, state, and country from location request\n const locationData = response.data.results[0].address_components;\n const city = locationData[2].long_name;\n const state = locationData[4].long_name;\n const country = locationData[5].long_name;\n\n // Return location object\n return {\n city: city,\n state: state,\n country: country\n }\n\n}", "title": "" }, { "docid": "e1d95908dbc5a25e8588265571aba118", "score": "0.5724461", "text": "function geoLookUp() {\n var city = $(\"#searchInput\").val();\n\n var settings = {\n async: true,\n crossDomain: true,\n url:\n \"https://devru-latitude-longitude-find-v1.p.rapidapi.com/latlon.php?location=\" +\n city,\n method: \"GET\",\n headers: {\n \"x-rapidapi-host\": \"devru-latitude-longitude-find-v1.p.rapidapi.com\",\n \"x-rapidapi-key\": \"4f9b629588mshaf3f53eee01ba60p166742jsn4b237a2eb674\",\n },\n };\n\n $.ajax(settings).done(function (response) {\n console.log(response);\n lat = response.Results[0].lat;\n lon = response.Results[0].lon;\n\n getResID(lat, lon); //FROM test.js\n });\n}", "title": "" }, { "docid": "79d37542facdaa9d85dff20da48ba160", "score": "0.5723563", "text": "function onSubmitLatLon() {\n\t\tlat = $('#lat').val();\n\t\tlon = $('#long').val();\n\t\texecute();\n\t}", "title": "" }, { "docid": "4f0c9ddb47e2fe7fa81c4c82e5aedd13", "score": "0.5712678", "text": "async function t(t,i,e){const c={};null!=i.sr&&\"object\"==typeof i.sr?c.sr=i.sr.wkid||JSON.stringify(i.sr):c.sr=i.sr,c.coordinates=JSON.stringify(i.coordinates);const d=i.conversionType||\"mgrs\";c.conversionType=_units_js__WEBPACK_IMPORTED_MODULE_2__[\"conversionTypeKebabDict\"].toJSON(d),c.conversionMode=i.conversionMode,c.numOfDigits=i.numOfDigits,c.rounding=i.rounding,c.addSpaces=i.addSpaces;const a=Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"parseUrl\"])(t),u={...a.query,f:\"json\",...c},f=Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"asValidOptions\"])(u,e);return Object(_request_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a.path+\"/toGeoCoordinateString\",f).then((({data:o})=>o.strings))}", "title": "" }, { "docid": "9a6b8868bf7527e85e924c66202fd0ce", "score": "0.5707884", "text": "function navpark(id) {\n\n $.ajax({\n type: \"GET\",\n url: \"http://localhost:3000/getjson\",\n success: function (response) {\n // JSNLog\n logger.info('Get successful!', response);\n\n if (response.length == 0) {\n\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Response empty!', response);\n\n } else {\n\n var latstart;\n var lngstart;\n var dist;\n var distold = 20000;\n var noparking = true;\n var navend = {\n \"lat\": null,\n \"lng\": null\n };\n\n // Using a forEach method iterating over the array of nested objects\n response.forEach(function (entry) {\n\n var type = entry.geojson.properties.type;\n var identry = entry._id;\n\n if (identry == id) {\n\n // Check what kind of feature it is\n if (entry.geojson.features[0].geometry.type == \"Point\") {\n\n var lat = entry.geojson.features[0].geometry.coordinates[1];\n var lng = entry.geojson.features[0].geometry.coordinates[0];\n\n } else {\n if (entry.geojson.features[0].geometry.type == \"LineString\" || \"MultiPoint\") {\n\n var lat = entry.geojson.features[0].geometry.coordinates[0][1];\n var lng = entry.geojson.features[0].geometry.coordinates[0][0];\n\n } else {\n\n var lat = entry.geojson.features[0].geometry.coordinates[0][0][1];\n var lng = entry.geojson.features[0].geometry.coordinates[0][0][0];\n\n }\n\n }\n\n // Set startpoint\n var navstart = {\n \"lat\": lat,\n \"lng\": lng\n };\n\n latstart = lat;\n lngstart = lng;\n\n // JSNLog\n logger.info(\"navstart\");\n logger.info(navstart);\n\n control.spliceWaypoints(0, 1, navstart);\n }\n })\n\n response.forEach(function (entry) {\n\n var type = entry.geojson.properties.type;\n\n if (type == \"parkingplace\") {\n\n // Check what kind of feature it is\n if (entry.geojson.features[0].geometry.type == \"Point\") {\n\n var lat = entry.geojson.features[0].geometry.coordinates[1];\n var lng = entry.geojson.features[0].geometry.coordinates[0];\n\n } else {\n if (entry.geojson.features[0].geometry.type == \"LineString\") {\n\n var lat = entry.geojson.features[0].geometry.coordinates[0][1];\n var lng = entry.geojson.features[0].geometry.coordinates[0][0];\n\n } else {\n\n var lat = entry.geojson.features[0].geometry.coordinates[0][0][1];\n var lng = entry.geojson.features[0].geometry.coordinates[0][0][0];\n\n }\n\n }\n\n // Calculate distance from start\n dist = getDistanceFromLatLonInKm(latstart, lngstart, lat, lng);\n\n if (dist < distold) {\n\n // Set endpoint\n navend.lat = lat;\n navend.lng = lng;\n distold = dist;\n noparking = false;\n\n // JSNLog\n logger.info(\"dist\");\n logger.info(dist);\n\n }\n\n\n };\n\n })\n\n if (noparking) {\n sweetAlert('Oops...', 'Sorry, no parkingspace found!', 'error');\n // JSNLog\n logger.error('No parkingspace!');\n } else {\n\n // JSNLog\n logger.info(\"navend\");\n logger.info(navend);\n\n control.spliceWaypoints(control.getWaypoints().length - 1, 1, navend);\n control.show();\n }\n\n }\n\n },\n error: function (responsedata) {\n\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed in!', response);\n },\n timeout: 3000\n }).error(function (responsedata) {\n\n sweetAlert('Oops...', 'Something went wrong!', 'error');\n // JSNLog\n logger.error('Failed out!', response);\n });\n}", "title": "" }, { "docid": "cb8232de3ec262478effca7c38f37189", "score": "0.570622", "text": "function geocode_input(address) {\n\tconsole.log(\"geocode running...\");\n\tvar replaced = address.replace(/\\s/g, '+');\n\tvar request = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" + replaced + \"&key=AIzaSyDj0h-T1onIDApJ9DHhP8-jfs0I26JcvLs\";\n\tvar pos = {};\n\t$.ajax({\n\t\turl : 'http://maps.google.com/maps/api/geocode/json',\n\t\ttype : 'GET',\n\t\tdata : {\n\t\t\taddress : replaced,\n\t\t\tsensor : false\n\t\t},\n\t\tasync : false,\n\t\tsuccess : function(result) {\n\t\t\tconsole.log(JSON.stringify(result));\n\t\t\tpos.lat = result.results[0].geometry.location.lat;\n\t\t\tpos.lng = result.results[0].geometry.location.lng;\n\t\t\tpos.dist = 10;\n\t\t\tconsole.log(JSON.stringify(pos));\n\t\t}\n\t});\n\treturn pos;\n}", "title": "" }, { "docid": "8518440649fd15de0edc61192ea0dfe2", "score": "0.5693396", "text": "function getCoordinates() {\n var result = [], arr = [];\n $.ajax({\n type: \"GET\",\n dataType: \"json\",\n url: \"/stash_datacite/geolocation_points/points_coordinates\",\n data: { resource_id: resource_id },\n async: false,\n success: function(data) {\n result = data;\n },\n error: function() {\n console.log('Error occured');\n }\n });\n return(result);\n }", "title": "" }, { "docid": "6be781a55684f6ab3e0744d61910d2dc", "score": "0.5692897", "text": "async function getLocationInfo() {\n const results = await getGeocode({ address: searchedCountry });\n const { lat, lng } = await getLatLng(results[0]);\n panTo({ lat, lng });\n dispatch(setLatLngAction(lat, lng));\n }", "title": "" }, { "docid": "4f640fa69d1a866a45b2a5e0f5ca3cce", "score": "0.5688839", "text": "async getQueries(location, query) {\n // Show loading message\n this.setState({\n loading: true,\n });\n // Pass lat/long from (Geocode Address API) here ↓ , in (Place Search API)\n try {\n // Retrieve coordinates data (lat, long) + await for a promise to be resolved\n const {\n data: {\n results: [\n {\n locations: [\n {\n latLng: { lat, lng },\n },\n ],\n },\n ],\n },\n } = await axios({\n url: `https://www.mapquestapi.com/geocoding/v1/address`,\n method: \"GET\",\n responseType: \"json\",\n params: {\n key,\n location: location,\n },\n });\n\n // Retrieve query results\n const {\n data: { results },\n } = await axios({\n url: `https://www.mapquestapi.com//search/v4/place`,\n method: \"GET\",\n responseType: \"json\",\n params: {\n // Passing long, lat from (Get Geocode Address API see below) to check the response\n circle: `${lng}, ${lat}, ${this.state.range}`,\n pageSize: 20,\n key: key,\n sort: \"relevance\",\n q: query,\n },\n });\n\n // Update state with the results data from an API call\n this.setState({\n queryList: results,\n searchResults: true,\n location,\n loading: false,\n });\n // Handle error if promise is rejected\n } catch (error) {\n swal(\"Error has occurred!\", `${error}`);\n }\n }", "title": "" }, { "docid": "332b9f98fe94ff1f99e34c3c78082bf4", "score": "0.56860155", "text": "function successFunction(position) {\n\t\tlat = position.coords.latitude;\n\t\tlng = position.coords.longitude;\n\n\t\t//console.log({lat,lng});\n\n\t\tgetVehicles(token_auth,lat+\",\"+lng,'');\n\n\t}", "title": "" }, { "docid": "b809650e62914007219c6b549001ab4c", "score": "0.5677406", "text": "function success(pos) {\n var crd = pos.coords;\n currentlng = crd.longitude;\n currentlat = crd.latitude;\t\n \n // get kit location closest to user & display directions\n findNearestPoint();\n}", "title": "" }, { "docid": "cd2584e698312d5174b4dc3149c07c88", "score": "0.56765735", "text": "async function search_in_radius_query(params){\n //search points in distance of \"radius\" parameter\n query_string_points = 'SELECT osm_id, name, ST_AsGeoJson(way) FROM planet_osm_point p ' +\n 'WHERE ST_DWithin(p.way::geography, ST_SetSRID(ST_Point($1,$2),4326)::geography, $3) ' +\n 'AND p.historic IS NOT null AND p.name IS NOT null ';\n query_string_polygons = 'SELECT osm_id, name, ST_AsGeoJson(way) FROM planet_osm_polygon p ' +\n 'WHERE ST_DWithin(p.way::geography, ST_SetSRID(ST_Point($1,$2),4326)::geography, $3) ' +\n 'AND p.historic IS NOT null AND p.name IS NOT null ';\n\n query_string = \"\";\n if (params.monuments_checked === 'true'){\n query_string += query_string_points;\n if (params.buildings_checked === 'true'){\n query_string += 'UNION ' + query_string_polygons;\n }\n }\n else {\n query_string += query_string_polygons;\n }\n\n points_of_interest_json = await perform_query(query_string, [params.lon, params.lat, params.radius]);\n //to visualise circle on map create buffer\n query_string = 'SELECT ST_AsGeoJson(ST_Buffer(ST_SetSRID(ST_Point($1,$2),4326)::geography, $3))';\n radius_circle_polygon_json = await perform_query(query_string, [params.lon, params.lat, params.radius]);\n\n //put all together to one array\n return points_of_interest_json.concat(radius_circle_polygon_json);\n}", "title": "" }, { "docid": "03c72c42823514cdb5376d8c05d59f2b", "score": "0.5675907", "text": "function getGeocode(address) {\n return new Promise(function (resolve, reject) {\n let apiKey = \"AIzaSyB09A6zOM3XKtwH__oAlIUAUr1IbyXIQUY\";\n let addressQuery = address;\n let queryURL = `https://maps.googleapis.com/maps/api/geocode/json?address=${addressQuery}&key=${apiKey}`;\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n let latitude = response.results[0].geometry.location.lat;\n let longitude = response.results[0].geometry.location.lng;\n // console.log(latitude, longitude);\n\n var latLong = { lat: 41.4925374, lng: -99.9018131 };\n latLong.lat = latitude;\n latLong.lng = longitude;\n // console.log(latLong);\n resolve(latLong);\n }).catch(function (error) {\n reject(error);\n });\n });\n}", "title": "" }, { "docid": "9bab399e38d99dcd86d7f5eca5f87e69", "score": "0.5672305", "text": "function successFunction(position) {\r\n \t\tconsole.log(\"Inside load geolocation city successfunction:::\");\r\n \t\tvar lat = position.coords.latitude;\r\n \t\tvar lng = position.coords.longitude;\r\n \t\tconsole.log(\"latitude : \" + lat);\r\n \t\tconsole.log(\"longitude : \" + lng);\r\n \t\tcodeLatLng(lat, lng)\r\n \t}", "title": "" }, { "docid": "b7fbd7a390c295ccd67f2f73a25ebb04", "score": "0.5671695", "text": "function success (position) {\n\n dataUrl = \"https://cors-anywhere.herokuapp.com/http://api.wunderground.com/api/\" + apiKey + \"/geolookup/conditions/q/\" + position.coords.latitude + \",\" + position.coords.longitude + \".json\";\n getJson(dataUrl);\n\n }", "title": "" }, { "docid": "53f0d74a34d6c06894fb4ccf36c37a98", "score": "0.56658417", "text": "function geocodeAddress(location) {\n var params = {\n key: googleKey,\n address: location\n };\n\n $.ajax({\n url: 'https://maps.googleapis.com/maps/api/geocode/json',\n type: 'GET',\n data: params\n })\n .done(function(response) {\n latLng = []; // An array of coordinates which determines search area\n latLng.push(response.results[0].geometry.location.lat);\n latLng.push(response.results[0].geometry.location.lng);\n initMap();\n getPhotos(latLng);\n })\n .fail(function(jqXHR, error) {\n alert('Geocode was not successful');\n });\n}", "title": "" }, { "docid": "cae2811d8b303d63e43edd6485821ecb", "score": "0.56624526", "text": "function getAllCoordinates(callback)\n\t\t{\n\t\t$scope.coordinates = {};\n\t\t$scope.req_count = 1; //kolvo sended requests to control setTimeout\n\t\t//and number of requests to google maps\n\t\tMongoService.getCoordinates(function(err,coords)\n\t\t\t{\n\t\t\tif (err){callback(null,'Error: When obtain all cordinates from mongoDB');return false};\n\n\t\t\tfor (var each in coords)\n\t\t\t\t{\n\t\t\t\t$scope.coordinates[coords[each]['city']] = coords[each];\n\t\t\t\t}\n\t\t\tcallback(null);\n\t\t\t});\t\n\n\t\t}", "title": "" }, { "docid": "c89a7191255f9cf30029a45ca2a2b518", "score": "0.56527764", "text": "async function addLatLng(){\n await fdnyLocations.forEach(function(d) {\n d.LatLng = new L.LatLng(d.Latitude, d.Longitude)})\n}", "title": "" }, { "docid": "baeb0a90b461d72597d8be739fa957f6", "score": "0.5650481", "text": "function create_vehicles_request(URL, lat_p, long_p, lat_d, long_d) {\r\n let request = new XMLHttpRequest();\r\n let pickup_value = \"\" + lat_p + \",\" + long_p;\r\n let dropoff_value = \"\" + lat_d + \",\" + long_d;\r\n let parameters = \"pickup=\" + pickup_value + \"&dropoff=\" + dropoff_value;\r\n\r\n\r\n\r\n request.open('GET', URL + \"?\" + parameters, true);\r\n return request; \r\n}", "title": "" }, { "docid": "b67c5189648fdd01c3aa77abf7c7f4ad", "score": "0.56499946", "text": "function getLatLong(e) {\n\tvar myAddress = e.selectedValue[0];\n\tvar xhrGeocode = Ti.Network.createHTTPClient();\n\txhrGeocode.onerror = function(e) {\n\t\talert('Error occurred');\n\t};\n\n\txhrGeocode.onload = function(e) {\n\t\tvar response = JSON.parse(this.responseText);\n\t\tif (response.status == 'OK' && response.results != undefined && response.results.length > 0) {\n\t\t\tvar myLat = response.results[0].geometry.location.lat;\n\t\t\tvar myLon = response.results[0].geometry.location.lng;\n\t\t\tplace.lat = myLat;\n\t\t\tplace.lng = myLon;\n\t\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\t\tonload : function(e) {\n\t\t\t\t\tvar response = JSON.parse(this.responseText);\n\t\t\t\t\tvar tabledata = [];\n\t\t\t\t\tfor (var i = 0; i < response.results.length; i++) {\n\t\t\t\t\t\tvar tableviewrow = Ti.UI.createTableViewRow({\n\t\t\t\t\t\t\ttitle : response.results[i].name.toString(),\n\t\t\t\t\t\t\tcolor : 'black',\n\t\t\t\t\t\t\tlatitude : response.results[i].geometry.location.lat,\n\t\t\t\t\t\t\tlongitude : response.results[i].geometry.location.lng,\n\t\t\t\t\t\t\tisMilestone : false,\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttabledata.push(tableviewrow);\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\t$.label1.hide();\n\t\t\t\t\t}\n\t\t\t\t\t$.table.data = tabledata;\n\t\t\t\t},\n\t\t\t\tonerror : function(e) {\n\n\t\t\t\t\talert(e.error);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// API to get the near by placeses of the selected city\n\t\t\tvar url = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\" + myLat + \",\" + myLon + \"&types=hindu_temple|stadium|shopping_mall|place_of_worship&rankby=distance&key=AIzaSyA_sCSDoOYmJDgLOIn_x3p52Zyg1dHpBYE\";\n\t\t\txhr.open('POST', url);\n\t\t\txhr.send();\n\t\t}\n\t};\n\n\t//API to get the lat and long of the selected city\n\tvar urlMapRequest = \"http://maps.google.com/maps/api/geocode/json?address=\" + myAddress.replace(' ', '+');\n\turlMapRequest += \"&sensor=\" + (Ti.Geolocation.locationServicesEnabled == true);\n\n\txhrGeocode.open(\"GET\", urlMapRequest);\n\txhrGeocode.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\n\txhrGeocode.send();\n\n}", "title": "" }, { "docid": "1bfa9bab6059253bdffd818bc4c88065", "score": "0.56456506", "text": "function gasStationFinder(lon, lat, city_input) {\n // inserting lat and lon taken from the restaurant API into the gas prices API since it doesnt accept city names\n var queryURL = \"http://api.mygasfeed.com/stations/radius/\" + lat + \"/\" + lon + \"/7/reg/Price/bpxxw96ps2.json\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n gasStationResponse(response, city_input);\n })\n}", "title": "" }, { "docid": "0480a5af6dfa6800c1fc0aa07cf13011", "score": "0.56450844", "text": "async requestLocation() {\r\n this.setState({ loading: true });\r\n const _that = this;\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(\r\n async (position) => {\r\n if (position && position.coords) {\r\n const result = await getDailyForecastByLatLng(\r\n position.coords.latitude,\r\n position.coords.longitude\r\n );\r\n _that.setState(\r\n {\r\n position,\r\n forecast: result.forecast,\r\n current: result.current,\r\n loading: false,\r\n },\r\n () => {\r\n store.position = position;\r\n store.current = result.current;\r\n store.forecast = result.forecast;\r\n }\r\n );\r\n }\r\n },\r\n (error) => {\r\n console.error(\"Error Code = \" + error.code + \" - \" + error.message);\r\n }\r\n );\r\n }\r\n }", "title": "" }, { "docid": "a8c6daeaab10c028ce27b4853b26ef27", "score": "0.56427306", "text": "function lilgeCircleCoords() {\n let apiKey = \"419fb4560d921e7e18ca1ed3261fc38f\";\n let url = `https://api.openweathermap.org/data/2.5/weather?lat=30.404017&lon=-86.834468&appid=${apiKey}&units=imperial`;\n axios.get(url).then(displayJumbotron).then(jumbotronTimeDate);\n\n url = `https://api.openweathermap.org/data/2.5/forecast?lat=30.404017&lon=-86.834468&appid=${apiKey}&units=imperial`;\n axios.get(url).then(displayForecast);\n}", "title": "" }, { "docid": "d547ebbfa4480400f9e2f216e3db2f75", "score": "0.56421626", "text": "getLocationGoogle() {\n return new Promise((resolve, reject) => {\n // Results are not very accurate\n let url = 'https://www.googleapis.com/geolocation/v1/geolocate';\n if(CONFIG.GOOGLE_API_KEY) {\n url += '?key=' + CONFIG.GOOGLE_API_KEY;\n }\n return fetch(url, {method: 'post'}).then(r => r.json())\n .then(data => {\n if (this.coordsInSanFrancisco(data.location)) {\n resolve(data.location);\n } else {\n let msg = \"User location out of bounds\";\n console.log(msg);\n reject(msg);\n }\n })\n .catch(reject);\n });\n }", "title": "" }, { "docid": "32cd04b53688017aac96518391e0b64f", "score": "0.56414545", "text": "function success_callback(p){\n $.get(\"http://maps.googleapis.com/maps/api/geocode/json?latlng=\"+p.coords.latitude+\",\"+p.coords.longitude+\"&sensor=false\", function(json) {\n console.log(json);\n $(\"#gAddress\").text(json.results[0].formatted_address);\n \n $(\"#latitude\").val(p.coords.latitude);\n $(\"#longitude\").val(p.coords.longitude);\n\n });\n $(\"#location-loading\").slideUp();\n $(\"#survey-body\").fadeIn();\n \n\n if (p.coords.accuracy >= 40) {\n $(\"#accuracyWarn\").removeClass('hide');\n $(\"#accuracy\").text(p.coords.accuracy);\n } else {\n $(\"#accuracyWarn\").addClass('hide');\n }\n console.log(p);\n }", "title": "" }, { "docid": "7cf7017de55e69d6e7e74b94c5d27511", "score": "0.5637992", "text": "async function t(t,i,e){const c={};null!=i.sr&&\"object\"==typeof i.sr?c.sr=i.sr.wkid||JSON.stringify(i.sr):c.sr=i.sr,c.strings=JSON.stringify(i.strings);const f=i.conversionType||\"mgrs\";c.conversionType=_units_js__WEBPACK_IMPORTED_MODULE_2__[\"conversionTypeKebabDict\"].toJSON(f),c.conversionMode=i.conversionMode;const m=Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"parseUrl\"])(t),p={...m.query,f:\"json\",...c},u=Object(_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"asValidOptions\"])(p,e);return Object(_request_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(m.path+\"/fromGeoCoordinateString\",u).then((({data:o})=>o.coordinates))}", "title": "" }, { "docid": "085d476129ff5198b7150f3d3b9ff750", "score": "0.5635791", "text": "function getLatLng (request, response) {\r\n const handler = {\r\n query: request.query.data,\r\n cacheHit: (results) => {\r\n response.send(results.rows[0]);\r\n },\r\n cacheMiss: () => {\r\n Location.fetch(request.query.data)\r\n .then( results => response.send(results));\r\n }\r\n };\r\n Location.lookupLocation(handler);\r\n}", "title": "" }, { "docid": "751e5a54f9f1fdb31a8c27c71a0195f4", "score": "0.5635039", "text": "async function getSeekerData(city){\n\n try {\n const res2 = await fetch('/api/v1/seeker'+'?city='+city)\n window.sdata = await res2.json();\n if (res2.status === 200) {\n console.log(\"Got Map data\"+sdata)\n $('#Searchtype').show();\n // Create markers.\n var count = 0;\n window.refdata = new Array(sdata.length);\n $('#loader').hide();\n console.log(sdata)\n return sdata;\n }\n if (res2.status === 403) {\n $('#loader').hide();\n showError('No Help Seekers registered in this District yet, be the first one to do it.');\n return;\n\n }\n if (res2.status === 400) {\n $('#loader').hide();\n showError('Database Error');\n return;\n }\n if (res2.status === 500) {\n $('#loader').hide();\n showError('Server Error!');\n return;\n }\n } catch (err) {\n $('#loader').hide();\n showError(err);\n return;\n }\n\n}", "title": "" }, { "docid": "d460aaca1b9bff9f28ab96ff9bf83624", "score": "0.5634849", "text": "function getLocation(callback){\n\t\t\tvar apiCall = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + req.body.latitude + ',' + req.body.longitude +'&key=' + gmKey;\n\n\t\t\t// Google API request\n\t\t\trequest({url: apiCall,json: true}, function (error, response, body) {\n\t\t\t\tif(!error && response.statusCode == 200) {\n\t\t\t\t\tvar location = \" - Envoyé depuis \" + body.results[1].formatted_address;\n\t\t\t\t\ttweet.update({tweet: req.body.Tweet}, {location: location}).exec();\n\t\t\t\t\tcallback(location);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "2c5d1978ff1f14ce5e11a50ac242b3e5", "score": "0.5634563", "text": "function geoCallback(position) {\n\n lat = position.coords.latitude;\n long = position.coords.longitude;\n\n\n\n\n}", "title": "" }, { "docid": "b69973e653b15c30d7cf5ef5fa9f6557", "score": "0.5633952", "text": "static async ajaxReportPutLatLon(ctx) {\n const db = ctx.state.user.db;\n const { lat, lon } = ctx.request.body;\n\n try {\n const geocoded = await Geocoder.reverse(lat, lon);\n\n const address = geocoded.formattedAddress;\n\n const geojson = {\n type: 'Point',\n coordinates: [ Number(lon), Number(lat) ], // note this will normally differ from geocoded lat/lon\n };\n\n const location = { address, geocode: geocoded, geojson };\n\n await Report.update(db, ctx.params.id, { location: location }, ctx.state.user.id);\n\n // note: don't bother re-fetching weather, most likely location won't have changed enough to matter\n\n ctx.response.status = 200; // Ok\n ctx.response.body = { lat, lon };\n ctx.response.body.root = 'reports';\n } catch (e) {\n await Log.error(ctx, e);\n ctx.response.status = 500; // Internal Server Error\n ctx.response.body = { message: e.message };\n }\n }", "title": "" }, { "docid": "c9abdb5a645e5fda909b1f3bf4d2f859", "score": "0.56299114", "text": "function getLatLon(place,callback) {\n return $http({\n method: \"GET\",\n url: \"http://nominatim.openstreetmap.org/search?format=json&limit=3&q=\"+place\n }).success(function(data) {\n callback([data[0].lat,data[0].lon]); // returns multiple places. first object is the most accurate\n }).error(function(){\n console.log(\"getLatLon error\");\n });\n }", "title": "" }, { "docid": "e8160d4f3aaaedf0d7a9578d143969ad", "score": "0.5619278", "text": "function findCorrespondingNums(){\r\n function onSuccess(data){\r\n gridx = data.properties.gridX;\r\n gridy = data.properties.gridY;\r\n console.log(lng);\r\n populateWeather();\r\n }\r\n function handleError() {\r\n\r\n }\r\n\r\n $.ajax(\r\n {\r\n type: \"GET\",\r\n url: \"https://api.weather.gov/points/\" + lat + \",\" + lng,\r\n success: onSuccess,\r\n error: handleError\r\n }\r\n );\r\n}", "title": "" }, { "docid": "1938dba91f5b5ff5263c27a8b9516574", "score": "0.5618678", "text": "function cityState() {\n const url = `https://api.opencagedata.com/geocode/v1/json?q=`;\n let place = $(\"#icon_prefix\").val();\n let cageKey = \"71d042c6415048dfa43baaaa58e46e6d\";\n let queryString = `${place}&key=${cageKey}`;\n queryURL = (url + queryString);\n\n // empty results div\n $(\".results-container\").empty();\n\n // call cagedata API\n $.ajax({\n url: queryURL,\n method: 'GET',\n }).then(function (response) {\n\n if (test) console.log(\" in cagedata response\");\n if (test) console.log(\" cagedata response\", response);\n\n let lat = response.results[0].geometry.lat;\n let lon = response.results[0].geometry.lng;\n\n let location = {\n latitude: lat,\n longitude: lon,\n success: true\n }\n\n getTrails(location);\n })\n}", "title": "" } ]
81abd72fb2ef595a2a566ba478daad0b
This method will check for the height of the chain and if there isn't a Genesis Block it will create it.
[ { "docid": "ae933f612b28b966e66333d38213a8f1", "score": "0.72733986", "text": "async initializeChain() {\n if (this.height === -1) {\n await this._addBlock(new Block({ data: \"Genesis Block\" }));\n }\n }", "title": "" } ]
[ { "docid": "d0db1d11c46ae0f24c901398e3f34f0e", "score": "0.7388426", "text": "async generateGenesisBlock() {\n const blockHeight = await this.getBlockHeight();\n if (blockHeight === -1) {\n const genesisBlock = new Block.Block();\n this.addBlock(genesisBlock);\n }\n }", "title": "" }, { "docid": "28ee49728c38a296608d46ad64b0650b", "score": "0.7205167", "text": "async generateGenesisBlock() {\n if (await this.getBlockHeight() === -1) {\n const block = new Block.Block(\"First block in the chain - Genesis block\");\n block.time = this._time();\n block.hash = this._hash(block);\n await this._addBlock(block);\n }\n }", "title": "" }, { "docid": "f8cc4772ca664997be252dff2ebfac2a", "score": "0.70951146", "text": "async initializeChain() {\n if( this.height === -1){\n let block = new BlockClass.Block({data: 'New York Times...'});\n await this._addBlock(block);\n }\n }", "title": "" }, { "docid": "6cff9704884b520561ae49877a6c1b19", "score": "0.70495343", "text": "async generateGenesisBlock() {\n //1 Check height of current blockchain on levelDB\n //2 if height === 0 then create the genesis block\n\n //1\n const chainHeight = await this.getBlockHeight();\n\n //2\n if (chainHeight === 0) {\n let newBlock = new Block.Block(`Genesis Block.`);\n newBlock.height = 0;\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n newBlock.previousBlockHash = '';\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n\n //Don't call addBlock() for the Genesis Block\n //Statically type the code to create it within this method\n\n console.log(newBlock);\n return await this.db\n .addLevelDBData(newBlock.height, JSON.stringify(newBlock))\n .then(persistedBlock => {\n // console.log(`New Block Persisted to the Blockchain = ${persistedBlock}`);\n return persistedBlock;\n })\n .catch(console.log);\n }\n }", "title": "" }, { "docid": "4422f6da4415fbe8e07a0ce3ac0d6458", "score": "0.70378137", "text": "generateGenesisBlock() {\n // Add your code here\n return this.getBlockHeight()\n .then(height => {\n if (height < 0) {\n let genesisBlock = new Block.Block('This is the genesis block with height equal to zero');\n genesisBlock.height = 0;\n genesisBlock.time = new Date().getTime().toString().slice(0, -3);\n genesisBlock.hash = SHA256(JSON.stringify(genesisBlock)).toString();\n return this.bd.addLevelDBData(genesisBlock.height, JSON.stringify(genesisBlock).toString());\n }\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "7bc060838359acf055034d29bc6ce248", "score": "0.70176816", "text": "generateGenesisBlock(){\n this.getBlockHeight().then(res => {\n if (res < 0) {\n const newBlock = new Block.Block(\"First block in the chain - Genesis block\");\n newBlock.height = 0;\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n this.saveBlockToDB(newBlock).then(genesisBlock => {\n\t\t\t\t\tconsole.log(\"​generateGenesisBlock -> \", genesisBlock)\n \n });\n }\n })\n \n }", "title": "" }, { "docid": "0762e4fd791d0b464a440f12c4359af4", "score": "0.68631774", "text": "createGenesisBlock() {\n return new Block(\"First block in the chain - Genesis block\");\n }", "title": "" }, { "docid": "e29c2eaf687956905f73fb196f50d47a", "score": "0.675129", "text": "async generateGenesisBlock(){\n let self = this;\n //initialize currentHeight variable with the current height or number of blocks in the DB\n\n await this.getBlockHeight().then(function(currHeight){\n self.currentHeight = currHeight;\n\n // if current blockchain height is 0, then add the Genesis Block\n if(self.currentHeight==-1){\n //we add a empty block because the addBlock method takes care of adding the block data for a Genesis Block, here we just call addBlock in case that AT STARTUP we detect that currentHeight is -1 or no blocks \n //are in the DB\n self.addBlock(new Block()).then( function(value){\n //Genesis Block successfully added\n console.log(`${value} block added at height # ${self.currentHeight}`);\n //after creating Genesis Block we set this blockchain as initialized\n self.initialized=true;\n }).catch(function(err){\n //log any error\n console.log(err);\n });\n }else{\n //in case no Genesis Block is needed we set this blockchain as initialized\n self.initialized=true;\n }\n\n console.log('Current Blockchain Height ' + self.currentHeight);\n }).catch(function(err){console.log(err);});\n }", "title": "" }, { "docid": "a8c38428e8e418dcae78aead23786620", "score": "0.6729103", "text": "createGenesisBlock() {\n const genesisTransaction = new Transaction(null, 'SomeOffice', 'SomeCandidate');\n const genesisBlock = new Block(0, genesisTransaction, '0'.repeat(64));\n\n genesisBlock.findNonce(this.difficulty);\n this.chain.push(genesisBlock);\n }", "title": "" }, { "docid": "dd86b071faf77fd84a010d0c777a8075", "score": "0.66551214", "text": "chainLoaded(){\n this.chain = this.storageAdapter.data\n if (this.chain == undefined || this.chain.length == 0){\n this.addBlock(new Block(\"First block in the chain - Genesis block\"));\n return\n }\n\n\n this.processMempool()\n }", "title": "" }, { "docid": "518ca5b5775457ba0e2225eb4a16e429", "score": "0.6643252", "text": "async _init() {\n if ((await this._getBlockHeight()) === 0) {\n await this._addBlock(new Block(\"Genesis block\"));\n }\n }", "title": "" }, { "docid": "a41fb5d019ea880bf0c0df1c596354a1", "score": "0.66218215", "text": "generateGenesisBlock() {\n // Add your code here\n let self = this;\n self.getBlockHeight()\n .then(function (blockCount) {\n if (blockCount == 0) {\n let genesisStar = new Star(\"70° 21' 0.6\", \"9h 26m 10.0s\", \"This is my Genesis Star.\");\n genesisStar.story = new Buffer(genesisStar.story).toString('hex');\n let genesisStarRequestModel = new StarRequestModel(\"1BtAwxYTSBQR8tj4ddAbEap1qqDLyvTgex\", genesisStar);\n self.addBlock(new Block(genesisStarRequestModel));\n }\n })\n .catch(function (err) {\n console.log(err);\n reject(new Error(\"ERROR_BLOCKCH_BLOCK_GEN\"));\n });\n\n }", "title": "" }, { "docid": "5cba26282fcf9fb501c5efea95a2bc11", "score": "0.6601155", "text": "async generateGenesisBlock () {\n // Add your code here\n const genesisBlock = new Block.Block('First block in the chain - Genesis block');\n genesisBlock.time = new Date().getTime().toString().slice(0, -3);\n genesisBlock.hash = SHA256(JSON.stringify(genesisBlock)).toString();\n this.bd.addLevelDBData(genesisBlock.height, JSON.stringify(genesisBlock).toString());\n}", "title": "" }, { "docid": "6f63ad97b7158c5a622738c0c4a77b1e", "score": "0.646979", "text": "createGenesisBlock() {\n let genesis = new Block('Genesis Block');\n genesis.index = 0;\n genesis.previousHash = '0';\n genesis.timestamp = new Date();\n console.log('Mining genesis block...');\n genesis.mineBlock(this.difficulty);\n return genesis;\n }", "title": "" }, { "docid": "c10571bd0e3f6f992c76c07d12fccc75", "score": "0.6448865", "text": "createGenesisBlock() {\n return new Block(\"26 / 07 / 2020\", 0); //previous hash declared as 0 because no previous blocks available!\n }", "title": "" }, { "docid": "28a3d9690ed3c4c94fbae15bbd14bdd3", "score": "0.64445496", "text": "createGenesis() {\n return new Block(new Item(0,0,0) ,\"Empty\");\n }", "title": "" }, { "docid": "e28dd3dc023927c8cf6443b7af34d00a", "score": "0.64399225", "text": "createGenesisBlock() {\n return new Block(Date.now(), [], '0');\n }", "title": "" }, { "docid": "ff8411c535da3aeb25192795c2b588fd", "score": "0.6424545", "text": "createGenesisBlock(){\n return new Block(0,\"01/01/2017\",\"Gensis block\", \"0\");\n }", "title": "" }, { "docid": "7e14d7213c967dad7428047a81175b89", "score": "0.63855237", "text": "createGenesisBlock(){\n return new Block(\"01/01/2018\", \"Genesis Block\", null);\n }", "title": "" }, { "docid": "44f78b3278e4f35ae535442a5299d392", "score": "0.6379813", "text": "function addBlock(newBlock){\n // key -1 contains the number of blocks in DB\n add.getLevelDBData(-1).then(function(value){ \n let height = parseInt(value) + 1;\n newBlock.height = height;\n //update number of blocks\n add.addLevelDBData(-1, height);\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n //get value of previousHash\n add.getLevelDBData(height - 1).then(function(value1){\n newBlock.previousBlockHash = JSON.parse(value1).hash;\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n add.addLevelDBData(height, JSON.stringify(newBlock));\n })\n //case: DB does not exist\n }).catch(function(err){\n newBlock.body = \"First block in the chain - Genesis block\";\n newBlock.height = 0;\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n add.addLevelDBData (0, JSON.stringify(newBlock));\n add.addLevelDBData(-1, 0);\n })\n}", "title": "" }, { "docid": "db22d63f1e55c606ca2bc979d7e6d58c", "score": "0.63431513", "text": "makeGenesisBlock(){\n const self = this;\n var genesisBlock = new Block(genesisParam)\n }", "title": "" }, { "docid": "b83e5ed5ab1d23129b24513a8845bc75", "score": "0.63389933", "text": "createGenesis(){\n return new Block(0, \"16/06/2021\", \"first block\", \"0\" )\n }", "title": "" }, { "docid": "7a4ccfff97c3534660e486533a03fcaa", "score": "0.6287873", "text": "function new_block(block){\n\tif(!known_blocks[block.height]){\n\t\tadd2stats(block);\n\t\tbuild_block(block);\n\t}\n\n\tknown_blocks[block.height] = block;\n}", "title": "" }, { "docid": "1e306367e4aff4f75cafb9e8195aea82", "score": "0.626349", "text": "createGenesisBlock() {\n\t\treturn new Block(Date.parse(\"2018-03-19\"), [], \"0\");\n\t}", "title": "" }, { "docid": "a434212691ff6193788547ca1c1e69b7", "score": "0.6232462", "text": "createGenesisBlock() {\n const genesisDate = '11/03/2020';\n return new Block('Genesis Block', 0, genesisDate, '0');\n }", "title": "" }, { "docid": "8c1a1651fb7c5315bae86927d343d7ac", "score": "0.62175333", "text": "createGenesisBlock() {\n return new Block(\"03/01/2021\", \"Genesis block\", \"0\")\n }", "title": "" }, { "docid": "7de11d3e6816cb951aee1dbaf0491db0", "score": "0.62148124", "text": "createGenesisBlock(){\n // the genesis block doesn't have a previous hash, so we can put whatever data we want inside of that field. \"0\" is fine.\n return new Block(0, \"09/24/2019\", \"Genesis block\", \"0\");\n }", "title": "" }, { "docid": "2ed81ce88ec98836bc60588a4cad5019", "score": "0.6192284", "text": "createGenesisBlock() {\n return new Block(0, \"01/01/2018\", \"GB\", \"0\");\n }", "title": "" }, { "docid": "09231cd956767f037289206ea74d3970", "score": "0.6175502", "text": "static getInstance() {\n if (!Blockchain.instance) {\n Blockchain.instance = new Blockchain();\n return Blockchain.instance.getBlockHeight()\n .then((height) => {\n if (height === 0) {\n const initialBlock = new Block('First block in the chain - Genesis block');\n return Blockchain.instance.addBlock(initialBlock);\n }\n })\n .then(() => Blockchain.instance);\n } \n\n return Promise.resolve(Blockchain.instance);\n }", "title": "" }, { "docid": "fc35e53f3f49b6a44869dce8b613524a", "score": "0.61279655", "text": "_createBlockNew(height, blockValidation, minerAddress, transactions, args){\n\n //validate miner Address\n\n args.unshift( this.blockchain, minerAddress, transactions, undefined, undefined );\n let data = new this.blockDataClass(...args);\n\n return new this.blockClass( this.blockchain, blockValidation, 1, undefined, this.blockchain.getHashPrev(), undefined, 0, data, height, this.db);\n\n }", "title": "" }, { "docid": "16a77baae20b699f8afc9293145d737a", "score": "0.6086382", "text": "function bigBlock() {\n var block = createSprite(1040, random(70,height-110), 100, 30); // Spawing coordinates and size\n block.velocity.x = -4; // Speed\n block.life = 500; // Lifespan in frames\n blocks.add(block); // Added to the blocks group\n}", "title": "" }, { "docid": "2a8fa142181e339915beac706f6067c6", "score": "0.6054505", "text": "function spawnBlocks() {\n if (settings.gameEnd == false) {\n var randomInterval = Math.random() * (2000 - 500) + 500;\n\n if (tracker.activeBlocks.length < settings.maxActiveBlocks && interactions.pause == false) {\n tracker.addToActive(new Block(settings, tracker));\n }\n setTimeout(spawnBlocks, randomInterval);\n }\n }", "title": "" }, { "docid": "6ef6e6c909314dbeb26767f20e1b7ca4", "score": "0.6046746", "text": "function createBlocks() {\n\n\t\tvar Block = require('block');\n\n\t\tvar numberOfBlocks = 6;\n\n\t\tfor (var i = 0; i < numberOfBlocks; i++) {\n\n\t\t\tvar blockSprite = new Block();\n\n\t\t\t// EASY WAY FOR STACKING BOXES, FOR MORE COMPLEX SITUATIONS O DIFFERENT SCREENS,\n\t\t\t// IS RECOMMENDED TO READ A JSON GENERATED WITH ANY TILE MAP GENERATOR.\n\n\t\t\tvar initialPosition = {};\n\n\t\t\tif (i < 3) {\n\n\t\t\t\tinitialPosition.x = game.screen.width - 300 - blockSprite.width * i;\n\t\t\t\tinitialPosition.y = cpY(GROUND_LEVEL + blockSprite.height);\n\n\t\t\t} else if (i < 5) {\n\n\t\t\t\tinitialPosition.x = game.screen.width - 300 - blockSprite.width * 0.5 - blockSprite.width * (i - 3);\n\t\t\t\tinitialPosition.y = cpY(GROUND_LEVEL + blockSprite.height * 2);\n\n\t\t\t} else if (i === 5) {\n\n\t\t\t\tinitialPosition.x = game.screen.width - 300 - blockSprite.width;\n\t\t\t\tinitialPosition.y = cpY(GROUND_LEVEL + blockSprite.height * 3);\n\n\t\t\t}\n\t\t\t;\n\n\t\t\t// Set initial position and save this coordinates in block.js for later refresh\n\n\t\t\tblockSprite.setInitPosition(initialPosition);\n\n\t\t\t// Mass of the block:\n\n\t\t\tvar mass = 0.5;\n\n\t\t\t// dynamicBody returns an object with the shape, body and moment.\n\t\t\t// TODO: Check if is better sync sprites with bodies iterating directly this object instead using new arrays :\n\n\t\t\tvar dynamicBody = World.addDynamicBoxBody({\n\t\t\t\tspace : space,\n\t\t\t\tsprite : blockSprite,\n\t\t\t\tmass : mass,\n\t\t\t\telasticity : 0.5,\n\t\t\t\tfriction : 1\n\t\t\t});\n\n\t\t\t// Add the block to scene:\n\n\t\t\tself.add(blockSprite);\n\n\t\t\t// Save sprites, moments, shapes and bodies for future synchronisation\n\n\t\t\tblocks_Sprite.push(blockSprite);\n\t\t\tblocks_Body.push(dynamicBody.body);\n\t\t\tblocks_Moment.push(dynamicBody.moment);\n\t\t\tblocks_Shape.push(dynamicBody.shape);\n\n\t\t};\n\n\t}", "title": "" }, { "docid": "a2f1a23341e0c996575eca4ec2e24d75", "score": "0.60425204", "text": "generateGenesisBlock(genesisblock){\n // check if a previous genesisblock has be previous created\n genesisblock.time = new Date().getTime().toString().slice(0,-3);\n genesisblock.hash = SHA256(JSON.stringify(genesisblock)).toString();\n this.db.addLevelDBData(genesisblock.height,JSON.stringify(genesisblock).toString());\n }", "title": "" }, { "docid": "e98265134c213ba2a0fcdd23feb9ad4b", "score": "0.6034093", "text": "function CreateBlock(x, y)\n{\n\tg_blocks.push(g_block.create(x, g_gameOptions.height - y));\n\tg_blocks.push(g_block.create(x, g_gameOptions.height - y - g_block.height));\n\tg_blocks.push(g_block.create(x, g_gameOptions.height - y - g_block.height * 2));\n\tg_blocks.push(g_block.create(x + g_block.width, g_gameOptions.height - y - g_block.height));\n\tg_blocks.push(g_block.create(x + g_block.width, g_gameOptions.height - y - g_block.height * 2));\n\tg_blocks.push(g_block.create(x + g_block.width * 2, g_gameOptions.height - y - g_block.height));\n\tg_blocks.push(g_block.create(x + g_block.width * 2, g_gameOptions.height - y - g_block.height * 2));\n\tg_blocks.push(g_block.create(x + g_block.width * 3, g_gameOptions.height - y));\n\tg_blocks.push(g_block.create(x + g_block.width * 3, g_gameOptions.height - y - g_block.height));\n\tg_blocks.push(g_block.create(x + g_block.width * 3, g_gameOptions.height - y - g_block.height * 2));\n}", "title": "" }, { "docid": "5f87f29a0bc9c884db7a7c7cfd7c9b6d", "score": "0.6029149", "text": "init_genesis(){\n const self = this\n\n var genblock = new Block(genesisParam)\n\n var ind1 = {\n number : 1,\n policyType : 0,\n action : 1\n }\n\n var ind2 = {\n number : 2,\n policyType : 1,\n action : 1\n }\n\n var ind3 = {\n number : 3,\n policyType : 2,\n action : 1\n }\n\n self.blockchain.push(genblock)\n self.addInner(ind1)\n self.addInner(ind2)\n self.addInner(ind3)\n self.blockdb_I.setBlock(genblock)\n }", "title": "" }, { "docid": "ff14713244d390a611d63d81648cc6b7", "score": "0.5982248", "text": "constructor() {\n this.chain = [this.createGenesisBlock()];\n }", "title": "" }, { "docid": "3e25b209b837ac0a9c4bfeb32f9f836d", "score": "0.5980425", "text": "async function newBlock() {\n let AliceSecret = \"\";\n let Alice = KeyRing.fromSecret(AliceSecret);\n\n let BobSecret = \"\";\n let Bob = KeyRing.fromSecret(BobSecret)\n\n let systemAccountSecret = \"\";\n let systemAccount = KeyRing.fromSecret(systemAccountSecret);\n\n let coinbase = TX.createCoinbase([{ address: Alice.getAddress(), amount: 15000 }], systemAccount);\n assert(coinbase.verify());\n\n let genesisBlock = Block.fromRaw(config.genesisBlockRaw);\n\n let newBlock = await BlockUtil.createBlock(Header.fromBlock(genesisBlock), headerChain);\n}", "title": "" }, { "docid": "7cc5e1915d802647cee567f220ede3b5", "score": "0.59711945", "text": "constructor(){\n \n this.chain = [this.createGenesisBlock()];\n }", "title": "" }, { "docid": "3d29e237f536e6aeb6880e6a0b8d5d2a", "score": "0.596006", "text": "constructor() { \n this.chain = [this.createGenesisBlock()]; \n }", "title": "" }, { "docid": "fafde4d505a8d2efafe0dfc66fcf940e", "score": "0.5950002", "text": "constructor() {\n this.chain = [this.createGenesisBlock()];\n }", "title": "" }, { "docid": "cb7e80d85cbe7e54cb3bed7093c829d6", "score": "0.5941638", "text": "function createBlocks() {\n\tswitch (currentLevel) {\n\t\t\tcase 1:\n\t\t\t\tfor (j = 0; j < numBlockRows; j++) {\n\t\t\t\t\tfor (i = 0; i < numBlockCols; i++) {\n\t\t\t\t\t\tblocks.push({\n\t\t\t\t\t\t\tx: (i * GAP_WIDTH) + (i * BLOCK_WIDTH) + 22,\n\t\t\t\t\t\t\ty: j * 25 + 50,\n\t\t\t\t\t\t\twidth: BLOCK_WIDTH,\n\t\t\t\t\t\t\theight: 20,\n\t\t\t\t\t\t\tcolour: 'blue',\n\t\t\t\t\t\t\tdestroyed: false\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "58eb90686d09feda1415c44bdbf2c60d", "score": "0.591909", "text": "createGensisBlock(){\n\t\treturn new Block(Date.parse(\"14-10-2018\"), [], \"0\");\n\t}", "title": "" }, { "docid": "88336b816d1c6e2119faa1b0a8dcb02e", "score": "0.5918577", "text": "static genesis(){\r\n //return new Block();\r\n }", "title": "" }, { "docid": "3f26d11d99ab4a6f7c8dee4abd4ccca7", "score": "0.59161925", "text": "constructor() {\n this.chain = [Block.genesisBlock()];\n }", "title": "" }, { "docid": "80aff5dda36a6e9ab146af690e2b1fd7", "score": "0.5915502", "text": "function getGenesisBlock() {\n return new Block(0, \"\", 1535165503, \"Genesis block\", \"a12eab42aa059b74b1ee08310a88b56e64c3d90cf803445250dc2f209833d6d2\");\n}", "title": "" }, { "docid": "2a0da878eb85bd1f524a40022db358aa", "score": "0.59122145", "text": "constructor() {\n this.chain = [Block.genesis()]\n }", "title": "" }, { "docid": "9b2483dfefa71dec8ac3a8133c73e75d", "score": "0.5855199", "text": "function addfalseBlock(newBlock){\n add.getLevelDBData(-1).then(function(value){ \n let height = parseInt(value) + 1;\n newBlock.height = height;\n add.addLevelDBData(-1, height);\n newBlock.time = new Date().getTime().toString().slice(0,-3);\n add.getLevelDBData(height - 1).then(function(value1){\n newBlock.previousBlockHash = \"huhu\";\n newBlock.hash = \"haha\";\n add.addLevelDBData(height, JSON.stringify(newBlock));\n })\n })\n}", "title": "" }, { "docid": "67c31767232ee39dc80e30892a96ade6", "score": "0.581915", "text": "_createBlockGenesis(blockValidation, minerAddress, args){\n\n //validate miner Address\n\n args.unshift ( this.blockchain, minerAddress, undefined, undefined, undefined );\n\n let data = new this.blockDataClass(...args);\n\n return new this.blockClass( this.blockchain, blockValidation, 1, undefined, __WEBPACK_IMPORTED_MODULE_0_common_blockchain_global_Blockchain_Genesis__[\"a\" /* default */].hashPrev, undefined, 0, data, 0, this.db );\n }", "title": "" }, { "docid": "12782e81e9552611d138f4a823c1e7f8", "score": "0.5807179", "text": "validateBlock(blockHeight){\n this.checkIfChainIsLoaded()\n // get block object\n let block = this.getBlock(blockHeight);\n // get block hash\n let blockHash = block.hash;\n // remove block hash to test block integrity\n block.hash = '';\n // generate block hash\n let validBlockHash = SHA256(JSON.stringify(block)).toString();\n // Compare\n if (blockHash===validBlockHash) {\n return true;\n } else {\n console.log('Block #'+blockHeight+' invalid hash:\\n'+blockHash+'<>'+validBlockHash);\n return false;\n }\n }", "title": "" }, { "docid": "643ec75a1996fcb4078e9ca197c26f95", "score": "0.58070683", "text": "function waitForNewBlock(height, cb) {\n var actualHeight = height;\n async.doWhilst(\n function (cb) {\n request({\n type: \"GET\",\n url: baseUrl + \"/api/blocks/getHeight\",\n json: true\n }, function (err, resp, body) {\n if (err || resp.statusCode != 200) {\n return cb(err || \"Got incorrect status\");\n }\n\n if (height + 2 == body.height) {\n height = body.height;\n }\n\n setTimeout(cb, 1000);\n });\n },\n function () {\n return actualHeight == height;\n },\n function (err) {\n if (err) {\n return setImmediate(cb, err);\n } else {\n return setImmediate(cb, null, height);\n }\n }\n )\n}", "title": "" }, { "docid": "2b64d55e2e3611eea2dd688bc4d11dfd", "score": "0.57920283", "text": "function generateGenesisBlock() {\n const block = {\n timestamp: + new Date(),\n data: \"Genesis Block\",\n previousHash: \"0\",\n }\n const hash = calculateHash(block)\n return { ...block, hash }\n}", "title": "" }, { "docid": "5c7960ad5fcde58d58c32954f38aaeda", "score": "0.57815987", "text": "async getBlockHeight () {\n // Add your code here\n return await this.bd.getBlocksCount() - 1;\n}", "title": "" }, { "docid": "b2741cd9e045caa69430bc76256fcfdb", "score": "0.5777126", "text": "_createBlockValidation_ForkValidation(height, forkHeight){\n\n let validationType = {\n \"skip-accountant-tree-validation\": true,\n \"skip-validation-transactions-from-values\": true //can not validate the transactions\n };\n\n if (height === this.forkChainLength-1)\n validationType[\"validation-timestamp-adjusted-time\"] = true;\n\n return new __WEBPACK_IMPORTED_MODULE_3_common_blockchain_interface_blockchain_blocks_validation_Interface_Blockchain_Block_Validation__[\"a\" /* default */](this.getForkBlock.bind(this), this.getForkDifficultyTarget.bind(this), this.getForkTimeStamp.bind(this), this.getForkPrevHash.bind(this), validationType );\n }", "title": "" }, { "docid": "491691403a5c7a77df42e34b752de828", "score": "0.57668304", "text": "getBlockByHeight(chainInput,height,onSuccess, onError)\n\t{\n\t\tlet params = [chainInput, height];\n\t\tthis.JSONRPC('getBlockByHeight', params, onSuccess, onError);\n\t}", "title": "" }, { "docid": "ded2fc309b0a0590d213c43452ce5c86", "score": "0.57650816", "text": "validateChain() {\n let self = this;\n let validatePromises = [];\n let promise;\n\n self.getBlockHeight().then((height) => {\n // Genesis block\n if (height === 0) {\n promise = Promise.resolve(null);\n\n validatePromises.append(promise);\n // Non-genesis block.\n } else {\n let promiseFactory = function(blockHeight, isLastBlock) {\n return new Promise((resolve, reject) => {\n self.validateBlock(blockHeight).then((result) => {\n if (isLastBlock) {\n // if block is validated, return null. Otherwise, return the height of the block with problem.\n resolve(result ? null : blockHeight);\n } else {\n if (result) {\n self.validateTwoBlocks(blockHeight).then((validationResult) => {\n if (validationResult === false) {\n // return the height of the block with problem\n resolve(blockHeight);\n } else {\n resolve(null);\n }\n });\n } else {\n // return the height of the block with problem\n resolve(blockHeight);\n }\n }\n });\n });\n };\n\n for (let i = 0; i < height; i++) {\n let isLastBlock = i === (height - 1);\n validatePromises.push(promiseFactory(i, isLastBlock));\n }\n\n console.log(\"validation promises length:\" + validatePromises.length);\n\n Promise.all(validatePromises).then((results) => {\n // Strip null in the results\n let errorLog = results.filter((obj) => obj);\n\n if (errorLog.length > 0) {\n console.log('Block errors = ' + errorLog.length);\n console.log('Blocks: ' + errorLog);\n } else {\n console.log('No errors detected');\n }\n });\n }\n });\n }", "title": "" }, { "docid": "ba67d43513ae2ca68d7c1bb71a018db1", "score": "0.5734948", "text": "function get_blocks(){\n\t\tnext++;\n\t\tif(next <= bag.chain.height){\n\t\t\trest_blockstats(next, get_blocks);\n\t\t}\n\t}", "title": "" }, { "docid": "57e1d622987b8e0ea4c0d2741b4113e9", "score": "0.5734451", "text": "function blockBuilder(bx,by){\r\n var virtualBlock=svg.rect({\r\n x:bx,\r\n y:by,\r\n width:w, height:h,\r\n fill: '#FF2626',\r\n });\r\n\r\n var block={\r\n x:bx,//x coordinate\r\n y:by,//x coordinate\r\n flag:1,//knowledge of whether or not it exists\r\n v:virtualBlock//knowledge of rectangle\r\n }\r\n\r\n blockArray.push(block);//add object to array\r\n //console.log(block1.attr().x);\r\n\r\n }", "title": "" }, { "docid": "8ec121675156ffd2b9f9239b0ee5107b", "score": "0.5729687", "text": "getBlock(height) {\n let self = this;\n return new Promise(function(resolve, reject) {\n self.db.getLevelDBData(height).then((blockDB) => {\n if(blockDB) {\n resolve(JSON.parse(blockDB));\n } else {\n throw new Error(`Block does not exist for height: ${height}`);\n }\n }).catch((err) => {\n console.log(\"REJECTING\");\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "5f4418635b49b7ead9722662ec20f92c", "score": "0.5724001", "text": "async _validateForkBlock(block, height ){\n\n //calculate the forkHeight\n let forkHeight = block.height - this.forkStartingHeight;\n\n if (block.height < this.forkStartingHeight) throw {message: 'block height is smaller than the fork itself', blockHeight: block.height, forkStartingHeight:this.forkStartingHeight };\n if (block.height !== height) throw {message:\"block height is different than block's height\", blockHeight: block.height, height:height};\n\n let result = await this.blockchain.validateBlockchainBlock( block );\n\n return result;\n }", "title": "" }, { "docid": "052b4c4b78891a049da72daa1511b62a", "score": "0.5713873", "text": "addBlock(data) {\r\n\t\t//const lastblock=this.chain[this.chain.length - 1];\r\n\t\tconst block= Block.mineBlock(this.chain[this.chain.length - 1],data);\r\n\t\tthis.chain.push(block);\r\n\r\n\t\treturn block;\r\n\t}", "title": "" }, { "docid": "8e559938c5d0eaf649839c08e6e36eb4", "score": "0.57078964", "text": "async getBlock (height) {\n // Add your code here\n return JSON.parse(await this.bd.getLevelDBData(height))\n }", "title": "" }, { "docid": "663feef355cfa0e18b64b3965e2732fc", "score": "0.57075435", "text": "createBlock(proofOfWork){\n\n const lastBlock = this.lastBlock;\n const blockString = JSON.stringify(lastBlock);\n\n const block = {\n index: lastBlock.index + 1,\n timestamp: Date.now(),\n transactions: this.currentTransactions,\n transactionHash: sha256(JSON.stringify(this.currentTransactions)),\n proof: proofOfWork,\n previousHash: sha256(blockString)\n }\n this.chain.push(block);\n this.currentTransactions = [];\n }", "title": "" }, { "docid": "1c63f4a395f4f438cebf417f5c87bb34", "score": "0.5706143", "text": "startGenesisBlock(){\n return new CryptoBlock(0, \"02/26/2020\", \"Initial Block in the Chain\", \"0\");\n }", "title": "" }, { "docid": "6ef31cfaf4d8ae66c7e2a3bfeaefa23b", "score": "0.5703945", "text": "getBlock(height) {\n return db.get(height).then((value) => JSON.parse(value));\n }", "title": "" }, { "docid": "81a8c392c1c6138ecccb172bb2fc012f", "score": "0.56855404", "text": "function Zombie(x,y, max_height, max_width, block_width){\n\tthis.x = x;\n\tthis.y = y;\n\tthis.max_height = max_height - 15;\n\tthis.max_width = max_width - 15;\n\tthis.block_width = block_width\n\tthis.red = 255;\n\tthis.green = 0;\n\tthis.blue = 0;\n\tthis.shading = \")-#000\";\n\tthis.color = \"45-rgb(\" + this.red + \",\" + this.green + \",\" + this.blue+this.shading;\n\tthis.block = null;\n\tthis.age = 0;\n\tthis.dead = false;\n\t\n\t//what block is this creature on?\n\t//use x and y to find out\n\tthis.findBlock = function(world){\n\t my_i = [Math.round(this.new_y/this.block_width)]\n\t my_j = [Math.round(this.new_x/this.block_width)]\n\t possible_blocks = new Array();\n\t //look at blocks close by\n\t for(i = -1; i < 2; i++){\n\t if(world[my_i/1 + i/1]){ //division needed, for some reason thinking is string, not int?\n\t for(j = -1; j < 2; j++){\n\t if(world[my_i/1 + i/1][my_j/1 + j/1]){\n\t possible_blocks.push(world[i/1+ my_i/1][j + my_j/1]);\n\t }//end if block exists\n\t }//end for j\n\t }//end if block row exists\n\t }//end for i\n\t //now that i have all possible blocks find the one i actually sit on\n\t for(b in possible_blocks){\n\t if(possible_blocks[b].isInside(this.new_x, this.new_y)){\n\t //let block know i'm on it\n\t if(this.block){\n\t this.block.removeZombie(this);\n\t }\n\t this.block = possible_blocks[b];\n\t possible_blocks[b].addZombie(this);\n\t return possible_blocks[b];\n\t }\n\t }\n\t return null;\n\t};\n\t\n\t//only look inside of my block to find other creatures to interact with\n\tthis.tick = function(world){\n\t this.moveRandomly();\n\t this.checkCollisions(world)\n\t this.time_passes();\n\t \n\t}\n\t\n\tthis.time_passes = function(){\n\t this.age += 1;\n\t if(this.age > 10){\n\t this.dead = true;\n\t this.block.removeZombie(this);\n\t }\n\t}\n\t\n\t\n\tthis.moveRandomly = function(){\n\t x_dir_calc = Math.random()*100;\n\t y_dir_calc = Math.random()*100;\n\t x_dir = 1;\n\t y_dir = 1;\n\t \n\t if(x_dir_calc > 50){\n\t x_dir = -1;\n\t }\n\t \n\t if(y_dir_calc > 50){\n\t y_dir = -1;\n\t }\n\t \n\t x_amount = Math.random()*this.block_width * x_dir;\n\t y_amount = Math.random()*this.block_width * y_dir;\n\t \n\t this.new_x = this.x + x_amount;\n\t this.new_y = this.y + y_amount;\t\n\n\t if(this.new_x > this.max_width || this.new_x < 0){\n\t this.new_x = this.x;\n\n\t } \n\t \n\t if(this.new_y > this.max_height || this.new_y < 0){\n\t this.new_y = this.y;\n\n\t } \n\t};\n\t\n\t//make sure you're going onto a light block. if yes, save movement.\n\t//if no, don't save movement.\n\tthis.checkCollisions = function(world){\n\t block = this.findBlock(world);\n\t if(block){\n\t if(!block.isBarrier()){\n\t this.x = this.new_x;\n\t this.y = this.new_y;\n\t }else{\n\n\t }\n\t }//end if block\n\t};\n}//end zombie", "title": "" }, { "docid": "6afacd5570442d7a7adec8b15076baff", "score": "0.5676038", "text": "async validateBlock(height) {\n const block = await this.getBlock(height);\n const blockClone = Object.assign({}, block, { hash: '' });\n const expectedBlockHash = SHA256(JSON.stringify(blockClone)).toString();\n return await (block.hash === expectedBlockHash);\n }", "title": "" }, { "docid": "5800ffc8ef7cd99d4fbf45bafd677c7d", "score": "0.56718636", "text": "async getBlockHeight() {\n // Add your code here\n return await this.db.getBlocksCount();\n }", "title": "" }, { "docid": "3b2c719cb20837c80d1d56e954f1e6d4", "score": "0.56643647", "text": "function genBlock(){\n var type;\n \n /*Generate a new block type (corner, striaght, cross, three)*/\n type = Math.floor((Math.random() * 4) + 1); \n\n /*Generate a new block for that particular type*/\n switch (type) {\n case 1: \n //Striaght\n type = Math.floor((Math.random() * 2) + 16);\n break;\n case 2:\n type = Math.floor((Math.random() * 4) + 11); \n break;\n case 3:\n type = Math.floor((Math.random() * 4) + 21); \n break;\n case 4:\n type = 20;\n break;\n }\n\n return type;\n}", "title": "" }, { "docid": "a102594da6ae2e535122b024ee1bd279", "score": "0.56615627", "text": "getBlock(height) {\n // Add your code here\n return this.bd.getLevelDBData(height.toString())\n .then(stringBlock => {\n return JSON.parse(stringBlock);\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "13b000f5ee63944abec5bec139609fa5", "score": "0.56541014", "text": "async getBlockHeight() {\n return await this.bd.getBlocksCount() - 1;\n }", "title": "" }, { "docid": "308f65ae9da2c293578a995a040d240b", "score": "0.56519365", "text": "async validateBlock(height) {\n // Add your code here\n\n //1 retrieve block from levelDB\n //2 transform block to JavaScript Object using JSON.parse(block)\n //3 store the block.hash locally for later reference\n //4 reassign block.hash to an empty string (because when the block.hash was initalised block.hash = '';\n //5 perform a SHA256 hash on the reassigned block (above) and finally .toString()\n //6 Check that the hash in //5 === the locally stored hash from //3\n\n\n //1\n const blockFromDB = await this.getBlock(height);\n\n //2\n let blockObject = JSON.parse(blockFromDB);\n\n //3\n const originalHash = blockObject.hash;\n\n //4\n blockObject.hash = '';\n\n //5\n const reHash = SHA256(JSON.stringify(blockObject)).toString();\n\n //6\n if(originalHash === reHash) {\n // the validation === true.\n return true;\n } else if(originalHash !== reHash) {\n // validation failed.\n return false;\n }\n\n\n }", "title": "" }, { "docid": "c9428845c8475cc0e47e3fcbc542289d", "score": "0.565177", "text": "function spawnBlock(index){\n\tvar block;\n\tvar rand = Math.floor(Math.random() * 2);\n\tif(stack.length != 0){\n\t\tblock = new THREE.Mesh(\n\t\t\tnew THREE.BoxGeometry(10,10,10),\n\t\t\tnew THREE.MeshPhongMaterial({color:getRandomColor(), wireframe:USE_WIREFRAME})\n\t\t);\n\t\t//left block\n\t\tif(rand == 0){\n\t\t\tblock.position.x = (stack[stack.length - 1].position.x) + 10.1;\n\t\t\tblock.position.z = (stack[stack.length - 1].position.z);\n\t\t}\n\t\t//right block\n\t\telse{\n\t\t\tblock.position.z = (stack[stack.length - 1].position.z) + 10.1;\n\t\t\tblock.position.x = (stack[stack.length - 1].position.x) ;\n\t\t}\n\t\t//block.position.x = 2;\n\t\t//block.position.z = 2;\n\t\tblock.position.y = -5;\n\t\tblock.receiveShadow = true;\n\t\tblock.castShadow = true;\n\t\t//0 if the player has not hit the block\n\t\t//1 if the player has hit the block\n\t\tblock.hit = 0;\n\t\t//time after death before block starts falling\n\t\tblock.deathTimeout =0;\n\t\tstack.push(block);\n\t\tscene.add(stack[index]);\t\n\t\t\n\t}\n\telse{\n\t\tblock = new THREE.Mesh(\n\t\t\tnew THREE.BoxGeometry(10,10,10),\n\t\t\tnew THREE.MeshPhongMaterial({color:0x5E3C58, wireframe:USE_WIREFRAME})\n\t\t);\n\t\tblock.position.x = 17.5;\n\t\tblock.position.z = 22.6;\n\t\tblock.position.y = -5;\n\t\tblock.hit = 0;\n\t\tblock.deathTimeout =0;\n\t\tblock.receiveShadow = true;\n\t\tblock.castShadow = true;\n\t\tstack.push(block);\n\t\tscene.add(stack[0]);\n\t\t\n\t}\n}", "title": "" }, { "docid": "c5069a6615054beb0a6a74640f8420b2", "score": "0.56423736", "text": "createNewBlock(nonce, prevBlockHash, hash){\n //creates new block object\n const newBlock = new Block(\n this.chain.length + 1,\n Date.now(),\n nonce,\n prevBlockHash,\n hash,\n this.pendingTransactions\n );\n this.pendingTransactions = []; //sets to empty array. all pendingTransactions put in block\n this.chain.push(newBlock); //pushes new block to chain\n return newBlock; //returns the new block\n }", "title": "" }, { "docid": "7ef8419f6c728e4ea9b35221d1034405", "score": "0.5640959", "text": "function CreateBlock(args)\n{\n //debugger;\n var histID = WSM.APIGetActiveHistory();\n var pt1 = WSM.Geom.Point3d(0.0, 0.0, 0.0);\n var pt2 = WSM.Geom.Point3d(args.w, args.l, args.h);\n var blockID = WSM.APICreateBlock(histID, pt1, pt2);\n}", "title": "" }, { "docid": "98ee941a56ec8ea7c1b6fed1d17efb0c", "score": "0.56389296", "text": "async validateBlock(height) {\n const block = await this.getBlock(height);\n const blockHash = block.hash;\n block.hash = '';\n if (blockHash === this._hash(block))\n return true;\n else\n return false; //return new Error(`Block ${height} is not valid`);\n }", "title": "" }, { "docid": "c40fa8f18e6ee188ef465e55794d4902", "score": "0.5633984", "text": "function addBlock() {\n // 우선 class 사용 new header -> new block (header, body) 를 해야겠군\n const version = getVersion()\n const index = getLastIndex() + 1\n const time = getCurrentTime()\n const previousHash = getLastHash()\n\n const body = ['next block']\n const tree = merkle('sha256').sync(body)\n const root = tree.root() || '0'.repeat(64)\n\n const header = new BlockHeader(version, index, previousHash, time, root)\n Blocks.push(new Block(header, body))\n}", "title": "" }, { "docid": "7789b94a55d67f7df8c6a02546c1bf2f", "score": "0.5627669", "text": "createBlock(data) {\n const previousBlock = this.chain[this.chain.length - 1];\n const nextIndex = previousBlock.index + 1;\n const nextBlock = new Block(nextIndex, data, previousBlock.hash);\n\n nextBlock.findNonce(this.difficulty);\n this.chain.push(nextBlock);\n\n return nextBlock;\n }", "title": "" }, { "docid": "7e867be9fdb01ffb086cbbcf3de396d4", "score": "0.5621896", "text": "function ensureBlock() {\n return t.ensureBlock(this.node);\n}", "title": "" }, { "docid": "87c86337232bc7dc906ae918826af817", "score": "0.5619156", "text": "function spawnFallingBlock() {\n\t// random integer between 0 - 480\n\tvar xcoord = Math.floor(Math.random() * (480));\n\n\tgameArea.addObj(new FallingBlock(30, 10, xcoord, 0, 2));\n}", "title": "" }, { "docid": "93cc5cf139f822d54d292f5fe476f271", "score": "0.5618898", "text": "function detectHeight() {\n\t\tvar arrForHeight = [];\n\n\t\t$('.pricing__bl').each(function() {\n\t\t\tvar priceBlockHeight = $(this).outerHeight();\n\t\t\tarrForHeight.push(priceBlockHeight);\n\t\t});\n\n\t\tvar max = Math.max.apply(null, arrForHeight);\n\t\t$('.pricing__bl > .pricing__in').css({'height': max});\n\t}", "title": "" }, { "docid": "80d364a5dbae6b8ec38e95bea4df1c12", "score": "0.5614453", "text": "addBlock(data) {\n const lastBlock = this.chain[this.chain.length-1];\n const block = Block.mineBlock(lastBlock, data);\n this.chain.push(block);\n return block;\n }", "title": "" }, { "docid": "939dfc0e4f66412bd2242877a1d70638", "score": "0.56079847", "text": "getBlock(height) {\n // Query the database to fetch block\n return this.db.getLevelDBData(height);\n }", "title": "" }, { "docid": "9addfd065bece0c3dc97d9d23b14be78", "score": "0.5594669", "text": "function GenBlock(bWidth, bHeight, padding, group)\n{\n var genBlock = new Array(bWidth);\n var scale = 1;\n for(x = 0; x < genBlock.length; x++)\n {\n genBlock[x] = new Array(bHeight);\n for(y = 0; y < genBlock[0].length; y++)\n {\n //Add building to lot\n var cube = CreateCube(scale, new THREE.Vector3(x+(x*padding), 1, y+(y*padding)));\n genBlock[x][y] = cube;\n group.add(genBlock[x][y]);\n //welcomeScene.add(cube);\n }\n }\n return genBlock;\n}", "title": "" }, { "docid": "016f386c434ae3efaafc3c0f22a1c2c3", "score": "0.5592884", "text": "constructor() {\n // Array of blocks, we provide our genesis block\n this.chain = [Block.genesis()];\n }", "title": "" }, { "docid": "56141c4e3912d69788da3adfffad9ff2", "score": "0.559183", "text": "addBlock(newBlock) {\n return this.getBlockHeight()\n .then((height) => {\n let promisePrevBlock;\n\n newBlock.height = height;\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n\n if (height > 0) {\n promisePrevBlock = this.getBlock(height - 1)\n .then((previousBlock) => {\n // linked blocks\n newBlock.previousBlockHash = previousBlock.hash;\n });\n }\n\n return Promise.all([promisePrevBlock])\n .then(() => {\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n return db.put(height, JSON.stringify(newBlock));\n });\n })\n .then(() => Blockchain.instance);\n }", "title": "" }, { "docid": "f4b4ab2f2ec46497c3de3025756d1ff1", "score": "0.55911493", "text": "function getGenesisBlock() {\n return {\n timestamp: 380221200000,\n lastHash: 'bigbang',\n hash: '0000c5f48c60d075730f45945cc7f8cad953e7d0f168186c8c7d3ff07db6f0f7',\n data: [{\n id: 'genesis',\n input: {},\n outputs: [\n {\n address: '046acf12468cb92de2e7bf7442987d73c183719454ccd91e42c5785437954c97418ec6fa979c63e82f4dd794db28f86f41ac81275603dbad9f99ac06d5046c133a',\n amount: 1000,\n },\n ],\n }],\n nonce: 195250,\n difficulty: 4,\n };\n}", "title": "" }, { "docid": "7300b39ca0dff70bdbe21ff0309c25cd", "score": "0.5589107", "text": "function generateBlock() {\n\t\tvar sizeX = Math.floor(generateRandom(35, 50)),\n\t\t\tsizeY = sizeX,\n\t\t\tx = Math.floor(generateRandom(0, rect.width - sizeX)),\n\t\t\ty = -sizeY,\n\t\t\tspeed = generateRandom(1, 5),\n\t\t\tmodifier = \"\", \n\t\t\tr = Math.floor(generateRandom(100, 255)),\n\t\t\tg = Math.floor(generateRandom(100, 255)),\n\t\t\tb = Math.floor(generateRandom(100, 255));\n\t\t\tif(generateRandom(1, 100) >= 90) {\n\t\t\t\tswitch(Math.floor(generateRandom(1, 5))) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tmodifier += \"speedUp\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tmodifier += \"slowDown\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tmodifier += \"damage\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tmodifier += \"bomb\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tspeed = 1;\n\t\t\t}\n\t\tblock = {\n\t\t\tsizeX: sizeX,\n\t\t\tsizeY: sizeY,\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tspeed: speed,\n\t\t\tmodifier: modifier,\n\t\t\tr: r,\n\t\t\tg: g,\n\t\t\tb: b\n\t\t}\n\t\treturn block;\t\n\t}", "title": "" }, { "docid": "34a77e3aac9185dc9b3f05adb5d5966a", "score": "0.55826914", "text": "addBlock(data){\n const lastBlock = this.chain[this.chain.length-1];\n const block = Block.mineBlock(lastBlock, data);\n this.chain.push(block);\n\n return block;\n }", "title": "" }, { "docid": "f9a145c4e8add47a5b6b497d1e87ac04", "score": "0.5579127", "text": "newBlock() {\r\n this.block = new Block (this.x, this.y, this.nextTypeQueue[0]);\r\n for (let i = 0; i < this.nextTypeQueue.length - 1; i++) {\r\n this.nextTypeQueue[i] = this.nextTypeQueue[i + 1];\r\n }\r\n this.nextTypeQueue[this.nextTypeQueue.length - 1] = this.randomizer();\r\n this.blockCounter++;\r\n for (let i = 0; i < this.nextTypeQueue.length; i++) {\r\n switch (this.nextTypeQueue[i]) {\r\n case I:\r\n this.nextBlockQueue[i] = new Block(COLUMNS + 7, 3.5 + i*5, this.nextTypeQueue[i]);\r\n break;\r\n case T:\r\n this.nextBlockQueue[i] = new Block(COLUMNS + 7.5, 3 + i*5, this.nextTypeQueue[i]);\r\n break;\r\n case O:\r\n this.nextBlockQueue[i] = new Block(COLUMNS + 8, 4 + i*5, this.nextTypeQueue[i]);\r\n break;\r\n default:\r\n this.nextBlockQueue[i] = new Block(COLUMNS + 7.5, 4 + i*5, this.nextTypeQueue[i]);\r\n }\r\n }\r\n if (this.blockCounter%7 === 6) {\r\n this.level++;\r\n this.maxDropTimer -= FRAMERATE/this.level/3;\r\n }\r\n if (this.collides()) {\r\n newGame();\r\n }\r\n this.storageUsed = false;\r\n }", "title": "" }, { "docid": "c5fb3327cae2443de72353c8fa885362", "score": "0.5575742", "text": "function mine() {\n const block = (0, _block.create)(JSON.stringify({data: \"BLOCKHEADZ\", from: \"SERVER\"}));\n _chain2.default.update(block);\n (0, _handlers.broadcast)((0, _actions.responseLatestMsg)());\n\n console.log('New block in chain has been added: ', block);\n return block;\n}", "title": "" }, { "docid": "65dbb3847477965f87f9775a1c90af1c", "score": "0.55742806", "text": "constructor(){\n\t\tthis.chain = [this.createGensisBlock()];\n\t\tthis.difficulty = 2;\n\t\t//we only create blocks on a specific interval, e.g. Bitcoin's 'Proof of Work' algorithm means 1 bitcoin per 10mins. \n\t\t//pendingTransactions stores transactions waiting for 'Proof of Work' time periods to pass\n\t\tthis.pendingTransactions = [];\n\t\t//defining a property that will control how much coins the miners get as rewards for each block mined.\n\t\tthis.miningReward = 100;\n\n\t}", "title": "" }, { "docid": "c8767daa64bed6ce6f75edb5083168a3", "score": "0.5563463", "text": "function addBlocks (Blockly) {\n const color = '#42CCFF';\n const dhtIconUrl = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI0NDJweCIgaGVpZ2h0PSIxODhweCIgdmlld0JveD0iMCAwIDQ0MiAxODgiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDQ0MiAxODgiIHhtbDpzcGFjZT0icHJlc2VydmUiPiAgPGltYWdlIGlkPSJpbWFnZTAiIHdpZHRoPSI0NDIiIGhlaWdodD0iMTg4IiB4PSIwIiB5PSIwIgogICAgaHJlZj0iZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFib0FBQUM4Q0FNQUFBQTVCNXNlQUFBQUJHZEJUVUVBQUxHUEMveGhCUUFBQUNCalNGSk4KQUFCNkpRQUFnSU1BQVBuL0FBQ0E2UUFBZFRBQUFPcGdBQUE2bUFBQUYyK1NYOFZHQUFBQXBWQk1WRVgvLy84VkZSZGozLzh3WkhkaQpYVnQ1Y25DSmduNUVRVUVpSWlPUGg0TnpiV3BGUWtKWFVsRWVIUjhzTEN4ZVVWWXJLU3BCUGo1V1VWQm5ZbUIyY0cyQ2UzaUtnMzh3CkxpOVFURXh1YVdhTGc0QThPanBqWGx5SWdIMDROalprWDEwa0l5VlZVVkNGZm5vM05UVnNabVI4ZFhKS1IwYUZmbnVJZ1gxeGEyZysKT3pzcktpb2RIUjRXRmhpS2duNWhYRm82TnpodWFHWmVXVmNuSmlkWVZGSWJHeDMvLy8veXl5bVNBQUFBQVhSU1RsTUFRT2JZWmdBQQpBQUZpUzBkRUFJZ0ZIVWdBQUFBSmNFaFpjd0FBQ3hNQUFBc1RBUUNhbkJnQUFBQUhkRWxOUlFma0RBZ0JPREtmejdHV0FBQUZYa2xFClFWUjQydTNkYTNQVE9oQ0hjYUNYSEhNNDBLYjMrNVZDMDVhV2xuNy9yOFlNRENkeVF1eTFvdFd1N09mL05qdDAwRy9peUZySmZ2T1cKNU0rYkpMSCtYd3d5MEJVYjZJb05kTVVHdW1JRFhiR0JydGhBVjJ5Z0t6YlFGUnZvaWswaXVuZjlqTFVPZE5CQjV5clFRZGZMV090QQpCeDEwcmdJZGRMMk10UTUwMEVIbkt0QkJ0MVJXNXBQZUllS1BXT3YwZzI1bGFWN29vSE1TNktDRERqcm9vSU1PT3FlQkRqcm9vSU1PCk91aWdjeHJvb0lNT09rOTBxMnZyNjJ1cm8zK3NsWVpPRjVIcWQ5Ny9hODBFWFNSZFZYMzR6eHJLSzEyY2JrYTY2b00xVk1GMEpwblMKVmY2dW1kQUo2ZDY3bTZ0QUo2U3JSdFpVME1YU3JWcFRRUmRMdDVhYjVtTnJvSlBSclVOWFVxQXJObHd3aTQzcE5BVzZWSFRaYnc2ZwpTMFNYLzVZY3VrUjArUmZDUE5DMXJ4eXJOT01TckU2YkxqL25vMXNHeGoyZFJkTUh1Z1IwTnEzVzN0QzFWTVQ5QzIyNnBoc2NvRnVHCnpvUU1PdWlnYzBMM1NTWFFRUWNkZE5CQkJ4MTAwRUVIWFNhNmpjM3gxdmJPYnJXN3M3MDEzdHlBcmhDNnZmMkR3N0JiV3gwZTdPOUIKNTUvdTZQaWttcy9KOFZFY0hhc3B1ZWhPejZwRk9UdDFScmM0QTZRN3Y3aXNGdWZ5NGh3Nlpicllwcy9WZGRXYzZ5dm9kT2tpVzYyagp6MVZiUHJkdk1QTkFseU9xZEIwM09OeDhhWldycWk4MzBHa21hbHZSelZlQlhGVjliYk9ETGcyZGZEUGZTUEtkKy9XOWE3bG1RcGVJClRycUY5cXI5ZCs3LzM3c3I2SExRQ1RldW43Zk5MY05jbjBPWGcwNTJYT1JpSHVoMlBMbTdmN2kvbTR4dlp6KzZnQzRIbmVpUTF1bnMKbmZpM3g2Zmc0NmZIYjdWUEw1dldWYUJMUlNjNkdqbTcrdlY5TWxNdytWNzcvQXc2SjNSSE0zTFBMM01sTDgrMWlvYTFhT2hTMFVrdQptTWQxdVIrdmY2bDUvUkdXSEVPblR5ZVlwdXpWdXp6UHIzK3RlZzIvZHllTCszZlFwYUlUM0J6czEzL25YaGFVdllTL2QvdlFhZE5KCmJza1BhblBMeWNLNlNURFBQSEJBSjE3VGpVcm5sZVBVZElLRnNJM2Fib2JIaHNySGFkbmh3djBxSHVpaW1qN082Q1RMejV1MTYrVlQKUStWVFVMYzVkTHFJams0WE9sSFRaeHpLM1RhVzNrNEx4OURGOU91RWRNSlc2MVpJTjI0c0RaUzNvTk9nNjdiQllUdWttelNXVHFhRgoyOUJwME1uSS9tUW5wTHRyTEwyYkZ1NUFaMCszRzlMZE41YmVUd3Qzb2JPbnEwMHdIeHBMSDRKS0lWMlczYzlEcGRQOTFrR25TS2Y3Cld3ZWRJcDN1REJNNlJUcmQrenJvRk9sMFYxT2dVNlRUWGNPRVRwRk90M01BblNLZGJyOE9PazI2VXJ2a2ZhUWJkVnQvSHVMZUZLOTAKZndaWWVzQ09IV0ZwOEJQU1NRL1lzUTlUaHk0aXdSakxEdGl4KzlsTHdsRVdYVE01YytBbDRURExEdGh4MHNkSmF1TXNPbURIK1RvbgpxUTIwN0lBZHAxcDlwRGJTd3JlZ2NaYmNSV3BETFgzM0lFOXc4SkFvT3A2YjRpRXhGOHkzUEszSVF5S21LYi9TbTJlRWxadmFjSGQ1CmJXUmZuc3hYYnNMeDd2amF5SDQ4RDdNMUdzdVB5ZWs2dndpdG5LZlFHdE9wOEFkREh2UGF5S1RQZnRhamF4aXpwWnR4a3BxWWhsN3kKcHM5ODBqMXhIYm9vT3BQWFJrSzNERjNIRFE3USthR3pFSU1PT3VpZ2d3NjZvZExwN1g2R0Rqcm9vSU1PT3VpZ2d3NDY2S0NERGpybwpHdWowVmxPc28wSTNqS2FQZFZUb2h0RnE3V1dXMytBQW5UbGQxTFlpNkZ6UWRkL01CNTBYdW81YmFLSHpROWRwNHpwMDFvazlMZ0tkCmVXcDA4a05hME5tblJpYytHcGtwS2VDZ2c4NWRUQytZMENXanl6MU5nUzRaWGU2Ymd3TG9WcUpXaHJQVFpiOGxoeTRWblVYekFMb1UKZFBtWG4vdERaMkZyMnZTQnJ1SHZpT2xNV3EzUUxVTm51c0VCdW1Yb3JIV2dndzQ2VjRFT091aWdndzQ2NktCekd1aWdndzQ2NktDRApUcDB1Y3VTaEd3NWRSS3gxb0lQT2xzNGkxanJRUVFlZHEwQUhYUzlqclFNZGROQzVDblJEcHlQNUExMnhnYTdZUUZkc29DczIwQldiCkpISS9BWjd3VFRwYVR2clJBQUFBSlhSRldIUmtZWFJsT21OeVpXRjBaUUF5TURJd0xURXlMVEE0VkRBeE9qVTJPalV3S3pBd09qQXcKaDJQUDdnQUFBQ1YwUlZoMFpHRjBaVHB0YjJScFpua0FNakF5TUMweE1pMHdPRlF3TVRvMU5qbzFNQ3N3TURvd01QWStkMUlBQUFBQQpTVVZPUks1Q1lJST0iIC8+Cjwvc3ZnPgo=';\n\n Blockly.Blocks['DHT_INIT'] = {\n init: function () {\n this.jsonInit({\n \"message0\": Blockly.Msg.DHT_INIT,\n \"args0\": [{\n \"type\": \"input_value\",\n \"name\": \"no\"\n }, {\n \"type\": \"field_dropdown\",\n \"name\": \"pin\",\n \"options\": [\n ['0', '0'],\n ['1', '1'],\n ['2', '2'],\n ['3', '3'],\n ['4', '4'],\n ['5', '5'],\n ['6', '6'],\n ['7', '7'],\n ['8', '8'],\n ['9', '9'],\n ['10', '10'],\n ['11', '11'],\n ['12', '12'],\n ['13', '13'],\n ['A0', 'A0'],\n ['A1', 'A1'],\n ['A2', 'A2'],\n ['A3', 'A3'],\n ['A4', 'A4'],\n ['A5', 'A5']]\n }, {\n \"type\": \"field_dropdown\",\n \"name\": \"mode\",\n \"options\": [\n ['dht11', '11'],\n ['dht21', '21'],\n ['dht22', '22']]\n ['dht23', '23']]\n }],\n \"colour\": color,\n \"extensions\": [\"shape_statement\"]\n });\n }\n};\n\n Blockly.Blocks.dht_readHumidity = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.DHT_READ_HUMIDITY,\n args0: [\n {\n type: 'field_image',\n src: dhtIconUrl,\n width: 50,\n height: 27\n }\n ],\n args1: [\n {\n type: 'input_value',\n name: 'no'\n }\n ],\n colour: color,\n extensions: ['output_number']\n });\n }\n };\n\n\n Blockly.Blocks.dht_readTemperature = {\n init: function () {\n this.jsonInit({\n message0: '%1',\n message1: Blockly.Msg.DHT_READ_TEMPERATURE,\n args0: [\n {\n type: 'field_image',\n src: dhtIconUrl,\n width: 50,\n height: 27\n }\n ],\n args1: [\n {\n type: 'input_value',\n name: 'no'\n },\n {\n type: 'field_dropdown',\n name: 'unit',\n options: [\n ['℃', 'false'],\n ['℉', 'true']]\n }\n ],\n colour: color,\n extensions: ['output_number']\n });\n }\n };\n\n return Blockly;\n}", "title": "" }, { "docid": "63c175dbff4b9ee4a5c5d0e6d74dbe8f", "score": "0.55595917", "text": "function InitBlocks(){\n\t\t//alert(\"InitBlocks\");\n\t\tvar bMat = new THREE.MeshPhongMaterial({\n\t\t\tcolor: 0xFF9900\n\t\t});\n\n\t\tblocks = new Array();\n\t\tvar count = 0;\n\t\tfor(var n = 0; n < 32; n++){\n\t\t\trandX = Math.round((threeDWidth-10)*Math.random());\n\t\t\trandY = Math.round((threeDHeight-10)*Math.random());\n\t\t\tif(n < 2){\n\t\t\t\t//alert(\"building1!\");\n\t\t\t\tvar building1 = new building_three();\n\t\t\t\t//alert(\"added building!\");\n\t\t\t\tfor(var i = randY; i < randY+10; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+10; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(n >= 2 && n < 7){\n\t\t\t\tvar building2 = new building_one();\n\t\t\t\tfor(var i = randY; i < randY+3; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+3; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(n >= 17 && n < 22){\n\t\t\t\tvar building3 = new building_two();\n\t\t\t\tfor(var i = randY; i < randY+3; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+3; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tvar building4 = new building_four();\n\t\t\t\tfor(var i = randY; i < randY+2; i++){\n\t\t\t\t\tfor(var j = randX; j < randX+2; j++){\n\t\t\t\t\t\tmapMatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (var i = 0; i < threeDHeight; i+=4){\n\t\t\tfor (var j = 0; j < threeDWidth; j++) {\n\t\t\t\t\tif(mapMatrix[i][j] == 2){\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Horizontal SEO\n\t\t\t\t\t\tvar preJ = j;\n\t\t\t\t\t\tvar rowNum = 0;\n\t\t\t\t\t\twhile(mapMatrix[i][j] == 2) {\t\n\t\t\t\t\t\t\trowNum++;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\n\t\t\t\t\t\tvar b1 = new THREE.Mesh(\n\t\t\t\t\t\t\tnew THREE.CubeGeometry(10*rowNum, 200*Math.random()+10, 10),\n\t\t\t\t\t\t\tbMat\n\t\t\t\t\t\t);\n\t\t\t\t\t\t//var b1 = new THREE.Mesh(\n\t\t\t\t\t\t//\tnew THREE.PlaneGeometry(10*rowNum, 10), \n\t\t\t\t\t\t//\tnew THREE.MeshLambertMaterial({color: 0xFFFFFF})\n\t\t\t\t\t\t//);\n\t\t\t\n\t\t\t\t\t\tvar nowJ = preJ + (rowNum-1)/2;\n\t\t\t\t\t\tb1.position.y = 0;\n\t\t\t\t\t\tb1.position.x = nowJ * 10;\n\t\t\t\t\t\tb1.position.z = i * 10;\n\t\t\t\t\t\tscene.add(b1);\n\t\t\t\t\t\tblocks.push(b1);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconsole.log(count);\n\t}", "title": "" }, { "docid": "7acbcfb154e18d329447cd42d8312e9c", "score": "0.55553013", "text": "constructor(height) {\r\n\t\tsuper(height);\r\n\t\tthis.grown = 0;\r\n\t\tthis.branches = 0;\r\n\t}", "title": "" }, { "docid": "a85b8a9de6f8a14feb131313622e83d2", "score": "0.5552488", "text": "function generateBlocks() {\n const getRandomColor = () => {\n return `rgb(${Math.floor(Math.random() * 256)},${Math.floor(Math.random() * 256)},${Math.floor(Math.random() * 256)})`;\n }\n function createBlocks() {\n const blocksLength = 25;\n const parentSquare = document.getElementById('parentSquare');\n parentSquare.innerHTML = '';\n for(let i = 0; i < blocksLength; i++) {\n const block = document.createElement('div');\n block.style.height = \"50px\";\n block.style.width = \"50px\";\n block.style.backgroundColor = getRandomColor();\n parentSquare.append(block);\n }\n return parentSquare;\n }\n return createBlocks();\n}", "title": "" }, { "docid": "891aeabffff2c9f7be6908626f7a6635", "score": "0.5549134", "text": "addOwnBlock(data) {\n //Generate raw data\n let block = this.rule.createNewBlock(this.chain.getLastBlock(),data);\n let integer = this.chain.getCorrectIntegrity();\n this.chain.addBlock(block, integer);\n //Check if block matches description\n return block;\n }", "title": "" }, { "docid": "0e8d4d02eac75a3a49aaa269dda3fca8", "score": "0.55465746", "text": "function createBlock(_data) {\n\tlet block = {\n\t\tindex: Blockchain.blocks.length,\n\t\tprevHash: Blockchain.blocks[Blockchain.blocks.\n\t\tlength - 1].hash,\n\t\tdata: _data,\n\t\ttimestamp: Date.now()\n\t}\n\tblock.hash = blockHash(block)\n\tBlockchain.blocks.push(block)\n\tconsole.log(block)\n\treturn block\n}", "title": "" }, { "docid": "d0174850d2883672bcd295ac5e547d1b", "score": "0.5529021", "text": "getBlockByHeight() {\n this.app.get(\"/block/height/:height\", async (req, res) => {\n\n // VALID REQUEST WITH PARAM\n if (req.params.height) {\n const targetHeight = parseInt(req.params.height);\n let block = await this.blockchain.getBlockByHeight(targetHeight);\n \n // VALID BLOCK\n if (block){\n return res.status(BlockchainController.SUCCESS).json(block);\n\n // INVALID BLOCK\n } else {\n return res.status(BlockchainController.INTERNAL_ERROR).send(\"Block Not Found By Height!\");\n }\n\n // INVALID REQ\n } else {\n return res.status(BlockchainController.ERROR).send(\"Block Not Found. Please review parameter:\" + req.params.height);\n }\n \n });\n }", "title": "" }, { "docid": "8c044bfcac08d950f3050ea099c09d9b", "score": "0.5527623", "text": "getBlockHeight() {\n // Add your code here\n let self = this;\n return self.bd.getBlocksCount().then(count => {\n return count - 1;\n }).catch(err => console.log(err));\n\n }", "title": "" } ]
62082841f60ea1ad891c9db73abf5d8a
console.log(arrayWey); console.log(typeof arrayWey); console.log("LOS ARRAY SON TIPO OBJETO"); Desplaza 13 espacios cada caracter
[ { "docid": "e06933079c104b8e8471eb1b97aa00df", "score": "0.0", "text": "function rot13(str) {\n let newStr=[];\n for (let i = 0; i < str.length; i++) {\n newStr[i]=str[i];\n switch (newStr[i]) {\n case \"A\": newStr[i]=\"N\"; break;\n case \"B\": newStr[i]=\"O\"; break;\n case \"C\": newStr[i]=\"P\"; break;\n case \"D\": newStr[i]=\"Q\"; break;\n case \"E\": newStr[i]=\"R\"; break;\n case \"F\": newStr[i]=\"S\"; break;\n case \"G\": newStr[i]=\"T\"; break;\n case \"H\": newStr[i]=\"U\"; break;\n case \"I\": newStr[i]=\"V\"; break;\n case \"J\": newStr[i]=\"W\"; break;\n case \"K\": newStr[i]=\"X\"; break;\n case \"L\": newStr[i]=\"Y\"; break;\n case \"M\": newStr[i]=\"Z\"; break;\n case \"N\": newStr[i]=\"A\"; break;\n \n case \"Ñ\": newStr[i]=\"B\"; break;\n\n case \"O\": newStr[i]=\"B\"; break;\n case \"P\": newStr[i]=\"C\"; break;\n case \"Q\": newStr[i]=\"D\"; break;\n case \"R\": newStr[i]=\"E\"; break;\n case \"S\": newStr[i]=\"F\"; break;\n case \"T\": newStr[i]=\"G\"; break;\n case \"U\": newStr[i]=\"H\"; break;\n case \"V\": newStr[i]=\"I\"; break;\n case \"W\": newStr[i]=\"J\"; break;\n case \"X\": newStr[i]=\"K\"; break;\n case \"Y\": newStr[i]=\"L\"; break;\n case \"Z\": newStr[i]=\"M\"; break;\n default:\n break;\n }\n }\n newStr=newStr.toString();\n newStr=newStr.replace(/,/g,\"\");\n // console.log(newStr);\n return newStr;\n}", "title": "" } ]
[ { "docid": "63366a20d32bb32a3ec7d65030fcf1f1", "score": "0.6562227", "text": "function showElements(array){\n //OJO: si no fuesen objetos-->alert(\"Discos de la lista: \"+arrayDiscos); \n //alert(arrayDiscos.toString()); (ver como crear una .toString en js)\n cadena=JSON.stringify(array);\n //console.log(cadena);\n alert(\"Mostrando elementos:\\n\"+cadena);\n}", "title": "" }, { "docid": "585049058ee8432e50e8a29862ae2345", "score": "0.61323583", "text": "function arr1() {\n\n /*\n I---------I---------I---------I\n 0 1 2 3\n \n Skapa en array \"cities\" med städerna Stockholm, Göteborg och New York\n Skriv ut det första, andra och tredje elementet i arrayen\n Vad händer om du försöker komma åt det fjärde elementet (som inte finns)?\n */\n\n let cities = ['Björknäs', 'Moshi', 'Dar Es Salaam'];\n // console.log(cities[0]);\n\n cities.forEach(city => {\n console.log(city);\n });\n\n\n // let emptyArr = [];\n // console.log(emptyArr);\n\n // Extra: skriv ut det andra elementet (\"Göteborg\") två gånger\n // Extra: Skriv ut de två första elementen vid sidan av varandra (\"StockholmGöteborg\")\n}", "title": "" }, { "docid": "e7253882085d0e8d661900b84164eefe", "score": "0.6012404", "text": "function Dev_log(array){ \r\n\tconsole.log(array);\r\n}", "title": "" }, { "docid": "1cdd2b833c1aa73ca858178ad27c9337", "score": "0.5987142", "text": "function logArrTypes(mixedArr){\n\nforEachElem(mixedArr, (el) => {\n console.log(typeof el)\n})\n\n}", "title": "" }, { "docid": "be14c189995b23e06d5601ef42f20e76", "score": "0.5976183", "text": "function arrayTipi (array){\r\n const tipi = [];\r\n\r\n array.forEach((item) => {\r\n // Se non include lo stesso item.type allora lo puoi pushare.\r\n if (!tipi.includes(item.type)) {\r\n tipi.push(item.type);\r\n }\r\n });\r\n return tipi;\r\n}", "title": "" }, { "docid": "e6a5b199e14a5c710bd8629ac9fe09fa", "score": "0.596175", "text": "function printArray(Array){\r\n\r\n return Array\r\n}", "title": "" }, { "docid": "e0fbb1e57948129aaa62c35018b38fe4", "score": "0.5961707", "text": "function logArrTypes(array) {\n forEachElem(array, (elem) => console.log(`${elem} is a ${typeof(elem)}`))\n}", "title": "" }, { "docid": "07effb56a63c793d1a81b54bbc3c0e81", "score": "0.59069234", "text": "function devuelveArrayComentado() {\n var el_nombre = document.getElementById(\"nombre2\").value.toUpperCase();\n var su_nombre = [...el_nombre];\n console.log(`Partim del nom ${el_nombre}`);\n\n for (let i = 0; i < su_nombre.length; i++) {\n\n if (isNaN(su_nombre[i])) {\n \n var letra = su_nombre[i];\n \n if (letra === 'A' || letra === 'E' || letra === 'I' || letra === 'O' || letra === 'U') {\n console.log(`He trobat la VOCAL: ${letra}`);\n } else {\n \n console.log(`He trobat la CONSONANT: ${letra}`);\n }\n\n \n } else {\n console.log(`Els noms de persones no contenen el numero: ${su_nombre[i]}`);\n \n\n }\n }\n}", "title": "" }, { "docid": "61600c79dfffc617b338f817f77db034", "score": "0.5906012", "text": "function tk(e){return Array.isArray(e)}", "title": "" }, { "docid": "389ca7bde98372bfb783cbb782e26213", "score": "0.5883206", "text": "getArrayTramo(){\n return this.l_arrayTramo;\n }", "title": "" }, { "docid": "9b72088f6f355a6ad979106ca256822e", "score": "0.582728", "text": "isArray (what) {\n return Object.prototype.toString.call(what) === \"[object Array]\";\n }", "title": "" }, { "docid": "db1dffd9e733f014bcbd896c05b6bd3d", "score": "0.5807252", "text": "function SeaArray() {}", "title": "" }, { "docid": "db1dffd9e733f014bcbd896c05b6bd3d", "score": "0.5807252", "text": "function SeaArray() {}", "title": "" }, { "docid": "b800672d3b5c802d86aba4a2ea0e4c09", "score": "0.5764471", "text": "function printArray(array) {\n console.log(array);\n}", "title": "" }, { "docid": "8ee4b96a19558ef5598cc973d55e31fe", "score": "0.57524234", "text": "function e(t){return Array.isArray?Array.isArray(t):\"[object Array]\"===g(t)}", "title": "" }, { "docid": "8d2998b61ee56c9afd8c82bd0b3472c7", "score": "0.57489353", "text": "function prendoPerTipo(array) {\r\n const iconeTipi = [];\r\n array.forEach((element) => {\r\n //*devo inserire la condizione perché per pushare non lo deve includere\r\n // types.push(element.type)\r\n if (!iconeTipi.includes(element.type)) {\r\n iconeTipi.push(element.type);\r\n };\r\n\r\n });\r\n return iconeTipi;\r\n}", "title": "" }, { "docid": "b112b4b6ace5ab7dee641dd4be53f031", "score": "0.5746584", "text": "toString () { return `${this.length} ${util.arraysToString(this)}` }", "title": "" }, { "docid": "385ba226685d25d3f8eb039cee321c49", "score": "0.57415223", "text": "function arrayToString(arr) {\n\n}", "title": "" }, { "docid": "cd0b94a5d26432d8f46f1233857a652c", "score": "0.5727192", "text": "function mendArr(str) {\n let newArrayOne = str.split(/\\W/).join(\" \");\n console.log(\"mend array function\", typeof newArrayOne);\n return newArrayOne;\n}", "title": "" }, { "docid": "a5757305b18f7c8d81b12fd44cc9abc8", "score": "0.57243246", "text": "function i(t){return Array.isArray(t)}", "title": "" }, { "docid": "6cbf957cdae3737f21dab05977cfb624", "score": "0.57150865", "text": "toString() {\n return arrayToString(this);\n }", "title": "" }, { "docid": "59d4451df80d60872cb60d992c43fefb", "score": "0.57073617", "text": "function t(e){return Array.isArray?Array.isArray(e):\"[object Array]\"===p(e)}", "title": "" }, { "docid": "51c3df7ad28c90662a17eb4c4c255e2e", "score": "0.57007605", "text": "function saludoArray (n){\n\n if(n!==\"Eduardo\")\n return Saludo = [\"hola\", n]\n \n\n else\n return listadenombresnogustada = [\"no nos gusta\", \"el nombre de\", n]\n\n}", "title": "" }, { "docid": "d3130fae5668a037d95a061ea83f21ec", "score": "0.5695287", "text": "function printArray(array){\n return array.toString().split('').join('');\n}", "title": "" }, { "docid": "e5bd3f1208e225b98bd6938aff073216", "score": "0.5677187", "text": "function le_preparaPaginaLeitura() {\n/*--------------------------------*/\nconsole.log(\"leit.js> *** Executando le_preparaPaginaLeitura() ***\");\n \n // Carregar ev_dtInicLeit ---> ACERTAR\n // ev_arrayLidas\n\n\n console.log(\"leit.js> =======<<< PREPARA PAGINA LEITURA >>>=======\");\n console.log(\"leit.js> ev_dtInicLeit.: \" + ev_dtInicLeit);\n console.log(\"leit.js> ev_numLeit....: \" + ev_numLeit);\n console.log(\"leit.js> ev_numHoje....: \" + ev_numHoje);\n console.log(\"leit.js> ev_numPend....: \" + ev_numPend);\n console.log(\"leit.js> ----------------------------------------\");\n console.log(\"leit.js> ev_arrayLidas.: \" + ev_arrayLidas[ev_numLeit]);\n console.log(\"leit.js> ev_dtHoje.....: \" + ev_dtHoje);\n console.log(\"leit.js> ev_arrayDatas.: \" + ev_arrayDatas[ev_numLeit]);\n console.log(\"leit.js> =================================================\");\n \n\n}", "title": "" }, { "docid": "259b38a584310614f8bb9e635e8d7d4f", "score": "0.5647336", "text": "function mostrarArray(elementos, textoCustom = \"\") {\n document.write(\"<h1>CONTENIDO DEL ARRAY \" + textoCustom + \"</h1>\");\n document.write(\"<ul>\");\n elementos.forEach((elemento, index) => {\n document.write(\"<li>\" + elemento + \"</li>\");\n });\n document.write(\"</ul>\");\n}", "title": "" }, { "docid": "c7197a7b43246775f68267dc48990b67", "score": "0.5647003", "text": "function SmiToString() {\n result = array.toString();\n}", "title": "" }, { "docid": "67c803a38885a0a7572ecd7b7a58e253", "score": "0.5641526", "text": "function spausdintiVisusNumerius(arr) {\n for (var i = 0; i < arr.length; i++){\n console.log(arr[i]);\n }\n}", "title": "" }, { "docid": "7b0deb3d77d7a8affce99bca28917d63", "score": "0.562714", "text": "function InicializaArray(){\r\n primervalor = 0;\r\n segundovalor = 0;\r\n accion = '';\r\n\r\n}", "title": "" }, { "docid": "69b6b98b948eded269fe930817f4c547", "score": "0.5608092", "text": "function mostrarArray(elementos, textoCustom =\"\"){\r\n\tdocument.write(\"<h1>contenido dentro del array\"+textoCustom+\"</h1>\")\r\n\r\n\tdocument.write(\"<ul>\");\r\n\telementos.forEach((elemento, index) =>{\r\n\tdocument.write(\"<li>\" +elemnto+ \"</li> \");\r\n\r\n\r\n\t});\r\n\tdocument.write(\"</ul>\")\r\n}", "title": "" }, { "docid": "1fbfb9a0e7d8be5b49e5dcf2d977b1e1", "score": "0.5598788", "text": "function le_converteLidasEmArray( stringLidas ) {\n/*---------------------------------------------*/\nconsole.log(\"leit.js> *** Executando le_converteLidasEmArray() ***\");\n\n var arrayLidas = new Array();\n\n for (i = 0; i <= 365; i++) {\n if ( i == 0 ) {\n arrayLidas[i] = \"X\";\n } else {\n if ( i <= ( stringLidas.length ) ) {\n arrayLidas[i] = stringLidas.charAt( i-1 );\n } else {\n arrayLidas[i] = \"N\";\n };\n };\n };\n\n return arrayLidas;\n}", "title": "" }, { "docid": "99cd713ada1b8bd90ddfb530057db58e", "score": "0.5596567", "text": "function mostrarArray(elementos, texto=''){\n\tdocument.write('<h1>Contenido del array '+texto+'</h1>');\n\tdocument.write('<ul>');\n\telementos.forEach((elemento, index)=>{\n\t\tdocument.write('<li>'+elemento+'<li>');\n\t});\n\tdocument.write('<ul>');\n}", "title": "" }, { "docid": "df31040b5ab3dc844d90cb36a5703efc", "score": "0.55770415", "text": "function checkArray(e) {\n return e == \"X\" || e == \"O\";\n }", "title": "" }, { "docid": "b020ea1038e866aa95748f506615116e", "score": "0.5560548", "text": "function Gooble(a) { // turns a 2d array of numbers to an array of strings\n\t\t\t\t\t // to turn a 1d array of numbers into a string, do Gooble([a])[0]\n\t\t\t\t\t // to turn a number into a character, do Gooble([[a]])[0]\n\t\t\t\t\t \n\t\t\t\t\t // to turn a 2d array of numbers into a single string, do Gooble(a).join(\"\\n\")\n\t\t\t\t\t \n\t\t\t\t\t //i know this is just 1 line but this is for my convenience\n\treturn a.map((b)=>{return String.fromCodePoint(...b.map((c)=>{return c+32;}))});\n}", "title": "" }, { "docid": "f410c19d3f62e6d99e1f2b01d56361c2", "score": "0.55550206", "text": "_arrayToString(msg) {\n let res = '';\n // Length\n res += '*' + msg.length + '\\r\\n';\n for (let val of msg.value) {\n res += this.toString(val);\n }\n return res;\n }", "title": "" }, { "docid": "9d7d59888a442f39c0c82b9d0d213cfa", "score": "0.5528717", "text": "function e(){return[0,0,0,1]}", "title": "" }, { "docid": "fdb22ddf4dbd3c77b2a03ddc304499fe", "score": "0.5525321", "text": "function testTableu() {\n var tableauFruits = [\"Papaya\", \"Ananas\", \"Mango\", \"Orange\"];\n var tableauNumeros = [1, 4, 3, 10, 7];\n console.log(tableauFruits);\n console.log(tableauNumeros);\n for (var i = 0; i < 5; i++) {\n console.log(i);\n }\n for (const fruit of tableauFruits) {\n console.log(fruit);\n }\n}", "title": "" }, { "docid": "5027b9aca8d07a123b9a22c2e0e2d05c", "score": "0.55141777", "text": "function geirEksempel(arrayParam){\n console.log(\"------------Eksempel-----------------\");\n var teller = 0;\n var maxCount = arrayParam.length;\n\n while(teller < maxCount){\n console.log(arrayParam[teller]);\n teller++;\n }\n console.log(\"------------Eksempel-----------------\");\n}", "title": "" }, { "docid": "a19396d63afaf95d7cd100bb9c07c80f", "score": "0.55112916", "text": "function printFavoriteBooks() {\n var num = FavoriteBooks.length;\n console.log('livre' + 'favoris:' + ' ' + num);\n for (let element of FavoriteBooks) {\n console.log(element)\n }\n // AUTREMENT DIT //\n // for (let i=0; i< num; i++){ console.log(FavoriteBooks[i]);}\n }", "title": "" }, { "docid": "5edb078636463c4b0becf200475d5d05", "score": "0.55068374", "text": "function printArray(array) {\n //code to print the array on console\n console.log(array);\n}", "title": "" }, { "docid": "fe656166ad06024e6f8f424082455f08", "score": "0.54980165", "text": "function Array() {}", "title": "" }, { "docid": "fe656166ad06024e6f8f424082455f08", "score": "0.54980165", "text": "function Array() {}", "title": "" }, { "docid": "ffd3ab528675c6e5b2fac15d5e3c21db", "score": "0.54945016", "text": "function devuelveArray() {\n var nombre = document.getElementById(\"nombre1\").value.toUpperCase();\n var mi_nombre = Array.from(nombre);\n\n mi_nombre.forEach((letras) => console.log(letras));\n\n}", "title": "" }, { "docid": "b03c92279296fef65f426b8003ca8647", "score": "0.5491505", "text": "function logArrayWithWords(array) {\n for(let i = 0; i < array.length; i++) {\n console.log(`The value of index ${i} is ${array[i]}`)\n }\n }", "title": "" }, { "docid": "09a534a5e891d15f2f7b103d1628186a", "score": "0.5489829", "text": "function printCarsArray() {\r\n for (var i = 0; i < cars.length; i++) {\r\n console.log(\"cars[\" + i + \"] = \" + cars[i].toString());\r\n }\r\n }", "title": "" }, { "docid": "5d0b32f7b5b160e65656f7ad47c88efc", "score": "0.54774123", "text": "function toString0() {\r\n let b = 989;\r\n let a = dusun.toString();\r\n document.getElementById('hasil').innerHTML= dusun +' typeof ' + typeof(dusun) +\r\n '<br>' + a + ' typeof ' + typeof(a);\r\n \r\n }", "title": "" }, { "docid": "2bed398dcf17661fc81954adf30fcda2", "score": "0.5469544", "text": "function dibujarEspacios(banda){\n var espacios = [];\n for(var i = 0; i < banda.length; i ++){\n if(isLetter(banda[i])){\n espacios.push('__');\n }else{\n //espacios.push('[ ]');\n espacios.push('&nbsp');\n //espacios.push('&blank;');\n }\n }\n //console.log(espacios);\n return espacios;\n}", "title": "" }, { "docid": "a66e55ee41c8fdf0789f6159e607ed7c", "score": "0.5463107", "text": "function ejercicio3 (array){\n var texto = array.reduce(function(a, b, indice) { //creamos el objeto texto mediante reduce\n a['propiedad' + (indice + 1)] = b;\n return a;\n }, {}); // obtenemos un objeto texto tipo {propiedad1: 6}\n var respuesta = ''; //concatenamos las propiedades de texto\n Object.getOwnPropertyNames(texto).forEach(\n //el metodo object.getOwnPropertyNames nos proporciona el nombre de cada propiedad y sus valores\n function (val) {\n respuesta += val + ' --> ' + texto[val] + '; ';\n }\n );\n return respuesta.slice(0, -2);\n}", "title": "" }, { "docid": "1e319c29f97309b1ec56de2b85c1761a", "score": "0.54629827", "text": "function tipoDeDado(qualquer) {\n console.log(typeof(qualquer));\n}", "title": "" }, { "docid": "cab865cbd78ffbea0b8e72df466c881f", "score": "0.5459714", "text": "convertToString(){\r\n var casillas_string=[\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null],\r\n [null,null,null,null,null,null,null,null]\r\n ];\r\n for(var i=0;i<8;i++){\r\n for(var j=0;j<8;j++){\r\n if(this.casillas[i][j] != null){\r\n var ficha_char = this.casillas[i][j].getTipoFicha().charAt(0) + this.casillas[i][j].getColor();\r\n }else{\r\n ficha_char = '*2';\r\n }\r\n \r\n casillas_string[i][j] = ficha_char;\r\n }\r\n }\r\n return casillas_string;\r\n }", "title": "" }, { "docid": "b303e9f11a7c8cd3de5aa2d752454a1a", "score": "0.54502624", "text": "function oblicz () {\n return [1,2,3]; // pomysl by funkcja zwracala kilka wartosci\n}", "title": "" }, { "docid": "d61c4bdec9c11cc964a4ac7ba5430398", "score": "0.5449204", "text": "function l$1(e){return Array.isArray(e)}", "title": "" }, { "docid": "c01f94d5b42aa7505ce6d977e4607022", "score": "0.5446111", "text": "function arrayIntoString(myArray){\n\treturn myArray.toString()\n}", "title": "" }, { "docid": "81f6c19399315728363ce2f7e433cfdf", "score": "0.5438389", "text": "function processArray(array){\r\n \r\n}", "title": "" }, { "docid": "42cd4f306ecde80ec0f3441ad9b49046", "score": "0.54375696", "text": "_getTypeArray(arrayOfName) {\n for (const index in arrayOfName) {\n if (arrayOfName.hasOwnProperty(index)) {\n arrayOfName[index] = Utils.Ui.getSimpleJavaType(arrayOfName[index]);\n }\n }\n return _.join(arrayOfName, ', ');\n }", "title": "" }, { "docid": "ce87883af13b8bf8a388d7eebb7077ea", "score": "0.54284036", "text": "function isvestiVardusIrPavardes(ieskomi, arrVardo, arrPavardes) {\n for (var i = 0; i < ieskomi.length; i++) {\n var index = ieskomi[i];\n console.log(arrVardo[index] + \" \" + arrPavardes[index]);\n }\n}", "title": "" }, { "docid": "eaa3c6007cb6fc3dd57133dfe7068460", "score": "0.54281133", "text": "function printSlogan(){\n let slogan = [\"We\", \"Only\", \"Have\", \"One\", \"Earth!\", \" \", \"Website\", \"by\", \"Huy\", \"Pham\",\"2021\"];\n slogan.forEach(word => {\n console.log(word)\n });\n}", "title": "" }, { "docid": "1089936e4e76f406f6faabb57bacc91e", "score": "0.541602", "text": "function dataHandling2(arr){\n for(var i=0;i<arr.length;i++){\n console.log(`Nomor ID: ${arr[i][0]}`);\n console.log(`Nama Lengkap: ${arr[i][1]}`);\n console.log(`TTL: ${arr[i][2]} ${arr[i][3]}`);\n console.log(`Hobi: ${arr[i][4]}`);\n console.log(\"\");\n }\n}", "title": "" }, { "docid": "d1d85856055822604de7f8a55aba5da7", "score": "0.54060525", "text": "function printArrayItems(arry){\n\n}", "title": "" }, { "docid": "9697efc508d94d238bc51ef560bca9c2", "score": "0.5397206", "text": "function rastiPavarde(arrVardo, ieskomasTekstas, arrPavardes) {\n var rastiVardoIndex = arrVardo.indexOf(ieskomasTekstas);\n console.log(arrPavardes[rastiVardoIndex]);\n}", "title": "" }, { "docid": "f730afcf2bd90579e21b26e7c1e05fbe", "score": "0.5397116", "text": "function is_array()\n{ \n document.getElementById('isarray').innerHTML=Array.isArray(arr);\n document.getElementById('isarray1').innerHTML=Array.isArray(10)\n}", "title": "" }, { "docid": "dc6643643ae501bab4c4098db18eb6d5", "score": "0.53933734", "text": "function log(array) {\r\n console.log(array[0]);\r\n console.log(array[1]);\r\n}", "title": "" }, { "docid": "0a7e9ac4040961c3c5e0aa580915f384", "score": "0.5381697", "text": "function makeArray(e){return Array.isArray(e)?e:[e]}", "title": "" }, { "docid": "03dc4f70effc85796a290f4fb3b08b8f", "score": "0.5381398", "text": "function stringItUp(arr){\n var stringified = arr.map(function(item){\n return item.toString()\n })\n console.log(stringified) \n }", "title": "" }, { "docid": "963819fb0f61d8fa76fde55ed3f780f3", "score": "0.5378579", "text": "function funcaoFor(){\n var analise9 = [\"Pêra\", \"Uva\", \"Maça\", 120];\n var text = [];\n\n for(i=0;i<analise9.length;i++){\n text[i] = analise9[i];\n }\n document.getElementById(\"resultado6\").innerHTML = text;\n}", "title": "" }, { "docid": "2e61792212110a32cbd024febce31568", "score": "0.5373257", "text": "function getArray() {\r\n return [\"Hello\", \"I\" , \"am\", \"Sarah\"];\r\n}", "title": "" }, { "docid": "ceb8eb190cfe04642eee97f1cf94c4af", "score": "0.5372659", "text": "function isArray(e){return Array.isArray(e)}", "title": "" }, { "docid": "1d3ee59cc39be3b039d9f860536f60cd", "score": "0.537101", "text": "function accessElementInArray() {\n ['this is an array','content', 'more content']\n}", "title": "" }, { "docid": "c50b4500c3ac5f37fe8abadec4216176", "score": "0.5368223", "text": "function rango_fechas(entrada,salida,fecha_hoy){\n fechaEntrada = new Array();\n fechaEntrada = entrada.replace(/[ :]/g, \"-\").split(\"-\");\n\n fechaSalida = new Array(); \n fechaSalida = salida.replace(/[ :]/g, \"-\").split(\"-\");\n\n var fechaEntradaFinal = Array(fechaEntrada[2],fechaEntrada[1],fechaEntrada[0]);\n var fechaSalidaFinal = Array(fechaSalida[2],fechaSalida[1],fechaSalida[0]);\n//console.log(fechaSalidaFinal);\n\n arr_fechas = [];\n _rango_maxLength(fechaEntradaFinal,fechaSalidaFinal,_rango_para_meses(fechaEntradaFinal));\n var encontro = arr_fechas.indexOf(fecha_hoy);\n \n //console.log(\"arr final:\");\n //console.log(arr_fechas);\n\n return encontro;\n}", "title": "" }, { "docid": "cb7bb494c87beaef923864f48759243c", "score": "0.5367207", "text": "function dataOpschonenOogkleur() {\n\n //van de antwoorden hoofdletters maken\n oogkleurData = oogKleur.map(entry => entry.toUpperCase());\n\n //van rgb naar hex\n //oogkleurData = oogkleur.forEach(element => {\n \n \n\n}", "title": "" }, { "docid": "ef1e84ea3ac82493c3d588c4f3811296", "score": "0.53650516", "text": "function kursoTikrinimas(studentai) {\n let tipas = typeof studentai[1].course;\n console.log(tipas);\n if (studentai[1].course === 4) {\n console.log('studentas mokosi 4 kurse ' + tipas)\n }\n for (let i = 0; i < studentai.length; i++) {\n if (studentai[i].course == 4) {\n console.log(studentai[i].firstname + studentai[i].lastname + ' yra abiturientas');\n } else {\n console.log(studentai[i].firstname + ' ' + studentai[i].lastname + ' dar toli iki mokslu baigimo');\n }\n }\n\n }", "title": "" }, { "docid": "fcd3b5b4a14ea9565ad3519157bc70d0", "score": "0.5362158", "text": "function n(t){return Array.isArray(t)}", "title": "" }, { "docid": "f6580bfa476b762e02c851afcb16b1d1", "score": "0.5358436", "text": "function getPizzaType (array) {\n return array[0];\n}", "title": "" }, { "docid": "98f867d6fadfeea4be77629714703c96", "score": "0.5347822", "text": "function getArray(reqArray){\n\n\n\n let strV = \"\";\n\n let strH1 = \"\";\n let strH2 = \"\";\n \n //Arreglo que descompone cada string y lo convierte en arreglo\n let arrayDNA = [];\n //arreglo que almacena todo\n let arrayPeticionDNA = [];\n //expresion regular verifica si se encuentran estas letras en el string\n const REX = /[B,D,E,F,H,I,J,K,L,M,N,Ñ,O,P,Q,R,S,U,V,W,X,Y,Z]/; \n\n\n for (let i = 0; i < reqArray.length; i++) {\n\n //SI no es cuadrada\n if(reqArray.length !== reqArray[i].length){\n return [];\n }\n\n //si tiene un caracter invalido\n if(REX.exec(reqArray[i].toUpperCase())){\n console.log(reqArray[i]);\n return ['i'];\n }\n\n\n //Agrega todas las horizontales\n arrayPeticionDNA.push(reqArray[i]);\n\n //Descompone el string y evalua sus posiciones\n arrayDNA = Array.from(reqArray[i]);\n\n //se obtiene la diagonal y se almacena en el strH2 hasta tener un \"TTGGTT\"\n strH2 = strH2 + arrayDNA[i];\n\n //se obtiene la diagonal y se almacena en el strH1 hasta tener un \"AAGGCC\"\n strH1 = strH1 + arrayDNA[reqArray.length-1];\n \n \n strV =\"\";\n\n for (let j = 0; j < reqArray.length; j++) {\n //obtiene las verticales y las hace un solo string\n arrayDNA = Array.from(reqArray[j]);\n strV = strV + arrayDNA[i];\n \n } \n \n //ya que se genera el string con los valores se guarda en los arreglos\n arrayPeticionDNA.push(strV.toUpperCase());\n \n \n }\n\n arrayPeticionDNA.push(strH1.toUpperCase(),strH2.toUpperCase());\n\n \n return arrayPeticionDNA;\n \n}", "title": "" }, { "docid": "2782836753625191210d3330de905b72", "score": "0.53392434", "text": "function printarray(array){\n\tfor(var i=0; i<array.length; i++){\n\t\tif(typeof(array[i]) == \"string\") process.stdout.write(array[i].replace(/\\n/gi, \" \")+\"\\n\");\n\t\telse process.stdout.write(\"\"+array[i]+\"\\n\");\n\t}\n}", "title": "" }, { "docid": "6ca5c5b7163e74ca37d0e06f8ce56788", "score": "0.5332429", "text": "function pickOutcoms(twoD_Array){\n\n\n var verTransArray =[];\n //var k=0;\n for (i=2; i<twoD_Array.length; i++){\n var trow_array = twoD_Array[i];\n var swishstr = String(trow_array[9]);\n swishstr = swishstr.substring(0, 5);\n //console.log('swishstr ' + swishstr);\n\n var strEight = String();\n\n\n var strNine= String(trow_array[9]);\n //flytta refferens om de är bellop till rätt plats i radArrayen\n if (typeof trow_array[9] != \"string\"){\n //console.log(trow_array);\n trow_array[11] = trow_array[10];\n trow_array[10] = trow_array[9];\n trow_array[9] = \"-\";\n }\n //console.log(trow_array);\n //console.log('------------------');\n\n if ('Swish' != swishstr) {\n var trow =[trow_array[2], trow_array[5], trow_array[8], trow_array[9], trow_array[10], trow_array[11]];\n verTransArray.push(trow);\n\n }//end of if\n\n }//end of forloop\n\n //console.log(verTransArray);\n return verTransArray;\n}", "title": "" }, { "docid": "57901a5fcabdf7acfd2083d4e06c58d4", "score": "0.5321788", "text": "function log(array) {\n console.log(array[0])\n console.log(array[1])\n}", "title": "" }, { "docid": "6b035a60a2e1ae4b81cd03ef51c8b2e2", "score": "0.5312294", "text": "function Act4() {\n var alumnos = [];\n\n alumnos[0] = {\n Nombre: 'Fabian',\n Apellido: 'Cruz',\n Edad: '25',\n Sexo: 'H',\n };\n alumnos[1] = {\n Nombre: 'Juan',\n Apellido: 'Cruz',\n Edad: '22',\n Sexo: 'H',\n };\n alumnos[2] = {\n Nombre: 'Julia',\n Apellido: 'Martinez',\n Edad: '28',\n Sexo: 'M',\n };\n\n console.log('Nombre Completo: ' + alumnos[0].Nombre + ' ' + alumnos[0].Apellido);\n console.log('Nombre Completo: ' + alumnos[1].Nombre + ' ' + alumnos[1].Apellido);\n console.log('Nombre Completo: ' + alumnos[2].Nombre + ' ' + alumnos[2].Apellido);\n}", "title": "" }, { "docid": "f3d35a7e984f7578956eca4fb34ee631", "score": "0.53108394", "text": "function e(){return[1,0,0,0,1,0,0,0,1]}", "title": "" }, { "docid": "de1efd67a17e9fdc6de04e391c040081", "score": "0.53066796", "text": "function getPizzaType(arr) {\n return arr[0];\n}", "title": "" }, { "docid": "4076994a0ecd153265e0325b91aca940", "score": "0.53046054", "text": "function getArray() {\n return [\"Hello\", \"I\" , \"am\", \"Sarah\"];\n}", "title": "" }, { "docid": "85abf56a60f613fe9cdd948c5bbada10", "score": "0.53010976", "text": "function log(array){\n conosle.log(array[0])\n consol.log(array[1])\n }", "title": "" }, { "docid": "86e775a41cda8d5f7ee345628dc1ba26", "score": "0.5300822", "text": "function alContrario (parola){\n //divido la parola in un array contenente in ogni elemento un lettera\n var splitParola = parola.split(\"\");\n //inverto l'ordine degli elementi dell'array\n var revArray = splitParola.reverse(); \n return revArray.join(\"\"); //convero l'array in una stringa\n \n}", "title": "" }, { "docid": "c7f07d80567ff8da19eed915371d7b33", "score": "0.52955514", "text": "function demo(array) {\n return []\n}", "title": "" }, { "docid": "3741f5bdc0d35ed4d9dd8ca767b014d6", "score": "0.52925026", "text": "function tiretWord(objet) {\n tiret = []\n objet.forEach(function(item) { //si le code bug, ajoute var cachelettre devant\n if (item.isVisible === false) {\n tiret = tiret + \"_\"\n } else {\n tiret = tiret + item.letter\n }\n })\n}", "title": "" }, { "docid": "d5434cbe4604eb8459efbb1368361521", "score": "0.5285703", "text": "visitLiteralArrayExpr(ast,ctx){if(ast.entries.length===0){ctx.print(ast,'(');}const result=super.visitLiteralArrayExpr(ast,ctx);if(ast.entries.length===0){ctx.print(ast,' as any[])');}return result;}", "title": "" }, { "docid": "e0059a50490b0acbaac6dca648702d70", "score": "0.52846044", "text": "telaParaArray(){\n this.cadastro(this.tela());\n document.getElementById(\"c1\").value = \"\";\n document.getElementById(\"c2\").value = \"\";\n arr = this.aluno.length;\n }", "title": "" }, { "docid": "23155dad93308a8b4d4b6e496829802b", "score": "0.52807796", "text": "arrayType (array) { return array.constructor }", "title": "" }, { "docid": "987a18f6e6ca4cfc80ca6b67a3cb1cdd", "score": "0.5271954", "text": "function topping() \n{\n\nfor (var i = 0; i< array.length; i++) \n{\n var a1 = array[i].topping;\nfor (var j= 0; j< a1.length;j++ )\n{\nconsole.log(a1[j].type);\n\n}\n}\n}", "title": "" }, { "docid": "db4b49531b38f0377b8d05787f308d1c", "score": "0.527137", "text": "function arrays() {\n\n let array = [2, 4, 6];\n let array2 = [ ];\n\n array.push(8);\n array.push(10);\n\n let x = array[1];\n\n console.log(\"x = \" + x);\n console.log(array);\n console.log(\"array = \" + array);\n\n for (let i = 0; i < array.length; i++) {\n console.log(\"Value at index \" + i + \" is \" + array[i]);\n }\n\n for (let value of array) {\n console.log(value);\n }\n}", "title": "" }, { "docid": "5ecd5740ad87a1007c2ea03f2335e329", "score": "0.52663654", "text": "function denganForIsiArray() {\n const dogs = [\"golden\", \"oni\", \"ola\", \"bulldog\"];\n\n for (let i = 0; i < dogs.length; i++) {\n console.log(`anjing ke-${i} adalah ${dogs[i]}`);\n }\n }", "title": "" }, { "docid": "d4d843803dec9004c6eba447e7cd452a", "score": "0.52584505", "text": "function crearArrayDeDosNumeros(){\n\n\n\treturn [1,2] // me devuelve un arrat de dos numeros\n}", "title": "" }, { "docid": "d4d843803dec9004c6eba447e7cd452a", "score": "0.52584505", "text": "function crearArrayDeDosNumeros(){\n\n\n\treturn [1,2] // me devuelve un arrat de dos numeros\n}", "title": "" }, { "docid": "f61d05781e321a5bf1c3ed13a972008e", "score": "0.52485174", "text": "function isEtoile(){\n var res=[0,0];\n //on cherche la générale non annoncée\n for (let i=0;i<4;i++){\n if (this.plis[i].length==32){//le joueur i a || le joueur i a fait une générale\n if (this.contrat.valeur!='Générale' || this.preneur!=i){//le joueur i n'a pas annoncé une générale ou n'est pas le preneur\n res[i%2]=1;\n }\n }\n }\n\n //on cherche le capot non annoncé de l'équipe 0\n if (this.plis[0].length +this.plis[2].length==32){//l'équipe 0 a fait un capot\n if ((this.contrat.valeur!='Générale' && this.contrat.valeur!='Capot')){//le contrat n'est ni une générale ni un capot\n res[0]=1;\n } else if (this.preneur==1 || this.preneur==3){//le preneur n'est pas 0 ni 2\n res[0]=1;\n }\n }\n\n //on cherche le capot non annoncé de l'équipe 1\n if (this.plis[1].length +this.plis[3].length==32){//l'équipe 0 a fait un capot\n if ((this.contrat.valeur!='Générale' && this.contrat.valeur!='Capot')){//le contrat n'est ni une générale ni un capot\n res[1]=1;\n } else if (this.preneur==0 || this.preneur==2){//le preneur n'est pas 0 ni 2\n res[1]=1;\n }\n }\n\n return res;\n }", "title": "" }, { "docid": "258c54ce71ed65578e97f1df8412f170", "score": "0.52449673", "text": "function aneh(){\nvar cars = [\"BMW\", \"Volvo\", \"Saab\", \"Ford\"];\nvar s = cars.length\nconsole.log(s)\nfor (var i = 0; i < cars.length; i++) {\n console.log('ke ' + cars[i])\n}\n}", "title": "" }, { "docid": "cc77ac39330c0e8f2ca3422ca99a9411", "score": "0.5244491", "text": "function values (){\n for (let string of arr) {\n console.log(string);\n }\n}", "title": "" }, { "docid": "d8b057eb91086f04510c4b7b167da5f6", "score": "0.5242753", "text": "function getArray(array){\n return array;\n}", "title": "" }, { "docid": "0b7ce901af40d26c287bea4add207df0", "score": "0.5232461", "text": "function arrToStr(arg) {\n var y = \"\";\n for(i=0; i < arg.length; i++){\n y += arg[i];\n }\n return y;\n\n}", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.52311814", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.52311814", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" }, { "docid": "18244d0ca18f871faa402464aa43f0c2", "score": "0.52311814", "text": "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "title": "" } ]
85533f571771cece8da1b4851f316581
Checks if channel is live
[ { "docid": "c578af4e473b64823c7422d495143e82", "score": "0.738951", "text": "function checkIfChannelIsLive(id, username) {\n request.get(`https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${id}&type=video&eventType=live&key=${apiKey}`, (_error, _res, body) => {\n let data = JSON.parse(body)\n if (data.pageInfo.totalResults != 1) {\n console.log(username + \" is not live! Reciving last streams!\")\n getChannelCompletedStreams(id, username)\n } else {\n console.log(username + \" is live! Started \" + data.items[0].snippet.publishedAt + \"!\")\n }\n })\n}", "title": "" } ]
[ { "docid": "0ae0b1bd96a1886613e8471c8e02897b", "score": "0.66251737", "text": "function isChannelActive(channel) {\r\n return module.exports.activeChannels.includes(channel.id);\r\n}", "title": "" }, { "docid": "3ea63fb35fe01f1195c3b8e02defa4a9", "score": "0.6172363", "text": "get connected () {\n return (this._connected && this._channel.readyState === 'open')\n }", "title": "" }, { "docid": "3ea63fb35fe01f1195c3b8e02defa4a9", "score": "0.6172363", "text": "get connected () {\n return (this._connected && this._channel.readyState === 'open')\n }", "title": "" }, { "docid": "3907a6af5513af4f15c0f1b5aac9cd76", "score": "0.6149533", "text": "async isChannelCreated(channel: Channel): Promise<boolean> {\n let result: boolean = true\n try {\n await this.bindChannel(channel).getGenesisBlock({\n txId: this.newTransactionID()\n })\n } catch (error) {\n if (!error.message || !error.message.includes(\"NOT_FOUND\")) {\n throw error\n }\n result = false\n }\n return result\n }", "title": "" }, { "docid": "04b0ef4f2a34779787ee40e6ab2ae3f4", "score": "0.6134961", "text": "isLive () {\n return null\n }", "title": "" }, { "docid": "891eaa13fdaca035249f1d8ad9c9ddc5", "score": "0.61231107", "text": "function checkIfExisting(channelNameToCheck) {\n $.getJSON(\"https://wind-bow.gomix.me/twitch-api/channels/\" + channelNameToCheck, (channel) => {\n //If the channel not is existing --> display the channel\n if (typeof channel.status === \"number\") {\n displayNotExistingChannel();\n }\n\n //If the channel is existing --> display the channel\n else {\n displayOfflineChannel(channel);\n }\n })\n}", "title": "" }, { "docid": "b3cf29d556a4c9d43a808445f7fa26cc", "score": "0.6072396", "text": "function inactiveCheck(channel) {\n if (channel.members.size == 0) {\n channel.delete();\n }\n else {\n setTimeout(inactiveCheck, 5000, channel);\n }\n}", "title": "" }, { "docid": "05718707d1fe11ee6ace605a197640d1", "score": "0.5904726", "text": "connected() {\n return this.dataChannel && this.dataChannel.readyState == 'open';\n }", "title": "" }, { "docid": "11da20df6c918317eec81e99a08471f6", "score": "0.5892732", "text": "function checkOnline() {\n for (let i = 0; i < channels.length; i++) {\n $.getJSON(\"https://wind-bow.gomix.me/twitch-api/streams/\" + channels[i], (stream) => {\n //If the channel is Online --> Display the Channel\n if (stream.stream) {\n displayOnlineChannel(stream);\n }\n\n //If the channel not is Online --> Check if the channel is existing\n else {\n checkIfExisting(channels[i]);\n }\n })\n }\n}", "title": "" }, { "docid": "c198a81c3bfb255a35b96c09d3b27282", "score": "0.5886391", "text": "isOnline() {\n return this.connectionStatus === 1\n }", "title": "" }, { "docid": "32ad1f742bd33c345c502713319d11fb", "score": "0.5877475", "text": "isLive() {\n\t\treturn this.parents.filter(p => !p.blown).length === 0;\n\t}", "title": "" }, { "docid": "f9838a6ceb110bdb1b128dcba08f56bc", "score": "0.5874884", "text": "connected() {\n return this.connectionState$.getValue() === exports.RxStompState.OPEN;\n }", "title": "" }, { "docid": "c8af06926f0640a29d35716c215975f7", "score": "0.5831412", "text": "imm_isOnline()\n {\n return (Date.now() - this.lastPingStamp) < 10000;\n }", "title": "" }, { "docid": "8e94fd2c6a01546485a73b4f7bbaf4a9", "score": "0.5775345", "text": "connected() {\n console.debug('channel connected');\n }", "title": "" }, { "docid": "feeffcf4a082b4c936316ff0736a799c", "score": "0.5740293", "text": "isLiveUpdating() {}", "title": "" }, { "docid": "f91f8d2c66fd4ab0d4554d926ab17e0a", "score": "0.57309556", "text": "checkConnectionStatus() {\n if (new Date().getTime() - timestampLastMessageReceived > 1000) {\n\n if (currentlyConnected) {\n currentlyConnected = false;\n this.store.dispatch(connectionStatusChanged(connectionStatus.NOT_CONNECTED));\n }\n\n this.requestXPlaneOutput(this.remoteAddress);\n\n } else {\n if (!currentlyConnected) {\n currentlyConnected = true;\n this.store.dispatch(connectionStatusChanged(connectionStatus.CONNECTED));\n }\n }\n }", "title": "" }, { "docid": "ff5b310e29ef2255eb87d9f8c060bbc2", "score": "0.56706905", "text": "function channelStatus(entry) {\n\t\t\t\t\ttwitchRequest(channelQuery).done(function(response) {\n\t\t\t\t\t\tif(response.stream == null) {\n\t\t\t\t\t\t\tvar offline = $(\"<img>\");\n\t\t\t\t\t\t\toffline.attr(\"src\", \"/images/red.png\");\n\t\t\t\t\t\t\tentry.append(offline);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar online = $(\"<img>\");\n\t\t\t\t\t\t\tonline.attr(\"src\", \"/images/green.png\");\n\t\t\t\t\t\t\tentry.append(online);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "9fefc4517b796cf0fa9f6898de619941", "score": "0.56145525", "text": "function isOnline() {\n return _online.getValue();\n}", "title": "" }, { "docid": "d0e4d27454e1f29973ec8877acdba5fc", "score": "0.5603682", "text": "channel_exists_returns(exists) {\n this.stub_channel_exists = exists\n }", "title": "" }, { "docid": "112f9832b5502e7280e08fcf1bf36bd0", "score": "0.56004196", "text": "function getChannelStatus() {\n return BP_CHANNEL_CONFIG.status;\n }", "title": "" }, { "docid": "c38a36232e94c33d0834e9fe1e6ebda1", "score": "0.55973756", "text": "checkActiveConnection() {\n console.log(\"Checking connection: \", this.connection)\n return this.connection !== undefined\n }", "title": "" }, { "docid": "328775c432e7b73f8d48fb4e5c18e554", "score": "0.5573351", "text": "setLive(value) {\n this._isLive = value;\n }", "title": "" }, { "docid": "d88f34ce16e25ab4e5664c9342c157c1", "score": "0.5570724", "text": "get shouldUpdateChannel() {\n\t\tconst route = this.router.current_name;\n\t\treturn Twilight.POPOUT_ROUTES.includes(route) || Twilight.SUNLIGHT_ROUTES.includes(route);\n\t}", "title": "" }, { "docid": "3658859094113a2a240842a96daf5c43", "score": "0.5552797", "text": "function hasFayededConnection(){\r\n\treturn globalFaye.isConnected;\r\n}", "title": "" }, { "docid": "8a3ebbaf72de1b31159e8330c338c144", "score": "0.5525235", "text": "function check(){\n\tif (!alreadyChecking){\n\t\tif (!btnClkd){ // button not clicked\n\t\t\tclog('Alarm went off. Checking if Facebook is on active tab.');\n\t\t\tchrome.tabs.getSelected(null,function(tab){\n\t\t\t\tvar g=tab.url.indexOf('facebook.com');\n\t\t\t\tclog('Active tab object:');\n\t\t\t\tconsole.log(tab);\n\t\t\t\tclog('tab.url.indexOf(\\'facebook.com\\')=='+g);\n\t\t\t\tif(g==-1||g>12){ //'facebook.com' may be at most at 13th place: [https://www.f] <- 'f' is 13th char\n\t\t\t\t\tclog('Connecting…');\n\t\t\t\t\tvar now=new Date();\n\t\t\t\t\t//localStorage['FBnotifier-lastCheck'] = now.valueOf();\n\t\t\t\t\tchrome.browserAction.setTitle({title:'Connecting ('+now.toLocaleTimeString()+')'});\n\t\t\t\t\twaitBadge();\n\t\t\t\t\tcheckNotifications();\n\t\t\t\t} else {\n\t\t\t\t\tclog('Assuming Facebook is on selected tab, so check is not performed.');\n\t\t\t\t\tclearButton();\n\t\t\t\t\tclog('Counters cleared.');\n\t\t\t\t}\n\t\t\t});\n\t\t} else { // button clicked\n\t\t\tclog('Alarm went off but meantime button was clicked. Not checking.');\n\t\t\tbtnClkd = false;\n\t\t}\n\t} else {\n\t\tclog('alreadyChecking == '+alreadyChecking);\n\t}\n}", "title": "" }, { "docid": "152167cbe2c593f06d0762d8d74b1ca3", "score": "0.5521345", "text": "async function betaOnline() {\r\n return isReachable('https://beta.music.apple.com');\r\n }", "title": "" }, { "docid": "d99f00385124a41bd2cf02cdd535d73f", "score": "0.55160135", "text": "get connected() {\n if (!this.webSocket) {\n return false;\n }\n\n return this.webSocket.readyState === WebSocket.OPEN;\n }", "title": "" }, { "docid": "9689b2ea097edd1b41fc54687f2d12c2", "score": "0.5496325", "text": "function checkIfLiveCell(cell) {\n var numNeigh = cell.numNeigh;\n\n //If current cell has 2 or three neighbors\n if (numNeigh == 2 || numNeigh == 3) {\n\n //If it has three neighbors, it's alive, it it has two neighbors\n //and it is not alive already, then it cannot be given life\n if(cell.isDead==LIVE_CELL || numNeigh==3){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "1b86f0a0f8250206d0e79848984b994c", "score": "0.54951304", "text": "isConnected() {\n return this.connection.isOpen()\n }", "title": "" }, { "docid": "e8891ab1e75df12ba6957852a3c1ac99", "score": "0.54775006", "text": "connected(){ return this.token!=null }", "title": "" }, { "docid": "0a297257adaf2e66b6bb675839ac9001", "score": "0.5465627", "text": "function hasConnection() {\n\tif (Ti.Network.online == false) {\n\t\t//utilities.showAlert(Alloy.Globals.selectedLanguage.networkError, Alloy.Globals.selectedLanguage.noInternet);\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "2140092bbadc9e82c9a4dd8ffdeced78", "score": "0.54527646", "text": "function isConnected() {\n return _status.getValue();\n}", "title": "" }, { "docid": "4e8cefc7d164d329afab85324fba5a5c", "score": "0.5452039", "text": "checkConnection() {\n if (this.connection && this.connectionStatus !== this.connection.readyState) {\n this.connectionStatus = this.connection.readyState;\n if (this.isOnline()) this.sendUserProfile();\n this.triggerEvent(\"onSignal\",[{type:\"connection_status\",data:{status:this.connection.readyState}}])\n }\n }", "title": "" }, { "docid": "929132cb5679816d11bc25b001d34f02", "score": "0.5449165", "text": "isConnected() {\n return !this.#connection._closed;\n }", "title": "" }, { "docid": "4fbebd283249c6d8e091cfac77437e1e", "score": "0.54456854", "text": "function isOnline(){\r\n onlinePage(); onlineMessage.classList.add('online-message-active');\r\n setTimeout(function(){onlineMessage.classList.remove('online-message-active'); },2000)\r\n console.info( 'Connection: Online'); \r\n }", "title": "" }, { "docid": "7aeebdaff3d0fb5f2a7be4db21a87c79", "score": "0.5432513", "text": "function handleReceiveChannelStateChange() {\n\tvar readyState = receiveChannel.readyState;\n\tlog('Receive channel state is: ' + readyState);\n}", "title": "" }, { "docid": "63454f6025bc3149ef45c0d5d8c40663", "score": "0.54221624", "text": "isAlive() {\n return this.lifeState === 1;\n }", "title": "" }, { "docid": "317baa657fd05e51acbec97e9be790aa", "score": "0.5412814", "text": "function jsCheckIfServerIsOnline() {\n var serverResponse = false;\n\n // Seccure that test has been done\n jsCheckIfStartedByGolang()\n serverResponse = QmlBridge.checkIfServerIsOnline();\n console.log(\"*** QmlBridge.checkIfServerIsOnline(); ***: \" +serverResponse)\n if (serverResponse === true) {\n rootTable.startedByGolang = true\n } else {\n rootTable.startedByGolang = false\n }\n\n\n // Allways Make a check if backend is awake\n jsBackenTimerTimeChanged(true)\n\n\n}", "title": "" }, { "docid": "91de2655b5cd57f54339ff84c20b7273", "score": "0.54000163", "text": "function remotePeerIsConnected() {\n if (global.remotePeerId == null)\n print_('no-peer-connected');\n else\n print_('peer-connected');\n}", "title": "" }, { "docid": "90398005c350c2e6d9053eaeb730a5b4", "score": "0.53923136", "text": "function checkStaleStream() {\n var endOfBuffer = (0, _timeRanges2.default)(_videotag.buffered);\n var live = _this.isLive();\n\n // Don't end if we have noting buffered yet, or cannot get any information about the buffer\n if (live && endOfBuffer && _lastEndOfBuffer === endOfBuffer) {\n if (_staleStreamTimeout === -1) {\n _staleStreamTimeout = setTimeout(function () {\n _stale = true;\n checkStreamEnded();\n }, _staleStreamDuration);\n }\n } else {\n clearTimeouts();\n _stale = false;\n }\n\n _lastEndOfBuffer = endOfBuffer;\n }", "title": "" }, { "docid": "ce6692b65a728acb54965551300e6ac6", "score": "0.53821373", "text": "function checkIfOnline(){\n\tdb.findAll(\"stream_username\")\n\t\t.then(function(usernames){\n\t\t\tlet api = \"https://api.twitch.tv/kraken/streams/\";\n\t\t\tlet opts = {\n\t\t\t\turl: \"\",\n\t\t\t\theaders: {\n\t\t\t\t\t\"Accept\": \"application/vnd.twitchtv.v3+json\",\n\t\t\t\t\t\"Client-ID\": config.twitch_client_id\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfor(let i = 0; i < usernames.length; i++) {\n\t\t\t\topts.url = api + usernames[i].twitch_username;\n\t\t\t\trequest(opts, function(err, res, body){\n\t\t\t\t\tif(err)\n\t\t\t\t\t\tconsole.error(err);\n\n\t\t\t\t\tdb.find(\"stream_username\", {\"twitch_username\": usernames[i].twitch_username})\n\t\t\t\t\t\t.then(function(username){\n\t\t\t\t\t\t\tlet is_currently_streaming = username[0].is_up;\n\t\t\t\t\t\t\tlet stream_data = JSON.parse(body);\n\n\t\t\t\t\t\t\tif(stream_data.stream){\n\t\t\t\t\t\t\t\tif(is_currently_streaming !== true){\n\t\t\t\t\t\t\t\t\tdb.update(\"stream_username\", {\"twitch_username\": usernames[i].twitch_username}, {\"is_up\": true, \"announce_message_id\": null})\n\t\t\t\t\t\t\t\t\t\t.then(function(){\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(usernames[i].twitch_username + \" has started streaming.\");\n\t\t\t\t\t\t\t\t\t\t\tannounce(usernames[i], stream_data);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tif(is_currently_streaming !== false){\n\t\t\t\t\t\t\t\t\tdb.update(\"stream_username\", {\"twitch_username\": usernames[i].twitch_username}, {\"is_up\": false, \"announce_message_id\": null})\n\t\t\t\t\t\t\t\t\t\t.then(function(){\n\t\t\t\t\t\t\t\t\t\t\tdb.find(\"output_channel\", {\"guild_id\": username[0].guild_id})\n\t\t\t\t\t\t\t\t\t\t\t\t.then(function(channel){\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet chan = bot.channels.find('id', channels[0].output_channel);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(chan){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet announce_msg = chan.fetchMessage(username[0].announce_message_id);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(announce_msg){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tannounce_msg.delete();\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\tconsole.info(usernames[i].twitch_username + \" has stopped streaming.\");\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t});\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "9c1b7fb716d67e079133daa41e7e6ee3", "score": "0.5379494", "text": "isConnected() {\n return !__classPrivateFieldGet(this, _CDPBrowser_connection, \"f\")._closed;\n }", "title": "" }, { "docid": "e43ff9dd6a0276cd46f3960753fcaeed", "score": "0.53778017", "text": "function checkChannel(name, number, length){\n\n //Set vars\n var twitchApiUrl = 'https://wind-bow.gomix.me/twitch-api';\n\n var channelsApi = twitchApiUrl + '/channels';\n var usersApi = twitchApiUrl + '/users';\n var streamsApi = twitchApiUrl + '/streams';\n\n if(name !== undefined){\n\n //Get\n var request = $.get(streamsApi+'/'+name, function(data){\n\n if(data.stream === null){\n stateStreams[name] = {\n 'state': false,\n 'name' : name\n };\n\n } else {\n stateStreams[name] = {\n 'state': true,\n 'name' : name\n };\n }\n\n }).done(function(){\n\n //Fetch information from this fucker\n $.get(channelsApi+'/'+name, function(data){\n\n //console.log(\"channel info: \", data.logo, data.url);\n\n //logo\n if(data.logo !== undefined){\n stateStreams[name][\"logo\"] = data.logo;\n }\n stateStreams[name][\"url\"] = data.url;\n\n }).done(function(){\n\n //Remove Streamer\n var indexOf = streamersLeft.indexOf(name);\n streamersLeft.splice(indexOf, 1);\n\n //console.log(number, length);\n if(streamersLeft.length === 0){\n setInfo(stateStreams);\n }\n\n });\n\n\n });\n\n //console.log(stateStreams);\n\n }\n }", "title": "" }, { "docid": "8c708d2ceb14492dd3a21f051de544cf", "score": "0.53495055", "text": "function inChat() {\n return ((window[\"ws_handler\"] && window[\"ws_handler\"][\"connected\"]) || (window[\"websocket_handler\"] && window[\"websocket_handler\"][\"connected\"]) || (window[\"flash_handler\"] && window[\"flash_handler\"][\"connected\"]) || (window[\"html_handler\"] && window[\"html_handler\"][\"connected\"]));\n }", "title": "" }, { "docid": "ac0c0b6d05e334d8695e6786b6da5947", "score": "0.53351593", "text": "async isChannelJoined(channel: Channel): Promise<boolean> {\n const peers = channel\n .getPeers()\n .filter(\n peer =>\n isFcwPeer(peer) &&\n peer.getAdminMspIds().includes(this.mspId)\n )\n if (peers.length === 0) {\n throw new Error(\n `Error cannot call isChannelJoined, channel contains no peers that are owned by this user's Organisation ${\n this.mspId\n }`\n )\n }\n const channelName = channel.getName()\n const responses = await Promise.all(\n peers.map(peer => this.queryChannels(peer))\n )\n return responses.every(response =>\n response.channels.some(\n channelInfo => channelInfo.channel_id === channelName\n )\n )\n }", "title": "" }, { "docid": "a4ade6852972a1b8370111c05ce16748", "score": "0.5335095", "text": "function checkPageIsLive(){\n\tvar checked = $(\"#page_is_live\").attr(\"checked\");\n\t$(\"#page_is_live\").attr(\"checked\", !checked);\n\tif(!checked){\n\t\t$('#page_is_live_toggle').removeClass('private').addClass('live');\n\t} else {\n\t\t$('#page_is_live_toggle').removeClass('live').addClass('private');\n\t}\n}", "title": "" }, { "docid": "c48b012a908cbd2b70593ff83f046b01", "score": "0.5317599", "text": "get connected() {\n return this.socket && this.socket.readyState === WebSocket.OPEN;\n }", "title": "" }, { "docid": "012e054b7f975f95abd78dfeea024c40", "score": "0.53156257", "text": "get isChannelsMessage() {\n if (!this.isMessage || !this.message) return false;\n const message = this.message;\n return message.channel.startsWith('C');\n }", "title": "" }, { "docid": "5267af82cc6d653631e4a66e3c76fcc0", "score": "0.53020316", "text": "function isAvailable() {\n return Boolean(getClient());\n}", "title": "" }, { "docid": "fbee5377303a337c6117dc57159079ba", "score": "0.53013766", "text": "function isAlive(){\n\treturn true;\n}", "title": "" }, { "docid": "5b4bedd3c2ca0f928bddee4b7eca9932", "score": "0.5282737", "text": "isOnline() {\n if (this.id != null && this.manager != null) {\n return this.app.players.isPlayerOnline(this);\n }\n\n return false;\n }", "title": "" }, { "docid": "72644c43dfc885a8a67f83a8df96df54", "score": "0.5277727", "text": "function checkIfStillRunning()\n{\n chrome.storage.local.get(\"isRunning\", function(result){\n if(result.isRunning == false) {\n button_yamete.onclick();\n }\n else {\n window.setTimeout(checkIfStillRunning, 1000);\n }\n });\n}", "title": "" }, { "docid": "e1e703e2d7349887ed86082aacaeeb6a", "score": "0.52743393", "text": "function isActive() {\n\t\tvar now = new Date;\n\t\tdb.serialize(function () {\n\t\t\tconsole.log(\"run is active\");\n\t\t\tdb.each(\"select * from host\", function (err, row) {\n\t\t\t\tvar diff = now.getTime() - row.time;\n\t\t\t\t//console.log(diff+\" \"+now.getTime()+\" \"+row.time);\n\t\t\t\tif (diff > 600000) { // more than 10 minutes\n\t\t\t\t\tdb.run(\"UPDATE host SET active = 0 WHERE ip = '\" + row.ip + \"'\");\n\t\t\t\t\tconsole.log(row.ip + \" is inactive\\n\");\n\t\t\t\t} else\n\t\t\t\t\tconsole.log(row.ip + \" is active\\n\");\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "56b438a02930749db932079969099289", "score": "0.5269916", "text": "isActionCableConnectionOpen () {\n return this.StimulusReflex.subscription.consumer.connection.isOpen()\n }", "title": "" }, { "docid": "8f36a6874663c2246219d30b59e12177", "score": "0.52692175", "text": "isOpen() {\n if (this.webSocket) {\n return this.webSocket.readyState === WebSocket.OPEN;\n }\n return false;\n }", "title": "" }, { "docid": "ad41a9b8fc22e0a3e36b6803e551f070", "score": "0.5250412", "text": "function check_status () {\n var button = window.chat_status_change_button;\n var classes = button.firstChild.getAttribute('class');\n var class_to_status_map = {\n \"Tr dk dh\" : \"online\", // green\n \"Tr dk dj\" : \"online\", // red\n \"Tr df\" : \"offline\" // invi, offline\n };\n var state = class_to_status_map [classes];\n if ((state == \"online\") ||\n ((state == \"offline\") && isInvisible ())){\n ping ();\n }\n window.setTimeout (arguments.callee, \n window.gtalk_status_ping_duration_seconds * 1000);\n }", "title": "" }, { "docid": "0706b645bbfcdd9b4b9805baa0b92151", "score": "0.5245065", "text": "function checkForNew() {\n // TODO\n // Hint: Use the lastId global variable\n getChats(`chat.php?last_id=${lastId}`);\n}", "title": "" }, { "docid": "745e93b930c32b3d3c39068d45d4eeb5", "score": "0.523748", "text": "isOpen() {\n const result = this.link && this.link.isOpen();\n logger.verbose(\"%s Receiver for sessionId '%s' is open? -> %s\", this.logPrefix, this.sessionId, result);\n return result;\n }", "title": "" }, { "docid": "e8c662316d09bdf094d2c9fc73584e4b", "score": "0.5233781", "text": "function doesChannelHaveData (core, modChannelName) {\n\treturn core.config[MODULE_NAME].hasOwnProperty(modChannelName);\n}", "title": "" }, { "docid": "add96d65c22729c70f09eae3947d5779", "score": "0.522323", "text": "async function checkVideos(youtubeChannel, ChannelDATA){\r\n try{\r\n let lastVideos = await YTP.getLatestVideos(youtubeChannel);\r\n // If there isn't any video in the youtube channel, return\r\n if(!lastVideos || !lastVideos[0]) return false;\r\n // If the last video is the same as the last saved, return\r\n if(ChannelDATA.oldvid && (ChannelDATA.oldvid === lastVideos[0].id || ChannelDATA.oldvid.includes(lastVideos[0].id))) return false;\r\n if(ChannelDATA.alrsent && (ChannelDATA.alrsent.includes(lastVideos[0].id))) return false;\r\n return lastVideos[0];\r\n } catch {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "f4027ae74608bc50de0e14dbeb291a61", "score": "0.52213484", "text": "canPing () {\n return this.websocket && this.websocket.ping;\n }", "title": "" }, { "docid": "383eb047a318157b1fae8a5b917d161d", "score": "0.52211934", "text": "async getChannel(name) {\n\t\ttry {\n\t\t\tconst channel = await this.channels.cache.find(r => r.name == name);\n\t\t\treturn channel;\n\t\t} catch (err) {\n\t\t\tconsole.log(err.message);\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "4327bd6d09a74dd7bbf3019dce84391f", "score": "0.52066886", "text": "_check_heartbeat() {\n let difference = Date.now() - this.#last_ping;\n let max_duration = this.#heartbeat_duration * this.#heartbeat_margin;\n if (difference > max_duration) this.#ws.close();\n this.#handlers.log('HEARTBEAT_CHECK');\n }", "title": "" }, { "docid": "e2dfe25d4c8d1fd0a18bfb198e3e05b5", "score": "0.52054304", "text": "function statusOnline(callback) {\n if (cyberqData.status == 'online') {\n util.wuLog('Current status is online', severity.debug);\n callback(null, true);\n }\n else {\n\t util.wuLog('Current status is offline', severity.debug);\n\t callback(null, false);\n\t }\n }", "title": "" }, { "docid": "07864288d67cc98b4ccd80fb8c292a51", "score": "0.519347", "text": "async function checkChangeChannelButtonWithDelayedChannelState(\n canChangeChannel) {\n const resolver = new PromiseResolver();\n browserProxy.getChannelInfo = async function() {\n await resolver.promise;\n this.methodCalled('getChannelInfo');\n return Promise.resolve(this.channelInfo_);\n };\n const result = await checkChangeChannelButton(canChangeChannel);\n resolver.resolve();\n return result;\n }", "title": "" }, { "docid": "f1dd0d8c2b986a17fe9aca07ddc502c7", "score": "0.5189894", "text": "function onlineState() {\n return _online_observer;\n}", "title": "" }, { "docid": "eb9864de4898b91a6e83eb2d65ee7da3", "score": "0.51811695", "text": "isAvailable() { return this.#connection_.isConnected() && this.#connection_.isAuthenticated(); }", "title": "" }, { "docid": "3153c821b8dcb4940ae62658edaf144e", "score": "0.5167936", "text": "function channelStateChange(event, channel) {\n console.log(util.format(\n 'Channel %s is now: %s', channel.name, channel.state));\n }", "title": "" }, { "docid": "37c940851b9718a97bc39d3366c8c01f", "score": "0.51623183", "text": "hasLifetime() {\n return !!this.getLifetime();\n }", "title": "" }, { "docid": "3b11b149049afaea60db00791a38a3fb", "score": "0.51621133", "text": "isRunning() {\n return this.process != null && !this.closed;\n }", "title": "" }, { "docid": "30ebf7bd9c8c42dc8e1324281ee95839", "score": "0.51562583", "text": "function checkActiveState() {\n\n\tvar now = $.now();\n\t\n\tvar startActive = new Date($.now());\n\tstartActive.setHours(5);\n\tstartActive.setMinutes(0);\n\tstartActive.setSeconds(0);\n\n\tvar finishActive = new Date($.now());\n\tfinishActive.setHours(18);\n\tfinishActive.setMinutes(0);\n\tfinishActive.setSeconds(0);\n\n\treturn ((now >= startActive.getTime()) && (now <= finishActive.getTime())) ? true : false;\n}", "title": "" }, { "docid": "d5f736d3bd022825372e7f0bb1d82c63", "score": "0.5153372", "text": "function canApplyUpdates() {\r\n return module.hot.status() === 'idle';\r\n}", "title": "" }, { "docid": "a2a67e4c12f853c55c6e09fd497607f4", "score": "0.51522267", "text": "function isConnected() {\n return connected;\n}", "title": "" }, { "docid": "a2a67e4c12f853c55c6e09fd497607f4", "score": "0.51522267", "text": "function isConnected() {\n return connected;\n}", "title": "" }, { "docid": "5a4a22cdfe76563fdedad61698ee1222", "score": "0.51515627", "text": "shouldLive(count, currIsAlive) {\n // Any live cell with fewer than two live neighbors dies, as if caused\n // by underpopulation.\n if (count < 2) { return false };\n // Any live cell with two or three live neighbors lives on to the next generation\n if (currIsAlive && (count === 2 || count === 3)) { return true; };\n // Any live cell with more than three neighbors dies, as if by overpopulation.\n if (currIsAlive && count > 3) { return false };\n // Any dead cell with exactly three live neighbors becomes a live cell,\n // as if by reproduction\n if (!currIsAlive && count === 3) { return true; };\n return false // handles rest of cases;\n }", "title": "" }, { "docid": "4d52d604f2214e4aecc4431caf51f9a0", "score": "0.5150382", "text": "function checkAlive(role){\n\treturn $('.'+role).hasClass('livePlayer');\n}", "title": "" }, { "docid": "e3d17e8d96d0355fea6bf9644d4a7482", "score": "0.5139772", "text": "subscribeChannel(chNum) {\n\n let x = new Boolean(true);\n let foundChannel = this.#allChannels.find((x) => x.channel == chNum)\n let foundsubscribe = this.#subscribeChannels.includes(chNum)\n //Not subscribed\n if (foundChannel && !foundsubscribe) {\n\n this.#subscribeChannels.push(chNum)\n x = false\n\n }\n //Already subscirbed\n else {\n x = true\n }\n\n return x\n\n }", "title": "" }, { "docid": "10dc81e426e27b204ef9c6f10d7f68ad", "score": "0.5127624", "text": "async function check(){\r\n //get the Keys\r\n var keys = await YTP.YTP_DB.keys;\r\n keys.forEach(async key => {\r\n //get the Channels from the key\r\n var allChannels = await YTP.YTP_DB.get(`${key}.channels`);\r\n //if no channels defined yet, return\r\n if(!allChannels || allChannels.length == 0) return;\r\n //loop through all yt channels\r\n allChannels.forEach(async (ChannelDATA, index) => {\r\n try{\r\n //If there is no Channellink return\r\n if(!ChannelDATA.YTchannel) return console.log(ChannelDATA.YTchannel)\r\n //get the latest Youtube Channel Information (name, id, etc.)\r\n let channelInfos = await YTP.getChannelInfo(ChannelDATA.YTchannel);\r\n //if no channelInfos return\r\n if(!channelInfos) return;\r\n //get the latest video\r\n let video = await checkVideos(channelInfos.url, ChannelDATA);\r\n //if no video found, return error\r\n if(!video) return; //not a latest video posted\r\n //define a global dc channel variable\r\n let DCchannel;\r\n try{\r\n //try to get a DC channel from cache\r\n DCchannel = await YTP.client.channels.cache.get(ChannelDATA.DiscordChannel);\r\n //if no Channel found, fetch it\r\n if(!DCchannel) {\r\n DCchannel = await YTP.client.channels.fetch(ChannelDATA.DiscordChannel);\r\n }\r\n } catch{\r\n //Do some logging because it failed finding it\r\n console.log(YTP.ytp_log + `Could not find the Discord Channel for ${ChannelDATA.YTchannel}\\n${JSON.stringify(ChannelDATA)}`.italic.brightRed)\r\n console.log(YTP.ytp_log + \"Removing it from the DB...\")\r\n //delete the Channel\r\n await YTP.deleteChannel(ChannelDATA.DiscordGuild, ChannelDATA.YTchannel)\r\n }\r\n //if no DC Channel found, return error\r\n if(!DCchannel) return; \r\n //send the Message\r\n await DCchannel.send(stringmsg(ChannelDATA.message));\r\n //get the string message and replace the datas\r\n function stringmsg(txt) {\r\n return String(txt).replace(/{videourl}/ig, video.link)\r\n .replace(/{video}/ig, video.link)\r\n .replace(/{url}/ig, video.link)\r\n .replace(/{videotitle}/ig, video.title)\r\n .replace(/{name}/ig, video.title)\r\n .replace(/{title}/ig, video.title)\r\n .replace(/{videoauthorname}/ig, channelInfos.name)\r\n .replace(/{authorname}/ig, channelInfos.name)\r\n .replace(/{author}/ig, channelInfos.name)\r\n .replace(/{creator}/ig, channelInfos.name)\r\n .replace(/{creatorname}/ig, channelInfos.name)\r\n .replace(/{discorduser}/ig, ChannelDATA.DiscordUser)\r\n .replace(/{user}/ig, ChannelDATA.DiscordUser)\r\n .replace(/{member}/ig, ChannelDATA.DiscordUser)\r\n }\r\n //set the new old vid to the latest send video\r\n ChannelDATA.oldvid = video.id;\r\n //push the data in the already sent ones, so it's never repeating again, if a reupload and delete after, etc.\r\n ChannelDATA.alrsent.push(video.id)\r\n //if the already sent starts to get to big, remove the end of it\r\n if(ChannelDATA.alrsent.length > 5) {\r\n ChannelDATA.alrsent.pop()\r\n }\r\n //replace item in the\r\n allChannels[index] = ChannelDATA;\r\n //set the new channels\r\n await YTP.YTP_DB.set(`${ChannelDATA.DiscordGuild}.channels`, allChannels);\r\n }catch (e){\r\n console.log(String(e).grey)\r\n }\r\n })\r\n })\r\n }", "title": "" }, { "docid": "8932870c46d479847ae8248b5061f116", "score": "0.5126458", "text": "function canApplyUpdates() {\n\t return module.hot.status() === 'idle';\n\t}", "title": "" }, { "docid": "8932870c46d479847ae8248b5061f116", "score": "0.5126458", "text": "function canApplyUpdates() {\n\t return module.hot.status() === 'idle';\n\t}", "title": "" }, { "docid": "8932870c46d479847ae8248b5061f116", "score": "0.5126458", "text": "function canApplyUpdates() {\n\t return module.hot.status() === 'idle';\n\t}", "title": "" }, { "docid": "8932870c46d479847ae8248b5061f116", "score": "0.5126458", "text": "function canApplyUpdates() {\n\t return module.hot.status() === 'idle';\n\t}", "title": "" }, { "docid": "58d1d9a4319d0bfa28a9e570d931d5c0", "score": "0.5126148", "text": "function getTwChannelStatus(channel, cb) {\n client.api({\n 'url': twBaseUrl + `/streams/${channel}`,\n 'headers': headers,\n }, (err, res, body) => {\n if (err) {\n console.error(err);\n return cb(null);\n }\n return cb(body);\n });\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5116113", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5116113", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5116113", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5116113", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5116113", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5116113", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5116113", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "d8e1196e648a66d073cd0a7d258dd380", "score": "0.5112814", "text": "isConnected(){\n return this.client.isConnected();\n }", "title": "" }, { "docid": "d8e1196e648a66d073cd0a7d258dd380", "score": "0.5112814", "text": "isConnected(){\n return this.client.isConnected();\n }", "title": "" }, { "docid": "1834518a91dc8bf120de956d1e6c2296", "score": "0.5108831", "text": "isConnected() {\n return this.tracking || super.isConnected();\n }", "title": "" }, { "docid": "e71ab2de48a77f5c8c6dbc64733fbe29", "score": "0.51065147", "text": "function check_user_status(){\n\tvar users = comsdb.getUsers(['username','lastseen','online']);\n\n\tvar currentTime = new Date().getTime();\n\n\tvar offlineusers = [];\n\n\tfor(var user in users){\n\t\tif((users[user].online == 1) && ((currentTime - users[user].lastseen) > 5*60000)){\n\t\t\tofflineusers.push(users[user].username);\n\t\t}\n\t}\n\n\tconsole.log(\"OFFLINE\");\n\tconsole.log(offlineusers);\n\n\tfor(var user in offlineusers){\n\t\tconsole.log(\"Setting Offline: \" + offlineusers[user]);\n\t\tcomsdb.set_offline(offlineusers[user]);\n\t}\n\n\tif(offlineusers.length > 0)\n\t\tsocketHandler.update_web(\"user\");\n\n}", "title": "" }, { "docid": "fba03faaeef6f1602401a4f405ae97ba", "score": "0.51039267", "text": "function checkEveryoneReady(){\n\t\n\tif(playersReady>=nbPlayerConnected){\n\t\tlet timeStart = Date.now()+20000; \n\t\tio.emit('starting',timeStart);\n\t\tplayerInGame = playersReady;\n\t\tconsole.log('EVERYONE READY !');\n\t\tplayersReady = 0;\n\t\tgameRestarting = false ;\n\t}\n}", "title": "" }, { "docid": "e73bbe8d10d032c1a2295766aa5c8cd2", "score": "0.50978583", "text": "isPlaying() {\r\n return !(this.player.paused || this.client.paused);\r\n }", "title": "" }, { "docid": "23907dbaccfc2946e7432f185f09f086", "score": "0.5094449", "text": "is_lost() {\n\t\treturn (this.player_list.length == 0 || this.timer <= 0);\n\t}", "title": "" }, { "docid": "2b9ff9e98901d9cc842940eddad6d499", "score": "0.5082563", "text": "function checkExternalPluginActive(){\n if (priv.$externalPlugin[0]) {\n if (!priv.externalPluginActive) {\n clearTimeout(priv.setTimeoutId);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "835386a7dd4ad8da76d983964115a470", "score": "0.5079284", "text": "get isConnected() {\n return this.childProcess && this.childProcess.connected && !this.childProcess.killed;\n }", "title": "" }, { "docid": "a7030f6201935770a01308e1070a5e29", "score": "0.507534", "text": "isServerConncted() {\n return serverConnected;\n }", "title": "" } ]
819b34ecaff00f9b6a505366130c1659
Create the text inside a course div from stored information, if isExepandedMode is false, this methode will addapte the content so that the div have a width and heigh of exactly maxDims This methode just put content all in the div. If it don't fit it reduce the amount of display content and retry until everything fit. If the content cannot reducedanymore, the font size will be reduced instead.
[ { "docid": "f9e9fdc5820ed6a5af41c1074776fdfe", "score": "0.6801382", "text": "fillText(parent,groupStart,maxDims,isExepandedMode,enabling){\n\t\tfunction isOk(dim){\n\t\t\treturn dim.x <= maxDims.x + 1e-3 && dim.y < maxDims.y + 1e-3\n\t\t}\n\t\tfunction mkRoomLink(parent, room){\n\t\t\tparent.append(\"a\")\n\t\t\t\t.text(room)\n\t\t\t\t.attr(\"href\",DaViSettings.epflPlanQuerry+room)\n\t\t\t\t.classed(DaViSettings.roomLinkTextClass)\n\t\t}\n\t\tparent.style('font-size',DaViSettings.cellFontDefault)\n\n\t\tparent.html(\"\")\n\t\tlet text = parent.append(\"div\")\n\t\t\t.classed(DaViSettings.detailDiv,true)\n\n\t\tlet slots = this.slotDict[this.cellBackId(groupStart)]\n\t\tlet allTitleName =[];\n\t\tlet allCodes = [];\n\n\t\tlet everythingFit = true\n\t\tlet isFirst = true\n\t\tfor(let coursId in slots){\n\t\t\tlet slot = slots[coursId]\n\t\t\tlet course = ISA_data[coursId]\n\t\t\tallTitleName.push(coursId)\n\t\t\tallCodes.push(course.code)\n\t\t\tif(everythingFit){\n\t\t\t\tif(!isFirst)\n\t\t\t\t\ttext.append(\"hr\")\n\t\t\t\t\t.attr(\"noshade\",\"noshade\")\n\t\t\t\t\t.style(\"background-color\",\"red\")\n\t\t\t\t\t.style(\"color\",\"darkred\")\n\t\t\t\tlet detailsDiv = text.append(\"div\")\n\t\t\t\tif(isExepandedMode){\n\t\t\t\t\tlet color = this.getColor(slot)\n\t\t\t\t\tlet temp = detailsDiv.transition()\n\t\t\t\t\t\t.ease(d3.easeCubicOut)\n\t\t\t\t\t\t.duration(DaViSettings.defaultDelay)\n\t\t\t\t\t\t.style(\"background-color\",color)\n\t\t\t\t\tif(dictLen(slots)>1)\n\t\t\t\t\t\ttemp.style(\"padding\",\"2px\")\n\t\t\t\t\t\t.style(\"border\",\"2px solid\")\n\t\t\t\t\t\t.style(\"border-color\",d3.interpolateLab(color, \"black\")(0.5))\n\t\t\t\t}\n\t\t\t\tdetailsDiv.append(\"a\")\n\t\t\t\t\t.text(coursId+\" (\"+course.code+\")\")\n\t\t\t\t\t.classed(DaViSettings.cellTitleTextClass,true)\n\t\t\t\tlet rooms = slot.room\n\t\t\t\tif(isExepandedMode){\n\t\t\t\t\tlet stuffDiv = detailsDiv.append(\"div\")\n\t\t\t\t\tstuffDiv.append('div')\n\t\t\t\t\t\t.text('👁')\n\t\t\t\t\t\t.classed(\"left\",true)\n\t\t\t\t\t\t.on(\"click\",()=>{\n\t\t\t\t\t\t\td3.event.stopPropagation();\n\t\t\t\t\t\t\tcourselist.showDetails(coursId, course);\n\t\t\t\t\t\t\td3.select(\"#courseInfo\")\n\t\t\t\t\t\t\t.style('background-color',\"rebeccapurple\")\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.duration(DaViSettings.shortNoticeableDelay)\n\t\t\t\t\t\t\t.ease(d3.easeCubicOut)\n\t\t\t\t\t\t\t.style('background-color',\"white\");\n\t\t\t\t\t\t})\n\t\t\t\t\tstuffDiv.append('div')\n\t\t\t\t\t\t.text('❌')\n\t\t\t\t\t\t.classed(\"right\",true)\n\t\t\t\t\t\t.on(\"click\",() => {courselist.enableCourse(coursId, d3.event)})\n\t\t\t\t\tlet roomsDiv = stuffDiv.append(\"div\")\n\t\t\t\t\t\t.classed(\"center\",true);\n\t\t\t\t\tmkRoomLink(roomsDiv,rooms[0])\n\t\t\t\t\tfor(let i =1;i<rooms.length;i++){\n\t\t\t\t\t\troomsDiv.append(\"span\")\n\t\t\t\t\t\t\t.txt(\",\")\n\t\t\t\t\t\tmkRoomLink(roomsDiv,rooms[i]);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\tlet roomsDiv = detailsDiv.append(\"div\")\n\t\t\t\t\tmkRoomLink(roomsDiv,rooms[0])\n\t\t\t\t\tfor(let i =1;i<rooms.length;i++){\n\t\t\t\t\t\troomsDiv.append(\"span\")\n\t\t\t\t\t\t\t.txt(\",\")\n\t\t\t\t\t\tmkRoomLink(roomsDiv,rooms[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\t\t\t\tisFirst = false\n\t\t\t}\n\t\t}\n\n\t\tif(!everythingFit){\n\t\t\ttext.html(\"\");\n\t\t\tisFirst = true\n\t\t\tfor(let coursId in slots){\n\t\t\t\tif(!everythingFit)\n\t\t\t\t\tbreak;\n\n\t\t\t\tlet slot = slots[coursId]\n\t\t\t\tlet course = ISA_data[coursId]\n\n\t\t\t\tif(!isFirst)\n\t\t\t\t\ttext.append(\"hr\")\n\t\t\t\tlet detailsDiv = text.append(\"div\")\n\t\t\t\tdetailsDiv.append(\"a\")\n\t\t\t\t\t.text(coursId)\n\t\t\t\t\t.classed(DaViSettings.cellTitleTextClass,true)\n\t\t\t\tlet rooms = slot.room\n\t\t\t\tlet roomsDiv = text.append(\"div\")\n\t\t\t\tmkRoomLink(roomsDiv,rooms[0])\n\t\t\t\tfor(let i =1;i<rooms.length;i++){\n\t\t\t\t\troomsDiv.append(\"spand\")\n\t\t\t\t\t\t.txt(\",\")\n\t\t\t\t\tmkRoomLink(roomsDiv,rooms[i]);\n\t\t\t\t}\n\t\t\t\tisFirst = false\n\t\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\t\t\t}\n\t\t}\n\n\t\tif(!everythingFit){\n\t\t\tlet dictKeys = Object.keys(slots);\n\t\t\tif(dictKeys.length ==1){\n\t\t\t\tlet size =0.9;\n\t\t\t\ttext.html(\"\");\n\t\t\t\tlet nSpan = text.append(\"span\")\n\t\t\t\t\t.text(dictKeys[0])\n\t\t\t\tfor(let i =0;i<6 && !everythingFit;i++){\n\t\t\t\t\tnSpan.style('font-size',size+\"em\")\n\t\t\t\t\tsize *= 0.9;\n\t\t\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!everythingFit){\n\t\t\ttext.html(\"\");\n\t\t\tisFirst = true\n\t\t\tfor(let coursId in slots){\n\n\t\t\t\tif(!everythingFit)\n\t\t\t\t\tbreak;\n\t\t\t\tlet slot = slots[coursId]\n\t\t\t\tlet course = ISA_data[coursId]\n\t\t\t\tif(!isFirst)\n\t\t\t\t\ttext.append(\"hr\")\n\t\t\t\tlet detailsDiv = text.append(\"div\")\n\t\t\t\tdetailsDiv.append(\"a\")\n\t\t\t\t\t.text(course.code)\n\t\t\t\t\t.classed(DaViSettings.cellTitleTextClass,true)\n\t\t\t\tlet rooms = slot.room\n\t\t\t\tlet roomsDiv = text.append(\"div\")\n\t\t\t\tmkRoomLink(roomsDiv,rooms[0])\n\t\t\t\tfor(let i =1;i<rooms.length;i++){\n\t\t\t\t\troomsDiv.append(\"span\")\n\t\t\t\t\t\t.txt(\",\")\n\t\t\t\t\tmkRoomLink(roomsDiv,rooms[i]);\n\t\t\t\t}\n\t\t\t\tisFirst = false\n\t\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\n\n\t\t\t}\n\t\t}\n\t\tif(!everythingFit){\n\t\t\ttext.html(\"\");\n\t\t\ttext.classed(DaViSettings.cellTitleTextClass,true)\n\t\t\ttext.text(allTitleName.join(\" / \"))\n\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\n\t\t}\n\t\tif(!everythingFit){\n\t\t\tlet titleDims = Vec.Dim(text.node().getBoundingClientRect())\n\t\t\ttext.text(allCodes.join(\" / \"))\n\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\t\t\twhile(allCodes.length > 1 && !everythingFit){\n\t\t\t\tallCodes.pop()\n\t\t\t\tlet otherCount = allTitleName.length - allCodes.length\n\t\t\t\tif(otherCount == 1)\n\t\t\t\t\totherCount += \" other\"\n\t\t\t\telse\n\t\t\t\t\totherCount += \" others\"\n\t\t\t\ttext.text(allCodes.join(\" / \")+\" and \"+otherCount)\n\t\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\t\t\t}\n\t\t\tlet fontSize = 1;\n\t\t\twhile(!everythingFit){\n\t\t\t\tfontSize*=0.9;\n\t\t\t\ttext.style('font-size',fontSize+\"em\")\n\t\t\t\teverythingFit = isOk(Vec.Dim(text.node().getBoundingClientRect()))\n\t\t\t}\n\t\t}\n\t\tif(enabling)\n\t\t\tparent = parent.style('font-size',DaViSettings.cellFontVerySmall)\n\n\t\treturn parent;\n\n\t}", "title": "" } ]
[ { "docid": "779d65425b543874222eddf71cd443c1", "score": "0.59511435", "text": "function sizeTextDiv() {\n \t// We need the length for use in sizing the div\n \t\t\tvar post_length = 0;\n \t\t\t// the text ID is different when in view mode, needs to be ignore in tables.\n \t\t\t\n \t\t// since this could be called from a variety of locations we test the argument\n \t\t// in this case we should have the edgeless_field1 so this presumes edit mode\n\t\tif (typeof myPost != \"undefined\") {\n\t\t\t// we grab that text and store it in a variable \n\t\t\tvar string_of_my_post = $('#edgeless_field1').attr('value');\n\t\t\t// and set a variable with method scope to have the length of that variable\n\t\t\tpost_length = string_of_my_post.length;\t\n\t\t}\n\t\telse {\n\t\t\tvar string_of_content = $('#edgeless_field1').html();\n\t\t\tpost_length = string_of_content.length;\n\t\t}\n \t\t\t\n\t\t// I think this is stupid and I need to figure out WTF I was doing here and why. \n\t\t// there has to be a better way\n\t\tif(post_length < last_post_length) {\n\t\t\tvar font_size = $('#edgeless_field1').css('font-size');\n\t\t\tfont_size = parseInt(font_size); \n\t\t\tdecreaseOutputDiv(font_size);\n\t\t}\n\t\tvar font_size = $('#edgeless_field1').css('font-size');\n\t\tfont_size = parseInt(font_size); \n \t\t\n \t\t// don't grow the div for small posts with small font sizes.\n \t\tif (post_length < 34 && font_size < 12) {\n\t\t\treturn;\n \t\t}\n\n \t\t// sizing the div we get current widths and increase the width of the outer div\n\t\twhile ( $('#edgeless_field1').outerWidth() >= $('#post_text_output').innerWidth() ) {\n\t\t\tvar new_width = $('#post_text_output').innerWidth();\n\t\t\tnew_width++;\n\t\t\t$('#post_text_output').css('width', ( new_width ));\n\t\t}\n \t\t// and we need to add some padding, so we set a variable for the div width now\n \t\t\tvar a_pinch_more = $('#post_text_output').outerWidth();\n \t\t\n\t\t\tfor (var i=0;i<16;i++) {\n\t\t\t\ta_pinch_more += 1;\n\t\t\t}\n \t\t// set new width to the css\n \t\t\t$('#post_text_output').css('width', ( a_pinch_more));\n \t\t// add new width to the hidden input field\n \t\t\t$('#post_text_output_width').val( a_pinch_more );\n \t\t\t$('#post_text_output_width').html( a_pinch_more);\n\n }", "title": "" }, { "docid": "66d27cff719164fae5eb27448285ecdc", "score": "0.59086233", "text": "function showContent() {\n if(writingMode) {\n writingMode = false;\n page.innerHTML = allText ;\n blurredPage.style.display = \"none\";\n lastLineBlurredPage.style.display = \"none\";\n document.getElementById(\"page-layout\").style.gridTemplateRows = \"60px auto 85px\";\n document.getElementById(\"toggle-writer\").innerHTML = \"Compose Mode\";\n document.getElementById(\"tools\").setAttribute(\"id\", \"tools-animate\");\n\n } else {\n page.style.display = \"inline\";\n blurredPage.style.display = \"inline\";\n lastLineBlurredPage.style.display = \"inline\";\n document.getElementById(\"page-layout\").style.gridTemplateRows = \"10px auto 85px\";\n document.getElementById(\"toggle-writer\").innerHTML = \"Review Mode\";\n document.getElementById(\"tools-animate\").setAttribute(\"id\", \"tools-out\");\n document.getElementById(\"tools-out\").setAttribute(\"id\", \"tools\");\n writingMode = true;\n\n allText = page.innerHTML;\n lastLineBlurredPage.innerHTML = '';\n blurredPage.innerHTML = allText;\n page.innerHTML = '<br>';\n lastLine = '';\n prevLines = allText;\n\n }\n }", "title": "" }, { "docid": "fe2e662b20da6afad00299268df573c5", "score": "0.58567894", "text": "function init()\n {\n $(exDiv).show();\n result = moveTextToDynamic(mainDiv, dynamicDiv);\n var totalLines = result.lines;\n totalBlocks = Math.round(totalLines/linesPerBlock);\n var totalWords = result.words;\n var fontSize = result.fontSize;\n\n $(mainDiv).hide();\n var mWidth = $('.games-inner-container').width();\n var mHeight = $('.games-inner-container').height();\n $('.games-inner-container').css('width',$(\".games-inner-container\").width());\n $(dynamicDiv).css('width',mWidth+'px');\n $(dynamicDiv).css('height',mHeight+'px');\n $(dynamicDiv).show();\n $(dynamicDiv).disableSelection();\n var avgWordsLine = Math.round(totalWords/totalLines);\n var avgWordsBlock = avgWordsLine * linesPerBlock;\n for (var i=0; i<5; i++)\n speeds[i] = (avgWordsBlock/speedsWpm[i])*60*1000;\n speedSelectedValue = speeds[0];\n\n\n // determine how many lines will fit in the div\n // and make them fit evenly\n var divHeight = $(dynamicDiv).outerHeight();\n var lineHeight = Math.floor(parseInt(fontSize * 1.2));\n linesPerPage = parseInt(divHeight/lineHeight);\n var exactLineHeight = divHeight/linesPerPage;\n if (linesPerPage%linesPerBlock ==1)\n {\n linesPerPage--;\n exactLineHeight = divHeight/linesPerPage;\n }\n if (linesPerPage%linesPerBlock==2)\n {\n linesPerPage++;\n exactLineHeight = divHeight/linesPerPage;\n }\n $(dynamicDiv).css('line-height',parseInt(exactLineHeight)+'px');\n lastLineThisPage = linesPerPage;\n }", "title": "" }, { "docid": "32bd2bc552075b211eeb5675b96e1498", "score": "0.5839412", "text": "create(o) {\n bb.fn.text.super.create.call(this, o);\n this.type.push('text');\n this.addClass('text');\n this.pv.align = bb.align.CENTER;\n let margin = this.layers.content;\n if (o.align !== undefined)\n this.pv.align = o.align;\n if (o.needsMargin) { // TODO: changed in bb v.1.1.04, need to add in call in lomob\n margin = bb.appendHTML(this.layers.content, 'div', {\n style: {\n 'position': 'absolute',\n 'width': '96%',\n 'height': '100%',\n 'margin-left': '2%',\n 'margin-right': '2%'\n }\n });\n this.pv.margin = margin;\n }\n var text = this.pv.text = bb.appendHTML(margin, 'div', {\n style: styleAlign(this.pv.align)\n });\n if ('text' in o)\n this.pv.text.innerHTML = o.text;\n if ('size' in o) {\n if (o.size == 'auto')\n this.pv.autosize = 0.9;\n else if (o.size >= 1) {\n this.pv.autosize = 0;\n this.element.style['font-size'] = o.size;\n } else {\n this.pv.autosize = o.size;\n this.element.style['font-size'] = 0.1;\n }\n }\n text.style.opacity = 0;\n bb.wait(0, function () {\n text.style.opacity = 1;\n });\n return this.element;\n }", "title": "" }, { "docid": "e856c1eb5fa045d42bb014251ce10a2e", "score": "0.5821577", "text": "function display_text(text, size, parentId) {\n // append text in div to parent container\n var div = document.createElement(\"div\");\n div.id = \"textDiv\";\n div.style.position = \"absolute\";\n div.style.top = (h/2-200).toString()+'px';\n div.style.left = (w/2-300).toString()+'px';\n div.style.width = '600px';\n\tdiv.style.backgroundColor = \"#ffffff\";\n div.style.textAlign = 'center';\n div.style.fontFamily = 'Arial';\n div.style.fontSize = size;\n div.innerHTML = text;\n\n document.getElementById(parentId).appendChild(div);\n \n}", "title": "" }, { "docid": "92773e0fae643870cc7bd8fd32fe54fa", "score": "0.56909215", "text": "function settext() {\r\n\r\n $(\".rtext\").each(function () {\r\n var p = $(this).find(\"p\");\r\n var cont = $(this).find(\".textcont\");\r\n $(this).css(\"height\", \"380px\");\r\n $(this).parent().find(\".more\").css(\"display\", \"none\");\r\n if (!started) {\r\n $(this).parent().find(\".hide\").html($(p).html());\r\n } else {\r\n $(p).html($(this).parent().find(\".hide\").html());\r\n }\r\n\r\n ////console.log($(this).parent().parent().parent().parent().parent().parent().parent().attr('class'));\r\n\r\n ////console.log($(cont).outerHeight());\r\n if ($(cont).outerHeight() > 385) {\r\n $(this).parent().find(\".more\").css(\"display\", \"inline\").attr(\"rel\", $(cont).outerHeight() + \"\");\r\n\r\n var count = 0;\r\n while ($(cont).outerHeight() > 385 && count < 40) {\r\n count++;\r\n $(p).text(function (index, text) {\r\n return text.replace(/\\W*\\s(\\S)*$/, \"...\");\r\n });\r\n }\r\n }\r\n });\r\n started = true;\r\n}", "title": "" }, { "docid": "4a7d87a6ee4f3ff9e6cf527c0831e253", "score": "0.5617141", "text": "function setText() {\n if (p.optionGroupArr.length != p.optionHolderArr.length) {\n alert(\n 'optionGroupArr length and optionHolderArr length mismatch, plese provide appropriate holder to set text'\n );\n alert('execution stopped here');\n return;\n }\n for (var i = 0; i < p.optionGroupArr.length; i++) {\n var _parentOffset = $(p.domObj[p.optionHolderArr[i]]).offset();\n for (var j = 0; j < p.optionGroupArr[i].length; j++) {\n var _id = p.optionGroupArr[i][j];\n var temp = p._shellModel.getTextValue(_id);\n if (temp) {\n var _div = iFrameDoc.createElement('div');\n var _leftPadding = 0;\n var _topPadding = 0;\n if (p.txtLeftPadding) {\n _leftPadding += Number(p.txtLeftPadding);\n }\n if (p.singleTxtPadding && p.singleTxtPadding[_id]) {\n if (p.singleTxtPadding[_id]['left']) {\n _leftPadding += Number(p.singleTxtPadding[_id]['left']);\n }\n if (p.singleTxtPadding[_id]['top']) {\n _topPadding += Number(p.singleTxtPadding[_id]['top']);\n }\n }\n var _lineHt = 0;\n if (p.lineHt != undefined) {\n _lineHt = p.lineHt;\n }\n $(_div).css({\n position: 'relative',\n display: 'inline-block',\n float: 'left',\n 'margin-left': _leftPadding,\n 'margin-top': _topPadding,\n 'line-height': _lineHt + 'px'\n });\n $(_div)\n .appendTo(p.domObj[p.optionHolderArr[i]])\n .html(temp)\n .attr('id', _id + '_parent')\n .attr('group', i)\n .attr('status', 'false');\n var _tempSpan = $(_div).find('span');\n $(_tempSpan)\n .attr('id', _id)\n .attr('group', i)\n .attr('status', 'false');\n\n p.domObj[p.optionGroupArr[i][j] + '_parent'] = _div;\n //console.log(_tempSpan);\n p.domObj[p.optionGroupArr[i][j]] = _tempSpan[0];\n if (p.bottomBorder) {\n if (p.normalbottomBorderCss) {\n $(_tempSpan).css({\n 'border-bottom': p.normalbottomBorderCss\n });\n }\n }\n // create tick/cross inside span\n if (p.tickNcross) {\n createTickAndCross(_div, _id);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d912d6d4ce716c8bf0e2586e45e352cf", "score": "0.56104815", "text": "function handleCompactTextpanelSizes(showTextpanel){\n\t\t\t\n\t\tvar wrapperSize = g_functions.getElementSize(g_objWrapper);\n\t\tvar objImage = g_objSlider.getSlideImage();\n\t\tvar objImageSize = g_functions.getElementSize(objImage);\n\t\t\n\t\tif(objImageSize.width == 0)\n\t\t\treturn(false);\n\t\t\n\t\t\n\t\tg_temp.textPanelLeft = objImageSize.left;\n\t\tg_temp.textPanelTop = objImageSize.bottom;\n\n\t\tvar textPanelWidth = objImageSize.width;\n\t\t\n\t\tif(g_objNumbers){\n\t\t\t\n\t\t\tvar objNumbersSize = g_functions.getElementSize(g_objNumbers);\n\t\t\ttextPanelWidth -= objNumbersSize.width;\n\t\t\t\n\t\t\t//place numbers object\n\t\t\tvar numbersLeft = objImageSize.right - objNumbersSize.width;\n\t\t\tg_functions.placeElement(g_objNumbers, numbersLeft, g_temp.textPanelTop);\n\t\t}\n\t\t\t\n\t\t\t\n\t\tif(g_objTextPanel){\n\t\t\tg_objTextPanel.show();\n\t\t\tg_objTextPanel.refresh(true, true, textPanelWidth);\n\t\t\tsetCompactTextpanelTop(objImageSize);\n\t\t}\n\t\t\n\t\tvar isChanged = handleCompactHeight(objImageSize);\n\t\t\n\t\tif(isChanged == false){\n\t\t\t\n\t\t\tg_temp.positionFrom = \"handleCompactTextpanelSizes\";\n\t\t\t\n\t\t\tif(g_objTextPanel){\n\t\t\t\tg_objTextPanel.positionPanel(g_temp.textPanelTop, g_temp.textPanelLeft);\n\t\t\t\tif(showTextpanel === true){\n\t\t\t\t\tshowTextpanel();\n\t\t\t\t\tshowNumbers();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "00a5cac5e9b67ed6bf1240f2821c747d", "score": "0.5577188", "text": "createHTMLText(){\n let myText = document.createElement(\"text\");\n myText.contentEditable = true;\n myText.innerHTML = this.content;\n myText.setAttribute( 'class', 'textElementSlide');\n myText.setAttribute('spellcheck', \"false\");\n myText.setAttribute('id', this.id);\n return myText;\n }", "title": "" }, { "docid": "3e81197e4566ed9e08b445eb6419495a", "score": "0.5568553", "text": "resizeOverflowingText() {\n if (!this.params.behaviour.scaleTextNotCard) {\n return; // No text scaling today\n }\n\n // Resize card text if needed\n const $textContainer = this.getDOM().find('.h5p-dialogcards-card-text');\n const $text = $textContainer.children();\n this.resizeTextToFitContainer($textContainer, $text);\n }", "title": "" }, { "docid": "63c299ebb5c5961b15edd24656e0cddf", "score": "0.5560423", "text": "function appText(){\n\t\t\t\tdocument.getElementById('text1').style.width = \"245px\";\n\t\t\t\tdocument.getElementById('text2').style.width = \"260px\";\n\t\t\t\tdocument.getElementById('motif').style.opacity = \"1\";\n\t\t\t}", "title": "" }, { "docid": "85e93b9fe9e5da4c34803e60a02322eb", "score": "0.555761", "text": "function buildSection() {\n var $section = $('#'+section),\n $sectionIntro = $(\"#\"+section+\"-intro\"),\n ElChatPart;\n\n text = chatContent[section][\"intro\"];\n delete chatContent[section][\"intro\"];\n\n var ElChatPart = $(\"<div class='chatPart-bot'>\"\n +\"<p class='chatPart-text jsLoading'>\"+text+\"</p>\"\n +\"</div>\");\n\n $sectionIntro.append(ElChatPart);\n\n if (section == \"practice\") {\n showingCommon($sectionIntro, showingPractice);\n } else {\n var ElChatOptions = getOptions(title);\n $sectionIntro.find(botClass).append(ElChatOptions);\n showingCommon($sectionIntro, showingSentence);\n }\n }", "title": "" }, { "docid": "e786d130069ca74620018a0716887fce", "score": "0.55519813", "text": "function demographics(school) {\n var demographics_content = \n '<div class=\"scrollme\">'+ \n 'African American: '+school.african_american+\n '<br/>Asian: '+school.asian+\n '<br/>Hispanic: '+school.hispanic+\n '<br/>Native American: '+school.native_american+\n '<br/>White: '+school.white+\n '<hr>'+ \n 'Free Reduced Lunch: '+school.reduced_lunch+\n '<br/>With Special Needs: '+school.special_needs+\n '<br/>English Language Learners: '+school.english_learners+\n '<br/>'+\n '<hr>'+\n 'Licensed Art Specialist: '+school.art_specialist+\n '<br/>Licensed Music Specialist: '+school.music_specialist+\n '<br/>Licensed Physical Education Specialist: '+school.pe_specialist+\n '</div>';\n\n return demographics_content;\n}", "title": "" }, { "docid": "c5b3fc815dbe46e5b1e196a84e3c85f2", "score": "0.5525234", "text": "function text_creation(textValue, heightPower, widthPower, lineHeight ){\r\n\t\t \r\n\t\t var texts = new THREEx.DynamicText2DObject();\r\n\t\t texts.parameters.text = textValue;\r\n\t\t \r\n\t\t //HeightPower\r\n\t\t //The HeightPower works in the power of two and starts with 2^7 = 128\r\n\t\t //The height for the canvas works like this = 2^(7+heightPower); \r\n\t\t texts.dynamicTexture.canvas.height = Math.pow(2, 7+heightPower);\t\r\n\t\t \r\n\t\t //WidthPower\r\n\t\t //The WidthPower works in the power of two and starts with 2^7 = 128\r\n\t\t //The width for the canvas works like this = 2^(7+widthPower); \r\n\t\t texts.dynamicTexture.canvas.width = Math.pow(2, 7+widthPower);\t\r\n\t\t \r\n\t\t /** Powers of 2\r\n\t\t\t\t 2^(7) = 128\r\n\t\t\t\t 2^(8) = 256\r\n\t\t\t\t 2^(9) = 512\r\n\t\t\t\t 2^(10) = 1024\r\n\t\t\t\t 2^(11) = 2048\r\n\t\t\t\t 2^(12) = 4096\r\n\t\t **/\r\n\t\t \r\n\t\t //Line Height\r\n\t\t //The higher the value the higher gap\r\n\t\t texts.parameters.lineHeight= lineHeight;\r\n\t\t \r\n\t\t texts.parameters.align = \"center\";\r\n\t\t \r\n\t\t texts.update();\r\n\t\t return texts;\r\n\t }", "title": "" }, { "docid": "a993ad0fd84b56452a9072970d321891", "score": "0.5492785", "text": "function setupText() {\n output = createP(\"\");\n textP = createP(\"Anzahl St&auml;dte: \");\n textX = createP(\"x-Pixel\");\n textY = createP(\"y-Pixel\");\n err = createP(\"Boxen sind nicht vollst&auml;ndig\");\n timeWarning = createP(\"Dies kann einige Minuten dauern.\");\n textTravel[0] = createSpan(\"Wenn 1 Kilometer \");\n textTravel[1] = createSpan(\"Pixeln entspricht, mit durchschnittlich\");\n textTravel[2] = createSpan(\"Km/h, ergibt sich: \");\n textTravel[3] = createSpan(\"Gesamt Streckenl&auml;nge = \");\n textTravel[4] = createSpan(\"\");\n textTravel[5] = createSpan(\"Gesamt Fahrzeit = \");\n textTravel[6] = createSpan(\"\");\n\n textTravel[0].parent(output);\n textTravel[1].parent(output);\n textTravel[2].parent(output);\n textTravel[3].parent(output);\n textTravel[4].parent(textTravel[3]);\n textTravel[5].parent(output);\n textTravel[6].parent(textTravel[5]);\n\n output.position(width + 40, 400)\n textP.position(width + 20, 0)\n textX.position(width + 90, 40)\n textY.position(width + 150, 40)\n err.position(width + 40, 370);\n timeWarning.position(width + 160, 0);\n // textTravel[0].position(width + 40, 380);\n textTravel[3].position(0, 110);\n textTravel[4].position(160, 0);\n textTravel[5].position(0, 140);\n textTravel[6].position(120, 0);\n\n\n err.style(\"color\", \"#ff0000\");\n timeWarning.style(\"color\", \"#ff0000\");\n err.hide();\n timeWarning.hide();\n textTravel[0].hide();\n textTravel[1].hide();\n textTravel[2].hide();\n textTravel[3].hide();\n textTravel[4].hide();\n textTravel[5].hide();\n textTravel[6].hide();\n}", "title": "" }, { "docid": "cee7ed91bb0c2235657757d5168356d5", "score": "0.5468442", "text": "function resizeOutputCampus() {\n var campusLength = outputCampus.textContent.length;\n if (campusLength < 6) {\n outputCampus.style.fontSize = '90px';\n } else if (campusLength < 9) {\n outputCampus.style.fontSize = '70px';\n } else {\n outputCampus.style.fontSize = '55px';\n }\n}", "title": "" }, { "docid": "8c68580842f4757707f730bbef2c5df6", "score": "0.5460647", "text": "function AjoutDiv(){\n\n\t/* Mettre test de taille */\n\tif(getClientWidth() > 765 && ($('.paraDroite').length < 1) ){\n\t\t$('article.deco').append('<div class=\"paraGauche\"></div>');\n\t\t$('article.deco').append('<div class=\"paraDroite\"></div>');\n\t}else {\n\t\t$('.paraDroite, .paraGauche').remove();\n\t}\n}", "title": "" }, { "docid": "6cd93b824cc32d9e007fd814894fa882", "score": "0.5441492", "text": "function setupContent() {\r\n\ttry {\r\n\t\tvar o = getTirelireData();\r\n\t} catch (e) {\r\n\t\thandleNoData(1);\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (o.nodata == \"yes\") handleNoData(2); //nodata\r\n\telse {\r\n\t\t// set up background color\r\n\t\tif (o.couleur_fond) {\r\n\t\t\tvar aColor = o.couleur_fond.split(\"|\");\r\n\t\t\tbgcolor.style.backgroundColor = '#' + aColor[myRandom(1, aColor.length) - 1];\r\n\t\t}\r\n\r\n\t\t// load bg image\r\n\t\ttry {\r\n\t\t\tloadBackground(o.visuel_mode, o.visuel_details, o.visuel_ext);\r\n\t\t} catch (err) {\r\n\t\t\tonBgImgError(null);\r\n\t\t}\r\n\r\n\t\t// set texts\r\n\t\tsetValue('#intro .titre', o.titre);\r\n\t\tsetValue('#outro .textCta', window.adFormat == '728x90' ? o.txt_cta.replace('<br>', ' ') : o.txt_cta); // exception for 728x90. Removes <br>\r\n\r\n\t\t// set details description style\r\n\t\tif(o.boxe_quinte == \"large\") sel('.description').className += ' large';\r\n\r\n\t\t// set date\r\n\t\tvar dateToDisplay = '';\r\n\t\tif (o.descr != \"date\") {\r\n\t\t\tdateToDisplay = o.descr;\r\n\t\t} else {\r\n\t\t\tvar aDays = [\"dimanche\", \"lundi\", \"mardi\", \"mercredi\", \"jeudi\", \"vendredi\", \"samedi\"];\r\n\t\t\tvar aDaysInMonth = [\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"30\", \"30\", \"31\", \"30\", \"31\"];\r\n\t\t\tvar aMonths = [\"janvier\", \"février\", \"mars\", \"avril\", \"mai\", \"juin\", \"juillet\", \"août\", \"septembre\", \"octobre\", \"novembre\", \"décembre\"];\r\n\t\t\tvar aTemp = o.date_prochaine_tirelire.split(\"/\");\r\n\t\t\tvar myDate = new Date();\r\n\t\t\tvar myDate2 = new Date(aTemp[2], aTemp[1] - 1, aTemp[0]); //date de la prochaine tirelire\r\n\t\t\tvar date1Timestamp = myDate.getTime();\r\n\t\t\tvar date2Timestamp = myDate2.getTime();\r\n\r\n\t\t\t// Si la date du jour est identique à la date de la prochaine tirelire\r\n\t\t\tif (myDate.getDate() == _setZero(aTemp[0])) {\r\n\t\t\t\tdateToDisplay = \"Aujourd'hui, \";\r\n\t\t\t} else {\r\n\t\t\t\tif (date1Timestamp > date2Timestamp) {\r\n\t\t\t\t\thandleNoData(3);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdateToDisplay = \"Demain, \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdateToDisplay += aDays[myDate2.getDay()];\r\n\t\t}\r\n\t\tsetValue('#details .date', dateToDisplay);\r\n\r\n\t\t// set montant tirelire\r\n\t\tif (o.montant_prochaine_tirelire) {\r\n\t\t\tsetValue('#details .montant .inner', o.montant_prochaine_tirelire.split(\".\").join(\" \") + \"€\");\r\n\r\n\t\t}\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "219b7119da553970b1f8414fb045a4e5", "score": "0.54248524", "text": "function createContentText( i, left, top, width, height, content, key, border ){\n\tid = \"textPane\"+i;\n\tvar textDiv = document.createElement(\"div\");\n\ttextDiv.style.width = '100%';\n\ttextDiv.style.height = '100%';\n\tdojo.attr(textDiv, \"id\", id+'Text');\n\ttextDiv.innerHTML = content;\n\t\n\t// now the hiden key \n\tvar input = document.createElement(\"input\");\n\tinput.setAttribute(\"type\", \"hidden\");\n\tinput.setAttribute(\"name\", id+\"Key\");\n\tinput.setAttribute(\"id\", id+\"Key\");\n\tinput.setAttribute(\"value\", key);\n\ttextDiv.appendChild(input);\n\t\n\tcreateContentItem( \"textPane\"+i, left, top, width, height, textDiv, \"textPane\", key, border );\n}", "title": "" }, { "docid": "e683ea3b1acd8fce9e89699d5fb5cb5e", "score": "0.5423631", "text": "function buildQuestion(){\n\ttoggleQuestionLoader(false);\n\tif(!$.editor.enable){\n\t\ttoggleGameTimer(true);\n\t}\n\t\n\tvar curQuestionText = questionTextDisplay.replace('[NUMBER]', (questionCountNum+1));\n\tif(totalQuestions != 0){\n\t\tvar totalMax = totalQuestions > sequence_arr.length ? sequence_arr.length : totalQuestions;\n\t\tcurQuestionText = curQuestionText.replace('[TOTAL]', totalMax);\n\t}else{\t\n\t\tcurQuestionText = curQuestionText.replace('[TOTAL]', sequence_arr.length);\n\t}\n\tquestionTxt.text = curQuestionText;\n\tvar questionType = question_arr[sequenceCountNum].type;\n\t\n\tif(questionType == 'image'){\n\t\t$.question['q'+questionCountNum] = new createjs.Bitmap(imageLoader.getResult('questionImage'));\n\t\t$.question['q'+questionCountNum].regX = $.question['q'+questionCountNum].image.naturalWidth/2;\n\t\t$.question['q'+questionCountNum].regY = 0;\n\t\t$.question['q'+questionCountNum].x = canvasW/2;\n\t\t$.question['q'+questionCountNum].y = questionStartY+questionImageOffsetY;\n\t\t\n\t\tquestionContainer.addChild($.question['q'+questionCountNum]);\n\t}else{\n\t\tvar fontSize = question_arr[sequenceCountNum].fontSize;\n\t\tfontSize = fontSize == undefined ? questionTextSize : fontSize;\n\t\t$.question['q'+questionCountNum] = new createjs.Text();\n\t\t$.question['q'+questionCountNum].font = fontSize+\"px bariol_regularregular\";\n\t\t$.question['q'+questionCountNum].lineHeight = Number(fontSize)+Number(textLineHeight);\n\t\t$.question['q'+questionCountNum].color = questionTextColour;\n\t\t$.question['q'+questionCountNum].textAlign = questionTextAlign;\n\t\t$.question['q'+questionCountNum].textBaseline='alphabetic';\n\t\t\n\t\t$.question['q'+questionCountNum].x = canvasW/2;\n\t\t$.question['q'+questionCountNum].y = questionStartY;\n\t\t\n\t\t$.question['q'+questionCountNum].text = question_arr[sequenceCountNum].question;\n\t\tquestionContainer.addChild($.question['q'+questionCountNum]);\n\t}\n\t\n\tbuildAnswers();\n\t\n\tif(audio_arr.length == 0){\n\t\tinitanimateAnswerss();\n\t}else if(audio_arr.length == 1 && audio_arr[0].type == 'question'){\n\t\tinitanimateAnswerss();\t\n\t}\n\t\n\tquestionContainer.alpha = 0;\n\tTweenMax.to(questionContainer, .5, {alpha:1, overwrite:true, onComplete:function(){\n\t\tif(audio_arr.length > 0)\n\t\t\tplayAudioLoop();\n\t}});\n}", "title": "" }, { "docid": "8e8bf637aae9ae3676675e3cd32b3f8b", "score": "0.54185903", "text": "buildOnDiv(element) {\n let textarea = document.createElement('textarea');\n let div = element;\n let iframe = document.createElement('iframe');\n let content = element.innerHTML;\n div.style.width = element.clientWidth;\n div.style.height = element.clientHeight;\n element.innerHTML = '';\n\n this.assemble(textarea, div, iframe, content);\n }", "title": "" }, { "docid": "1f26f29c88c6190f9eb25f33729f17c9", "score": "0.5402151", "text": "function createTextNote(newDivNote, text) {\n let divText = document.createElement(\"div\");\n divText.style.height = \"55%\";\n divText.style.width = \"80%\";\n divText.style.overflow = \"auto\";\n divText.style.marginLeft = \"5%\";\n divText.style.marginBottom = \"13%\";\n divText.innerHTML = text;\n newDivNote.append(divText);\n}", "title": "" }, { "docid": "740af61d05faeea15ea4136772b9f651", "score": "0.53910375", "text": "function creeZoneTexte(e, data, objet){\r\n var div = $('<div>');\r\n div\r\n .css({\r\n \"overflow-y\": \"scroll\",\r\n \"color\" : \"Black\",\r\n \"background-color\" : \"white\",\r\n \"width\" : \"1050px\",\r\n \"height\" : \"500px\"\r\n })\r\n .html(objet.iso +\"<br />\"+objet.desc+'<br />')\r\n .appendTo(\"#rep\");\r\n var flag = $('<img>');\r\n flag.attr(\"src\",objet.img)\r\n .prependTo(div);\r\n var img = $('<img>');\r\n img .attr(\"src\",objet.photo)\r\n .appendTo(div);\r\n }", "title": "" }, { "docid": "6940b820875fb0497e7fc4d7cbff1251", "score": "0.5383836", "text": "function setRichTextContent() {\n\tif(preferredEditor==\"Word\" && fromCreateForm){ //EditInWord\n window.objectCreationType = \"ooxml\"; //\"html!docx\";\n window.objectCreationObjectId = \"\";\n window.objectCreationContentData = CKControlsDict['CKEDITOR_ooxml_'];\n window.objectCreationContentText = \"\";\n window.serverURLWithRoot = serverURLWithRoot;\n window.objectCreationCsrfParams = csrfParams;\n return;\n// clear rich text if creation is a success\n// if(preferredEditor==\"Word\"){\n// \tCKControlsDict['CKEDITOR_ooxml_'] = '';\n// \tjQuery('#NewRichTextEditor').html('');\n// }\n\t}\n\tif(preferredEditor==\"Word\"){\n\t\tformatToSave = \"ooxml\"; //\"html!docx\";\n\t}\n\n var formName = 'editDataForm';\n if (fromCreateForm)\n formName = 'emxCreateForm';\n\n var objectId = '';\n var savedFormat = '';\n var richText = '';\n var contentText = '';\n\n if (formatToSave == HTML_FORMAT) {\n richText = CKEDITOR.instances['CKEDITOR_' + editorDivIDCK].getData();\n\n //Test Case Description in mandatory field.\n if(richText == \"\" && isTextCaseDescriptionXHTML())\n {\n \talert(\"Must enter valid value of Description.\");\n \treturn false;\n }\n //JX5 content text is not correctly formatted\n var temp = document.createElement(\"div\");\n temp.innerHTML = richText;\n \t//++VMA10 added for IR-689358-3DEXPERIENCER2019\n textData = temp.innerHTML;\n textData = temp.textContent || temp.innerText;\n for (var i = 0; i < temp.childNodes.length; i++) {\n \tvar tag = temp.childNodes[i];\n \tif(tag.tagName==\"TABLE\")\n\t\t\t{\n\t\t\t\tif(tag.align==\"center\")\n\t\t\t\t{\n\t\t\t\t\ttag.style.margin = \"auto\";\n\t\t\t\t}\n\t\t\t}\n }\n /*temp.childNodes.\n forEach(\n\t \t\tfunction(tag)\n\t \t\t{\n\t \t\t\tif(tag.tagName==\"TABLE\")\n\t \t\t\t{\n\t \t\t\t\tif(tag.align==\"center\")\n\t \t\t\t\t{\n\t \t\t\t\t\ttag.style.margin = \"auto\";\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n \t\t)*/\n richText = temp.innerHTML\n \n\t//--VMA10\n \n // Always encode in base64 in order to bypass the default input filtering\n // We have our own input filtering on the server side\n var UTF8Input = strToUTF8Arr(richText);\n richText = base64EncArr(UTF8Input);\n\n savedFormat = HTML_FORMAT;\n }\n\n if(preferredEditor!=\"Word\") { //EditInWord\n var UTF8InputContentText = strToUTF8Arr(textData);\n contentText = base64EncArr(UTF8InputContentText);\n }\n\n // > 4 MO\n if (checkMaxSize(richText, false) == false)\n return false;\n \n if (!fromCreateForm) {\n // Get the object ID, clean the input field, and clear the editor\n //objectId = jQuery('#NewRichTextEditorPLC').attr('onload').split('\"')[3];\n\n \tobjectId = objId;\n \tif(preferredEditor==\"Word\"){//EditInWord\n \t\trichText = CKControlsDict['CKEDITOR_ooxml_'];\n \t}\n else if (typeof CKEDITOR != 'undefined') {\n CKEDITOR.instances['CKEDITOR_' + editorDivIDCK].setData('');\n jQuery(document.forms[formName]).find(idDivEditorTextArea).val('');\n }\n\n var data = new FormData();\n data.append('type', formatToSave);\n data.append('objectId', objectId);\n data.append('contentText', contentText);\n data.append('contentData', richText);\n\n jQuery.ajax({\n type: 'POST',\n cache: false,\n contentType: false,\n processData: false,\n url: richEditRestPath + \"setRichContent\" + \"?\" + csrfParams,\n data: data,\n complete: function(data) {\n \t// In case we have a RCO inside\n\t \tsyncRCOContent();\n\t \tif(preferredEditor==\"Word\"){//EditInWord\n\t \t\trequire(['DS/RichEditor/RichEditor'], function(RichEditor){\n\t \t\t\tvar richEditor = new RichEditor();\n\t \t\t\trichEditor.cleanup(objectId);\n\t \t\t});\n\t \t}\n },\n error: function(xhr, status, error){\n \tvar message = typeof xhr.responseText == 'string' ? JSON.parse(xhr.responseText).status : xhr.responseText; \n \talert(error + \":\" + message);\n },\n dataType: 'text',\n async: false\n });\n } else {\n window.objectCreationType = formatToSave;\n window.objectCreationObjectId = objectId;\n window.objectCreationContentData = richText;\n window.objectCreationContentText = contentText;\n window.objectCreationCsrfParams = csrfParams;\n\n // CKEDITOR.instances['CKEDITOR_'].setData('');\n jQuery(document.forms[formName]).find(idDivEditorTextArea).val('');\n }\n}", "title": "" }, { "docid": "34c326ee1246c5c067ad4401f6bc1758", "score": "0.53820074", "text": "function FittedText(element){\n\n element = $(element);\n\n /**\n * When true, the input event for the element provided will trigger the fit function with the text that was edited.\n * @type {boolean}\n */\n this.autoFit = true;\n /**\n * The smallest font size that will be scaled to before overflow will default to the CSS property.\n * @type {number}\n */\n this.minSize = 8;\n /**\n * The largest font size that will be scaled to within the container.\n * @type {number}\n */\n this.maxSize = 32;\n\n /**\n * Scales the text of the element provided in the constructor to fit inside of the element.\n * @param content - Optional parameter that will scale the text size so the provided content can fit instead of the\n * text that is inside of the element.\n */\n this.fit = function(content){\n if(!content) content = element.html();\n\n // Visibility hidden must be used over display none so that the size is computed\n let size = $(\"<span style='display: inline-block; visibility: hidden;'></span>\");\n // Element must be in the DOM for size to be computed\n $(\"body\").append(size);\n let font = parseInt(element.css(\"font-size\"));\n // Mirror the content in a div that will expand to fit the text to see how much space the text actually\n // takes up given the font and font size.\n size.html(content);\n\n // Shrink the font if needed\n size.css(\"font-size\", font + \"px\");\n while(size.width() > element.width() || size.height() > element.height()){\n if(font <= this.minSize) break;\n font--;\n element.css(\"font-size\", font + \"px\");\n size.css(\"font-size\", font + \"px\");\n }\n\n // Grow the font if needed\n size.css(\"font-size\", (font + 1) + \"px\");\n while(size.width() < element.width() && size.height() < element.height()){\n if(font >= this.maxSize) break;\n font++;\n element.css(\"font-size\", font + \"px\");\n size.css(\"font-size\", (font + 1) + \"px\");\n }\n\n // Clean up any leftovers\n size.remove();\n };\n\n /* Constructor */\n\n element.on(\"input\", function(){\n if(this.autoFit) this.fit();\n }.bind(this));\n\n}", "title": "" }, { "docid": "04d07e1cc1a7c69f98a43aa36dfe91c1", "score": "0.53757346", "text": "function displayArrayAsParagraph(content_id, data_array) {\n var data_text = '';\n\n if (data_array) {\n if (data_array.length == 1) {\n data_text = data_array[0];\n }\n // else if (data_array.length > 1) {\n // var paragraph = $('<p/>');\n // paragraph.css('padding-left', '0px');\n // $.each(data_array, function(index, value) {\n // paragraph.append(value+\"<br style='content: \\\" \\\"; display: block; margin: 5px;'/>\");\n // });\n // data_text = paragraph;\n // }\n else if (data_array.length > 1) {\n var paragraph = $('<p/>');\n paragraph.css('padding-left', '0px');\n\n var content_text = $('<span></span>');\n content_text.css('padding-right', '8px');\n content_text.html(data_array[0]);\n\n var content_div = $('<div></div>');\n content_div.attr('id', content_id);\n content_div.addClass('collapse');\n\n $.each(data_array.slice(1), function(index, value) {\n paragraph.append(value+\"<br style='content: \\\" \\\"; display: block; margin: 5px;'/>\");\n });\n // data_text = paragraph;\n content_div.append(paragraph);\n\n var container = $('<div></div>');\n container.append(content_text);\n container.append(showHideDiv(content_id));\n container.append(content_div);\n\n return container;\n\n }\n }\n return data_text;\n}", "title": "" }, { "docid": "6902e8f6cfca1aae0e9923bbd8b98d5a", "score": "0.536005", "text": "renderDescriptions() {\n let canvas = this.glassCanvas;\n let ctx = canvas.getContext('2d');\n ctx.fillStyle = 'black';\n ctx.font = \"bold 18px Old Standard TT\";\n\n ctx.fillText(\"I\", Config.TextPaddingX, this._getLineBaseY(0) + Config.TextMarginTop);\n ctx.fillText(\"II\", Config.TextPaddingX, this._getLineBaseY(1) + Config.TextMarginTop);\n ctx.fillText(\"III\", Config.TextPaddingX, this._getLineBaseY(2) + Config.TextMarginTop);\n\n ctx.fillText(\"aVR\", Config.TextPaddingX, this._getLineBaseY(3) + Config.TextMarginTop);\n ctx.fillText(\"aVL\", Config.TextPaddingX, this._getLineBaseY(4) + Config.TextMarginTop);\n ctx.fillText(\"aVF\", Config.TextPaddingX, this._getLineBaseY(5) + Config.TextMarginTop);\n\n ctx.fillText(\"V1\", canvas.width*0.5 + Config.TextPaddingX, this._getLineBaseY(0) + Config.TextMarginTop);\n ctx.fillText(\"V2\", canvas.width*0.5 + Config.TextPaddingX, this._getLineBaseY(1) + Config.TextMarginTop);\n ctx.fillText(\"V3\", canvas.width*0.5 + Config.TextPaddingX, this._getLineBaseY(2) + Config.TextMarginTop);\n ctx.fillText(\"V4\", canvas.width*0.5 + Config.TextPaddingX, this._getLineBaseY(3) + Config.TextMarginTop);\n ctx.fillText(\"V5\", canvas.width*0.5 + Config.TextPaddingX, this._getLineBaseY(4) + Config.TextMarginTop);\n ctx.fillText(\"V6\", canvas.width*0.5 + Config.TextPaddingX, this._getLineBaseY(5) + Config.TextMarginTop);\n }", "title": "" }, { "docid": "b0a56092cd0e5d29fef99cd7221ca8b0", "score": "0.5343212", "text": "function finished(){\n\t\t\n\t\tvar newdiv, newdivz, newdiv_, width, words, wordz, words2, oText, oText2, names = \"div\" + options.milestone, namez = \"divz\" + options.milestone;\n\t\tif(!document.getElementById(names)){\n\t\t\tnewdiv = document.createElement('div');\n\t\t\tnewdivz = document.createElement('div');\n\t\t\tnewdivz.id = \"divz\" + options.milestone;\n\t\t\tnewdiv.id = \"div\" + options.milestone;\n\t\t}\n\t\telse{\n\t\t\tnewdiv.id = names;\n\t\t\tnewdivz.id = namez;\n\t\t}\n\t\t\n\t\tif(open[options.milestone] == 0 || closed[options.milestone] == 0){\n\t\t\topen[options.milestone] == 0 ? width = \"100%\" : width = \"0%\";\n\t\t}\n\t\telse{\n\t\t\twidth = (open[options.milestone]/(closed[options.milestone]+open[options.milestone]));\n\t\t\twidth = 100 - (width*100) + \"%\";\n\t\t}\n\t\t\n\t\twordz = document.createElement(\"p\");\n\t\twordz.innerHTML = \"<p>\"+ title[options.milestone] + \"</p><p>\"+Math.round(closed[options.milestone]/(open[options.milestone]+closed[options.milestone])*100) + \"% complete</p>\";\n\t\t\n\t\twords = document.createElement(\"p\");\n\t\twords2 = document.createElement(\"p\");\n \t\twords.innerHTML = \"<span class='t-negative'>\" + open[options.milestone] + \"</span> open tickets\";\n\t\twords2.innerHTML = \"<span class='t-positive'>\" + closed[options.milestone] + \"</span> closed tickets\";\n\t\tdocument.getElementById(id).appendChild(wordz);\n\t\tdocument.getElementById(id).appendChild(words);\n\t\tdocument.getElementById(id).appendChild(words2);\n\n\n\t\tnewdivz.width = \"200px\";\n\t\tnewdivz.height = \"50px\";\n\t\tnewdivz.align=\"centre\";\n\t\tnewdivz.style.backgroundColor = \"grey\";\n\t\tnewdivz.style.border = \"2px solid black\";\n\t\tnewdivz.style.width = \"200px\";\n\t\tnewdivz.style.height = \"25px\";\n\n\t\tnewdiv.style.backgroundColor = \"#77AB13\";\n\t\tnewdiv.style.width = width;\n\t\tnewdiv.style.height = newdivz.style.height;\n\t\tnewdiv.innerHTML = \"&nbsp;\";\n\t\tdocument.getElementById(id).appendChild(newdivz);\n\t\tnewdivz.appendChild(newdiv);\n\n\t\tnewdiv_ = document.createElement(\"div\");\n\t\tnewdiv_.id = \"times\" + options.milestone;\n\n\t\tif(options.time){\n\t\t\tdashBoard.milestone( newdiv_.id, {\n \t\twhen: dueOn[options.milestone],\n \t\tgradient: \"Days\"\n \t});\n\t\t}\n\n\t\tdocument.getElementById(id).appendChild(newdiv_);\n\t\t\t\t\n\t\tsetTimeout( refresh, 30000 );\n}", "title": "" }, { "docid": "a49004e1d99d83b0f72779506c080bc2", "score": "0.5324903", "text": "function displayContent() {\n // Remove the previous segment, if it exists.\n var activeSegment = document.getElementsByClassName('active-segment-text');\n if (activeSegment) {\n editorPairs[activeEditorId].areaBelow.innerHTML = '';\n }\n\n setCounterCompletedSegments();\n createNewParagraph('tmgmt-active-segment-div', 'Selected segment', editorPairs[activeEditorId].activeSegmentStrippedText, editorPairs[activeEditorId].areaBelow, 'active-segment');\n createNewParagraph('tmgmt-active-word-div', 'Selected word', editorPairs[activeEditorId].activeWord, editorPairs[activeEditorId].areaBelow, 'active-word');\n if (editorPairs[activeEditorId].activeTag) {\n createNewParagraph('tmgmt-active-tag-div', 'Selected tag', editorPairs[activeEditorId].activeTag, editorPairs[activeEditorId].areaBelow, 'active-tag');\n }\n\n wrappers[editorPairs[activeEditorId].id].appendChild(editorPairs[activeEditorId].areaBelow);\n }", "title": "" }, { "docid": "eae5ce717ee7d8562dbc34f1cc0ca6e6", "score": "0.5319714", "text": "function verificaDisplay () {\n if (displayEl.textContent.length >= 16 && displayEl.textContent.length < 20)\n displayEl.style.fontSize = '2em';\n\n if (displayEl.textContent.length >= 20 && displayEl.textContent.length < 27)\n displayEl.style.fontSize = '1.5em';\n\n if (displayEl.textContent.length >= 27 && displayEl.textContent.length < 41)\n displayEl.style.fontSize = '1em';\n\n if (displayEl.textContent.length >= 41)\n alert('Too much numbers, men!!');\n}", "title": "" }, { "docid": "fd5031860a7f18afc78866b040fb3151", "score": "0.5313478", "text": "function longContent (content_id, str, label) {\n\n var content_text = $('<span></span>');\n content_text.css('padding-right', '8px');\n content_text.html(label);\n\n var content_div = $('<div></div>');\n content_div.attr('id', content_id);\n content_div.addClass('collapse');\n\n var content_list = $('<p></p>');\n content_list.css('padding-left', '25px');\n content_list.css('padding-top', '6px');\n content_list.html(str);\n\n content_div.append(content_list);\n\n var container = $('<div></div>');\n container.append(content_text);\n container.append(showHideDiv(content_id));\n container.append(content_div);\n\n return container;\n}", "title": "" }, { "docid": "a6bce64ed22d01366ce027a1090d5dea", "score": "0.5301658", "text": "function AdjustCourseTitle(title) {\n\n var objCoursetitle = document.getElementById(\"coursetitle\");\n var fixedDivSize;\n var currentDivSize;\n var currentFontSize;\n var intFontSize;\n\n objCoursetitle.innerHTML = title;\n objCoursetitle.style.height = \"auto\";\n objCoursetitle.style.top = (document.getElementById('header').offsetHeight / 2) - (objCoursetitle.offsetHeight / 2);\n fixedDivSize = 42;\n currentDivSize = objCoursetitle.clientHeight;\n currentFontSize = parseFloat(window.getComputedStyle(objCoursetitle, null).getPropertyValue('font-size')) + \"px\";\n intFontSize = currentFontSize.substring(0, 2);\n\n while (currentDivSize > fixedDivSize) {\n objCoursetitle.style.fontSize = eval(\"(intFontSize--)+'px'\");\n currentDivSize = objCoursetitle.clientHeight;\n }\n\n parent.parent.document.getElementById('loadMyPage').style.display = \"none\";\n objCoursetitle.style.visibility = 'visible';\n\n}", "title": "" }, { "docid": "2a917840e1369a00d3e035dc80f7d1dd", "score": "0.52998525", "text": "showHeroText(textToDisplay, lifespan) {\n this.heroTextGroup = this.add.group();\n this.textInfo = this.add.text(\n this.hero.x + 8,\n this.hero.y - 10,\n textToDisplay,\n this.textStyle\n ); \n this.textInfo.anchor.setTo(0.5); // set anchor to middle / center\n this.textInfo.lifespan = lifespan;\n this.heroTextGroup.add(this.textInfo); \n }", "title": "" }, { "docid": "56118e0a88e38e2104e88db513a9ee49", "score": "0.5294315", "text": "function displayDescript(){\n\t\tdescription.style.display=\"block\";\n\t\tdescription.style.backgroundColor=\"black\";\n\t\tdescription.style.position=\"absolute\";\n\t\tdescription.style.left=\"5%\";\n\t\tdescription.style.top=\"35%\";\n\t\tdescription.style.width=\"50%\";\n\t\tdescription.style.color=\"white\";\n\t\tdescription.style.zIndex=\"100\";\n\t\tdescription.style.padding=\"10px\";\n\t\tdescription.style.fontFamily=\"miriam libre\";\n\t}", "title": "" }, { "docid": "e5f587cb4a145aa023ccec71320ca0b3", "score": "0.5285881", "text": "function ex6Display(id,content,num) {var delay = 50; if (num <= content.length) {var lt = content.substr(0,num); document.getElementById(id).innerHTML = lt.replace(RegExp(brk,'g'),'<br \\/>'); num++; if (num > content.length) delay = resetTime * 1000;} else {document.getElementById(id).innerHTML = ''; num = 0;} if (delay > 0) setTimeout('ex6Display(\"'+id+'\",\"'+content+'\",\"'+num+'\")',delay);}", "title": "" }, { "docid": "70a09b9fa0bedbd2b4b6f1a31f2ca3cd", "score": "0.52812433", "text": "function renderContent(content){\n showBlock.innerHTML = \"\";\n let dom = \"\";\n if(content.length > 0){\n content.forEach(data=>{\n let typeColor = data.type === 'cost' ? 'text-danger' : 'text-primary';\n let categoryName = data.categoryName === \"\" ? \"na\" : data.categoryName;\n let shop = data.shop === \"\" ? \"na\" : data.shop; \n dom += `\n <div class=\"card mt-2 all-data container\" data-type=\"${data.type}\" data-toggle=\"modal\" data-target=\"#editItem_${data.id}\">\n <div class=\"card-body row\">\n <span data-id=\"${data.id}\" style=\"display: none;\"></span>\n <span class=\"col-md-2 text-center\" data-shop=\"${shop}\">${shop}</span>\n <span class=\"col-md-2 text-center\" data-title=\"${data.title}\">${data.title}</span>\n <span class=\"col-md-2 text-center\" data-date=\"${data.date}\">${data.date}</span>\n <span class=\"col-md-2 text-center\" data-category=\"${categoryName}\">${categoryName}</span>\n <span class=\"col-md-2 text-center\" data-cost=\"${data.cost}\">${data.cost}</span>\n <span class=\"col-md-2 text-center ${typeColor}\" data-type=\"${data.type}\">${data.typeName}</span> \n </div>\n </div>`;\n })\n }else{\n dom += `<h3 class=\"text-center mt-5\">~沒有資料喔~</h3>`;\n }\n return dom;\n }", "title": "" }, { "docid": "a88419b2fa081c49487ecc866d3467db", "score": "0.5273095", "text": "function displayQue(){\n var newDiv;\n $(\"#optionGrp\").show();\n $(\"#resultSummaryDiv\").hide();\n $(\"#resultDiv\").hide();\n \n if (currentQue<loadedQue.length)\n {\n \n $(\"#questionText\").text(loadedQue[currentQue].qText);\n console.log(questionText);\n \n\n for(var j=0; j<loadedQue[currentQue].options.length;j++)\n {\n var objName=\n optionDivObj=$(\"#option\"+j);\n optionDivObj.empty();\n optionDivObj.append(loadedQue[currentQue].options[j]);\n }\n\n rightAnswer=loadedQue[currentQue].correctAns;\n startTimer();\n } else{\n $(\"#questionDiv\").hide();\n $(\"#resultSummaryDiv\").show();\n resultSummary();\n }\n}", "title": "" }, { "docid": "54d86351f36abbf63c797b4cf56992c4", "score": "0.5272878", "text": "static format (content, cfg) {\n let defs = {\n x:0,\n y:0,\n height:100,\n width:300,\n attr:{},\n lineSpacing:0,\n textAnchor:'tm',\n pad:0,\n yOffset:0,\n justify:'left',\n ellipseize:true,\n rotate:0,\n format:d=>d\n };\n cfg = {...defs, ...cfg};\n content = String(cfg.format(content));\n\n let attr = {};\n Object.keys(cfg.attr).filter(d => d.startsWith('font-')).map(d => attr[this.snakeToCamel(d)] = cfg.attr[d]);\n\n let rv = layoutText(content, {maxWidth:cfg.width, maxLines: 9999}, attr, {'lineSpacing':cfg.lineSpacing});\n let rvLen = rv[0].lines.length;\n\n let singleHeight = rv[0].lines[0].measure.height;\n let lines = rv[0].lines.slice(0, parseInt(cfg.height / singleHeight));\n let maxWidth = lines.map(d => d.measure.width).reduce((a, b)=>Math.max(a, b));\n if (maxWidth > cfg.width) maxWidth = cfg.width;\n\n if (cfg.ellipseize && rvLen > lines.length) { // ellipseize\n let last = lines.length-1;\n this.ellipseize(lines[last], maxWidth, attr);\n }\n\n this.reposition(lines, maxWidth, singleHeight, cfg);\n\n var e = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n // e.setAttribute('transform', `rotate(${cfg.rotate} ${cfg.x},${cfg.y})`)\n\n let strAttr = (' '+JSON.stringify(cfg.attr)).replace(/[{}]/g, '').replaceAll(':', '=').replaceAll(',',' ')\n .replaceAll('\"=', '=').replaceAll(' \"',' ');\n\n lines.forEach((item, i) => {\n e.innerHTML += `<text x=${item.position.x} y=${item.position.y} ${strAttr} text-anchor=\"start\" transform=\"rotate(${cfg.rotate} ${cfg.x},${cfg.y})\">${item.text.replace('&nbsp;', ' ')}</text>`;\n });\n e.innerHTML = e.innerHTML.replaceAll('&nbsp;', ' ');\n\n return ({maxWidth, lines, e, bbox:{w:rv[0].width, h:singleHeight*lines.length}});\n }", "title": "" }, { "docid": "a1032a366b6e445be011ac06639b9ccc", "score": "0.52541393", "text": "function contentPreview() {\n for (let i = 0; i < content.length; i++) {\n if (content[i].innerHTML.length > 400) {\n content[i].innerHTML = content[i].innerHTML.substring(0, 400) + \"...\";\n }\n }\n }", "title": "" }, { "docid": "cc33fda1507e14a17c2929e31c5bbe09", "score": "0.52451766", "text": "function tempFormat(design){\n $display.prepend(\n '<div class=\"col s12 m6 l4 xl4\">' +\n '<div class=\"card large hoverable tooltipped\" data-tooltip=\"' + design.designName + ' ' + design.category + ' ' + design.Gender + '\">' +\n '<div class=\"card-image waves-effect waves-block waves-light\"><img class=\" activator\" src=\"' + design.image + '\">'+\n '</div>' +\n '<div class=\"card-content\">' +\n '<span class=\"center teal-text text-darken-4 card-title activator\">' + design.designName + '</span>' +\n '<p class=\"\">' + design.Description + '</p>' +\n '</div>' +\n \n '<div class=\"card-action\">' +\n '<a href=\"#modal' + design.id + '\" id=\"more\" data-id = \"' + design.id + '\" class=\"btn waves-effect waves-light teal modal-trigger\">More Details</a>' +\n //MODAL\n '<div class=\"modal\" id=\"modal' + design.id + '\">' +\n '<div class=\"col l3 m12 s12\">'+\n '<img class=\"responsive-img materialboxed\" src=\"' + design.image + '\">' +\n '<img class=\"responsive-img materialboxed\" src=\"' + design.image + '\">' +\n '<img class=\"responsive-img materialboxed\" src=\"' + design.image + '\">' +\n '</div>'+\n '<div class=\"modal-content col l9\">' +\n '<h1 class=\"teal-text\">' + design.designName + '</h1>' +\n '<blockquote>'+\n '<h6>Designed by: ' + design.Designer +'</h6>' +\n '<h6>Designed for: ' + design.Gender + '</h6>' +\n '<h6>Design Category: ' + design.category + '</h6>' +\n '</blockquote>' +\n '<h4>Design Description:</h4>' +\n '<p class=\"flow-text\">' + design.Description + \n '</br>' +\n '</br>' +\n design.Description +\n '</br>'+\n design.Description +\n '</br>' +\n design.Description +\n '</br>' +\n design.Description +\n '</br>' +\n design.Description +\n '</p>' +\n '</div>' +\n '<div class=\"modal-footer\">' +\n '<a href=\"#!\" class=\"btn waves-effect waves-light modal-close teal\">Close</a>' +\n '</div>' +\n '</div>' +\n '</div>' + //card action ends\n //CAR REVEAL\n '<div class=\"card-reveal\">' +\n '<span class=\"teal-text card-title\">' + design.designName + '<i class=\"material-icons right\">close</i></span>' +\n '<blockquote>' +\n design.category +\n '</br>' +\n design.Gender +\n '</br>' +\n 'By: ' + design.Designer +\n '</blockquote>' +\n '<p>' + design.Description + \"...\" + '</p>' +\n '<div class=\"card-action\">' +\n '<a class=\"card-title\" href=\"#!\">Close</a>' +\n '<a href=\"#modal' + design.id + '\" id=\"more\" class=\"teal-text modal-trigger\" data-id = \"' + design.id + '\">More Details</a>' +\n '</div>'+\n '</div>' +\n '</div>' +\n '</div>'\n );\n }", "title": "" }, { "docid": "4c115f4b8b47726114a92e961766cd18", "score": "0.52450544", "text": "function displaySubjectHelp() {\n closeSideBar();\n document.getElementById(\"content\").innerHTML =\n '<div style = \"text-align: center\"><h1>Subject Help</h1></div><p>In the \"Subject\" input field, you should write a few words describing what your email talks about.</p>' +\n \"<p>For example, if you are emailing a professor about a test, you should include the course code for the class in the subject line, since the professor \" +\n \"may not know all of their students by name.</p>\" +\n '<p>You can type the subject of your email in the \"Subject\" box :</p><img src = \"images/SubjectBox.png\"><br><br>';\n}", "title": "" }, { "docid": "68443597d00b61adb8853a216a88d9af", "score": "0.5243841", "text": "function showStrings(){\n //random string from our sheet\n text = STRINGS[Math.floor(Math.random() * STRINGS.length)];\n\n $('#picked').html(text);\n $('#wisdom').fadeIn();\n\n //resize the box to fill the screen\n $('.blockToFill').height(\"90%\").width(\"90%\");\n \n //resize the text to fill the box\n $('.blockToFill').textfill({minFontPixels:20, maxFontPixels:1500});\n\n}", "title": "" }, { "docid": "ecfd6ba990b886d92e6a2bb6b5326664", "score": "0.52433366", "text": "function innerHtml() {\n return ` <div class=\"task-container\">\n<div class=\"task-header\"></div>\n<div class=\"task-main-container\">\n <div class=\"task-id\"></div>\n <div class=\"text\" contentEditable ='false'></div>\n</div>\n</div>`\n}", "title": "" }, { "docid": "43be882b3e377cd1dee52e41a58849f9", "score": "0.52408224", "text": "function show_texts() {\n var res = [];\n\n // Fetch texts div and clear its contents.\n var textsobj = $('#texts');\n textsobj.html('');\n\n // Construct a div for each text\n for (i in texts) {\n res.push(\n '<div id=\"text' + i + '\" class=\"atext\"',\n ' style=\"top:' + calc_top_style(texts[i].y) + 'px;',\n 'left:' + calc_left_style(texts[i].x) + 'px\">',\n texts[i].txt,\n '</div>'\n );\n textsobj.append(res.join(''));\n res = [];\n }\n}", "title": "" }, { "docid": "7608c596b33600a04dea37124cd7f651", "score": "0.5224298", "text": "function creatediv(hobject)\n{\n const div = document.createElement(\"div\");\n const paragraph1 = document.createElement(\"p\");\n const paragraph2 = document.createElement(\"p\");\n const paragraph3 = document.createElement(\"p\");\n const paragraph4 = document.createElement(\"p\");\n const hr = document.createElement(\"hr\");\n paragraph1.innerHTML = `Name : ${hobject.name}`;\n paragraph2.innerHTML = `Health : ${hobject.health}`;\n paragraph3.innerHTML = `WeaponType : ${hobject.weapon.type}`;\n paragraph4.innerHTML = `Weapon Damage: ${hobject.weapon.damage}`;\n div.className = \"display\"\n section = document.getElementById(\"displayStats\") ;\n div.append(paragraph1);\n div.append(paragraph2);\n div.append(paragraph3);\n div.append(paragraph4);\n div.append(hr);\n section.append(div);\n}", "title": "" }, { "docid": "231d6f91df3c411a7cbee848480c5fc7", "score": "0.5223538", "text": "function fitText (outputSelector){\n\t//Get the DOM output element by its selector\n\tlet outputDiv = document.getElementById(outputSelector);\n\t//Get element's size\n\tlet width = outputDiv.clientWidth;\n\tlet height = outputDiv.clientHeight;\n\t//Get content's size\n\tlet contentWidth = outputDiv.scrollWidth;\n\tlet contentHeight = outputDiv.scrollHeight;\n\t//Get fontSize\n\tlet fontSize = parseInt(window.getComputedStyle(outputDiv, null).getPropertyValue('font-size'),10);\n\t//Scale down font one pixel at a time until it fits inside element\n\twhile ((contentWidth > width) || (contentHeight > height)) {\n\t\tfontSize--\n\t\toutputDiv.style.fontSize = fontSize+'px'\n\t\twidth = outputDiv.clientWidth\n\t\theight = outputDiv.clientHeight\n\t\tcontentWidth = outputDiv.scrollWidth\n\t\tcontentHeight = outputDiv.scrollHeight\n\t}\n}", "title": "" }, { "docid": "f5e848deba7c47d875c7b23452d85aed", "score": "0.52100194", "text": "buildOnTextarea(element) {\n let textarea = element;\n let div = document.createElement('div');\n let iframe = document.createElement('iframe');\n let content = element.value;\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n textarea.style = '';\n\n textarea.parentNode.insertBefore(div, textarea);\n textarea.parentNode.removeChild(textarea);\n\n this.assemble(textarea, div, iframe, content);\n div.style.height = height + 'px';\n div.style.width = width + 'px';\n if (element.hasAttribute('data-chalk-class')) {\n div.classList.add(element.getAttribute('data-chalk-class'));\n } else {\n div.classList.add('chalk-text-hide');\n }\n }", "title": "" }, { "docid": "7fbe8caed67e354cec04177f7bc85dde", "score": "0.5209816", "text": "function bindHtml(cnt) {\n //target Content HTML\n var content = angular.element('.content')\n cnt.forEach(function(val, index){\n if(val.type === 'editor-text'){\n var container = angular.element(document.createElement('md-content'))\n container.css( \"background-color\",\"white\");\n container.css('margin-top','20px;');\n container.css('margin-botton','20px;');\n var courseCnt = angular.element(document.createElement('editor-text-view'));\n courseCnt.attr('cnt', 'cnt['+index+']');\n courseCnt.attr('mode', 'read');\n courseCnt.attr('index', index);\n container.append(courseCnt)\n content.append(container)\n //content.append(\"<md-content><editor-text-view ng-cloack index='\"+index+\"' mode='read' cnt='cnt[\"+index+\"]'></editor-text-view></md-content>\")\n } else if(val.type ==='iframe-module'){\n var container = angular.element(document.createElement('md-content'))\n container.css('margin-top','20px;');\n container.css('margin-botton','20px;');\n var courseCnt = angular.element(document.createElement('iframe-module'));\n courseCnt.attr('cnt', 'cnt['+index+']');\n courseCnt.attr('mode', 'read');\n courseCnt.attr('index', index);\n container.append(courseCnt)\n content.append(container)\n }\n else if(val.type ==='steps'){\n $log.info(val)\n var container = angular.element(document.createElement('md-content'))\n container.css('margin-top','20px;');\n container.css('margin-botton','20px;');\n var courseCnt = angular.element(document.createElement('se-steps'));\n courseCnt.attr('cnt', 'cnt['+index+']');\n courseCnt.attr('mode', 'read');\n courseCnt.attr('index', index);\n container.append(courseCnt)\n content.append(container)\n }\n else if(val.type ==='survey'){\n var courseCnt = angular.element(document.createElement('se-survey'));\n content.append(courseCnt)\n } else if(val.type === 'code-terminal'){\n content.append('<md-content><code-terminal></code-terminal></md-content>')\n } else if(val.type === 'slide-course'){\n content.append('<md-content><slide-course></slide-course></md-content>')\n }\n else if(val.type === 'r-code-exe'){\n var courseCnt = angular.element(document.createElement('r-code-exe'));\n courseCnt.attr('cnt', 'cnt['+index+']');\n courseCnt.attr('index', index);\n courseCnt.attr('mode', 'read');\n content.append(courseCnt)\n }\n else if(val.type === 'challenge'){\n var courseCnt = angular.element(document.createElement('challenge'));\n courseCnt.attr('index',index);\n courseCnt.attr('mode','read');\n content.append(courseCnt)\n }\n })\n $compile(content)($scope);\n }", "title": "" }, { "docid": "a10140b23ecae3361be3be31d821b07d", "score": "0.5201541", "text": "function setContent(by_what) {\t\n\t\tclearCanvas();\n\t\t\n\t\tvar content = \"\";\n\t\tcontent += \"<div style='float:left;width:110px;padding-right:10px;'>\";\n\t\tcontent += \"<span class='categoryTitle'>Jump around a lot</span><br />\";\n\t\tcontent += \"<div style='border-left:2px solid #424254;position:relative;left:1px;top:0'>\";\n\t\tcontent += \"<label><input type='checkbox' class='control_select_all' id='all_jumpers' style='vertical-align: middle; margin: 0px' /> Visualize all</label><br />\";\n\t\tfor(i=0;i<names_jumpers.length;i++) {\n\t\t\tcontent += \"<label><input type='checkbox' name='control_jumpers' class='control' id='\" + names_jumpers[i] + \"' /> <span id='text_\" + names_jumpers[i] + \"'>\" + names_jumpers[i] + \"</span></label><br />\";\n\t\t}\n\t\tcontent += \"</div></div>\";\n\n\t\tcontent += \"<div style='float:left;width:110px;padding-right:10px;'>\";\n\t\tcontent += \"<span class='categoryTitle'>Prefer a single seat</span><br />\";\n\t\tcontent += \"<div style='border-left:2px solid #E8CAA4;position:relative;left:1px;top:0'>\";\n\t\tcontent += \"<label><input type='checkbox' class='control_select_all' id='all_seaters' style='vertical-align: middle; margin: 0px' /> Visualize all</label><br />\";\n\t\tfor(i=0;i<names_seaters.length;i++) {\n\t\t\tcontent += \"<label><input type='checkbox' name='control_seaters' class='control' id='\" + names_seaters[i] + \"' /> <span id='text_\" + names_seaters[i] + \"'>\" + names_seaters[i] + \"</span></label><br />\"\n\t\t}\n\t\tcontent += \"</div></div>\";\n\t\t\n\t\tcontent += \"<div style='float:left;width:110px;padding-right:10px;'>\";\n\t\tcontent += \"<span class='categoryTitle'>Prefer a single zone</span><br />\";\n\t\tcontent += \"<div style='border-left:2px solid #64908A;position:relative;left:1px;top:0'>\";\n\t\tcontent +=\"<label><input type='checkbox' class='control_select_all' id='all_zoners' style='vertical-align: middle; margin: 0px' /> Visualize all</label><br />\";\n\t\tfor(i=0;i<names_zoners.length;i++) {\n\t\t\tcontent += \"<label><input type='checkbox' name='control_zoners' class='control' id='\" + names_zoners[i] + \"' /> <span id='text_\" + names_zoners[i] + \"'>\" + names_zoners[i] + \"</span></label><br />\";\n\t\t}\n\t\tcontent += \"</div></div>\";\n\t\tcontent += \"<br /><br />\";\n\t\n\t\t$(\"#scrollPaneContent\").html(content).fadeIn();\n\t\t\n\t\t//reassign event listeners\n\t\tassignEventListeners();\n}", "title": "" }, { "docid": "d5f8bcab2fd116f2345b2c2e4ed1cfcc", "score": "0.5198149", "text": "function renderPostText( content ) {\n let HTML = ''\n let text = ''\n let more = ''\n const shortTextLength = 60\n const maxTextLength = 350\n// jei yra, generuojame posto teksta pagal ilgi ir fono spalva (data.js 117, 130 eilute)\nlet textClass = ''\n if (content.text) {\n if( content.text.length < shortTextLength && !content.img ) {\n textClass = 'big-text'\n }\n if (content.background && !content.img){\n textClass += ' background ' + content.background\n }\n\n text = content.text\n if (content.text.length > maxTextLength){\n // atkirpsime teksto dali iki maxTextLength (tarkim 350) simboliu\n text = content.text.slice(0, maxTextLength)\n // nutrinsime is galo nepilnus zodzius iki tarpo ' ' (ar sakinius, kai zyme '.')\n let letterRemove = 0\n for( let i=maxTextLength-12; i>0; i-- ){\n const letter = text[i]\n if (letter === ' ') {break}\n letterRemove++\n }\n text = text.slice(0, -letterRemove-12)\n more = '... <span class=\"more\">See more</span>'\n }\n\n HTML = `<p class=\"${textClass}\"> ${text}${more} </p>`\n if ( more !== '' ) {\n HTML += `<p class=\"${textClass} hidden\"> \n ${content.text} \n </p>`\n }\n }\n return HTML\n}", "title": "" }, { "docid": "22aab6a8ae0472d509ae3719e40f40e4", "score": "0.5195681", "text": "function TemplateCSE(obj = []) {\n\tif (obj.length === 0) return;\n\tif (obj.data == null || obj.data.length == 0) return;\n\tlet viewDom = document.querySelector(obj.domEl);\n\tif (viewDom === null) {\n\t\tlet mess = \"Your Given ID/Class is Wrong\";\n\t\tthrow new Error(mess);\n\t}\n\tlet speed = obj.scrolldelay ? obj.scrolldelay : 5;\n\tlet bg = obj.bg ? obj.bg : \"#49244e;\";\n\tlet textColor = obj.textColor ? obj.textColor : \"#333\";\n\tviewDom.innerHTML = `<div class=\"dsetem1\" style=\"background: ${bg};color:${textColor}\">\n\t\t<div class=\"dsetem-header\">\n\t\t\tCSE\n\t\t</div>\n\t\t<marquee onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\" loop=\"true\" scrollamount=\"${speed}\">\n\t\t\t${obj.data\n\t\t\t.map(v => {\n\t\t\t\treturn `<span>\n\t\t\t\t\t\t${v.name} ${v.f}\n\t\t\t\t\t\t<br> \n\t\t\t\t\t\t<code>${v.l}</code>\n\t\t\t\t\t</span>`;\n\t\t\t})\n\t\t\t.join(\"\")}\n\t\t</marquee>\n \t</div>`;\n}", "title": "" }, { "docid": "e12c675b12689c4deecb82711eb0aaec", "score": "0.5192275", "text": "function displayCourseResult(sub) {\n courseDiv.innerHTML = \"\";\n $(\".course-result-modal.modal\").style.cssText = \"display: block;\";\n $(\".overlay\").style.display = \"block\";\n $(\".course-result-modal.modal h2\").textContent = \"Courses You Can Study\";\n for (let el of sub) {\n courseDiv.innerHTML += `<h4 class=\"course-child\">${el}</h4>`;\n }\n /* for (let key in sub) {\n courseDiv.innerHTML += `<h4 class=\"course-title\">${key}</h4>`;\n sub[key].subjects.compulsory.forEach(code => {\n courseDiv.innerHTML += `<p class=\"course-child\">${courseCodes[code]} (Compulsory)</p>`;\n });\n\n for (let place in sub[key].subjects.optional) {\n sub[key].subjects.optional[place].forEach(code => {\n courseDiv.innerHTML += `<p class=\"course-child\">${courseCodes[code]} (Optional)</p>`;\n });\n } \n } */\n}", "title": "" }, { "docid": "4a71d77c4cfacc0701ebf5c38a7dae85", "score": "0.5187154", "text": "function addText(ev){\n\tvar txt = document.getElementById(\"textInput\").value;\n\tif(txt != \"\"){\n\t\t//clear the canvas\n\t\tctF.clearRect(0, 0, full.width, full.height);\n\t\t//reload the image\n\t\tvar w = full.width;\n\t\tvar h = full.height;\n\t\tctF.drawImage(i, 0, 0, w, h);\n\t\t//add the new text to the image\n\t\tvar middle = full.width / 2;\n\t\tvar toptxt = full.height - 400;\n\t\tvar bottomtxt = full.height - 100;\n\t\tctF.font = \"30px sans-serif\";\n\t\tctF.fillStyle = \"red\";\n\t\tctF.strokeStyle = \"gold\";\n\t\tctF.textAlign = \"center\";\n\t\t//adding text on canvas and text wrapping conditions\n\t\tvar words = txt.split(\" \");\n\t\tvar line = \"\";\n\t\tfor(var n = 0; n < words.length; n++){\n\t\t\tvar testLine = line + words[n] + \" \";\n\t\t\tvar metrics = ctF.measureText(testLine);\n\t\t\tvar testWidth = metrics.width;\n\t\t\tif(testWidth > full.width && n >0){\n\t\t\t\tif(document.getElementById(\"topBtn\").checked){\n\t\t\t\t\tctF.fillText(line, middle, toptxt);\n\t\t\t\t\tctF.strokeText(line, middle, toptxt);\n\t\t\t\t\tline = words[n] + \" \";\n\t\t\t\t\ttoptxt += 25;\n\t\t\t\t}\n\t\t\t\telse if(document.getElementById(\"bottomBtn\").checked){\n\t\t\t\t\tctF.fillText(line, middle, bottomtxt);\n\t\t\t\t\tctF.strokeText(line, middle, bottomtxt);\n\t\t\t\t\tline = words[n] + \" \";\n\t\t\t\t\tbottomtxt += 25;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tline = testLine;\n\t\t\t}\n\t\t}\n\t\tif(document.getElementById(\"topBtn\").checked){\n\t\t\tctF.fillText(line, middle, toptxt);\n\t\t\tctF.strokeText(line, middle, toptxt);\n\t\t\tline = words[n] + \" \";\n\t\t\ttoptxt += 25;\n\t\t}\n\t\telse if(document.getElementById(\"bottomBtn\").checked){\n\t\t\tctF.fillText(line, middle, bottomtxt);\n\t\t\tctF.strokeText(line, middle, bottomtxt);\n\t\t\tline = words[n] + \" \";\n\t\t\tbottomtxt += 25;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f374eca6544742b92631316e578aff9f", "score": "0.51850003", "text": "function questionContent() {\n\t\t// a for loop would be cool here...\n \t$(\"#gameScreen\").append(\"<p><strong>\" +\n \t\tquestions[questionCounter].question +\n \t\t\"</p><p class='choices'>\" +\n \t\tquestions[questionCounter].choices[0] +\n \t\t\"</p><p class='choices'>\" +\n \t\tquestions[questionCounter].choices[1] +\n \t\t\"</p><p class='choices'>\" +\n \t\tquestions[questionCounter].choices[2] +\n \t\t\"</p><p class='choices'>\" +\n \t\tquestions[questionCounter].choices[3] +\n \t\t\"</strong></p>\");\n\t}", "title": "" }, { "docid": "896341a205e8685ceeec97b3ccc5242b", "score": "0.51789767", "text": "function xPand(obj){\r\n if(Math.max(document.documentElement.clientWidth, window.innerWidth) > 981){ //CHECKING THE WIDTH OF THE SCREEN. IF ITS MORE THAN 981 THEN\r\n //CERTAIN WIDTH AND HEIGHT ARE ASSIGNED\r\n width = 20;\r\n height = 50;\r\n }\r\n else{//IF NOT, BOOLEAN VALUE ASSIGNED BELOW\r\n var hasSmallScreen = true;\r\n }\r\n var row = obj.parentElement;//gets parent element of clicked object\r\n var elements = row.getElementsByClassName(obj.className); //gets array of all objects in a row\r\n\r\n\r\n if(!hasSmallScreen){//IF NOT SMALL SCREEN PROCCED ELSE DO NOTHING\r\n\r\n //MAKE ALL ELEMENT IN A ROW OF WIDTH 0\r\n for (var i = 0; i < elements.length; i++) {\r\n elements[i].style.width = 0 +'%';\r\n }\r\n // length of clicked element in percents independent of screen size\r\n currentWidth = Math.round((obj.offsetWidth/row.offsetWidth)*100);\r\n console.log(Math.round((obj.offsetHeight/row.offsetHeight)*100));//\r\n\r\n\r\n\r\n if(currentWidth == width)\r\n {\r\n obj.style.width = \"100%\";\r\n obj.style.height = \"100%\";\r\n obj.style.cursor = \"default\";\r\n // console.log(obj.getElementsByClassName(\"instruction_Content\")[0].style);\r\n\r\n //timeout for text to be dicplayed in the box, not out of it\r\n displayParagraphsBlock(obj);\r\n\r\n }\r\n else\r\n {\r\n //loop to make all blocks initioal size\r\n for(var i = 0; i<elements.length; i++){\r\n elements[i].style.width = width+'%';\r\n elements[i].style.height = height+'%';\r\n row.getElementsByTagName(\"h2\")[i].style.display = \"block\";\r\n obj.style.cursor = \"pointer\";\r\n }\r\n for (var i = 0; i < row.getElementsByTagName(\"p\").length; i++) {\r\n row.getElementsByTagName(\"p\")[i].style.display = \"none\";\r\n }\r\n if(currentWidth < width){\r\n obj.getElementsByTagName(\"h2\").style.display = \"block\";\r\n obj.style.width = \"100%\";\r\n obj.style.height = \"100%\";\r\n obj.style.cursor = \"default\";\r\n displayParagraphsBlock(obj);\r\n }\r\n }\r\n }\r\n\r\n\r\n} //END OF EXPAND", "title": "" }, { "docid": "aaf49e3e80ed81e12777126eea56bbd6", "score": "0.5177574", "text": "function fitToContent(maxHeight, text) {\n if (text) {\n var adjustedHeight = text.clientHeight;\n if (!maxHeight || maxHeight > adjustedHeight) {\n adjustedHeight = Math.max(text.scrollHeight, adjustedHeight) + 4;\n if (maxHeight) {\n adjustedHeight = Math.min(maxHeight, adjustedHeight);\n }\n if (adjustedHeight > text.clientHeight) {\n text.style.height = adjustedHeight + \"px\";\n }\n }\n }\n }", "title": "" }, { "docid": "1ce235ba871b9d8128d57d7f4dc46317", "score": "0.51751834", "text": "function drawText()\n\t{\n\t\t// Choose a width based on the character count\n\t\tvar w = chooseSize();\n\n\t\t// Draw the text\n\t\ttext = that.add('text', {\n\t\t\tw: w,\n\t\t\ttext: that.text,\n\t\t\tfont: that.font || style.font,\n\t\t\tcolor: style.color,\n\t\t\talign: style.align,\n\t\t\tdepth: depth + 1,\t\t// The box will be at \"depth\" so be sure to go on top of it\n\t\t\thidden: true\n\t\t});\n\t}", "title": "" }, { "docid": "5d5acc26ebd005e717d012d63a5ea16f", "score": "0.5172948", "text": "function switchPDText() {\n var pdLongElement = document.getElementById('prof-dev-title-long');\n var pdShortElement = document.getElementById('prof-dev-title-short');\n\n pdLongElement.style.display = \"block\" \n pdShortElement.style.display = \"block\" \n\n if (parseFloat(pdLongElement.scrollHeight/pdShortElement.scrollHeight) > 3) {\n pdShortElement.style.visibility = \"visible\"\n pdLongElement.style.visibility = \"hidden\"\n pdLongElement.style.display = \"none\" \n } else {\n pdLongElement.style.visibility = \"visible\"\n pdShortElement.style.visibility = \"hidden\"\n pdShortElement.style.display = \"none\" \n }\n}", "title": "" }, { "docid": "2c6b4cab2c9690d46d1120fa7cbfe2a3", "score": "0.51583445", "text": "function Engraver(elem){ \n //this is the function that shows the text in the tags \n\t\t \n //display the word count for every line \n $('div#counter').html('<span class=\"wordcount\">' +wordCount(elem.maxLength, elem) + '</span>');\n \n \n //get what the user is entering and the div that is going to display it on the preview\n var inputString = $(elem).attr('class') == 'EngB activate' ? $('input.EngB') : $('input.EngF');\n //alert($(elem).attr('class'));\n var outString = $(elem).attr('class') == 'EngB activate' ? //if this input element is the front \n nextElementSibling($('div#accordion h3.ui-state-active').get(0)).childNodes[1].childNodes[3] : //set the output element to the textshowerD\n nextElementSibling($('div#accordion h3.ui-state-active').get(0)).childNodes[1].childNodes[2]; //set the output element to texshower\n\n //insert the text into the tag's body\n outString.innerHTML = ' '; \n var pre = false; //control variable to know when to introduce a new line\n inputString.each(function(i){ \n if(this.value != ''){ \n if(pre == true){\n var newLine = document.createElement('br');\n outString.appendChild(newLine); \n } \n var inText = document.createTextNode(this.value.replace(/ /g, '\\u00A0')); \n outString.appendChild(inText); \n pre = true;\n }\n }) \n }", "title": "" }, { "docid": "bbabeaa875c33be960a544fb1a37fbb5", "score": "0.5143955", "text": "function renderDivs(){\n if (!data.length){return}\n for(var i=0; i<data.length;i++){\n var textToInsert = data[i].text;\n var cardToRender =\n `<div class=\"card\">\n <textarea class=\"content\" value=\"${textToInsert}\" id=\"${data[i].id}\"> ${textToInsert}</textarea>\n <button class=\"x\" onClick=\"this.parentNode.parentNode.removeChild(this.parentNode)\">x</button>\n </div>\n `\n parent.insertAdjacentHTML(\"beforeend\", cardToRender)\n }\n}", "title": "" }, { "docid": "22bd970fb7f451e70aa33c2bfbfc7066", "score": "0.5143855", "text": "function fillSummaryDiv(content) {\n content.setAttribute('style', 'text-align: center; vertical-align: middle; line-height: 24px;');\n let attr = ['Strength', 'Defense', 'Speed', 'Dexterity'];\n $(content).empty();\n for (let i=0; i < attr.length; i++) {\n let s = document.createElement('span');\n s.setAttribute('style', 'color: red; margin: 10px');\n if (attr[i] === 'Strength') {\n s.appendChild(document.createTextNode('+' + strengthPct + '%'));\n } else if (attr[i] === 'Defense') {\n s.appendChild(document.createTextNode('+' + defPct + '%'));\n } else if (attr[i] === 'Speed') {\n s.appendChild(document.createTextNode('+' + speedPct + '%'));\n } else if (attr[i] === 'Dexterity') {\n s.appendChild(document.createTextNode('+' + dexPct + '%'));\n }\n content.appendChild(document.createTextNode(attr[i] + ':'));\n content.appendChild(s);\n }\n }", "title": "" }, { "docid": "2e58ef28b595d734e38f1de387b2b03d", "score": "0.5142786", "text": "function createFinalText(divId) {\r\n let newDivContainerFinal = document.createElement(\"div\"); \r\n newDivContainerFinal.id = \"containerFinal\";\r\n document.getElementById(divId).appendChild(newDivContainerFinal);\r\n for (i = 0; i < nbQuestion; i++) { \r\n let newDivFinal = document.createElement(\"div\");\r\n let newDivInnerFinalL = document.createElement(\"div\");\r\n let newDivInnerFinalR = document.createElement(\"div\");\r\n let newDivFinalScore = document.createElement(\"div\");\r\n let newDivFinalPoints = document.createElement(\"div\");\r\n let newSpanFinalQuestion = document.createElement(\"span\");\r\n let newSpanFinalPoints = document.createElement(\"span\");\r\n let newSpanFinalResponse = document.createElement(\"span\");\r\n let newSpanFinalExample = document.createElement(\"span\");\r\n let newSpanFinalSpeech = document.createElement(\"span\");\r\n let newSpanFinalTranlate = document.createElement(\"span\");\r\n \r\n newDivFinal.id = \"final\" + i;\r\n newDivFinal.classList.add(\"blocFinal\");\r\n newDivInnerFinalL.classList.add(\"finalL\");\r\n newDivInnerFinalR.classList.add(\"finalL\"); \r\n newDivFinalScore.id = \"scoreEachQuestion\" + i;\r\n newDivFinalScore.classList.add(\"finalR\"); \r\n newSpanFinalQuestion.id = \"questionFinal\" + i;\r\n newSpanFinalQuestion.classList.add(\"final\"); \r\n newSpanFinalPoints.id = \"pointsFinal\" + i; \r\n newSpanFinalResponse.id = \"responseFinal\" + i;\r\n newSpanFinalResponse.classList.add(\"final\"); \r\n newSpanFinalExample.id = \"exampleFinal\" + i;\r\n newSpanFinalExample.classList.add(\"final\"); \r\n newSpanFinalSpeech.id = \"speechFinal\" + i;\r\n newSpanFinalSpeech.classList.add(\"speech\"); \r\n newSpanFinalSpeech.innerHTML= \"<i class=\\\"fas fa-volume-up\\\"></i>\";\r\n newSpanFinalSpeech.onclick = function() { \r\n let elt = this;\r\n let textToSpeechId = this.getAttribute(\"id\");\r\n let textToSpeechNumber = textToSpeechId.split(\"l\")[1];\r\n if (!this.classList.contains(\"speaking\")) {\r\n this.classList.add(\"speaking\");\r\n textToSpeech(textToSpeechNumber, \"final\");\r\n }else{\r\n this.classList.remove(\"speaking\");\r\n window.speechSynthesis.cancel();\r\n } \r\n } \r\n newSpanFinalTranlate.id = \"translatFinal\" + i;\r\n newSpanFinalTranlate.classList.add(\"final\");\r\n newDivContainerFinal.appendChild(newDivFinal);\r\n newDivFinal.appendChild(newDivInnerFinalL);\r\n newDivFinal.appendChild(newDivInnerFinalR);\r\n newDivFinal.appendChild(newDivFinalScore);\r\n newDivInnerFinalL.appendChild(newSpanFinalQuestion);\r\n newDivInnerFinalL.appendChild(newSpanFinalTranlate);\r\n newDivInnerFinalR.appendChild(newSpanFinalResponse);\r\n newDivInnerFinalR.appendChild(newSpanFinalSpeech);\r\n newDivInnerFinalR.appendChild(newSpanFinalExample);\r\n newDivFinalScore.appendChild(newSpanFinalPoints);\r\n }\r\n}", "title": "" }, { "docid": "213c14a7ae98cfd03b49527998eb5273", "score": "0.51381946", "text": "function questionDivHtml(xmlLessonObject, topicCounter) {\n var x = '<div id=\"collapse' + topicCounter + '\" class=\"panel-collapse collapse\">';\n x += '<div class=\"omm_panel-body\">';\n x += '<table class=\"table table-striped table-hover\">';\n var questionCounter = 1;\n\n //fuer jede Frage im XML-Dokument\n $(xmlLessonObject).find(\"question\").each(function() {\n x += '<tr>';\n //Geruest fuer Frage bereitstellen, so wie Fragennummer, Titel, Tabelle und Checkbox\n x += htmlQuestion(questionCounter, $(this).attr(\"name\"));\n\n //DIV-Element fuer Details der Frage\n x += '<td><div class=\"hidden omm_question\">';\n\n var wellFormedQuestionBody;\n var questionAnswers = new Array();\n if ($(this).attr(\"type\") !== 'ClozeText') {\n wellFormedQuestionBody = styler.getWellFormedQuestionBody($(this));\n x += htmlQuestionBody(wellFormedQuestionBody);\n //div fuer Antworten erzeugen\n x += '<div class=\"omm_question-answers-html\">';\n $(this).find('answer').each(function() {\n questionAnswers.push($(this));\n x += htmlQuestionAnswers($(this));\n });\n\n //div fuer Antworten schließen\n x += '</div>';\n } else {\n wellFormedQuestionBody = styler.getWellFormedQuestionBody($(this));\n x += htmlQuestionBodyClozeText(wellFormedQuestionBody);\n }\n\n\t\t\tx += htmlQuestionNotice($(this).attr('notice'));\n x += htmlQuestionNoticeOnWrong($(this).attr('notice_on_wrong'));\n x += htmlQuestionType($(this).attr('type'));\n x += htmlQuestionNoticeOnCorrect($(this).attr('notice_on_correct'));\n x += htmlQuestionPattern($(this).attr('pattern'));\n\n //div fuer Fragendetails schließen\n x += '</div></td>';\n\n x += htmlQuestionInfoContent(wellFormedQuestionBody, questionAnswers);\n x += '</tr>';\n questionCounter++;\n });\n x += '</table></div></div>';\n return x;\n }", "title": "" }, { "docid": "08449b7d9cb900698727d8d93414c4e4", "score": "0.5134574", "text": "function randomizeDivText()\n{\n var paras = [[\"Think left and think right\", \n \"and think low and think high.\",\n \"Oh, the thinks you can think up\",\n \"If only you try!\",\n \"-- Dr Seuss\"], \n [\"\", \n \"Creativity takes a leap\",\n \"then looks to see where it is.\",\n \"\", \n \"-- Mason Cooley\"],\n [\"Meaning lies as much\",\n \"in the mind of the reader\",\n \"as in the Haiku.\",\n \"\",\n \"-- Douglass R. Hofstader\"],\n [\"To live a creative life,\",\n \"we must lose our fear\",\n \"of being wrong.\",\n \"\", \n \"-- Joseph Chilton Pearce\"],\n [\"\",\n \"Creativity is intelligence\",\n \"having fun.\",\n \"\", \n \"-- Einstein\"],\n [\"\",\n \"Genius is one percent inspiration\",\n \"and ninety-nine percent perspiration.\",\n \"\", \n \"-- Thomas Edison\"],\n [\"\",\n \"No great thing\",\n \"is created suddenly.\",\n \"\", \n \"-- Epictetus\"],\n [\"The imagination\",\n \"imitates.\",\n \"It is the critical spirit\",\n \"that creates.\", \n \"-- Oscar Wilde\"],\n [\"Creativity\",\n \"is allowing yourself to make mistakes\",\n \"Art\",\n \"is knowing which ones to keep\", \n \"-- Scott Adams\"],\n [\"It is better to create\",\n \"than to be learned.\",\n \"Creating is the true essence\",\n \"of life\", \n \"-- Barthold Georg Niebuhr\"],\n [\"Creativity\",\n \"is the power to connect\",\n \"the seemingly unconnected.\",\n \"\", \n \"-- William Plomer\"],\n [ \"Simplicity\",\n \"is the ultimate\", \n \"sophistication.\",\n \"\",\n \"-- Leonardo da Vinci\"],\n [\"When I am working on a problem I never think about beauty.\",\n \"I think only how to solve the problem.\",\n \"But when I have finished, if the solution is not beautiful,\",\n \"I know it is wrong.\",\n \"-- R. Buckminster Fuller\"],\n [\"First,\", \n \"solve the problem.\",\n \"Then,\",\n \"write the code.\",\n \"-- John Johnson\"],\n [\"Beauty\", \n \"is the ultimate defense\",\n \"against complexity.\",\n \"\",\n \"-- David Gelernter\"],\n [\"\",\n \"\",\n \"while (!succeed = try());\",\n \"\",\n \"\"], \n [\"Most good programmers do programming\", \n \"not because they expect to get paid\",\n \"or get adulation by the public,\", \n \"but beccause it is fun to program.\",\n \"-- Linus Torvalds\"], \n [\"It's art if can't be explained.\",\n \"It's fashion if no one asks for an explanation.\",\n \"It's design if it doesn’t need explanation.\",\n \"\",\n \"-- Wouter Stokkel\"],\n [\"Every child is an artist.\",\n \"The challenge is to remain an artist\",\n \"after you grow up.\",\n \"\",\n \"-- Pablo Picasso\"],\n [\"In design man becomes what he is.\",\n \"Animals have language and perception as well,\",\n \"but they do not design\",\n \"\",\n \"-- Otl Aicher\"],\n [\"\",\n \"\",\n \"Everyone is an artist\",\n \"\",\n \"- Joseph Beuys\"],\n [\"The life of a designer\",\n \"is a life of fight:\",\n \"fight against the ugliness.\",\n \"\",\n \"-- Massimo Vignelli\"],\n [\"\",\n \"Inspiration the seed.\",\n \"Design but the flower.\",\n \"\",\n \"-- Michael Langham\"],\n [\"\",\n \"Maths is easy;\",\n \"design is hard.\",\n \"\",\n \"-- Jeffrey Veen\"]];\n \n rand = Math.floor(Math.random() * paras.length);\n divText = paras[rand];\n \n return divText;\n}", "title": "" }, { "docid": "703cb5ab119da0161701c70632a4153a", "score": "0.5133218", "text": "function questionContent() {\n\n $(\"#gameWindow\").append(\"<p>\" +\n questions[questionCounter].question +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[0] +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[1] +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[2] +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[3] +\n \"</p>\");\n } // End of questionContent function", "title": "" }, { "docid": "40d9b7f51aa314f4543b5a4a33de9f48", "score": "0.5126014", "text": "function createContent(context) {\r\nconst container = document.querySelector('#container');\r\n\r\nconst content = document.createElement('div');\r\ncontent.classList.add('content');\r\ncontent.textContent = context\r\n\r\ncontainer.appendChild(content)\r\n}", "title": "" }, { "docid": "fe4b29663891ec14f4c78b4fa220350e", "score": "0.512445", "text": "displayDegree() {\n var _this = this;\n var text_view = \"#\" + this._UID + \" .text-view\";\n\n $(text_view + \" p\").transition({\n \"animation\" : \"fade\",\n \"onComplete\" : function() {\n $(text_view + \" p\").text(_this._headers[_this._focus] + \": \" + _this._entries[_this._focus]);\n\n while($(text_view + \" p\").width() < $(text_view).width())\n $(text_view + \" p\").css(\"font-size\", (parseInt($(text_view + \" p\").css(\"font-size\")) + 1));\n \n while($(text_view + \" p\").width() > $(text_view).width())\n $(text_view + \" p\").css(\"font-size\", (parseInt($(text_view + \" p\").css(\"font-size\")) - 1));\n\n while($(text_view + \" p\").height() > $(text_view).height())\n $(text_view + \" p\").css(\"font-size\", (parseInt($(text_view + \" p\").css(\"font-size\")) - 1));\n\n\n var vcent_dist = ($(text_view).height() - $(text_view + \" p\").height()) / 2;\n var hcent_dist = ($(text_view).width() - $(text_view + \" p\").width()) / 2;\n $(text_view + \" p\").css(\"top\", vcent_dist + \"px\");\n $(text_view + \" p\").css(\"left\", hcent_dist + \"px\");\n\n $(text_view + \" p\").transition(\"fade\");\n }\n });\n }", "title": "" }, { "docid": "f788e34b91f1f684a866a6577074276c", "score": "0.5124235", "text": "buildBlock() {\n\t\tthis.html = document.createElement(\"div\")\n\n\t\tCSS.style({width: (this.size - 2) + \"px\", height: (this.size - 2) + \"px\"}, this.html)\n\t\tCSS.addClass(\"block\", this.html)\n\t}", "title": "" }, { "docid": "50281d02b4886895e2d5fc1f0381671e", "score": "0.5122771", "text": "function miFuncion() {\n if(document.getElementById(\"#contingutArticle\")){\n var $contingut = document.getElementById(\"#contingutArticle\").innerHTML;\n var decodedText = $(\"<p/>\").html($contingut).text();\n document.getElementById(\"#contingutArticle\").innerHTML=decodedText;\n }\n if(document.getElementById(\"#contingutDesccripcio\")) {\n var $contingut = document.getElementById(\"#contingutDesccripcio\").innerHTML;\n var decodedText = $(\"<p/>\").html($contingut).text();\n document.getElementById(\"#contingutDesccripcio\").innerHTML = decodedText;\n }\n $(\"#caracters\").html(\" \"+ $(\"#description\").val().length+\" de 140\");\n $(\"#description\").on('keydown',function () {\n $(\"#caracters\").html($(\"#description\").val().length+\"de 140\");\n });\n\n }", "title": "" }, { "docid": "af06a94de1875f1f4dbd5cc279da74e4", "score": "0.5117644", "text": "function questionContent() {\n // a for loop would be cool here...\n $(\"#gameScreen\").append(\n \"<p><strong>\" +\n questions[questionCounter].question +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[0] +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[1] +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[2] +\n \"</p><p class='choices'>\" +\n questions[questionCounter].choices[3] +\n \"</strong></p>\"\n );\n }", "title": "" }, { "docid": "fdbc47f96d5a5ef42585740e6abdba96", "score": "0.51160216", "text": "function fitTextInCircle(ctx, text, font_size, width, step) {\r\n //Lower the font size until the text fits the canvas\r\n do {\r\n font_size -= step\r\n ctx.font = \"normal normal 300 \" + font_size + \"px \" + font_family\r\n } while (ctx.measureText(text).width > width)\r\n return font_size\r\n }//function fitTextInCircle", "title": "" }, { "docid": "16d9dcdff65ac6a1bc78d57606b169f4", "score": "0.51100284", "text": "function longNameCheck(idOfContainer,idOfText)\n{\n containerH = document.getElementById(idOfContainer).offsetHeight;\n containerW = document.getElementById(idOfContainer).offsetWidth;\n textH = document.getElementById(idOfText).offsetHeight;\n textW = document.getElementById(idOfText).offsetWidth;\n console.log(containerH,containerW, textH, textW);\n if (containerH < textH)\n {\n scaleFactor = containerH / textH;\n //alert(scaleFactor);\n fontH = document.getElementById(idOfText).style.fontSize;\n newFontH = parseInt(fontH) * scaleFactor;\n document.getElementById(idOfText).style.fontSize = newFontH + \"px\";\n } \n \n if (containerW < textW)\n { \n document.getElementById(idOfContainer).style.overflow = \"hidden\";\n document.getElementById(idOfText).style.overflow = \"hidden\"; \n }\n\nvar rect = p1NameDiv.getBoundingClientRect();\nconsole.log(rect.top, rect.right, rect.bottom, rect.left);\n\n}", "title": "" }, { "docid": "ea47f9ccac17c99626a5eb5cf1d63856", "score": "0.51082474", "text": "function getText () {\n return `Integer fringilla, lorem eget ultricies tempor, justo purus suscipit nulla, in pulvinar lorem arcu dapibus leo. Nam finibus ut sem vel pellentesque.\nInteger sit amet venenatis justo, vitae posuere ipsum. Suspendisse non ante eros. Mauris ut urna at risus varius laoreet.\nNam ultricies ante quis lectus imperdiet, bibendum condimentum mi aliquam. Sed bibendum a velit at tempus.\n\nSuspendisse gravida mi ut orci varius sollicitudin. Aenean feugiat nisi eget leo aliquam pretium. Maecenas iaculis, est ut euismod luctus, eros diam imperdiet sapien, vel consectetur nulla lectus et nibh. Phasellus eget augue hendrerit, vehicula nulla eu, imperdiet arcu.\nSed vehicula, nisi et dictum aliquam, ante ante fringilla sem, eget luctus diam mauris sit amet purus. Praesent sollicitudin, sapien eu auctor eleifend, turpis metus mattis quam, eget pulvinar neque enim rutrum erat.\nNam feugiat dignissim augue.\nCras eu velit sit amet nulla convallis pretium eu at odio. Maecenas et lacinia elit.\nInterdum et malesuada fames ac ante ipsum primis in faucibus. Mauris volutpat nec sem auctor feugiat.\nNullam ultrices vehicula leo fringilla tristique.\nUt a tellus non lectus ultrices lacinia ut vitae quam.\n\nSed ullamcorper ligula eget lacus rutrum suscipit.\nNunc quis sodales massa, eget suscipit magna. Curabitur id leo eget lorem mattis congue vel eu dolor. Nulla commodo, odio ut aliquam tempor, ante dui iaculis nisi, sit amet congue ligula massa porta massa. Pellentesque auctor lacinia quam, non fringilla neque ornare nec.\nMorbi scelerisque, nisl sed euismod malesuada, ex diam commodo diam, non volutpat arcu arcu quis urna. Donec faucibus erat auctor justo dapibus feugiat.\n\nNulla facilisi. Sed gravida ligula nisi, sed porta nibh vulputate nec. Aenean feugiat felis a sapien gravida mattis. Quisque sed ante tempor, pretium arcu eget, consectetur eros. Quisque in venenatis metus. Vestibulum quam massa, blandit quis egestas ut, ullamcorper ac sem. Nullam eget ultricies purus, sit amet eleifend metus.\nPraesent nec mauris semper, accumsan lacus id, sollicitudin lacus. Nullam orci augue, accumsan sed mi sed, iaculis maximus quam. Phasellus a vestibulum est.\nAliquam erat volutpat.\n\nPellentesque aliquet, purus eu tincidunt maximus, mauris sapien posuere tortor, eu vulputate magna lorem a felis. Maecenas scelerisque nunc felis. Mauris sodales metus vestibulum, vestibulum diam vel, accumsan tellus. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nSed velit mi, consectetur a tellus feugiat, iaculis pharetra sem. Nulla facilisi. Sed placerat ligula nec lobortis dictum. Aenean tincidunt nulla in maximus mattis. Aliquam finibus sem et nulla porttitor pellentesque.\nDonec varius purus ac eros placerat, sed sagittis elit facilisis.`\n}", "title": "" }, { "docid": "d28992f2d48e7e697cb3cdf7586bef20", "score": "0.5108184", "text": "textQ34(text, w, h) {\n text.setWidthAndHeight(\"100%\", \"40%\");\n text.move(0, \"60%\");\n }", "title": "" }, { "docid": "296c9b0785cac04fc10a03e304b75f4c", "score": "0.50952107", "text": "function displayContent($t, parentDiv) {\n var pos = $t.parents('.col-three-wrap').position(),\n height = $t.parent('.col-three').height() + parseInt($('.customer-grid').css('padding-top'));\n if (parseInt($t.parents('.col-three-wrap').css('margin-bottom')) === 0) {\n $t.parents('.col-three-wrap').css({'margin-bottom': 350 + 'px', 'transition': 'all 0.5s ease'});\n $('.customer-grid .customer-info-div').slideUp(200);\n } else {\n $('.customer-grid .customer-info-div').css('display', 'none');\n }\n $('.customer-grid .customer-info-div').css({'top': pos.top + height + 'px'}).stop(true, true).slideDown(function () {\n var openHeight = $('.customer-grid .customer-info-div').outerHeight(true) + 10;\n $t.parents('.col-three-wrap').css({'margin-bottom': openHeight + 'px', 'transition': 'all 0.5s ease'});\n });\n }", "title": "" }, { "docid": "e00bc7c74e71b91f2b26aa6883289aaa", "score": "0.5089316", "text": "function displayDescript1(){\n\t\tdescription1.style.display=\"block\";\n\t\tdescription1.style.backgroundColor=\"black\";\n\t\tdescription1.style.position=\"absolute\";\n\t\tdescription1.style.left=\"5%\";\n\t\tdescription1.style.top=\"60%\";\n\t\tdescription1.style.width=\"50%\";\n\t\tdescription1.style.color=\"white\";\n\t\tdescription1.style.zIndex=\"100\";\n\t\tdescription1.style.padding=\"10px\";\n\t\tdescription.style.fontFamily=\"miriam libre\";\n\t}", "title": "" }, { "docid": "949813f45feabc9b59c3ce5fd1b7aa4f", "score": "0.50882876", "text": "function renderTextLayer(){\n if(textDivs.length === 0){\n clearInterval(renderTimer);\n renderingDone = true;\n me.textLayerDiv = textLayerDiv = canvas = ctx = null;\n return;\n }\n var textDiv = textDivs.shift();\n if(textDiv.dataset.textLength > 0){\n textLayerDiv.appendChild(textDiv);\n\n if(textDiv.dataset.textLength > 1){ // avoid div by zero\n // Adjust div width to match canvas text\n\n ctx.font = textDiv.style.fontSize + ' sans-serif';\n var width = ctx.measureText(textDiv.textContent).width;\n\n var textScale = textDiv.dataset.canvasWidth / width;\n\n var vendorPrefix = (function(){\n if('result' in arguments.callee) return arguments.callee.result;\n\n var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/;\n\n var someScript = document.getElementsByTagName('script')[0];\n\n for(var prop in someScript.style){\n if(regex.test(prop)){\n return arguments.callee.result = prop.match(regex)[0];\n }\n }\n if('WebkitOpacity' in someScript.style) return arguments.callee.result = 'Webkit';\n if('KhtmlOpacity' in someScript.style) return arguments.callee.result = 'Khtml';\n\n return arguments.callee.result = '';\n })();\n\n var textDivEl = Ext.get(textDiv);\n\n // TODO: Check if these styles get set correctly!\n textDivEl.setStyle(vendorPrefix + '-transform', 'scale(' + textScale + ', 1)');\n textDivEl.setStyle(vendorPrefix + '-transformOrigin', '0% 0%');\n }\n } // textLength > 0\n }", "title": "" }, { "docid": "cd43bbc5597ea6ff8a4c592f8162247e", "score": "0.5087685", "text": "function calc() {\n // Verify entered value\n if (!$(\"#font-size\").length) {\n throw new Error(\"Font Size Element not found\");\n }\n if ($(\"#font-size\").val() <= 0) {\n throw new Error(\"Font Size must be bigger than 0\");\n }\n if (!$.isNumeric($(\"#font-size\").val())) {\n throw new Error(\"Font Size must be a number\");\n }\n\n // Get set font size and calculate optimal line height\n var fontSize = $(\"#font-size\").val();\n var lineHeight = Math.round(fontSize * 1.4);\n\n // DEBUG\n console.log('Text Size: ' + fontSize);\n console.log('Line Height: ' + lineHeight);\n\n // Store reference to texts used to calculate char width\n var $ws = $(\"#ws\");\n var $is = $(\"#is\");\n\n // Calculate character widths for w's and i's\n var wCharWidth = getCharWidth(adjustElementWidth($ws, fontSize));\n var iCharWidth = getCharWidth(adjustElementWidth($is, fontSize));\n\n // Calculate optimal content width\n var averageWidth = (wCharWidth + iCharWidth) / 2;\n console.log(averageWidth); // DEBUG\n\n var optimalContentWidth = averageWidth * 90;\n console.log(optimalContentWidth); // DEBUG\n\n // Calculate headline size\n var headlines = generateHeadlines(fontSize, 3);\n console.log(headlines); // DEBUG\n\n // Style text according to calculated values\n styleText(fontSize, lineHeight, optimalContentWidth, headlines);\n setValues(fontSize, lineHeight, optimalContentWidth, headlines);\n }", "title": "" }, { "docid": "867c06165fd7e567e45a53f4b59d38ff", "score": "0.508764", "text": "usertext(value) {\n const div1 = this.renderer.createElement(\"div\");\n div1.setAttribute(\"class\", \"container darker\");\n this.renderer.appendChild(this.div.nativeElement, div1);\n const Img = this.renderer.createElement(\"img\");\n Img.setAttribute(\"src\", \"/assets/userimage.jpg\");\n Img.setAttribute(\"style\", \"width:12%\");\n this.renderer.appendChild(div1, Img);\n const p = this.renderer.createElement('p');\n p.innerHTML = value;\n this.renderer.appendChild(div1, p);\n this.scrollToBottom();\n }", "title": "" }, { "docid": "143a7275738cfecd8b9a3ad5c4509bbc", "score": "0.5085482", "text": "function composeSectionFinal() {\n // addHeader();\n\n // ddCont.push({\n // text: 'Important Note:',\n // margin: [0, 200, 0, 0],\n // bold: true,\n // fontSize: 16\n // });\n // ddCont.push({\n // text: nheap.content_data['final-page--important-note.txt'],\n // margin: [0, 0, 0, 0],\n // bold: false,\n // fontSize: 16\n // });\n ddCont.push(\n {\n columns:\n [\n {\n image: imagesRack.loadedImages['brand-logo'].dataURI,\n width: 150,\n margin: [40, 40, 0, 0]\n }\n ]\n });\n ddCont.push({\n canvas: [{ type: 'line', x1: 0, y1: 5, x2: 700, y2: 5, lineWidth: 1 }],\n margin: [40, 15, 40, 0]\n });\n ddCont.push({\n text: 'Disclaimer:',\n margin: [40, 15, 0, 0],\n bold: true,\n fontSize: 16,\n color: '#2574a9'\n });\n ddCont.push({\n alignment: 'justify',\n text: nheap.content_data['final-page--disclaimer.txt'],\n margin: [40, 15, 40, 0],\n bold: false,\n fontSize: 11\n });\n ddCont.push({\n canvas: [{ type: 'line', x1: 0, y1: 5, x2: 700, y2: 5, lineWidth: 1 }],\n margin: [40, 15, 40, 0]\n });\n //.outputs assembled chart to html-page nicely formatted\n //$$.c('pre').to( document.body ).ch(\n // $$.div().html( JSON.stringify( contCharts[0].options, null, ' ' )));\n\n //ddCont[ ddCont.length - 1 ].pageBreak = 'after';\n }", "title": "" }, { "docid": "7abb5ca5ed4045e30d1d022e6c20a473", "score": "0.508268", "text": "function createText(hierarchy, event) {\r\n\r\n var content = \"Entrer du texte\";\r\n var dico = getTrans3D();\r\n var currentScale = dico.scaleZ;\r\n var container = $(event.target);\r\n\r\n //si le texte est crée depuis du code\r\n if (event.type === \"code\") {\r\n container = event.container;\r\n var x = event.x;\r\n var y = event.y;\r\n var z = event.z;\r\n var content = event.content;\r\n } else {\r\n //si le texte est crée via un vrai event\r\n container = $(event.target);\r\n (container).unbind('click'); // permet de désactiver le clic sur la surface\r\n\r\n ///////////////////////////////conserver les trois méthode, normalement la première devrait marcher mais dépend fortemetn de la precision de getVirtualCoord\r\n\r\n// var $slideTemp = $(\"<div style='height:700' data-z='1000'></div>\");\r\n// var posVirtuel = getVirtualCoord(event, $slideTemp);\r\n// \r\n// \r\n// var eventMagouille = ({\r\n// pageX: window.innerWidth / 2,\r\n// pageY: window.innerHeight / 2\r\n// });\r\n// var off = getVirtualCoord(eventMagouille, $slideTemp);\r\n\r\n //position du clic dans le monde des slides\r\n// var x = posVirtuel[1] - off[1];\r\n// var y = posVirtuel[0] - off[0];\r\n// \r\n// //position du clic en relative par rapport à la slide\r\n// var x = x - container.attr('data-x');\r\n// var y = y - container.attr('data-y'); \r\n// \r\n// console.log(x+\" \"+container.attr('data-x'));\r\n\r\n\r\n //Claire Z\r\n// var x = (event.pageX - (window.innerWidth / 2) - parseFloat(dico.translate3d[0])) * (currentScale);\r\n// var y = (event.pageY - (window.innerHeight / 2) - parseFloat(dico.translate3d[1])) * (currentScale);\r\n\r\n\r\n //sans passer par le monde des slides\r\n// var parentOffset = container.offset();\r\n// var x = event.pageX - parentOffset.left;\r\n// var y = event.pageY - parentOffset.top;\r\n\r\n\r\n //en fait il faut calculer les coord après la creation du html afin de pouvoir compenser les coord de la mpitié des dimensions de l'element texte\r\n var x = 450;\r\n var y = 350;\r\n var z = 0;\r\n\r\n }\r\n\r\n var idElement = \"element-\" + j++; // id unique élément -> ds json + ds html\r\n var idContainer = container.attr('id');\r\n var containerScale = pressjson.slide[idContainer].scale;\r\n var stringText = '{\"class\": \"element text\",\"type\": \"text\", \"id\" : \"' + idElement + '\", \"pos\": {\"x\" : \"' + x + '\", \"y\": \"' + y + '\", \"z\": \"' + z + '\"},\"rotate\" : {\"x\" : \"' + dico.rotateX + '\", \"y\": \"' + dico.rotateY + '\", \"z\": \"' + dico.rotateZ + '\"}, \"scale\" : \"' + containerScale + '\", \"hierarchy\":\"' + hierarchy + '\", \"content\": \"' + content + '\"}';\r\n var jsonComponent = JSON.parse(stringText);\r\n pressjson.slide[idContainer].element[idElement] = jsonComponent;\r\n\r\n //pour savoir s'il faut vider le champ de texte lorsqu'on clic\r\n (content === 'Entrer du texte') ? jsonComponent.newCreated = 'true' : jsonComponent.newCreated = 'false';\r\n\r\n jsonToHtmlinSlide(jsonComponent, container);\r\n\r\n //console.log(pressjson);\r\n $('#text-tool').parent().removeClass(\"buttonclicked\"); // mise en forme css\r\n}", "title": "" }, { "docid": "beb01b7bdf2145fd21c49822883664a8", "score": "0.5078683", "text": "function addContent(event) {\n\tvar result = 0;\n\t//create a new div element and set its id\n\tvar div = document.createElement(\"div\");\n\tdiv.setAttribute(\"id\", \"div\"+i);\n\n\t//create a new edit button and set its attributes\n\tvar editButton = document.createElement(\"input\");\n\teditButton.setAttribute(\"type\", \"button\");\n\teditButton.setAttribute(\"id\", \"Edit\"+i);\n\teditButton.setAttribute(\"value\", \"Edit\");\n\n\t//add a paragraph to course content\n\tif (event.target.name === \"SubmitText\")\n\t\taddParagraph(div, editButton);\n\n\t//add a header to course content\n\tif (event.target.name === \"SubmitTitle\"){\n\t\tresult = addHeader(div, editButton)\n\t\tif (result < 0)\n\t\t\treturn;\n\t}\n\n\t//add a image to course content\n\tif (event.target.name === \"SubmitImage\") {\n\t\tcreateBreak(div);\n\t\tdiv.appendChild(document.getElementById(\"image\"));\n\t}\n\t//create and append a delete button\n\tcreateButton(div, \"Delete\", div.id);\n\t\n\t//if current html has an element with id = \"View Page\", delete that element\n\tif (document.getElementById(\"View Page\") != null)\n\t\tdocument.getElementById(\"View Page\").parentElement.removeChild(document.getElementById(\"View Page\"));\n\n\t// create and append a new View Page button\n\tcreateBreak(div);\n\tcreateButton(div, \"View Page\", '');\n\tdocument.getElementById(\"courseContent\").appendChild(div);\n\n\t//clear content in dynamicForm\n\tclearDynForm();\n\ti++;\n}", "title": "" }, { "docid": "9bd6e42a97e101f424559278e79333c4", "score": "0.50759065", "text": "function setLegalText(_legalText) {\n\t\t\tlegalDivHolder = document.createElement('div');\n\t\t\tlegalDivHolder.id = 'legalDivHolder';\n\t\t\tlegalDivHolder.className = 'legalDivHolder';\n\t\t\tdocument.getElementsByTagName('body')[0].appendChild(legalDivHolder);\n\t\t\n\t\t\tlegalDivHolder.style.width = \"270px\";\n\t\t\tlegalDivHolder.style.height = \"230px\";\n\t\t\tlegalDivHolder.style.top = \"0px\";\n\t\t\tlegalDivHolder.style.padding = \"20px\";\n\t\t\tlegalDivHolder.style.position = \"absolute\";\n\t\t\tlegalDivHolder.style.display = \"none\";\n\t\t\tlegalDivHolder.style.backgroundColor = \"rgba(255,255,255,.95)\";\n\t\t\n\t\t\tlegalDiv = document.createElement('div');\n\t\t\tlegalDiv.id = 'legalDiv';\n\t\t\tlegalDiv.className = 'legalDiv';\n\t\t\tlegalDivHolder.appendChild(legalDiv);\n\t\t\n\t\t\tlegalDiv.innerHTML = _legalText;\n\t\t\n\t\t\tlegalDiv.style.position = \"absolute\";\n\t\t\tlegalDiv.style.top = \"20px\";\n\t\t\tlegalDiv.style.width = \"270px\"\n\t\t\tlegalDiv.style.height = \"210px\";\n\t\t\tlegalDiv.style.overflow = \"auto\";\n\t\t\tlegalDiv.style.fontFamily = \"Arial\";\n\t\t\tlegalDiv.style.fontSize = \"11px\";\n\t\t\tlegalDiv.style.color = \"#333333\";\n\t\t\tlegalDiv.style.backgroundColor = \"rgba(255,255,255,0)\";\n\t\t\n\t\t\tlegalClose = document.createElement('div');\n\t\t\tlegalClose.id = 'legalClose';\n\t\t\tlegalClose.className = 'legalClose';\n\t\t\tlegalDivHolder.appendChild(legalClose);\n\t\t\n\t\t\tlegalClose.style.position = \"absolute\";\n\t\t\tlegalClose.style.display = \"innerBlock\";\n\t\t\tlegalClose.style.top = \"3px\";\n\t\t\tlegalClose.style.right = \"20px\";\n\t\t\tlegalClose.style.fontFamily = \"arial\";\n\t\t\tlegalClose.style.fontSize = \"11px\";\n\t\t\n\t\t\tlegalClose.style.padding = \"2px 4px 2px\"\n\t\t\tlegalClose.style.backgroundColor = \"#d51e29\";\n\t\t\tlegalClose.style.color = \"#FFF\";\n\t\t\tlegalClose.innerHTML = \"X\";\n\t\t\n\t\t\tlegalClose.style.cursor = \"pointer\";\n\t\t\tlegalClose.style.userSelect = \"none\";\n\t\t\tlegalClose.style.webkitUserSelect = \"none\";\n\t\t\tlegalClose.style.MozUserSelect = \"none\";\n\t\t\n\t\t\tvar el = document.getElementById(\"legalClose\"),\n\t\t\t\ts = el.style;\n\t\t\tel.setAttribute(\"unselectable\", \"on\"); // For IE and Opera\n\t\t\n\t\t\tlegalClose.addEventListener('click', function () {\n\t\t\t\tlegalDivHolder.style.display = \"none\";\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "7a6d755a078d30a582cb5757ee159256", "score": "0.50747246", "text": "function createText(){\n\n\n\n\n\n\n}", "title": "" }, { "docid": "6d4e8ab0cdba8efdd522af436e001133", "score": "0.5073131", "text": "function setLegalText(_legalText) {\n\t\t\tlegalDivHolder = document.createElement('div');\n\t\t\tlegalDivHolder.id = 'legalDivHolder';\n\t\t\tlegalDivHolder.className = 'legalDivHolder';\n\t\t\tdocument.getElementsByTagName('body')[0].appendChild(legalDivHolder);\n\t\t\n\t\t\tlegalDivHolder.style.width = \"708px\";\n\t\t\tlegalDivHolder.style.height = \"70px\";\n\t\t\tlegalDivHolder.style.top = \"0px\";\n\t\t\tlegalDivHolder.style.padding = \"20px\";\n\t\t\tlegalDivHolder.style.position = \"absolute\";\n\t\t\tlegalDivHolder.style.display = \"none\";\n\t\t\tlegalDivHolder.style.backgroundColor = \"rgba(255,255,255,.95)\";\n\t\t\n\t\t\tlegalDiv = document.createElement('div');\n\t\t\tlegalDiv.id = 'legalDiv';\n\t\t\tlegalDiv.className = 'legalDiv';\n\t\t\tlegalDivHolder.appendChild(legalDiv);\n\t\t\n\t\t\tlegalDiv.innerHTML = _legalText;\n\t\t\n\t\t\tlegalDiv.style.position = \"absolute\";\n\t\t\tlegalDiv.style.top = \"30px\";\n\t\t\tlegalDiv.style.width = \"698px\"\n\t\t\tlegalDiv.style.height = \"50px\";\n\t\t\tlegalDiv.style.overflow = \"auto\";\n\t\t\tlegalDiv.style.fontFamily = \"Arial\";\n\t\t\tlegalDiv.style.fontSize = \"11px\";\n\t\t\tlegalDiv.style.color = \"#333333\";\n\t\t\tlegalDiv.style.textAlign = \"left\";\n\t\t\tlegalDiv.style.backgroundColor = \"rgba(255,255,255,0)\";\n\t\t\n\t\t\tlegalClose = document.createElement('div');\n\t\t\tlegalClose.id = 'legalClose';\n\t\t\tlegalClose.className = 'legalClose';\n\t\t\tlegalDivHolder.appendChild(legalClose);\n\t\t\n\t\t\tlegalClose.style.position = \"absolute\";\n\t\t\tlegalClose.style.display = \"innerBlock\";\n\t\t\tlegalClose.style.top = \"5px\";\n\t\t\tlegalClose.style.right = \"30px\";\n\t\t\tlegalClose.style.fontFamily = \"arial\";\n\t\t\tlegalClose.style.fontSize = \"11px\";\n\t\t\n\t\t\tlegalClose.style.padding = \"2px 4px 2px\"\n\t\t\tlegalClose.style.backgroundColor = \"#d51e29\";\n\t\t\tlegalClose.style.color = \"#FFF\";\n\t\t\tlegalClose.innerHTML = \"X\";\n\t\t\n\t\t\tlegalClose.style.cursor = \"pointer\";\n\t\t\tlegalClose.style.userSelect = \"none\";\n\t\t\tlegalClose.style.webkitUserSelect = \"none\";\n\t\t\tlegalClose.style.MozUserSelect = \"none\";\n\t\t\n\t\t\tvar el = document.getElementById(\"legalClose\"),\n\t\t\t\ts = el.style;\n\t\t\tel.setAttribute(\"unselectable\", \"on\"); // For IE and Opera\n\t\t\n\t\t\tlegalClose.addEventListener('click', function () {\n\t\t\t\tlegalDivHolder.style.display = \"none\";\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "6d4e8ab0cdba8efdd522af436e001133", "score": "0.5073131", "text": "function setLegalText(_legalText) {\n\t\t\tlegalDivHolder = document.createElement('div');\n\t\t\tlegalDivHolder.id = 'legalDivHolder';\n\t\t\tlegalDivHolder.className = 'legalDivHolder';\n\t\t\tdocument.getElementsByTagName('body')[0].appendChild(legalDivHolder);\n\t\t\n\t\t\tlegalDivHolder.style.width = \"708px\";\n\t\t\tlegalDivHolder.style.height = \"70px\";\n\t\t\tlegalDivHolder.style.top = \"0px\";\n\t\t\tlegalDivHolder.style.padding = \"20px\";\n\t\t\tlegalDivHolder.style.position = \"absolute\";\n\t\t\tlegalDivHolder.style.display = \"none\";\n\t\t\tlegalDivHolder.style.backgroundColor = \"rgba(255,255,255,.95)\";\n\t\t\n\t\t\tlegalDiv = document.createElement('div');\n\t\t\tlegalDiv.id = 'legalDiv';\n\t\t\tlegalDiv.className = 'legalDiv';\n\t\t\tlegalDivHolder.appendChild(legalDiv);\n\t\t\n\t\t\tlegalDiv.innerHTML = _legalText;\n\t\t\n\t\t\tlegalDiv.style.position = \"absolute\";\n\t\t\tlegalDiv.style.top = \"30px\";\n\t\t\tlegalDiv.style.width = \"698px\"\n\t\t\tlegalDiv.style.height = \"50px\";\n\t\t\tlegalDiv.style.overflow = \"auto\";\n\t\t\tlegalDiv.style.fontFamily = \"Arial\";\n\t\t\tlegalDiv.style.fontSize = \"11px\";\n\t\t\tlegalDiv.style.color = \"#333333\";\n\t\t\tlegalDiv.style.textAlign = \"left\";\n\t\t\tlegalDiv.style.backgroundColor = \"rgba(255,255,255,0)\";\n\t\t\n\t\t\tlegalClose = document.createElement('div');\n\t\t\tlegalClose.id = 'legalClose';\n\t\t\tlegalClose.className = 'legalClose';\n\t\t\tlegalDivHolder.appendChild(legalClose);\n\t\t\n\t\t\tlegalClose.style.position = \"absolute\";\n\t\t\tlegalClose.style.display = \"innerBlock\";\n\t\t\tlegalClose.style.top = \"5px\";\n\t\t\tlegalClose.style.right = \"30px\";\n\t\t\tlegalClose.style.fontFamily = \"arial\";\n\t\t\tlegalClose.style.fontSize = \"11px\";\n\t\t\n\t\t\tlegalClose.style.padding = \"2px 4px 2px\"\n\t\t\tlegalClose.style.backgroundColor = \"#d51e29\";\n\t\t\tlegalClose.style.color = \"#FFF\";\n\t\t\tlegalClose.innerHTML = \"X\";\n\t\t\n\t\t\tlegalClose.style.cursor = \"pointer\";\n\t\t\tlegalClose.style.userSelect = \"none\";\n\t\t\tlegalClose.style.webkitUserSelect = \"none\";\n\t\t\tlegalClose.style.MozUserSelect = \"none\";\n\t\t\n\t\t\tvar el = document.getElementById(\"legalClose\"),\n\t\t\t\ts = el.style;\n\t\t\tel.setAttribute(\"unselectable\", \"on\"); // For IE and Opera\n\t\t\n\t\t\tlegalClose.addEventListener('click', function () {\n\t\t\t\tlegalDivHolder.style.display = \"none\";\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "4bb1a5009e1499cf3894807c4d9a78c7", "score": "0.5061489", "text": "function initSlide()\n\t{\n\t\tvar textArray = [{compId:\"ID_txt04\" ,x:\"179\" ,y:\"143\" ,width:\"98.45\" ,expand:\"up+down\" ,align:\"center\" ,size:\"10\"},\n\t\t{compId:\"ID_txt01\" ,x:\"147\" ,y:\"19\" ,width:\"155 \",expand:\"left+right\" ,align:\"center\" ,size:\"10\",class:\"greenout\"},\n\t\t{compId:\"ID_txt06\" ,x:\"359\" ,y:\"151\" ,width:\"77.4\" ,expand:\"up\" ,align:\"center\" ,size:\"10\",class:\"greenout\"},\n\t\t{compId:\"ID_txt02\" ,x:\"11\" ,y:\"136\" ,width:\"65.4\" ,expand:\"up\" ,align:\"center\" ,size:\"10\",class:\"greenout\"},\n\t\t{compId:\"ID_txt03\" ,x:\"91\" ,y:\"132\" ,width:\"40.2\" ,expand:\"left\" ,align:\"right\" ,size:\"10\"},\n\t\t{compId:\"ID_txt05\" ,x:\"312\" ,y:\"132\" ,width:\"40.2\" ,expand:\"right\" ,align:\"left\" ,size:\"10\"},\n\t\t{compId:\"ID_txt10\" ,x:\"179\" ,y:\"309\" ,width:\"98.45\" ,expand:\"up+down\" ,align:\"center\" ,size:\"10\"},\n\t\t{compId:\"ID_txt11\" ,x:\"370\" ,y:\"294\" ,width:\"68.4\" ,expand:\"down\" ,align:\"center\" ,size:\"10\",class:\"greenout\"},\n\t\t{compId:\"ID_txt08\" ,x:\"12\" ,y:\"293\" ,width:\"65.4\" ,expand:\"down\" ,align:\"center\" ,size:\"10\",class:\"greenout\"},\n\t\t{compId:\"ID_txt09\" ,x:\"91\" ,y:\"299\" ,width:\"40.2\" ,expand:\"left\" ,align:\"right\" ,size:\"10\"},\n\t\t{compId:\"ID_txt12\" ,x:\"225\" ,y:\"358\" ,width:\"40.2\" ,expand:\"right\" ,align:\"left\" ,size:\"10\"},\n\t\t{compId:\"ID_txt14\" ,x:\"124\" ,y:\"400\" ,width:\"213\" ,expand:\"down\" ,align:\"center\" ,size:\"10\",class:\"greenout\"},\n\t\t{compId:\"ID_txt13\" ,x:\"3\" ,y:\"386\" ,width:\"72.5\" ,expand:\"down\" ,align:\"center\" ,size:\"10\",class:\"greenout\"},\n\t\t{compId:\"ID_txt07\" ,x:\"1\" ,y:\"213\" ,width:\"90.4\" ,expand:\"right\" ,align:\"left\" ,size:\"10\",class:\"greenout\"}];\t\t\t\t\t\t\n\t\t\n\t\t//Add each text object into the new stage\n\t\tvar tComp;\t\t\t\t\n\t\tfor(var i = 0;i<textArray.length;i++)\n\t\t{\n\t\t\ttextArray[i].div = \"canvasId\";\n\t\t\ttComp = getCJSElement(\"TEXT\",textArray[i],\"canvasId\");\n\t\t\tchildStage.addChild(tComp);\n\t\t}\n\t\tupdate = true;\n\t\tchildStage.update();\n\t}", "title": "" }, { "docid": "87ccff5dfa0b36bba24b5b77e5d97ca2", "score": "0.505356", "text": "function showAnswersPart(text) {\n var qpart = document.querySelector(\".answer-part\");\n qpart.style.display = \"flex\";\n qpart.innerHTML = \"<p>\" + text + \"</p>\";\n }", "title": "" }, { "docid": "bd023fe5c98f5aa40e9a685ad1e41a05", "score": "0.5047194", "text": "toHtml()\n\t{\n\t\tvar answer = '<div class=\"course-card-panel\">'\n\t\t+'<div id=\"course-card-header\" class=\"course-card-header-hard\">'\n\t\t+'<h3 id=\"course-title\">'+this.name+'</h3>'\n\t\t+'<div id=\"semester-info\"class=\"personal-row\"\">'\n\t\t+'<p id=\"card-semeter\" class=\"semester\">Semster '+this.semester+' </p>'\n\t\t+'<p class=\"card-year semester\">'\n\t\t+'<svg width=\"1\" height=\"24\" viewBox=\"0 0 1 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><line x1=\"0.5\" y1=\"2.18557e-08\" x2=\"0.499999\" y2=\"24\" stroke=\"#E2E8F0\"/></svg> '\n\t\t+this.year+'</p>'\n\t\t+'</div>'\n\t\t+'</div>'\n\t\t+'<p>'+this.department+'<br />'+this.university+'</p>'\n\t\t+'<div class=\"panel-btn personal-row space-between\">'\n\t\t+'<div class=\"flex-start\"><a href=\"/course-page.html?course_id='\n\t\t+ this.code + '\" class=\"secondary-btn\">Go to course</a></div>'\n\t\t+'</div>'\n\t\t+'</div>';\n\t\treturn answer;\n\t}", "title": "" }, { "docid": "ad6eda8cebaef5ad58d83d897e3d0c52", "score": "0.5042852", "text": "solutionContent(){\n this.iFrameUserContent = \"<style>\" + this.textAreaPracticeCss + \"</style>\" + this.textAreaPracticeHtml;\n\n this.textAreaPracticeCss =\n this.$el.children[1].innerHTML\n .split(\"</span>\")[0]\n .replace(\"<span>\", \"\")\n .replace(/\\s[^\\S]/g, \"\")\n .replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\")\n .replace(/(\\*\\/)[^\\}]/g, \"$1\\n\")\n .replace(/(\\/\\*)/g, \"\\n\\n$1\")\n .replace(/(\\{)\\s(\\w+)/g, \"$1\\n $2\")\n .replace(/(;)\\s(\\w+)/g, \"$1\\n $2\")\n .replace(/(;)\\s(\\})/g, \"$1\\n$2\")\n .replace(/(\\})\\s?(\\S)/g, \"$1\\n\\n$2\")\n .trim();\n\n this.textAreaPracticeHtml =\n this.$el.children[1].innerHTML\n .split(\"</span>\")[1]\n .replace(/(\\s){2,}/gm, \" \")\n .replace(/(<\\/?\\w+>)/g, \"\\n$1\")\n .replace(/>\\s?</g,\">\\n<\")\n .replace(/(>)\\s?(\\w+)/g,\"$1\\n $2\")\n .replace(/(<\\w+>)\\s?(\\w+)/g, \"$1\\n $2\")\n .trim();\n }", "title": "" }, { "docid": "2f50a79675aac54754f5cdc3c2282020", "score": "0.5042373", "text": "function decreaseOutputDiv(new_font_size) {\t\n \t// get the contents of the post\n \t\tvar the_post = $('#edgeless_field1').val(); \t\n \t// set a variable to the length\n \t\tvar post_size = the_post.length; \t\n \t// set the size of the text entry field to that variable.\n \t\t$('#edgeless_field1').attr('size', post_size); \t\n \t// divide the font size by 25 - we want a rational number\n \t\tvar multiple = new_font_size / 25; \t \t\n \t// we are going to multiply by 1 plus the rational number above \t\n \t\tvar multiplier = multiple; \t\n \t// set our new width to be the existing width times that value\n \t\tvar new_width = ($('#post_text_output').width()) * multiplier;\n \t// call the anonymous function to set the width of the post_text_output div\n\t\t\tsetNewWidth(new_width); \t\n }", "title": "" }, { "docid": "1d2c450088b46e3ae13aba2ca764784e", "score": "0.50350547", "text": "function construirEstadisticas() {\n console.log(\"Usuario administrador trata de ver estadisticas\");\n var estadisticasGeneralesHTML = estadisticasGenerales();\n\n\n var fullHtml = '<div id=\"divEstadisticas\"><div id=\"divGenerales\">' + estadisticasGeneralesHTML + '</div> <div id=\"divParticulares\"></div></div>';\n\n $(\"#mainDiv\").html(fullHtml);\n estadisticasParticulares(-1);\n}", "title": "" }, { "docid": "cc11b2e02dc292efb7bbc8e500a585e1", "score": "0.5033005", "text": "display () {\n if(!this.should_display){\n return;\n }\n ctx.textBaseline = \"hanging\";\n ctx.fillStyle = this.color;\n ctx.font = (this.font_height * canvas.width) / curr_scene.inside_dimensions.x +\n \"px Lucida Console, Monaco, monospace\";\n // todo: have x dimension affect x and y dimension affect y\n var pos = this.position.scale(canvas.width / curr_scene.inside_dimensions.x);\n ctx.fillText(this.text, pos.x, pos.y);\n }", "title": "" }, { "docid": "a5da1dc59985f70cdacc4affd86a01bb", "score": "0.5029652", "text": "function setContent(){\n // Overtflow\n if(options.overflow == false){\n if(width*1 + 50 > windowW()){\n height = (windowW() - 50) * height / width;\n width = windowW() - 50;\n }\n if(height*1 + 50 > windowH()){\n width = (windowH()-50) * width / height;\n height = windowH() - 50;\n }\n }\n var url = link;\n type = 'multimedia';\n type = 'img';\n content='<img src=\"'+link+'\" width=\"100%\" height=\"100%\"/>';\n \n return content;\n}", "title": "" }, { "docid": "d733f402f91f433c47b16dbac76d42a2", "score": "0.5028611", "text": "_measure() {\n\t\tthis.cardBody.style.display = \"block\";\n\t\tthis.infoBody.style.display = \"block\";\n\n\t\tthis.detailWidth = this.cardDetail.getBoundingClientRect().width;\n\t\tthis.infoHeight = this.infoBody.getBoundingClientRect().height;\n\t\tthis.contentHeight = this.cardBody.getBoundingClientRect().height - this.infoHeight;\n\n\t\tif(!this.expanded) {\n\t\t\tthis.cardBody.style.display = \"none\";\n\t\t}\n\t\tif(!this.infoOpen) {\n\t\t\tthis.infoBody.style.display = \"none\";\n\t\t}\n\n\t\tif(this.expanded) {\n\t\t\tthis.cardSubject.style.transform = `translateX(${-this.detailWidth + 10}px)`;\n\t\t}\n\n\t}", "title": "" }, { "docid": "fe80fdab07005d41301aac91cae59402", "score": "0.5023553", "text": "function increaseOutputDiv(new_font_size) { \t\n \t// divide the font size by 25 - we want a rational number\n \t\tvar multiple = new_font_size / 25; \t \t\n \t// we are going to multiply by 1 plus the rational number above \t\n \t\tvar multiplier = 1 + multiple; \t \t\n \t// set our new width to be the existing width times that value (1 + (font size / 40))\n \t\tvar new_width = ($('#post_text_output').width()) * multiplier;\n \t// call the setter so that this info is persisted\n\t\t\tsetNewWidth(new_width);\n }", "title": "" }, { "docid": "ca50f4b2496a3d7435add476928bfc5e", "score": "0.5014093", "text": "drawCanvas(maxWidth = this.defaultSize, maxHeight = maxWidth, forceSize, unit = 'px', wiggleRoom = 20) {\n try {\n if (isNaN(maxWidth) || isNaN(maxHeight)) throw 'Width and Height must be numbers'; // what if it is a non-number object???\n if (maxWidth <= 0 || maxHeight <= 0) throw 'Width and Height must be positive numbers';\n if (this.points.length === 0) throw \"Cannot draw canvas with no elements.\"\n }\n catch(err) {\n console.log(err);\n }\n\n this.getRange();\n\n /*\n // add a key, if speecified\n if (this.key.length > 0) {\n let keyFontSizeDummy;\n if (this.keyFont) {\n keyFontSizeDummy = this.keyFont;\n } else {\n keyFontSizeDummy = (this.horizontalRange + this.verticalRange) / 2 * 0.05; // default value of the font of the key\n }\n const keyFontSize = keyFontSizeDummy;\n\n const keyY = this.yMax + (keyFontSize * 1.5 * this.key.length + .5);\n const keyX = (this.xMin + this.xMax) / 2;\n\n let index = 0;\n this.key.forEach((line) => {\n let newText = this.addText(line.text,new PointF(keyX, keyY - index * keyFontSize * 1.5),keyFontSize,0,'center');\n newText.setColor(line.color);\n index += 1;\n });\n\n this.getRange(); // get range again, with new text added\n }\n\n */\n\n try {\n if (this.horizontalRange.zero) throw 'Cannot draw canvas horizontal range = 0';\n if (this.verticalRange.zero) throw 'Cannot draw canvas with vertical range = 0';\n }\n catch (err) {\n console.log(err);\n }\n\n\n // transform to prepare for canvas;\n this.translate(-1 * this.xMin, -1 * this.yMin);\n\n\n let scaleFactor, xScaleFactor, yScaleFactor, canvasWidth, canvasHeight;\n if (!forceSize) {\n scaleFactor = nondistortedResize(this.horizontalRange, this.verticalRange, maxWidth - wiggleRoom * 2, maxHeight - wiggleRoom * 2);\n this.rescaleSingleFactor(scaleFactor);\n canvasWidth = this.horizontalRange * scaleFactor + wiggleRoom * 2;\n canvasHeight = this.verticalRange * scaleFactor + wiggleRoom * 2;\n xScaleFactor = scaleFactor;\n yScaleFactor = scaleFactor;\n } else {\n xScaleFactor = (maxWidth - wiggleRoom * 2) / (this.horizontalRange);\n yScaleFactor = (maxHeight - wiggleRoom * 2) / (this.verticalRange);\n this.rescaleDoubleFactor(xScaleFactor, yScaleFactor);\n canvasWidth = maxWidth;\n canvasHeight = maxHeight;\n }\n\n\n\n\n let c = document.createElement('canvas');\n c.setAttribute(\"width\", String(canvasWidth) + unit);\n c.setAttribute(\"height\", String(canvasHeight) + unit);\n let ctx = c.getContext('2d');\n\n // should i make this variable?\n let dotSize = (this.horizontalRange + this.verticalRange) / 2 / 30;\n this.segments.forEach((segment) => {\n ctx.lineWidth = segment.diagramQualities.thickness;\n ctx.lineCap = segment.diagramQualities.lineCap;\n ctx.strokeStyle = segment.diagramQualities.color;\n if (segment.diagramQualities.dotted) {\n let q;\n let length = segment.getLength().getFloat();\n let theta = segment.getAngleToHorizontal().getFloat();\n let Ndots = length / dotSize;\n for (q = 0; q < Ndots; q++) {\n if (q % 2 === 0) {\n ctx.beginPath();\n ctx.moveTo(wiggleRoom + segment.point1.x.getFloat() + length * q / Ndots * Math.cos(theta), canvasHeight - wiggleRoom - segment.point1.y.getFloat() - length * q / Ndots * Math.sin(theta));\n ctx.lineTo(wiggleRoom + segment.point1.x.getFloat() + length * (q + 1) / Ndots * Math.cos(theta), canvasHeight - wiggleRoom - segment.point1.y.getFloat() - length * (q + 1) / Ndots * Math.sin(theta));\n ctx.stroke();\n }\n }\n } else if (segment.diagramQualities.dashed) {\n let length = segment.getLength().getFloat();\n let Ndashes = 7;\n //let solidToSpaceRatio = 0.5;\n let Lsolid = length / Ndashes / 2;\n ctx.beginPath();\n ctx.setLineDash([Lsolid]);\n ctx.moveTo(wiggleRoom + segment.point1.x.getFloat(), canvasHeight - wiggleRoom - segment.point1.y.getFloat());\n ctx.lineTo(wiggleRoom + segment.point2.x.getFloat(), canvasHeight - wiggleRoom - segment.point2.y.getFloat());\n ctx.stroke();\n } else { /// normal (not dotted) lines\n ctx.beginPath();\n ctx.setLineDash([]);\n ctx.moveTo(wiggleRoom + segment.point1.x.getFloat(), canvasHeight - wiggleRoom - segment.point1.y.getFloat());\n ctx.lineTo(wiggleRoom + segment.point2.x.getFloat(), canvasHeight - wiggleRoom - segment.point2.y.getFloat());\n ctx.stroke();\n }\n });\n\n ctx.setLineDash([]);\n\n // 9-2-2020: still working on this and adapting it to the new 'mathematical function objects'\n /// I need to create the 'float function' => that will make this more efficient!!!\n this.curves.forEach((curveObject) => { /// in desperate need of some refartoring, to make it easier to comprehend what's going on\n // too many different options in their own method and too much repeated code\n ctx.lineWidth = curveObject.diagramQualities.thickness; // make these a\n ctx.lineCap = curveObject.diagramQualities.lineCap;\n ctx.strokeStyle = curveObject.diagramQualities.color; // can change later!\n let nSteps = 200;\n let thisXVal, thisYVal, lastXVal, lastYval;\n const curveXmin = curveObject.xMin.getFloat(); // do not confuse these with\n const curveYmin = curveObject.yMin.getFloat();\n const curveXmax = curveObject.yMax.getFloat();\n const curveYmax = curveObject.xMax.getFloat();\n let step = (curveXmax - curveXmin) / nSteps;\n lastXVal = curveXmin; // why do i need this?\n lastYval = curveObject.floatFunc(curveXmin);\n if (curveObject.cutoff) {\n for (thisXVal = curveXmin; thisXVal <= curveXmin; thisXVal += step) {\n thisYVal = curveObject.floatFunc(thisXVal); // make a 'float function'\n if (thisYVal > yMax || thisYVal < yMin) { // cutoff\n // pass\n } else {\n ctx.moveTo(wiggleRoom + (lastXVal - this.xMin) * xScaleFactor, canvasHeight - wiggleRoom - (lastYval - this.yMin) * yScaleFactor);\n ctx.lineTo(wiggleRoom + (thisXVal - this.xMin) * xScaleFactor, canvasHeight - wiggleRoom - (thisYVal - this.yMin) * yScaleFactor);\n ctx.stroke();\n }\n\n lastXVal = thisXVal;\n lastYval = thisYVal;\n }\n } else if (curveObject.dashed) {\n let dashOn = true;\n let dashLength = curveObject.dashLength;\n let sinceLastDashStart = 0;\n\n let x1,x2,y1,y2;\n let k;\n\n for (k = 0; k < nSteps; k++) { // a slightly different method here\n x1 = curveXmin + step * k;\n x2 = x1 + step;\n y1 = curveObject.floatFunc(x1);\n y2 = curveObject.floatFunc(x2);\n\n sinceLastDashStart += Math.sqrt((x2 - x1)**2 + (y2 - y1)**2);\n if (sinceLastDashStart > dashLength) {\n dashOn = !dashOn;\n sinceLastDashStart = 0;\n }\n if (dashOn) {\n ctx.moveTo(wiggleRoom + (x1 - this.xMin) * xScaleFactor, canvasHeight - wiggleRoom - (y1 - this.yMin) * yScaleFactor);\n ctx.lineTo(wiggleRoom + (x2 - this.xMin) * xScaleFactor, canvasHeight - wiggleRoom - (y2 - this.yMin) * yScaleFactor);\n ctx.stroke();\n }\n }\n\n /// so, i cannot have a yForced value on a dashed object!\n // need to fix that!\n\n } else { // no cutoffs or dashes\n for (thisXVal = curveXmin; thisXVal <= curveXmin; thisXVal += step) {\n thisYVal = curveObject.floatFunc(thisXVal);\n\n ctx.moveTo(wiggleRoom + (lastXVal - this.xMin) * xScaleFactor, canvasHeight - wiggleRoom - (lastYval - this.yMin) * yScaleFactor);\n ctx.lineTo(wiggleRoom + (thisXVal - this.xMin) * xScaleFactor, canvasHeight - wiggleRoom - (thisYVal - this.yMin) * yScaleFactor);\n ctx.stroke();\n\n lastXVal = thisXVal;\n lastYval = thisYVal;\n }\n }\n\n });\n\n this.circles.forEach((circleObject) => {\n ctx.fillStyle = circleObject.fillColor;\n ctx.strokeStyle = circleObject.lineColor;\n ctx.lineWidth = circleObject.lineThickness;\n\n ctx.beginPath();\n ctx.arc(wiggleRoom + circleObject.center.x.getFloat(), canvasHeight - wiggleRoom - circleObject.center.y.getFloat(), circleObject.radius.getFloat(), 0, Math.PI * 2);\n ctx.stroke();\n if (circleObject.filled) {ctx.fill();}\n });\n\n /*\n this.arcs.forEach((arcObject) => {\n /// ARC SECTION\n ctx.strokeStyle = \"#000000\";\n ctx.fillStyle = \"#FFFFFF\";\n // ctx.fillStyle = \"#FFFFFF\";\n ctx.lineWidth = 2;\n\n let start = -1 * arcObject.startRadians;\n let end = -1 * arcObject.endRadians;\n let anticlockwise = true;\n\n ctx.beginPath();\n\n /// THIS METHOD IS AN ABSOLUTE NIGHTMARE!\n // let anticlockwise, start, end;\n // if (!arcObject.crossZeroLine) {\n // start = arcObject.lesserAngle;\n // end = arcObject.greaterAngle;\n // console.log(start, end);\n // anticlockwise = true;\n // start *= -1;\n // if (start === 0) {\n // end *= -1;\n // } else if (start <= -1 * Math.PI + 1e-10) {\n // end *= -1;\n // }\n // if (start < Math.PI / 2 && end > 3 * Math.PI / 2) {\n // start *= -1;\n // }\n // console.log(start, end);\n // } else { // crosses zero line\n // anticlockwise = true;\n // start = arcObject.greaterAngle;\n // end = arcObject.lesserAngle;\n // console.log(start, end);\n // start *= -1;\n // end *= -1;\n // // works so far, but will probably break if I keep testing it!\n // }\n ctx.arc(wiggleRoom + arcObject.center.x, canvasHeight - wiggleRoom - arcObject.center.y, arcObject.radius, start, end, anticlockwise);\n ctx.stroke();\n });\n*/\n /// texts come last so they are not written over\n this.texts.forEach((textObject) => {\n const fontSize = textObject.relativeFontSize;\n ctx.font = `${fontSize}${unit} ${textObject.font}`;//String(font) + unit + \" \" + String(textObject.font);\n ctx.fillStyle = textObject.color;\n ctx.textAlign = textObject.alignment;\n ctx.textBaseline = textObject.baseline;\n const rotation = textObject.rotationAngle ? (textObject.rotationAngle.convertToRadians()).getFloat() : 0;\n \n console.log(ctx.textAlign);\n console.log(ctx.textBaseline);\n\n //// MUST ADD IF/THEN STATEMENT TO SET THE REFERENCE POINT BASED UPON THE TEXT ALIGNMENT AND BASELINE\n // not sure what this means? i have that in the text object definition\n\n if (Math.abs(rotation) > 1e-10) {\n ctx.translate(wiggleRoom + textObject.referencePoint.x.getFloat(), canvasHeight - textObject.referencePoint.y.getFloat() - wiggleRoom);\n ctx.rotate(-1 *rotation);\n ctx.fillText(textObject.letters, 0, 0);\n ctx.rotate(rotation);\n ctx.translate(-1 * (wiggleRoom + textObject.referencePoint.x.getFloat()), -1 * ( canvasHeight - textObject.referencePoint.y.getFloat() - wiggleRoom));\n } else {\n ctx.fillText(textObject.letters, wiggleRoom + textObject.referencePoint.x.getFloat(), canvasHeight - textObject.referencePoint.y.getFloat() - wiggleRoom);\n }\n\n });\n\n\n // before finishing, undo transformations\n if (!forceSize) {\n this.rescaleSingleFactor(1 / scaleFactor);\n } else {\n this.rescaleDoubleFactor(1 / xScaleFactor, 1 / yScaleFactor);\n }\n this.translate(this.xMin, this.yMin);\n\n return c\n }", "title": "" }, { "docid": "6d6f229b20c58b13cd3caecf963366e0", "score": "0.5009666", "text": "bottext(value) {\n const div1 = this.renderer.createElement(\"div\");\n div1.setAttribute(\"class\", \"container\");\n this.renderer.appendChild(this.div.nativeElement, div1);\n const Img = this.renderer.createElement(\"img\");\n Img.setAttribute(\"src\", \"/assets/botimage1.png\");\n Img.setAttribute(\"style\", \"width:11%\");\n Img.setAttribute(\"class\", \"right\");\n this.renderer.appendChild(div1, Img);\n const p = this.renderer.createElement('p');\n p.innerHTML = value;\n this.renderer.appendChild(div1, p);\n this.scrollToBottom();\n }", "title": "" }, { "docid": "e379f442b93560740cb62e7231ff952e", "score": "0.500875", "text": "actualizaTexto(){\n if(this.text.text != \"\"){\n this.textCont++;\n this.text.y-=5;//si hay un texto activo va subiendo en la y durante tres segundos\n if(this.textCont >= 3){\n this.textB = false;\n this.text.text = \"\";//despues desaparece\n }\n } \n }", "title": "" }, { "docid": "75cef7981c34efbbef32c26cd7a32648", "score": "0.5003391", "text": "function criarCases() {\n var section = $(\"#cases\");\n section[0].appendChild(criarTitulo('<span>CASES</span> - ACADÊMICOS'));\n section[0].appendChild(criarDescricao('<b>RAFAEL CHIELLE</b> - <i>Formado - Programador - Sysmo Sistemas</i><br>Ótimo curso, possui tutores qualificados para o ensino da grade curricular e para atender as dúvidas dos acadêmicos. O curso conta também com várias oportunidades para o ingresso ao mercado de trabalho.'));\n section[0].appendChild(criarDescricao('<b>DOUGLAS JULIANO RONALDO</b> - <i>Formado - TI - UNOESC</i><br>Sou Douglas Juliano Roldo me formei em 2017 em Ciência da Computação, pela Unoesc São Miguel, o curso me apresentou um leque de oportunidades, onde estudei várias áreas da computação. O curso me ajudou profissionalmente e tecnicamente, os professores são além docentes são meus amigos até hoje, posso dizer que o curso mudou a minha vida, pois o aprendizado foi de grande valia.'));\n section[0].appendChild(criarDescricao('<b>LUCAS MOREIRA</b> - <i>Formado - Programador - Sysmo Sistemas</i><br>O curso de ciência da computação da Unoesc campus São Miguel do Oeste oferece uma grande quantidade de oportunidades mensais para trabalhar nas empresas da região.'));\n}", "title": "" } ]
73c2805efcc0c671a6f447e59cd35e8a
start function which reload a new word
[ { "docid": "717f551f73bcf44e62ecbb31ebaeb448", "score": "0.0", "text": "function again(){\n var random_word = Math.round(Math.random()*10);//Math.floor(Math.random()*100);\n word = words[random_word];\n word_length = word.length;\n var letters=word.split(\"\").sort();\n\tdocument.getElementById(\"to_strt\").style.display ='none';\n\t//start main div\n main_div = document.createElement('div');\n main_div.setAttribute(\"id\", \"main_div\");\n\tmain_div.setAttribute(\"class\", \"maindiv\");\n document.body.appendChild(main_div);\n\t//end main div\n\t//start container \n\tvar container_div = document.createElement('div');\n container_div.setAttribute(\"id\", \"container_div\");\n main_div.appendChild(container_div);\n\t//end container\n\t//start set button \n for(i=0;i<word_length;i++){\n var mybutton = document.createElement('button');\n mybutton.setAttribute(\"value\", letters[i]);\n\t mybutton.setAttribute(\"id\", i);\n\t mybutton.setAttribute(\"class\", \"value_char\");\n container_div.appendChild(mybutton);\n\t document.getElementsByTagName(\"button\")[i].innerHTML = letters[i];\n\t mybutton.style.backgroundColor = '#'+(Math.random()*0xFFFFFF<<0).toString(16);\n\t mybutton.addEventListener('click', getvalue);\n\t}\n\t//end set button\n\t// start create text box\n\t var answer = document.createElement('input');\n answer.setAttribute(\"type\",\"text\");\n answer.setAttribute(\"id\",\"ans\");\n\t answer.setAttribute(\"class\",\"answer\");\n\t answer.setAttribute(\"readonly\",\"true\");\n container_div.appendChild(answer);\n\t//end create text box\n\t//start submit button\n\tvar submit_button = document.createElement('button');\n submit_button.setAttribute(\"id\",\"id_submit\");\n\tsubmit_button.setAttribute(\"class\",\"submit\");\n\tcontainer_div.appendChild(submit_button);\n\tdocument.getElementById(\"id_submit\").innerHTML = \"submit\";\n\tsubmit_button.addEventListener('click', tosubmit);\n\tsubmit_button.addEventListener('click', again);\n //end submit button\n\t//start score\n\tvar score = document.createElement('div');\n score.setAttribute(\"id\",\"id_score\");\n\tscore.setAttribute(\"class\",\"score\");\n\tmain_div.appendChild(score);\n\tdocument.getElementById(\"id_score\").innerHTML= \"SCORE : \" + score_number;\n\t//end score\n\t//start number of words\n\tvar number_words = document.createElement('input');\n\tnumber_words.setAttribute(\"type\",\"text\");\n number_words.setAttribute(\"id\",\"number_words\");\n\tnumber_words.setAttribute(\"class\",\"num_words\");\n\tnumber_words.setAttribute(\"readonly\",\"true\");\n\tmain_div.appendChild(number_words);\n\tdocument.getElementById(\"number_words\").value= num_try ;\n\t//start number of words\n\t//start clear button\n\tvar clear_all = document.createElement('button');\n clear_all.setAttribute(\"id\",\"id_delete\");\n\tclear_all.setAttribute(\"class\",\"delete\");\n\tcontainer_div.appendChild(clear_all);\n\tdocument.getElementById(\"id_delete\").innerHTML= \"CLEAR\";\n\tclear_all.addEventListener('click', to_clear);\n\t//end clear button\n\t//start time\n\tcountdiv = document.createElement(\"div\");\n countdiv.setAttribute(\"id\", \"countdown\");\n\tcountdiv.setAttribute(\"class\", \"conut_down\");\n main_div.appendChild(countdiv);\n count = document.getElementById(\"countdown\");\n countdown = setInterval(function(){\n secondpass(); \n },1000);\n function secondpass(){\n var minutes = Math.floor(seconds / 60);\n var remsecond = seconds%60;\n\t\t// to makr a result as 0:08\n if(seconds<10){\n remsecond = \"0\" + remsecond;\n }\n \n if(seconds > 0){\n\t\tdocument.getElementById(\"countdown\").innerHTML = minutes + \":\" + remsecond;\n seconds -=1;\n }\n\t else{\n\t\tclearInterval(countdown);\n\t }\n\t}\n\t if(seconds === 0){\n\t\t\n\t\t main_div.remove();\n\t\t //start the result after time end\n\t\t var main_result = document.createElement(\"div\");\n main_result.setAttribute(\"id\", \"id_result\");\n\t main_result.setAttribute(\"class\", \"result\");\n document.body.appendChild(main_result);\n\t\t//end the result after time end\n\t\t//start to play again\n\t\t var play_again = document.createElement(\"a\");\n play_again.setAttribute(\"href\", \"level2.HTML\");\n\t play_again.setAttribute(\"class\", \"playagain\");\n main_result.appendChild(play_again);\n\t\t //end to play again\n\t\t if(score_number>=5){\n\t // start if solution is good\n\t\t var good_result = document.createElement(\"div\");\n good_result.setAttribute(\"id\", \"good_result\");\n\t good_result.setAttribute(\"class\", \"goodresult\");\n main_result.appendChild(good_result);\n\t\t // end if solution is good\n\t\t //start to next level\n\t\t leval2 = document.createElement(\"a\");\n leval2.setAttribute(\"href\", \"level3.HTML\");\n\t leval2.setAttribute(\"class\", \"level2\");\n main_result.appendChild(leval2);\n\t\t //end to next level\n\t\t }\n\t\t else{\n\t\t// start if solution is bad\n\t var bad_result = document.createElement(\"div\");\n bad_result.setAttribute(\"id\", \"bad_result\");\n\t bad_result.setAttribute(\"class\", \"badresult\");\n main_result.appendChild(bad_result);\n\t\t // end if solution is bad\n\t\t }\n\t }\n\t //end time\n }", "title": "" } ]
[ { "docid": "9bf9e77569451bb7310768b294ec0e76", "score": "0.6468475", "text": "function editWord(){\r\n\tconsole.log(\"editword() called.\");\r\n}", "title": "" }, { "docid": "25d3af385349a80dcdf56ad7c3b12636", "score": "0.63582295", "text": "function changeWord() {\n PostRequest(RANDOM_WORD_GIVEN_USED + currentTurn.category,\n usedWords, RESPONSE_TEXT,\n data => {\n console.log('Random Word Chosen : ', data);\n setGameState(prevGameState => {\n const newUsedWords = prevGameState.usedWords;\n\n /** TODO : Only disabled for development\n * To be uncommented once we have enough words\n */\n // newUsedWords[categoryKey].push(data);\n\n const newGameState = {\n ...prevGameState,\n usedWords: newUsedWords,\n currentTurn: {\n ...prevGameState.currentTurn,\n word: data,\n },\n };\n broadcastGameState(newGameState);\n return newGameState;\n });\n },\n error => {\n console.error(error, 'No words left');\n },\n );\n }", "title": "" }, { "docid": "ba6bc032091450bbef8a755749216775", "score": "0.6332186", "text": "function refreshDisplay(){\r\n\tvar newWord = listOfWords[currentWord].word;\r\n\tvar newDef = listOfWords[currentWord].def;\r\n\tvar newExample = listOfWords[currentWord].example;\r\n\t//console.log(\"Current Word:\")\r\n\t//console.log(newWord);\r\n\t\r\n\t$(\"#word\").html(newWord);\r\n\t$(\"#definition\").html(newDef);\r\n\t$(\"#example\").html(newExample);\r\n}", "title": "" }, { "docid": "2f62b471191b90b3faeb0ae82b4132d6", "score": "0.63285065", "text": "function setNewWord(w)\n{\n\tif (words.length==0) {\n\t\treturn false;\n\t}\n\tvar r = getRndInteger(0, words.length-1);\n\tw.text = words[r].text;\n\tw.cat = words[r].cat;\n\tw.x = getRndInteger(20,workWidth-20);\n\tw.y = 0;\n\tw.tipo = getRndInteger(0, 3);\n\tw.active = true;\n\tw.movable = false;\n refleshCoordinates(w);\n\twords.splice(r,1); \n\treturn true;\n}", "title": "" }, { "docid": "dc51b5571093dafe8433d9f8104d3e9b", "score": "0.62848777", "text": "function addWord() {\n var wordEl = $(\"#introBanner .introContainer h1\");\n if (wordEl.text().length < words[currWord].length) {\n wordEl.text(words[currWord].slice(0, wordEl.text().length+1));\n setTimeout(addWord, 100);\n } else {\n currWord = (currWord + 1) % words.length;\n flashLineListener = setInterval(flashLine, 600);\n setTimeout(changeWord, 4000);\n }\n }", "title": "" }, { "docid": "1825fd22deb822e38b66667de8c52475", "score": "0.6208131", "text": "function reloadGame() {\r\n\tstr2pos(orginal_game); //Use that to rebuild the game\r\n}", "title": "" }, { "docid": "08f09a9c9b28fc8215b10f37526ed62d", "score": "0.6178495", "text": "navigateToWord(word) {\n this.updateWordInHistory(word);\n this.loadWord(word);\n }", "title": "" }, { "docid": "ef9d7ba1baa4bd8544e36a68ad9c6798", "score": "0.61236936", "text": "function showWord() {\n const randIndex = Math.floor(Math.random() * app.wordList.length);\n app.newWord = app.wordList[randIndex];\n $(\"#current-word\").html(app.newWord);\n}", "title": "" }, { "docid": "d089801e0af8612a6886a5e209446e05", "score": "0.6086555", "text": "function startNew(){\n\tlocation.reload();\n\tnewGame();\n}", "title": "" }, { "docid": "a705b1d4a0c53b3ff01b65ff201d5350", "score": "0.6058695", "text": "startGame() {\n this.activePhrase = this.RandomPhrase;\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "f08fd71cdbccd625c4464531fc1e9781", "score": "0.6033109", "text": "function reloadDocumentList() {\n}", "title": "" }, { "docid": "29d3d83a8fee5fc425fdeb83ccb5e0d5", "score": "0.6021047", "text": "function restart() {\n\ttl.restart();\n}", "title": "" }, { "docid": "5491dc25c82b2e409b0576758b645a32", "score": "0.5996375", "text": "readInWord (){\n readWord = woordje;\n if (readWord!= '') {\n this.spawnWord();\n }\n else {\n\n }\n }", "title": "" }, { "docid": "46b527ca1642fc80572e9115357140c1", "score": "0.59961826", "text": "function reloadDocument(caseID, editMode) {\n $(\".result-snippet\").each(function() {\n // clear any cases being viewed\n $(this).removeClass(\"viewing\").css(\"background-color\", 'gray');\n });\n\n var id = caseID;\n $(\"#res-\" + id).addClass(\"viewing\").css(\"background-color\", '#444444');\n\n $(\"#document-viewer\").html(\"\");\n $(\"#hashtag-container\").html(\"\");\n\n getHashtags(id, editMode, function(hashtags) {\n // show the selected case\n $(\"#\" + id + \".full-doc\").clone().appendTo(\"#document-viewer\").fadeIn(\"fast\"), function() {\n $('#document-viewer').show();\n }\n $(\"#document-viewer\").scrollTop(0);\n $(\"#hashtag-container\").html(hashtags);\n });\n}", "title": "" }, { "docid": "23acfacf83d3dfebfc9ca54ffe3c0b02", "score": "0.599203", "text": "function restart() {\n speechRec.start();\n }", "title": "" }, { "docid": "d73d146f199a5e211bfa99992b47f478", "score": "0.5989684", "text": "function restartGame() {\n randomWord = words[Math.floor(Math.random() * words.length)];\n eval(randomWord);\n guessesRemaining = 10;\n newWord();\n document.getElementById(\"listedLetters\").innerHTML = \"<li id='guess'> </li>\";\n var gameStart = \"Enter letter to make a guess!\";\n document.querySelector(\"#game\").innerHTML = gameStart;\n }", "title": "" }, { "docid": "1347d4c6399c02a715ddb2960599f27c", "score": "0.5989161", "text": "function restart() {\n\t\t\ttl.restart();\n\t\t}", "title": "" }, { "docid": "d796623d95752e6639e977285c80b664", "score": "0.5965162", "text": "function startNewGame(){\n\n\t// This just graps the frist word in Hangman array and creates a WORD object out of it.\n\tcurrentWord = new WORD(Hangman.shift());\n\tguessesLeft = 10; // resets \n\t//CLEAR();\n\tconsole.log(\"\\n\", currentWord.displayWord());// displays word initally\n\tplayGame();\n}//END startNewGame", "title": "" }, { "docid": "26b8099f1c5dab94f1e367830a0ea80c", "score": "0.5925011", "text": "function displayOldWord(){\t\t\t\t\t\t\n\t\t\toldWord = RandomArrayI(usedWordsArray);\n\t\t\t$(\"#the-word\").text(oldWord);\n\t\t}", "title": "" }, { "docid": "68cd3d9226353fee9ef65c20dee82482", "score": "0.592401", "text": "function refreshPhrases(){\n noun = fs.readFileSync('./phrases/noun.txt', 'utf8').split(\"\\r\\n\");\n verb = fs.readFileSync('./phrases/verb.txt', 'utf8').split(\"\\r\\n\");\n exclamatory = fs.readFileSync('./phrases/exclamatory.txt', 'utf8').split(\"\\r\\n\");\n endphrase = fs.readFileSync('./phrases/endphrase.txt', 'utf8').split(\"\\r\\n\");\n}", "title": "" }, { "docid": "cc2452a58b436e078bcb298a5f42be11", "score": "0.5907865", "text": "function Restart() {\n\n GetCity();\n console.log(_cityResult.word);\n\n // Add city to array control no duplicate\n _citiesDone.push(_cityResult.id);\n\n if (_citiesDone.indexOf(_cityResult.id) !== -1) {\n // catch html elements\n var _currentWordwordDiv = document.getElementById(\"currentWord\");\n var _imgTextP = document.getElementById(\"imgText\");\n var _imgCityImg = document.getElementById(\"imgCity\");\n var _cityNameH1 = document.getElementById(\"cityName\");\n var _missingLettersSpan = document.getElementById(\"missingLetters\");\n\n // Set html values\n _currentWordwordDiv.textContent = _cityResult.word;\n _imgTextP.textContent = _cityResult.description;\n _imgCityImg.src = _cityResult.imgUrl;\n _cityNameH1.textContent = _cityResult.name;\n }\n}", "title": "" }, { "docid": "6c503eeaf299c9ee3e56e4973156b97a", "score": "0.5873458", "text": "startGame() {\n\t\tthis.currentPhrase = new Phrase(this.getRandomPhrase());\n\t\tthis.currentPhrase.addPhraseToDisplay();\n\t}", "title": "" }, { "docid": "376b93e4c99f9f6b157a0bb44fa66c3c", "score": "0.58664036", "text": "function restart()\n {\n //reloads by clicking s\n location.reload();\n }", "title": "" }, { "docid": "747521ff87bfb6fac83f1a7089ebaac8", "score": "0.5834798", "text": "function givAWord() {\n console.clear()\n dicTemp = []\n dataGiveWord = JSON.stringify({\n \"sessionId\": sessionId,\n \"action\": \"nextWord\"\n })\n doPost(dataGiveWord, givAWordSuccs)\n}", "title": "" }, { "docid": "e44e13282df508a303a0b068018ab24e", "score": "0.58322346", "text": "function next() {\n console.log(\"word: \" + game.word + \" stage: \" + game.stage);\n document.getElementById(\"card\").contentDocument.getElementById(\"text\").style.fill=\"#000000\"; \n document.getElementById(\"card\").contentDocument.getElementById(\"text\").style.letterSpacing=\"25px\"; \n game.nextWord();\n if(!game.done()) {\n game.setInput(\"\");\n displayFlashcard(game.peekWord().replace(/./g, \"_\"));\n console.log(\"Word is: \", game.peekWord());\n }\n else {\n alert(\"Winner!\");\n //call fetchWords() here again to get new words\n }\n}", "title": "" }, { "docid": "2c7a1035cfcea75bb75a28a5aaa8fcde", "score": "0.58317316", "text": "function loadWord(word_id){\r\n\tselectedWord_g = word_id;\r\n\tconsole.log(\"loadWord() called. \" + word_id);\r\n\tif(isSetWordsArray_g){\r\n\t\tfor(i = 0; i < wordsArray_g.length; i++){ //horribly inefficient\r\n\t\t\tvar wordObj = JSON.parse(wordsArray_g[i]);\r\n\t\t\tif(wordObj.word_id == word_id){\r\n\t\t\t\t$(\"#defText\").html(wordObj.definition);\r\n\t\t\t\t$(\"#notesText\").html(wordObj.notes);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "b872b5e0c6b99e80c8e953ec9565c0ed", "score": "0.58269286", "text": "function redo() {\n const timerOverlay = document.getElementsByClassName(\"timer-overlay\")[0];\n timerOverlay.classList.remove(\"timer-animation\");\n generateNewWords();\n selectWord(0);\n input.value = \"\";\n input.focus();\n document.getElementById(\"word-wrapper\").classList.add(\"appearsdown\");\n document.getElementById(\"score\").classList.add(\"slidedown\");\n document.getElementById(\"word-wrapper\").classList.remove(\"slideup\");\n document.getElementById(\"score\").classList.remove(\"appearsup\");\n redoState = 1;\n timer = 0;\n document.getElementById(\"counter\").innerText = timer;\n wrongWordsArray.length = 0;\n rightWordsArray.length = 0;\n}", "title": "" }, { "docid": "bb5d377254dd01bc299e7709c928c51f", "score": "0.58132637", "text": "reloadFunc() {\n this.gun.reload();\n this.reloadText.setVisible(false);\n this.reloadStatus = false\n }", "title": "" }, { "docid": "6706a5a6c6b0cee5a51d7478b49ac4eb", "score": "0.5806327", "text": "function startAgain() {\n location.reload();\n}", "title": "" }, { "docid": "02eb0f22e0a32caf3361a948468d9133", "score": "0.57987374", "text": "function updateCurrentWord(){\r\n\tvar currentWordData = globalVariables.child('currentWord');\r\n\tcurrentWordData.update({\r\n\t currentWord: currentWord,\r\n\t timeStamp: Firebase.ServerValue.TIMESTAMP\r\n\t});\r\n}", "title": "" }, { "docid": "57289978232e3c4abff5909ef7834a59", "score": "0.57933915", "text": "handleStart() {\n this.shuffledWordList = shuffle(this.wordList);\n this.startTimer();\n this.roundCount = 0;\n this.setWord(this.shuffledWordList[this.roundCount]);\n }", "title": "" }, { "docid": "aed526eabe6411b63f324d03975ce0ea", "score": "0.57706064", "text": "function herstarten() {\n window.location.reload();\n }", "title": "" }, { "docid": "c13ddab3b471c56d9373c9c770f098ac", "score": "0.57703525", "text": "function restart() {\n clearInterval(interval);\n reload();\n}", "title": "" }, { "docid": "42514c4ff6b4403771618cb185f50c8c", "score": "0.5767668", "text": "function recallRandomWord() {\n var randomWordData = JSON.parse(localStorage.getItem(localStorageKey1)) || [];\n if (randomWordData.length === 0 || today.diff(moment(randomWordData[0], \"L\"))) {\n wodModalText = ''; // changed\n } else {\n wodModalText = randomWordData[1];\n }\n}", "title": "" }, { "docid": "d4d9fa0920a3a561558e2c509d42ff2c", "score": "0.573814", "text": "update_text(string){\n this.text = string;\n this.words = string.split(\" \");\n this.update_blocks();\n }", "title": "" }, { "docid": "47714bfcaf3ef090e079c76db3c0871b", "score": "0.57370293", "text": "function displayNewWord(){\n\t\t\tvar chosenCategory = chooseCategory();\t\t\t\n\t\t\tcurrentWord = chosenCategory.getWord();\n\t\t\t$(\"#the-word\").text(currentWord);\n\t\t\t//save array int array int so no repeats\n\t\t\tchosenCategory.saveArrayInt();\n\t\t}", "title": "" }, { "docid": "aa8e0ffe86166c8ab6de3f53b8938ea1", "score": "0.5719145", "text": "function StartNew() {\r\n document.location.reload();\r\n}", "title": "" }, { "docid": "8898f6edb03ebbc61fb68f9d71ceee9c", "score": "0.5712614", "text": "function showWord(word,prevWord,time){\n setTimeout( function() {\n word.removeClass().addClass('loading');\n prevWord.removeClass().addClass('loaded');\n },time);\n }", "title": "" }, { "docid": "354d0863009699e36b3143c14171c8c5", "score": "0.5712499", "text": "function addWord() {\n\tvar thisWord = $( '#newWordInput' ).val();\n\tvar thisRomanization = $( '#newWordRomanization' ).val();\n\tvar thisDefinition = $( '#newWordDefinition' ).val();\n\tif ( ( thisWord != null ) && ( thisWord.length > 0 ) ) {\n\t\tvar entry = { word: thisWord, romanization: thisRomanization, definition: thisDefinition };\n\t\tvar found = false;\n\t\tfor ( var i = 0; i < words.length; i++ ) {\n\t\t\tif ( words[i].word == thisWord ) {\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( found == false ) words.push( entry );\n\t\tchrome.storage.local.set( { 'words': words }, function () {\n\t\t\tfillWordList();\n\t\t} );\n\t}\n}", "title": "" }, { "docid": "5f50871adcb0b362e20d0c68a46b2c6d", "score": "0.57107043", "text": "function start(){\n wordFinder();\n arrayDisplay();\n setup();\n}", "title": "" }, { "docid": "ac4b3c089b521c25e95c0cab3d8e0bbf", "score": "0.57024395", "text": "async function generateWord() {\n const data = await window.fetch('/word');\n const json = await data.json();\n const word = json.word;\n const goodTrad = json.trad;\n setWord(word);\n setGoodTrad(goodTrad);\n }", "title": "" }, { "docid": "c662a7c8b2588708029e24a9538941a1", "score": "0.56964016", "text": "function restart(){\n}", "title": "" }, { "docid": "58557fd91bedd4ad7eba39f11ad8b17e", "score": "0.569629", "text": "function changeTitle() {\n\t\t\t nIntervId = setInterval(flashText, 2000);\n\t\t\t}", "title": "" }, { "docid": "1a7c5933637315a9165ae6423ac80478", "score": "0.56885314", "text": "startGame(){\n this.clearKeyboard();\n this.clearScoreboard();\n restartKeysPressed();\n let randomPhrase = this.getRandomPhrase();\n this.phraseObj = new Phrase(randomPhrase);\n this.phraseObj.addPhraseToDisplay();\n }", "title": "" }, { "docid": "b9711342b31ee991b554faf99f478394", "score": "0.5666009", "text": "function startGame(lives) {\n livesRemaining = lives;\n currentWordString = wordlist[Math.floor(Math.random() * wordlist.length)];\n currentWordObject = new Word(currentWordString);\n currentArrayLettersRemaining = currentWordString.split('');\n guessedLetters = [];\n displayWord(0);\n}", "title": "" }, { "docid": "6067823bb348c1c9f3b4e953a9a73681", "score": "0.56573564", "text": "function pressForNewWord() {\n\tpressKeyToStart.textContent = \"NICE WORK! PRESS C TO GO SOMEWHERE ELSE\"\n}", "title": "" }, { "docid": "e5c40fa20aeac91703db7ad3a1ed6b50", "score": "0.5649019", "text": "reload() {\n\t\t this.props.dispatch(Actions.dictionary())\n\t}", "title": "" }, { "docid": "b4db323bc82392a00424d6489633252d", "score": "0.56476545", "text": "function newWord () {\n resetDisplay()\n currentWordIndex = Math.floor(Math.random() * randomWords.length)\n background.classList.add(randomWords[currentWordIndex])\n var currentWord = Array.from(randomWords[currentWordIndex])\n currentWord.forEach(guessingWord.concat('_'))\n updateDisplay()\n console.log(currentWord)\n return currentWordIndex\n}", "title": "" }, { "docid": "c87b96f15c5b85bbbacf133bbad12759", "score": "0.56444466", "text": "function startGame() {\n pickWord();\n initBoard();\n updateBoard();\n createLetters();\n}", "title": "" }, { "docid": "ad53d610f0f7e0f5576d649dd8c7d5f0", "score": "0.56341296", "text": "restart() {\n console.log('[END] restart')\n game.scene.switch('end', 'title')\n }", "title": "" }, { "docid": "cad8a5c8229e69463ed28e7d78afaf74", "score": "0.5618661", "text": "function startWord() {\n if (matchWord()) {\n isPlay = true;\n time = 6;\n randomWord(words);\n score++;\n document.querySelector('#wordInput').value = '';\n }\n\n if (score === -1) {\n scoreDisplay.innerHTML = 0;\n } else {\n scoreDisplay.innerHTML = score;\n }\n}", "title": "" }, { "docid": "3e1718189b37c4293c8cffe1b254586f", "score": "0.560934", "text": "function changeKeyword (word) {\n setKeyword(word);\n }", "title": "" }, { "docid": "08550c9920e0a230a6ac667bf9faaf9b", "score": "0.5604322", "text": "function deleteWord() {\n var wordEl = $(\"#introBanner .introContainer h1\");\n if (wordEl.text().length > 0) {\n wordEl.text(wordEl.text().slice(0, wordEl.text().length-1));\n setTimeout(deleteWord, 100);\n } else {\n setTimeout(addWord, 100);\n }\n }", "title": "" }, { "docid": "4c6b30503f21f57be62baf999378d248", "score": "0.55925614", "text": "function startReload() {\n // Show the throbber and dim the content\n if (throbber) {\n throbber.centerAndShow();\n }\n options.hideContent(content);\n }", "title": "" }, { "docid": "a641299729ab43720351eb2f4e7c879a", "score": "0.5573185", "text": "function start(){\n //Set turns to 10 to start\n turns = 10;\n //Pick random word\n //Array of game words : assemble here\n words = [\"the birdcage\", \"the godfather\", \"lord of the rings\", \"twilight\", \"young frankenstein\"];\n //note: lowercase values entered so dont need to change case\n var randomNum = Math.floor(Math.random()* words.length);\n\n //Set game word: \n gameWord = words[randomNum];\n console.log(gameWord);\n\n // create new instance of Word for gameWord\n newWord = new Word(gameWord);\n\n //Display word blanks for user to see on command line\n console.log(newWord.charString());\n\n promptUser(newWord);\n\n}", "title": "" }, { "docid": "96f053777530e38c5f66815da0c1ca45", "score": "0.5570165", "text": "function initSection() {\n guessNo = 15;\n // guess a random word\n guessedWord = randomWord();\n newWord = new Word(guessedWord);\n\n // displaying the place holder for the word\n console.log(placeHolder.repeat(guessedWord.length));\n\n // main function \n userInput();\n}", "title": "" }, { "docid": "49077d262b2a75fa278bc062ffb8bcbf", "score": "0.5566155", "text": "function newSpeech() {\n\t\t// Scroll to top of page\n\t\twindow.scrollTo(0, 0);\n\t\t$body.addClass('generating');\n\t\t$generate.text('Writing...');\n\t\tglobalID = requestAnimationFrame(repeatOften);\n\n\t\tsetTimeout(function(){\n\t\t\t$body.removeClass('generating');\n\t\t\t$('.generate').blur();\n\t\t\t$('header .generate').text('Generate a new speech');\n\t\t\t$('footer .generate').text('Generate another speech');\n\t\t\tcancelAnimationFrame(globalID);\n\t\t}, 1000);\n\t}", "title": "" }, { "docid": "a0f4f9564c13ea3f88cfbdd145f989b4", "score": "0.55547434", "text": "function restart() {\n $('#tile_list').empty(); // empty tiles in tile rack\n tiles_on_hand = 0; // reset tiles on hand\n current_score = 0; // reset score\n strip_tile_word = []; // clear data of tiles inside strip\n\n // reset word counter\n $('#word_counter').text(\"Word: \");\n\n // close blank tile dialog if it exists\n try {\n $('#blank_tile_dialog').dialog('close');\n } catch(e) {} // do nothing and continue program if it doesn't exist\n\n // reset score counter\n $('#score_counter').text('Score: ' + current_score.toString());\n\n // reset flag\n double_word_score = false;\n\n // disable submit button if not already disabled\n $('#submitBtn').prop('disabled', true);\n\n // reinitiate scrabble and distribution\n initiateScrabble(false);\n}", "title": "" }, { "docid": "26761b75e075b40c2cb76c82fcc85126", "score": "0.5551199", "text": "reloadHome(newFlow){\t//this takes a string-name of the flow (e.g. 'default')\n\t\tconsole.log('switching to new flow:' + newFlow)\n\t\tremote.getGlobal('sharedObj').presentationFlow = newFlow;\n\t\t//notify the main that this has changed (so it can be persisted)\n\t\tipcRenderer.send('updatePresentationFlow');\n\n\n\t\t//have chosen a new toc. So use it. Need to kill the existing chapter/pages and reload\n\t\tif(this.home.currentChapter){\n\t\t\t//if we have a chapter, kill it\n\t\t\tthis.home.currentChapter.killChapter();\n\t\t}\n\n\t\t//reload the toc\n\t\tthis.home.killHome();\n\t\tsetTimeout(function(){this.home.build();}.bind(this), 500);\n\t\tsetTimeout(function(){this.msg.append('presentation has been updated')}.bind(this), 500);\n\t\tsetTimeout(function(){this.buildJdornEditor()}.bind(this), 500);\n\t}", "title": "" }, { "docid": "69c12962931bf34dd16b41b29194ea60", "score": "0.55508584", "text": "function NewGame() {\n\n\trestartGame = false;\n\n\t// Choose the word to be guessed\n\tcurrentWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n\n\tconsole.log(currentWord);\n\n\t// Set the number of guesses remaining\n\tguessesRemaining = currentWord.length + 7;\n\n\t// Clear the letters guessed\n\tlettersGuessed = \"\";\t\n\n\t//resets message to nothing\n\tmsg = \"\";\n\n\tupdateGame();\n}", "title": "" }, { "docid": "0918d1a47b81886ce4ef98a3a9aa86c0", "score": "0.55469567", "text": "function startLive(){\r\n\r\n started = 1;\r\n changePage();\r\n}", "title": "" }, { "docid": "51dd2374503eb2f8db5e3cbab31e1572", "score": "0.55452394", "text": "function doNew() {\n if(dirty) {\n displayMessage('Warning', 'You have unsaved work. Please save before continuing.');\n } else {\n EDITOR.setCode(\"from microbit import *\\n\\n# Type your Python code here. For example...\\ndisplay.scroll(\\\"Hello, World!\\\")\");\n dirty = false;\n \n }\n }", "title": "" }, { "docid": "ead12d98cd33484cf990967779591860", "score": "0.55393845", "text": "function startGameLevel() {\n\n if (renderintervalId) {\n return;\n }\n // logic for word selection\n input.value = \"\";\n let word = getMeRandomWord();\n scoringWord = word;\n text = new Text(word);\n renderintervalId = setInterval(renderText, 10);\n}", "title": "" }, { "docid": "4b2dcf0ee5be2a1af07289bd3f6768de", "score": "0.5533049", "text": "startGame() {\n\t\t\tthis.guesses = 10;\n\t\t\tthis.lettersGuessed = [];\n\t\t\tthis.currentWord = this.newWord();\n\t\t\tthis.currentWord.render();\n\t\t\tguessesLeft.innerText = 'guesses left: '+this.guesses;\n\t\t\tlettersTried.innerText = 'letters guessed';\n\t\t\t// console.log(this.currentWord);\n\t\t}", "title": "" }, { "docid": "0b22191afe148408c17b27bdd8e77f2f", "score": "0.5526915", "text": "function restartGame(){\n wins = 0;\n word=\"\";//original word to be guessed\n wordLetter=[];//split into lettters guessed or not\n guessedLetter = [];\n lives=12;\n imgLink = \"assets/images/HP_5_CVR_LRGB.jpg\";\n document.getElementById(\"leftimage\").src = imgLink;\n document.getElementById(\"gametitle\").style.display = \"none\";\n document.getElementById(\"notStarted\").style.display = \"initial\";\n getWordFromAPI();\n}", "title": "" }, { "docid": "8764094e6f59c5650e144196bd598ba9", "score": "0.55218333", "text": "function newGamed(){\n location.reload()\n}", "title": "" }, { "docid": "ccd44f12802632e0ab540996559cefaf", "score": "0.5519248", "text": "_updateLyricFromEditor() {\n const txt = this.editor.getText();\n this.lyric.setText(txt);\n this.lyric.skipRender = false;\n this.editor.stopEditor();\n if (!this.lyric.deleted && this.originalText !== txt) {\n this.view.addOrUpdateLyric(this.selection.selector, this.lyric);\n }\n }", "title": "" }, { "docid": "e06411647936cc3c45a13e2b907b4bab", "score": "0.55176514", "text": "function showNewWords(vis, theme, year) {\r\n vis.update(getWord(theme, year));\r\n}", "title": "" }, { "docid": "ee9292bfd095534d99a7b6ed38fdffa5", "score": "0.55095106", "text": "function replaceHighlight() {\n var replaceWord = document.getElementById(\"replaceWord\").value;\n var spans = document.querySelectorAll(\"mark\");\n\n var xhrStopWord = new XMLHttpRequest();\n var stopWordArray = [];\n var stopWordUrl = \"config/stopwords.txt\";\n\n // Replace all highlighted with replaceWord\n spans.forEach((span) =>\n span.innerHTML = replaceWord\n );\n\n document.getElementById(\"searchStatReplace\").innerHTML =\n \"Replaced with : <strong id=\\\"searchStatReplaceWord\\\">\"\n + replaceWord + \"</strong>\";\n\n toggleReplaceDisabled(true);\n document.getElementById(\"resetReplace\").disabled = false;\n\n // Reload doc stats after replacement\n xhrStopWord.open(\"GET\", stopWordUrl, true);\n xhrStopWord.send();\n\n xhrStopWord.onreadystatechange = function () {\n if (xhrStopWord.readyState === 4 && xhrStopWord.status === 200) {\n stopWordArray = xhrStopWord.responseText.split(/\\s+/);\n getDocStats(stripTags(document.getElementById(\"fileContent\").innerHTML),\n stopWordArray);\n }\n };\n}", "title": "" }, { "docid": "8346e43d93466a19a72352bd66246e1a", "score": "0.54977536", "text": "function updateWord() {\r\n\tvar curlist = [];\r\n\tcurlist = chooseList();\r\n\tvar random = getRandomInt(0, curlist.length);\r\n\t\r\n\t//prevent same word from ever being chosen twice in a row...\r\n\twhile(random === previndex) {\r\n\t\trandom = getRandomInt(0, curlist.length);\r\n\t}\r\n\tprevindex = random;\r\n\t\r\n\tcurword = curlist[random]\r\n\r\n\tdocument.getElementById(\"curword\").innerHTML = curword;\r\n}", "title": "" }, { "docid": "7b490f9779c7bc3444940510941523e7", "score": "0.54973876", "text": "function newWord() {\n gameWord = wordList[Math.floor(Math.random() * wordList.length)];\n}", "title": "" }, { "docid": "59b4ccc93cd87487129bb5757c045547", "score": "0.54908186", "text": "function restart() {\r\n\t\tc4tl.restart();\r\n\t\tplaying = true;\r\n\t}", "title": "" }, { "docid": "29daf5000a045043160be9cb8d9ab2ae", "score": "0.54763293", "text": "function restart() {\r\n readline.question(`Would you like to test another word?(y/n): `, (answer) => {\r\n if (answer.toLowerCase() == 'y') {\r\n testPalindrome();\r\n } else {\r\n readline.close();\r\n }\r\n })\r\n }", "title": "" }, { "docid": "38600b2098c894beb8167f82c0572f10", "score": "0.54741776", "text": "function restart() {\n location.reload();\n }", "title": "" }, { "docid": "6dbf7526a830fa2450e4bea8bd745981", "score": "0.5472979", "text": "function reloadAll() {\n Y.io('server/backend.php?from=' + largestId, {\n on : {\n complete: function(id, rsp, err) {\n var words = Y.JSON.parse(rsp.responseText);\n Y.log(words);\n Y.each(words, function(word) {\n Y.log(word);\n// map.append('<div class=\"brian-map-element\" id=\"brian-map-id-'+word.id+'\" style=\"left: '+word.x+'px; top: '+word.y+'px\">'+word.word+'</div>');\n insertElement(map,word.x,word.y,word.word, word.id);\n largestId = word.id;\n Y.log(largestId);\n })\n }\n }\n })}", "title": "" }, { "docid": "de514d47ad36bcb43970c0d8358eb86e", "score": "0.5467976", "text": "function restart() {\n\tlocation.reload();\n}", "title": "" }, { "docid": "ab0c96bd2a037c5dfdb68ba38de6c149", "score": "0.5462841", "text": "function goToStart(){\n\n location.reload();\n return;\n}", "title": "" }, { "docid": "f33545f9d3820ebd2dc4c4a79485a6d9", "score": "0.5460768", "text": "function newWord() {\n var rnum = Math.floor(Math.random() * wordBank.length);\n randomWord = wordBank[rnum];\n wordLength = randomWord.length;\n}", "title": "" }, { "docid": "cbdcc20e0f78c48e1b65053aa7102696", "score": "0.54605925", "text": "startGame(){\n $('#overlay').hide();\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "7ed80296002910017caaab681e66e053", "score": "0.5456031", "text": "function reloadOutput() {\n if (Editor.all[currentState] !== undefined) {\n Editor.all[currentState].loadContent();\n } else {\n document.getElementsByTagName('iframe')[0].contentDocument.location.reload(true);\n }\n }", "title": "" }, { "docid": "956160095625d5c44a279e49252eb50f", "score": "0.5454438", "text": "startGame() {\r\n document.getElementById('overlay').style.display = \"none\";\r\n this.activePhrase = this.getRandomPhrases();\r\n phrase = new Phrase(this.activePhrase);\r\n hint = new Hinthelp(); //hinthelp Class,\r\n time = new Chrono; // Chrono Class ,\r\n phrase.addPhraseToDisplay();\r\n /** \r\n * for testing // uncomment the next line to see the picked phrase in the console//\r\n */\r\n // console.log(`the current Phrase is : ${ phrase.phrase }`)\r\n }", "title": "" }, { "docid": "9b351bcd7c6528976d8b44f4a5939e80", "score": "0.5454274", "text": "function addWord(word){\n\tselected[word] = 1;\n\tshowSelected();\n\tfindEntries();\n}", "title": "" }, { "docid": "89f26fa73a9aae1baf4ca312f88a2daf", "score": "0.5443499", "text": "function refresh() {}", "title": "" }, { "docid": "30cf04e3c8bba1d494370ab4e121a385", "score": "0.5442223", "text": "startGame(){\n $('#overlay').delay(1000).slideUp(800);\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "23c48470edd264d226b8cae62c0495e1", "score": "0.54347825", "text": "startGame(){\n \t\tthis.gameReset();\n \t\t$('#overlay').fadeOut('slow'); let phrase = this.getRandomPhrase();\n \t\tphrase.addPhraseToDisplay(phrase);\n \t\tthis.activePhrase = phrase;\n \t}", "title": "" }, { "docid": "9ddb20812707c2bba4435967ea4ce23f", "score": "0.5426693", "text": "function animateWord() {\n\t\t\tvar content = document.getElementById(\"p\"+ctr);\n\n\t\t\tif(ctr > total_words - 1) {\n\t\t\t\tctr = 0;\n\t\t\t\tnextLine();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcontent.style.color = \"blue\";\n\t\t\tcontent.style.WebkitTextStroke = \"2px white\";\n\n\t\t\tvar duration = content.getAttribute(\"_duration\");\n\t\t\t\n\t\t\tcontent.style.transition = \"color \"+ duration +\"s linear 0s\";\n\t\t\tctr++;\n\t\t\t\n\t\t\ttimeHandler2 = window.setTimeout(animateWord, duration * 1000);\n\t\t}", "title": "" }, { "docid": "d5a7b902918ea2dc808dd1207f3a0973", "score": "0.54249567", "text": "function updateDOM() {\n randomWord = generateRandom();\n word.innerText = randomWord;\n}", "title": "" }, { "docid": "c1317a0a2d9d562ef4b90d4d1e7b5a5b", "score": "0.54246217", "text": "refresh() { }", "title": "" }, { "docid": "46d4e9cbeb066b44c7397c33a90a090b", "score": "0.5421919", "text": "function refreshTerm(){\n Data.nextTerm();\n var finished = Data.getFinished();\n var curr = Data.getCurrent();\n $(\"#termDef\").fadeOut();\n $(\"#termDef\").fadeIn();\n\n setTimeout(function() {\n document.getElementById(\"termDef\").innerHTML = curr.def;\n updateProgress();\n Data.updateData();\n resetForm();\n document.getElementById(\"inputText\").value = \"\";\n\n //reset timer except on the last term\n if (finished != true){\n resetTimer(); \n }\n \n }, 2400);\n \n\n}", "title": "" }, { "docid": "fc86e329185b26fa0b106973b681f7ea", "score": "0.54217947", "text": "function reloadFavNote() {\n loadDatas();\n}", "title": "" }, { "docid": "6d29c227ef74189ae2e9acc753334637", "score": "0.5414169", "text": "function setup(){\r\n\t\r\n\twordsstart = [\"a\", \"s\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\"];\r\n\t\r\n\tvar strmonkey = \"dad as sad lad lag sag gag hag had ask jag lass lads fads glad flag flask gags hags dads jags lads lasses has sass gaga ja flasks alfalfa\";\r\n\twordsmonkey = strmonkey.split(\" \");\r\n\t\r\n\tvar strtypist = \"read were pop trip wig yes toy eat your poop the tree treat food leaf reef quit drag tag rag yeah hi rip ripped sweet sip hello yellow free trees greet free year peek peel seek keep sleep freed seen wed reed she he her his their seed weak queer great greed pedal lead there play gray hay yard took look jar jagged sagged ragged lollypop quote quest quadruple it if its swap sheep\"\r\n\twordstypist = strtypist.split(\" \");\t\r\n\t\r\n\tvar strtop = \"q w e r t y u i o p\";\r\n\twordstop = strtop.split(\" \");\r\n\t\r\n\tvar strtopwords = \"tree try ire tie wit quit pretty pot wet queue yup pop it tire pepper proper prop row rye toy tower power tweet error quite erupt write writer popper pewter require your err poy poi tip pit prior tripe yip pip ripe wort tory typewriter type pro rope twerp rupture quiet rite wipe\"\r\n\t\r\n\twordstoplong = strtopwords.split(\" \");\r\n\t\r\n\tvar strsuper = \"reading popping tripping box dock cat kitten mood moo bark no son buy need want book bottle cup plate bag car crack smack went going mom light chair quick brown fox over down rain plane bread creep jump bead bat can more zoo soon box noon night back grabbing freedom wristwatch quintuple meaty venting axe peace family saved dog goober zipper break creeped broken crooked pinky five vive virtual zany knave knack boxer mixup exit\"\r\n\t\r\n\twordssuper = strsuper.split(\" \");\r\n\t\r\n\tloadSave();\r\n}", "title": "" }, { "docid": "81a8df9a3cae9d29cfbbf8f62070b203", "score": "0.54138803", "text": "function restart() {\n location.reload();\n}", "title": "" }, { "docid": "81a8df9a3cae9d29cfbbf8f62070b203", "score": "0.54138803", "text": "function restart() {\n location.reload();\n}", "title": "" }, { "docid": "49b71d7bc2d730e34aeec171695a2c93", "score": "0.54134095", "text": "function _restartGame(){\n _startNewGame.call(this,this.starter);\n }", "title": "" }, { "docid": "0d2bcecd2f57c72a399f5b19d18c16f9", "score": "0.54127926", "text": "function newWord(word, def, example, syntax, tag, views, date){\n this.word = word;\n this.def = def;\n this.example = example;\n this.syntax = syntax;\n this.tag = tag;\n this.views = views;\n this.date = date;\n }", "title": "" }, { "docid": "6b191842b2f07ddd48621557839741fb", "score": "0.54103166", "text": "startGame(){\n this.missed = 0;\n let randomPhrase = this.getRandomPhrases();\n randomPhrase.addPhraseToDisplay(randomPhrase);\n }", "title": "" }, { "docid": "99a98881d9cd2a5547d7e6a7da1a968e", "score": "0.5410206", "text": "function newWord() {\n word = words[Math.floor(Math.random() * words.length)];\n}", "title": "" }, { "docid": "98452821d236ea5db4a45f12a494634b", "score": "0.54093885", "text": "chooseWord(){\r\n\t\tlet r = Math.floor(Math.random()*(this.words.length));\r\n\t\tthis.currentWord = this.words[r];\r\n\t\tif (this.mode == 'movie') this.getPlot(this.currentWord.word).then(v => {this.plot = v});\r\n\t}", "title": "" }, { "docid": "213158649baa6354e1e6e4e28ba7a8c8", "score": "0.5408532", "text": "function updateStartChanges() {\n\n document.getElementById(\"heading\").innerHTML = aux[0].text;\n document.querySelector(\"#start-msg\").innerHTML = \"Good Luck!\";\n gameAlreadyStarted = true;\n}", "title": "" }, { "docid": "3d2bdc5d09f29355fbf98d4a03d4ebec", "score": "0.53992087", "text": "function reloadFileName() {\n viewModel.documentName('');\n if (lbs.activeInspector.ActiveExplorer.Class.Name === \"document\") {\n if (lbs.activeInspector.ActiveExplorer.Selection.Count > 0) {\n var document_data = lbs.common.executeVba(\"GetAccept.GetDocumentData,\" + className);\n document_data = JSON.parse(document_data);\n viewModel.documentName(document_data[0].file_name);\n }\n }\n }", "title": "" }, { "docid": "ba22194ec6f3151f44e5631a0ef79236", "score": "0.539573", "text": "function reStart() {\n reset();\n createFeild(x_lenght, y_lenght, mine_amount);\n}", "title": "" } ]
caf5155fcd894555feb2e17c30be3239
Trim extraneous whitespace from strings.
[ { "docid": "189c7fb1d856eafd5d970eb1bd124896", "score": "0.6904212", "text": "function trim(str) {\n return str.replace(/^\\s+/, '').replace(/\\s+$/, '');\n}", "title": "" } ]
[ { "docid": "cd09a97f49980432300d4673ff526188", "score": "0.7670117", "text": "function trim(str) { return str.replace(/^\\s+|\\s+$/g, ''); }", "title": "" }, { "docid": "cd09a97f49980432300d4673ff526188", "score": "0.7670117", "text": "function trim(str) { return str.replace(/^\\s+|\\s+$/g, ''); }", "title": "" }, { "docid": "b5da657450b1a2497a0c747d118ce536", "score": "0.7461264", "text": "function trimWhitespace(str) {\n return str.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\");\n }", "title": "" }, { "docid": "4dd094d5baea2508887e857f6403fae6", "score": "0.74425197", "text": "function AllTrim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a86f1924dea5e53c10896eb9e35dee3c", "score": "0.74029726", "text": "function trim(s) {\n return s.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a86f1924dea5e53c10896eb9e35dee3c", "score": "0.74029726", "text": "function trim(s) {\n return s.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a86f1924dea5e53c10896eb9e35dee3c", "score": "0.74029726", "text": "function trim(s) {\n return s.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a86f1924dea5e53c10896eb9e35dee3c", "score": "0.74029726", "text": "function trim(s) {\n return s.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a86f1924dea5e53c10896eb9e35dee3c", "score": "0.74029726", "text": "function trim(s) {\n return s.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a86f1924dea5e53c10896eb9e35dee3c", "score": "0.74029726", "text": "function trim(s) {\n return s.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "4c0f32ee0dfacda86302e44b2aba085b", "score": "0.73633224", "text": "function trimIt(x) {\n return x.replace(/^\\s+|\\s+$/gm, \"\");\n}", "title": "" }, { "docid": "3b243df9d05cf6a018fe50df0c0ce86c", "score": "0.7318274", "text": "function trim(s)\n{\n return s.replace(/(^\\s+)|(\\s+$)/g, \"\");\n}", "title": "" }, { "docid": "8a56d352ff21f539b5725b84e0e9e2de", "score": "0.72682273", "text": "function trim(s) {\n return s.replace( /^\\s*/, \"\" ).replace( /\\s*$/, \"\" );\n }", "title": "" }, { "docid": "740c91a99e1862b96c51b2d38bf5eb0b", "score": "0.72549593", "text": "function trim ( str ) {\n return str.replace(/^\\s+|\\s+$/g, '');\n }", "title": "" }, { "docid": "740c91a99e1862b96c51b2d38bf5eb0b", "score": "0.72549593", "text": "function trim ( str ) {\n return str.replace(/^\\s+|\\s+$/g, '');\n }", "title": "" }, { "docid": "140d5e11ff9131838b679392ce0ef6e3", "score": "0.72452927", "text": "function trim(s)\n{\n return s.replace(/(^\\s+)|(\\s+$)/g, \"\")\n}", "title": "" }, { "docid": "2b3524f5e01fa9efc7cde384a0a93a33", "score": "0.7237571", "text": "function trimSpaces(string){\n\treturn string.replace(/(\\s+)/gm,\"\");\n}", "title": "" }, { "docid": "31c002ed14e84483ef6531c1ecbce3f8", "score": "0.7224887", "text": "function trim(s) {\r\n return s.replace( /^\\s*/, \"\" ).replace( /\\s*$/, \"\" );\r\n }", "title": "" }, { "docid": "6400cc1eb4c9f9f354158862bc48c322", "score": "0.7220973", "text": "function trim(s){return s&&s.toString().replace(/^\\s+|\\s+$/g,'');}", "title": "" }, { "docid": "d63aba4fa6f70d10906eb6bd00bfd5dc", "score": "0.721958", "text": "function trim(s) {\n return s.replace(/^\\s+|\\s+$/, '');\n}", "title": "" }, { "docid": "1bac490673718764808be285c4844f77", "score": "0.72172755", "text": "function myTrim(x) {\n return x.replace(/^\\s+|\\s+$/gm, '');\n }", "title": "" }, { "docid": "04e879df21d352a6c4a09d1514d73fe5", "score": "0.7191872", "text": "function trim(str) {\n return str.replace(/^\\s+|\\s+$/g, \"\");\n}", "title": "" }, { "docid": "04e879df21d352a6c4a09d1514d73fe5", "score": "0.7191872", "text": "function trim(str) {\n return str.replace(/^\\s+|\\s+$/g, \"\");\n}", "title": "" }, { "docid": "56904af112640815ba3ffe0681cece20", "score": "0.7190496", "text": "function trim1(str) {\n\t return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\t}", "title": "" }, { "docid": "ec441780d4856d7428b37fa4dfa64c8f", "score": "0.71835893", "text": "function trim(str)\n{\n return str.replace(/^\\s+|\\s+$/g, '')\n}", "title": "" }, { "docid": "da7e815842d44aebf25de16eec84dcfa", "score": "0.7178229", "text": "function strip_whitespace (s) {\n if (options.strip_whitespace) {\n return s.replace(/\\s*\\n/g,\"\\n\").replace(/(\\r?\\n){2,}/g,\"\\n\\n\");\n }\n return s;\n }", "title": "" }, { "docid": "b7f513c39320c488ace0ab6d739ea9d5", "score": "0.7172398", "text": "function trim(s) {\n\t\treturn s.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\");\n\t}", "title": "" }, { "docid": "222a59220f95188ddcca7b10abdb75af", "score": "0.7172144", "text": "function trim(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "20fd00d0b1731d382f50a1654de8c5c6", "score": "0.716067", "text": "function trim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "20fd00d0b1731d382f50a1654de8c5c6", "score": "0.716067", "text": "function trim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a58319c5691f305500c13331881aeba6", "score": "0.71533525", "text": "function trim(str)\n{\n return str.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "a58319c5691f305500c13331881aeba6", "score": "0.71533525", "text": "function trim(str)\n{\n return str.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "f78d779cac4c66dc59a0e6c26053086c", "score": "0.71505356", "text": "function trimString(sInString) {\n sInString = sInString.replace( /^\\s+/g, \"\" );// strip leading\n return sInString.replace( /\\s+$/g, \"\" );// strip trailing\n}", "title": "" }, { "docid": "ea1b0933b7d745871b930fba9bf6b565", "score": "0.7144347", "text": "function trim(str) {\r\n return str.replace(/^\\s+/g, '').replace(/\\s+$/g, '');\r\n}", "title": "" }, { "docid": "eb8ff5b57c294630735bd9225cbb6807", "score": "0.7105071", "text": "function trim(s) {\n\treturn s.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\");\n}", "title": "" }, { "docid": "2bbba183b8fa4f687670ca8b02f0ec63", "score": "0.7092223", "text": "function trimString(sInString) {\r\n sInString = sInString.replace( /^\\s+/g, \"\" );\r\n return sInString.replace( /\\s+$/g, \"\" );\r\n}", "title": "" }, { "docid": "378c6da22f3356d5aa4fbba69ab214c1", "score": "0.708653", "text": "function trim(s) {\n\ts = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\n\ts = s.replace(/[ ]{2,}/gi,\" \");\n\ts = s.replace(/\\n /,\"\\n\");\n\treturn s;\n}", "title": "" }, { "docid": "9ceb95f63b7dc8b01e1d7665144406e0", "score": "0.70727557", "text": "function trim(s) {\n if (typeof String.prototype.trim === 'function') {\n return String.prototype.trim.call(s);\n } else {\n return s.replace(/^[\\s\\xA0]+|[\\s\\xA0]+$/g, '');\n }\n}", "title": "" }, { "docid": "524f2aebe5d29c83ba35d36356e157de", "score": "0.70532763", "text": "function trim(string)\r\n{\r\n return(string.replace(new RegExp(\"(^\\\\s+)|(\\\\s+$)\"),\"\"));\r\n}", "title": "" }, { "docid": "36b30706b831a654717267cb2db73aa7", "score": "0.7051359", "text": "function strip(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "3c8c2d11a79403f30bfbfedf9651b2ac", "score": "0.70412415", "text": "function trim(string) {\n return string.replace(' ', '');\n}", "title": "" }, { "docid": "b8d97df715519449a7630593b0d3bbd8", "score": "0.70336443", "text": "function StringTrim(str){\n\t\treturn str.replace(/^\\s+|\\s+$/g, \"\");\t\n\t}", "title": "" }, { "docid": "d33a489a9e95854377d3334bbc5cfd00", "score": "0.7027188", "text": "function stripWhitespace(str)\n{\n\treturn str.replace(/^\\s*|\\s*$/g, \"\");\n}", "title": "" }, { "docid": "02179bc36d47d5a2b9bb4714b6546ce8", "score": "0.7021306", "text": "function trim(string) {\n\t return string ? string.replace(/^\\s+|\\s+$/g, '') : string;\n\t }", "title": "" }, { "docid": "5660e0c5968ec0f9f83229256105554e", "score": "0.70117575", "text": "function trim(str)\n{\n return(str.replace(/^\\s+|\\s+$/g, ''));\n}", "title": "" }, { "docid": "228959d511cd6e9b1be856c065723c11", "score": "0.7006374", "text": "function trim(s){\n return ( s || '' ).replace( /^\\s+|\\s+$/g, '' );\n}", "title": "" }, { "docid": "dd4e3ef274d9ce3c8a38836ba46ac8f4", "score": "0.69902897", "text": "function strTrim(str)\n{\n\treturn str.replace(/(^\\s*)|(\\s*$)/g, \"\"); \n}", "title": "" }, { "docid": "720ac94d3e77f192b16a9213e47fa61a", "score": "0.6987567", "text": "function trim(string) {\n return string.replace(/^\\s+/,'').replace(/\\s+$/,'');\n }", "title": "" }, { "docid": "27deee1471d065c2909706d8c4bb945c", "score": "0.69827485", "text": "function stripWhitespace(str) {\n return str.trim().replace(/\\s*\\n\\s*/g, ' ');\n}", "title": "" }, { "docid": "97bab7398036e174631eb5511c1c4f33", "score": "0.69728136", "text": "function trim(str)\n{\n return String(str).replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "421ea4c334711aa0220bc377748f9d3e", "score": "0.69674116", "text": "function trimString(s) {\r\n\treturn s.replace(/^\\s+|\\s+$/g,'');\r\n}", "title": "" }, { "docid": "421ea4c334711aa0220bc377748f9d3e", "score": "0.69674116", "text": "function trimString(s) {\r\n\treturn s.replace(/^\\s+|\\s+$/g,'');\r\n}", "title": "" }, { "docid": "3eee6bab5d315cf6712814302c2984d5", "score": "0.69666326", "text": "function trim(str) {\n\treturn str.replace(/^\\s+ | \\s+$/g, \"\");\n\t/*\n\tHuh? Take a breath. Here we go:\n\t- The \"|\" separates this into two expressions, as in A or B.\n\t- \"^\\s+\" matches a sequence of one or more whitespace characters at the beginning of a string.\n - \"\\s+$\" is the same thing, but at the end of the string.\n - \"g\" makes is global, so we get all the whitespace.\n - \"\" is nothing, which is what we replace the whitespace with.\n\t*/\n\n}", "title": "" }, { "docid": "f054ecf62ad82e6c585ee3f22b1f6a7d", "score": "0.695945", "text": "function trim(str) {\r\n\treturn str.replace(/^\\s*|\\s*$/g, \"\");\r\n}", "title": "" }, { "docid": "0ea9cd031fa9c682ba9d810154573d34", "score": "0.69548696", "text": "function trim (mystring){\n return mystring.replace(/^\\s+|\\s+$/g, \"\");\n}", "title": "" }, { "docid": "d406f9d30b8343ef2ef15a3d67d435b6", "score": "0.6950789", "text": "function trim(str) {\r\n\treturn str.replace(/^\\s+|\\s+$/g,\"\");\r\n}", "title": "" }, { "docid": "df75f59320cab3ca4fdc145befce5662", "score": "0.6948071", "text": "function strip (string) {\n\treturn string.replace(/^[\\s]*|[\\s]*$|\\s+(?=\\s)/gm, \"\");\n}", "title": "" }, { "docid": "552b8a09df6c2a10516d183bedfb7942", "score": "0.6947647", "text": "function trim(str){\n return str.replace(/^\\s*|\\s*$/g,\"\");\n}", "title": "" }, { "docid": "db962217a864642609a6e73c4321804f", "score": "0.69472605", "text": "function deleteWhitespaces(inputStr) {\n return inputStr.replace(/\\s/g, '');\n}", "title": "" }, { "docid": "5c7fee25b2b7230db83d9cbb3b7a9e15", "score": "0.6946452", "text": "function trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}", "title": "" }, { "docid": "f4cc3d013a4ee51e677022079f88056b", "score": "0.6938046", "text": "function Jureeka_TrimString(string)\n{\n // If the incoming string is invalid, or nothing was passed in, return empty\n if (!string)\n return \"\";\n\n string = string.replace(/^\\s+/, ''); // Remove leading whitespace\n string = string.replace(/\\s+$/, ''); // Remove trailing whitespace\n\n // Replace all whitespace runs with a single space\n string = string.replace(/\\s+/g, ' ');\n\n return string; // Return the altered value\n}", "title": "" }, { "docid": "a750847d85e0ee163f0e3553afd4e41d", "score": "0.69332254", "text": "function trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}", "title": "" }, { "docid": "a89a529ccd28c6ce70fe52a136231706", "score": "0.69223106", "text": "function trim(str) {\n\tstr = str.replace('/^\\s+/', '');\n\treturn(str.replace('/\\s*$/', ''));\n}", "title": "" }, { "docid": "1df60bc3ab274d8c27257f419118ae53", "score": "0.6919282", "text": "function removeExtraSpaces(str) {\n return str.replace(/\\s+/g, ' ').trim()\n }", "title": "" }, { "docid": "228ebb3a6976e4e2369a788fe14abfda", "score": "0.69124925", "text": "function trim(str) {\r\n\treturn str.replace(/^\\s+/g,'').replace(/\\s+$/g,'');\r\n}", "title": "" }, { "docid": "f8740d34663f56396d9cb153e7dd3133", "score": "0.69118696", "text": "function trim(str) {\n return str.replace(/^\\s+/, '').replace(/\\s+$/, '');\n}", "title": "" }, { "docid": "827b57d9c638119edc0ee6a40b85fa42", "score": "0.6896694", "text": "function strTrim(str) {\n str = str.replace(/^\\s+/, \"\");\n str = str.replace(/\\s+$/, \"\");\n return str;\n}", "title": "" }, { "docid": "bb2afbcd42847bf66341ea3cd7698283", "score": "0.68958384", "text": "function lemurlogtoolbar_trimString( x ) {\n return x.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\");\n}", "title": "" }, { "docid": "5a66e93a59912bf9c5c4e969518c6f62", "score": "0.68925893", "text": "function stripWhitespace(s) {\n\tvar whitespace = \" \\t\\n\\r\";\n\treturn stripCharsInBag(s, whitespace);\n}", "title": "" }, { "docid": "175d597ffa885c5c6fafb430ea89898e", "score": "0.6881377", "text": "function trim(str) {\n\treturn str ? String(str).replace(/\\s+/g, '') : '';\n}", "title": "" }, { "docid": "18beefcf3c90587cd9f317d927e72bbc", "score": "0.6880265", "text": "function utilTrim (str) {\n if (String.prototype.trim) {\n return str.trim();\n }\n return str.replace(/(^\\s*)|(\\s*$)/g, '');\n}", "title": "" }, { "docid": "f07465dee1e4826714fe2c2e18d0d633", "score": "0.6877093", "text": "function strTrim(str){\n return str.replace(/^\\s+/,'').replace(/\\s+$/,'')\n}", "title": "" }, { "docid": "60ba4e39bbe4c5686d167e6cb0432322", "score": "0.687635", "text": "function removeSpaces(stringers) {\n\tfor (i = 0; i < 5; i++) {\n\t\tstringers = stringers.replace(\" \", \"\");\n\t}\n\treturn stringers;\n}", "title": "" }, { "docid": "054b3da1a599dc7e628139617e77e6d1", "score": "0.68683", "text": "function TrimAll(str) { \r\n\treturn LTrimAll(RTrimAll(str)); \r\n}", "title": "" }, { "docid": "09eea0f46b72155c5b5c13147053d45d", "score": "0.68506163", "text": "function stringPrototypeTrim() {\n return this.replace(/^\\s+|\\s+$/g, '');\n }", "title": "" }, { "docid": "aed86628d8188de6fa6023a312a07421", "score": "0.6849691", "text": "function TrimString( str ) \r\n\t{\r\n\t\tstr = str.replace( /^[\\s]+/, '' ); // Trims leading spaces\r\n\t\tstr = str.replace( /[\\s]+$/, '' ); // Trims trailing spaces\r\n\t\treturn str;\r\n\t}", "title": "" }, { "docid": "b686231c3ce57666e481b6c8604c886c", "score": "0.6840236", "text": "function trim (myString)\r\n{\r\nreturn myString.replace(/^\\s+/g,'').replace(/\\s+$/g,'');\r\n}", "title": "" }, { "docid": "79aebd4f165268ab7db34e0d474fbc91", "score": "0.6836753", "text": "function trimSpaces(str, leftAndRightOnly) {\n if (leftAndRightOnly) {\n return str.replace(/^\\s+|\\s+$/g,\"\");\n }\n return str.replace(/\\s+/g, '');\n}", "title": "" }, { "docid": "f2f6b13378a26423261b8c45d1b4c45c", "score": "0.6828581", "text": "function removeWhiteSpace(str)\n{\n\treturn str.replace(/\\s+/g, \"\");\n}", "title": "" }, { "docid": "18a58909fb99da837888a1a59abe79a1", "score": "0.6827142", "text": "function trimString(str){\n\t\t\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\t\t}", "title": "" }, { "docid": "5c73bd601a6a7e2209d69d61c9cbf60d", "score": "0.68238854", "text": "function sm_trim(string_to_trim)\n{\n\n if (string_to_trim == null) return null;\n\n\n // we could probably use the following, but the code below works\n // works with even older browsers (pre-version-4 generation)\n //\n //return string_to_trim.replace(/^\\s+|\\s+$/g,\"\");\n\n\n while (string_to_trim.charAt(0) == ' '\n || string_to_trim.charAt(0) == '\\\\n'\n || string_to_trim.charAt(0) == '\\\\t'\n || string_to_trim.charAt(0) == '\\\\f'\n || string_to_trim.charAt(0) == '\\\\r')\n string_to_trim = string_to_trim.substring(1, string_to_trim.length);\n\n while (string_to_trim.charAt(string_to_trim.length - 1) == ' '\n || string_to_trim.charAt(string_to_trim.length - 1) == '\\\\n'\n || string_to_trim.charAt(string_to_trim.length - 1) == '\\\\t'\n || string_to_trim.charAt(string_to_trim.length - 1) == '\\\\f'\n || string_to_trim.charAt(string_to_trim.length - 1) == '\\\\r')\n string_to_trim = string_to_trim.substring(0, string_to_trim.length - 1);\n\n return string_to_trim;\n\n}", "title": "" }, { "docid": "b6c8363c207c6d541b6214a403b4442b", "score": "0.6809536", "text": "function RTrimAll(str) {\r\n\tif (str==null){\r\n\t\treturn str;\r\n\t} for (var i=str.length-1; str.charAt(i)==\" \" || str.charAt(i)==\"\\n\" || str.charAt(i)==\"\\t\"; i--); \r\n\t return str.substring(0,i+1); \r\n}", "title": "" }, { "docid": "24f69cd8eea4d76acf9f08797df5c515", "score": "0.6809374", "text": "function squeeze(string) {\n return (string + '').trim().replace(/\\s\\s+/g, ' ');\n}", "title": "" }, { "docid": "da30120ac812ecae43f70ce73e0937a2", "score": "0.680782", "text": "function trim(str) \n{\n\t// Uses a regex to remove spaces from a string.\n\treturn str.replace(/^\\s+|\\s+$/g,\"\");\n}", "title": "" }, { "docid": "b8e1e841b33e76ae9594a7a0c3758e8e", "score": "0.6806336", "text": "function trim(str) {\n var processed = str.replace(/^[ \\t]+|[ \\t]+$/g, '');\n processed = processed.replace('&nbsp;','');\n return processed;\n}", "title": "" }, { "docid": "8f089632e9814a604a871ac1dbaf97e6", "score": "0.67871207", "text": "function trim (str) {\n return str ? str.replace(/^[ ]+|[ ]+$/g,'') : str;\n }", "title": "" }, { "docid": "55b8d31c6076d47bc69f74d465e3b0dc", "score": "0.67862004", "text": "function trim(str) {\n return (str || '').replace(/^(\\s|\\u00A0)+|(\\s|\\u00A0)+$/g, '');\n }", "title": "" }, { "docid": "2c6135d940ed73d30314ba935f3cee2f", "score": "0.67858994", "text": "function trim( str ) {\n\tstr = str.replace(/^\\s\\s*/, '');\n\tfor (var i = str.length - 1; i >= 0; i--) {\n\t\tif (/\\S/.test(str.charAt(i))) {\n\t\t\tstr = str.substring(0, i + 1);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn str;\n}", "title": "" }, { "docid": "aeaee020bcd5d87dfa39bc21bf78c5aa", "score": "0.67849964", "text": "function trim(stringToTrim) {\r\nreturn stringToTrim.replace(/^\\s+|\\s+$/g,\"\");\r\n}", "title": "" }, { "docid": "c17299e382a31a7ff276bd21c7068df7", "score": "0.6780311", "text": "function Trim(str){\n\tstr = str.replace(/^\\s+|\\s+$/g,'');//Removes all leading and trailing spaces\n\tstr = str.replace(/\\t/g,'');//Removes all tabs Test\n\tstr = str.replace(/\\\\/g,'');//Removes escape slashes used in mysql database security functions\n\treturn str;\n}", "title": "" }, { "docid": "d329260f107d187877c6a26f92dcdeae", "score": "0.6767798", "text": "function Trim(str) {\n\treturn str.replace(/^\\s+/g, '').replace(/\\s+$/g, '');\n}", "title": "" }, { "docid": "e200a5c49694f910452f902378872841", "score": "0.67581505", "text": "function Trim(s)\n{\n while (s.length && \" \\t\\r\\n\".indexOf(s.charAt(0)) >= 0)\n {\n s = s.slice(1, s.length);\n }\n while (s.length && \" \\t\\r\\n\".indexOf(s.charAt(s.length - 1)) >= 0)\n {\n s = s.slice(0, s.length - 1);\n }\n \n return s;\n}", "title": "" }, { "docid": "3760ca9e179fff96729ed7580b645bfe", "score": "0.675796", "text": "function trim(value) {\n\t// ^\\s+ means one or more than one spaces at start\n\t// \\s+$ means one or more than one spaces at end\n\t// ^\\s+|\\s+$ means one or more than one spaces at start or end.\n\treturn value.replace(/^\\s+|\\s+$/, \"\");\n}", "title": "" }, { "docid": "b681f8c4eab025a976470c3565b15516", "score": "0.6752367", "text": "function trim(s)\n{\n // developed by willmaster.com\n while ((s.indexOf(' ', 0) == 0) && (s.length > 1))\n {\n s = s.substring(1, s.length);\n }\n while ((s.lastIndexOf(' ') == (s.length - 1) && (s.length > 1)))\n {\n s = s.substring(0, (s.length - 1));\n }\n if ((s.indexOf(' ', 0) == 0) && (s.length == 1))\n s = '';\n return s;\n}", "title": "" }, { "docid": "df620bf776769ad18727d3445accff5a", "score": "0.67486227", "text": "function squeeze(string) {\n return string.replace(/\\s+/g, ' ');\n }", "title": "" }, { "docid": "5db78f8d973d17df595e720a2bbd1221", "score": "0.6744481", "text": "function trim(a){\n\tvar nonSpace=false;\n\ta = unescape(a);\n\n\tfor(j=0;j<a.length;j++)\n\t{\n\t\tif(a.charAt(j)!=' ')\n\t\t{\n\t\t\tnonSpace=true;\n\t\t}\n\t}\n\tif (nonSpace==false)\n\t{\n\t\ta=\"\"\n\t}\n\treturn a;\n}", "title": "" }, { "docid": "ccfecd3a12338595a1c95b82c01ed39d", "score": "0.6741823", "text": "function squeeze(string) {\r\n return string.replace(/\\s+/g, ' ');\r\n }", "title": "" }, { "docid": "986ce4c614ddb743af679821a058a9ac", "score": "0.6736962", "text": "function LTrimAll(str) {\r\n\tif (str==null){\r\n\t\treturn str;\r\n\t} \r\n\tfor (var i=0; str.charAt(i)==\" \" || str.charAt(i)==\"\\n\" || str.charAt(i)==\"\\t\"; i++); \r\n\treturn str.substring(i,str.length); \r\n}", "title": "" }, { "docid": "fba9dbf40e86b3e8eb076ba20fb2fd29", "score": "0.67299503", "text": "function trim(value) {\n\n\treturn value.replace(/^\\s+|\\s+$/g, '');\n}", "title": "" }, { "docid": "b9efa75cae6a10a9e5307e0498bdca93", "score": "0.6727255", "text": "function trim(str){\n\t//info: remove beginning and ending spaces, tabs, and line returns\n\tif (null != str && undefined != str && \"\" != str){\n\t\tvar rval=str.replace(/^[\\ \\s\\0\\r\\n\\t]*/g,\"\");\n\t\trval=rval.replace(/[\\ \\s\\0\\r\\n\\t]*$/g,\"\");\n\t return rval;\n\t\t}\n\telse{return \"\";}\n\t}", "title": "" } ]
e2ceac29da75495e0471d8d7345fa4f5
gets all motions with date filtering
[ { "docid": "a0c1cae29ecf674fb680118ecacf5725", "score": "0.7307351", "text": "GetAllMotionsByDate() {\n this.HelperGetMotions(motionUrl + \"?date=\" + this.motionDate + \n \"&month=\" + this.motionMonth + \"&year=\" + this.motionYear)\n }", "title": "" } ]
[ { "docid": "1b28eb7c1839ece8ea00a1048d3b685b", "score": "0.59445935", "text": "filterByDate(data){\n let today = new Date();\n let dd = today.getDate();\n let mm = today.getMonth()+1;\n let yyyy = today.getFullYear();\n\n if(dd<10) {\n dd='0'+dd\n }\n\n if(mm<10) {\n mm='0'+mm\n }\n\n today = yyyy+'-'+mm+'-'+dd;\n let filteredData = [];\n\n for(var prop in data) {\n let obj = data[prop];\n let date = parseDate(obj.electionDate);\n let todayParsed = parseDate(today);\n\n //Filter dates from today moving forward or President...\n if (obj.electionOffice == 'President' || date > todayParsed){\n filteredData.push(obj);\n }\n }\n\n function parseDate(dateStr) {\n let date = dateStr.split('-');\n let day = date[2];\n let month = date[1] - 1; //January = 0\n let year = date[0];\n return new Date(year, month, day);\n }\n return filteredData;\n }", "title": "" }, { "docid": "8aca0a9891d6727595c008f5ee18feb7", "score": "0.5811053", "text": "dateFilteredIDs() {\n if (this.filterDate) {\n const dateSplit = this.filterDate.split('-');\n const startDate = new Date(dateSplit[0].split('/').reverse().join('/'));\n const endDate = new Date(dateSplit[1].split('/').reverse().join('/'));\n return this.file.get('list').filter(listItem => {\n const date = new Date(listItem.date.split('/').reverse().join('/'));\n return date >= startDate && date <= endDate\n }).map(listItem => listItem.id)\n }\n return []\n }", "title": "" }, { "docid": "430531a333c9b4c8977c827bc7645f3b", "score": "0.57242733", "text": "function filterdate() {\n\t\tif (datetoggle) {\n\t\t\tvar min = $(\"#time_slide\").dateRangeSlider(\"min\");\n\t\t\tvar max = $(\"#time_slide\").dateRangeSlider(\"max\");\n\n\t\t\td3.selectAll(\"circle\")\n\t\t\t\t.filter(function(d) { return this.style.display != \"none\"; })\n\t\t\t\t.style(\"display\", function(d) { \n\t\t\t\t\t return (parseDate(d.lastdate) >= min &&\n\t\t\t\t\t \t parseDate(d.lastdate) <= max) ? null : \"none\"; });\n\t\t\tif (edgetoggle) {\n\t\t\t\td3.selectAll(\"line\")\n\t\t\t\t\t.filter(function(d) { return this.style.display != \"none\"; })\n\t\t\t\t\t.style(\"display\", function(d) {\n\t\t\t\t\t\t return ((parseDate(vis.ndata[d.source.index].lastdate) >= min &&\n\t\t\t\t\t\t \t parseDate(vis.ndata[d.source.index].lastdate) <= max) &&\n\t\t\t\t\t\t \t (parseDate(vis.ndata[d.target.index].lastdate) >= min &&\n\t\t\t\t\t\t \t parseDate(vis.ndata[d.target.index].lastdate) <= max)) ? null : \"none\"; });\n\t\t\t}\t\n\t\t\td3.selectAll(\"#slidetxt\")\n\t\t\t\t.html(\"Last seeded between \" + formatdate(min) + \" and \" + formatdate(max));\n\t\t}\n\t}", "title": "" }, { "docid": "572b95efd97a6528ea2d55b8b558a214", "score": "0.57015616", "text": "get dateArrayFromMoments() {\n return this.timePeriod.createDateArray(this.firstMomentDate, this.lastMomentDate);\n }", "title": "" }, { "docid": "926eb844e3b7c1be26f8e4b307f072fb", "score": "0.5648613", "text": "function filterListDates() {\n debug(\"date filter triggered\");\n myGlobal.datePickerActive = true;\n var f = moment($('.fromDate').datepicker('getDate')).subtract(1, 'day');\n var t = moment($('.toDate').datepicker('getDate')).add(1, 'd');\n userList.filter(function(item) {\n return moment(item.values().completed_at).isBetween(f, t, 'day');\n });\n myGlobal.datePickerActive = false;\n debug(\"date filter ended\");\n}", "title": "" }, { "docid": "901c17e2cd4dc6cc5c29def9e1861685", "score": "0.56392056", "text": "filterDate(data, date){\n if(!data){\n return undefined;\n }\n let filteredData = data.filter(piece => {\n return (moment(piece.date).diff(this.state.displayValue, 'days') > 0)\n })\n if(filteredData.length === 0){\n return undefined;\n } else {\n return filteredData\n }\n }", "title": "" }, { "docid": "0b4bf521c6a96afa133a9a68a85c6222", "score": "0.5637957", "text": "function filterByDate(value){\n this.copydata = [...this.data];\n const res = this.copydata.filter(item =>{\n \n return value == item.fecha_creacion.substr(0, 7);\n });\n this.copydata = [...res];\n renderData(res);\n }", "title": "" }, { "docid": "b3a57be4802876bf4b02ef46795f4d31", "score": "0.56174505", "text": "function filterData(date){\n\tvar formatedDate = standardDate(date);\n\tvar resultData = data.filter(ufoData => (ufoData.datetime===formatedDate));\n\treturn resultData;\n}", "title": "" }, { "docid": "86f427f162a7569b171d124934fe4451", "score": "0.55982405", "text": "function filterResults() {\n tmpSongData = new Array();\n startDate = new Date($('#start-date').val());\n endDate = new Date($('#end-date').val());\n\n if (!originalSongData) {\n originalSongData = songData;\n }\n $.each(songData, function (index, value) {\n relDate = new Date(value['Release Date']);\n\n if ((Number(relDate) > Number(startDate)) && (Number(relDate) < Number(endDate))) {\n tmpSongData.push(value);\n }\n });\n\n songData = tmpSongData;\n buildSongData();\n}", "title": "" }, { "docid": "af303467a41fecd02363350aa4b60368", "score": "0.55898464", "text": "function filterData(date) {\n console.log(`The date supplied for filtering is ${date}`);\n var filteredData = data.filter(sighting => sighting.datetime === date);\n console.log(`The filtered data is: ${filteredData}`);\n return filteredData;\n}", "title": "" }, { "docid": "acce721fc5b193c4ccf54dafe33b0cbd", "score": "0.5516233", "text": "function getMoments(input){\n\tvar output = _.map(input, (d) => {\n return moment(d.created_at); })\n\treturn output\n}", "title": "" }, { "docid": "b93094cb438e80a7fc08bb8f4f071964", "score": "0.5501616", "text": "function search(date) {\n var search_results = [];\n for(i=0;i<data.length;i++)\n {\n if (date === data[i][\"datetime\"])\n {\n search_results.push(data[i]);\n }\n }\n return search_results;\n }", "title": "" }, { "docid": "4d909d1df65e58f5ab955760123b8d6f", "score": "0.5425314", "text": "function getTodayLessons() {\n lessonsToday = []; // Clear the array first\n var lessons = lessonData.lesson; // Lesson objects in JSON\n var today = dayofweek(); // Get name of today\n for (var i = 0; i < lessons.length; i++) { // Loop through every lesson object\n var days = lessons[i].days;\n for (var j = 0; j < days.length; j++) { // Loop through each Day array that is in the lesson object\n if (days[j] == today) { // Filter just today in Day array\n lessonsToday.push(lessons[i]); // Add lesson object into a new Array that contains just Todays lessons.\n }\n }\n }\n }", "title": "" }, { "docid": "4e3baec33f60a224f1632a58ae61e8c9", "score": "0.53886455", "text": "function searchDate() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // console.log(\"initiated search\");\n\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n // log the input\n // console.log(inputValue);\n\n // filter based on input value\n var filteredUfos = ufos.filter((ufo) => ufo.datetime === inputValue);\n\n // console.log(filteredUfos);\n\n displayUfos(filteredUfos);\n}", "title": "" }, { "docid": "10015abaf83f71f7bc5a959478b6db3b", "score": "0.53718656", "text": "get allMillennialVampires() {\n let millennials = [];\n\n if (this.yearConverted > 1980) {\n millennials.push(this);\n }\n for (const offspringNode of this.offspring) {\n const millennialAfter = offspringNode.allMillennialVampires; \n millennials = millennials.concat(millennialAfter);\n }\n return millennials;\n }", "title": "" }, { "docid": "232b9d01f799e5436fafd8faba2beb9f", "score": "0.5345259", "text": "function filterData(){\n var date = d3.select(\"#datetime\").property(\"value\");\n var filteredData = data_final.filter(row => row.datetime === date);\n makeTable(filteredData);\n}", "title": "" }, { "docid": "4853d639e15d77351747ace58b5b3f33", "score": "0.53354305", "text": "function filterEvents(results) {\n var currentTime = moment();\n var today = moment().startOf('day');\n var tomorrow = moment(today).add(1, 'days').add(1, 'hour');\n \n _.each(results, function(r, index) {\n var events = [];\n \n _.each(r.events, function(e) {\n var eventIsToday = (e.date >= currentTime.toDate());\n var eventNotTomorrow = (e.date < tomorrow.toDate());\n \n if (eventIsToday && eventNotTomorrow) {\n events.push(e);\n }\n });\n \n // Update the results to the filtered r(esult).\n r.events = events;\n results[index] = r;\n });\n \n return results;\n }", "title": "" }, { "docid": "eddfaef2270d009a515986de4da17847", "score": "0.53223616", "text": "get allMillennialVampires() {\n let vampires = [];\n if (this.yearConverted > 1980) {\n vampires.push(this);\n }\n for (const vamp of this.offspring) {\n const findVamp = vamp.allMillennialVampires;\n vampires = vampires.concat(findVamp);\n }\n return vampires;\n }", "title": "" }, { "docid": "41a64dfc8a327af6c01c803cca9eb1b2", "score": "0.53132695", "text": "function getMoments(input, dataKey){\n\tvar output = _.map(input[dataKey], (d) => {\n return moment(d.created_at); })\n\treturn output\n}", "title": "" }, { "docid": "2c18141aac9c4134c31cd4e8d65320c8", "score": "0.5309833", "text": "getDates(start, end) {\n let result = []\n\n // get monts from props\n while (this.getDiffMonths(start, end) > 0) {\n result.push({\n year: moment(start, DATE_FORMAT).format('YYYY'),\n month: moment(start, DATE_FORMAT).format('M')\n });\n\n // add 1 month\n start = moment(start, DATE_FORMAT).add(1, 'months').format(DATE_FORMAT);\n }\n\n return result\n }", "title": "" }, { "docid": "65a78064db73c875647ed66bcfc25c62", "score": "0.52954185", "text": "function getBookingsBasedOnDate(date) {\r\n return bookings\r\n .chain()\r\n .find({ 'bookingDateTime': { $regex: date } })\r\n .data({ removeMeta: true });\r\n}", "title": "" }, { "docid": "ac5837e30c97ff45b6f982bf8640f4ac", "score": "0.5284919", "text": "function filterByDate() {\n var tbody = d3.select(\"tbody\");\n tbody.html(\"\");\n \n var filterByDateChoice = d3.select(\"#dateSelect\").property(\"value\");\n\n data.forEach(object => {\n if(object.datetime == filterByDateChoice) {\n var tr = tbody.append(\"tr\");\n Object\n .values(object)\n .forEach((object) => {\n tr.append(\"td\").text(object);\n });\n }; \n });\n}", "title": "" }, { "docid": "690b263414caa7b44df6a2af8c07765d", "score": "0.5276412", "text": "startAndEndTimePeriodMomentsForDate(date) {\n let result = {start: false, end: false};\n\n let startOfTimePeriod = this.timePeriod.startOfTimePeriodForDate(date);\n let startIndex = this.dateIndex(Number(startOfTimePeriod));\n\n if (startIndex !== -1) {\n result.start = this.moments[startIndex];\n if (startIndex+1 < this.moments.length) {\n result.end = this.moments[startIndex+1];\n }\n } else {\n let endOfTimePeriod = this.timePeriod.forwardOneTimePeriodForDate(startOfTimePeriod);\n let endIndex = this.dateIndex(Number(endOfTimePeriod));\n if (endIndex !== -1) {\n result.end = this.moments[endIndex];\n }\n }\n return result;\n }", "title": "" }, { "docid": "4030bcdd36854b3b2ca03177a654bcd1", "score": "0.5232072", "text": "GetAllDateTimePatterns() {\n\n }", "title": "" }, { "docid": "5f045dc6947155d8a039504ef12ea04e", "score": "0.5221564", "text": "filterByRange(array,start,end){\n let a = array;\n let b = [];\n \n for(var i = 0;i<a.length;i++){\n if(this.stringToDate(a[i].date)>=this.stringToDate(start) && this.stringToDate(a[i].date)<=this.stringToDate(end)){\n b.push(a[i])\n }\n }\n return b;\n }", "title": "" }, { "docid": "7b06d0cd73789828d0b567c8303ce0b8", "score": "0.5215374", "text": "function filterData(set_dates=false) {\n var render_data = raw_data;\n\n // filter by project ID\n var filter_id = document.getElementById(\"project_id\").value;\n if (filter_id != \"Select Project ID\" && filter_id != \"\") {\n render_data = render_data.filter(function (el) {\n return el.project_id == filter_id;\n });\n }\n \n // filter by data type\n var filter_type = document.getElementById(\"data_type\").value;\n if (filter_type != \"Select Data Type\" && filter_type != \"\") {\n render_data = render_data.filter(function (el) { // var filter_by_id = \n return el.data_type == filter_type;\n });\n }\n\n if(set_dates) {\n _autoSetDates(render_data);\n }\n\n // filter by date\n if(!$('#exp_time').prop('checked') && start_date && end_date) {\n render_data = render_data.filter(function (el) { //filterDate(render_data);\n timestamp = moment(el.timestamp);\n return (timestamp.isAfter(start_date-1) && timestamp.isBefore(end_date+1));\n });\n }\n\n return render_data;\n}", "title": "" }, { "docid": "932333c82d20b16afe206b68c36eeaf0", "score": "0.5206956", "text": "find(day) {\n return list\n .map(attribute => ({\n ...attribute,\n targetDate: attribute.includesDay(day),\n }))\n .filter(a => a.targetDate)\n .sort((a, b) => a.targetDate.compare(b.targetDate));\n }", "title": "" }, { "docid": "aec16666f6223251d189d448e73e72c5", "score": "0.5205643", "text": "function filterLatestMovies() {\n const filter = movies.filter((item) => {\n return item.Year > 2014\n });\n filter.map(getAllMovieDetails);\n console.log(filter);\n\n}", "title": "" }, { "docid": "ff6f80b96085e0dd144316848f813f53", "score": "0.5169316", "text": "function day_mosaics(date, newlist) {\n // Cast\n date = ee.Date(date);\n newlist = ee.List(newlist);\n\n // Filter an_image_coll between date and the next day\n var filtered = an_image_coll.filterDate(date, date.advance(1, 'day'));\n\n var image = ee.Image(filtered.mosaic()); // Make the mosaic\n \n image = image.copyProperties({source: filtered.first(),\n properties: ['system:time_start']\n });\n image = image.set({system_time_start: filtered.first().get('system:time_start')});\n\n // Add the mosaic to a list only if the an_image_coll has images\n return ee.List(ee.Algorithms.If(filtered.size(), newlist.add(image), newlist));\n }", "title": "" }, { "docid": "ff6f80b96085e0dd144316848f813f53", "score": "0.5169316", "text": "function day_mosaics(date, newlist) {\n // Cast\n date = ee.Date(date);\n newlist = ee.List(newlist);\n\n // Filter an_image_coll between date and the next day\n var filtered = an_image_coll.filterDate(date, date.advance(1, 'day'));\n\n var image = ee.Image(filtered.mosaic()); // Make the mosaic\n \n image = image.copyProperties({source: filtered.first(),\n properties: ['system:time_start']\n });\n image = image.set({system_time_start: filtered.first().get('system:time_start')});\n\n // Add the mosaic to a list only if the an_image_coll has images\n return ee.List(ee.Algorithms.If(filtered.size(), newlist.add(image), newlist));\n }", "title": "" }, { "docid": "cbe380f11f2611cb0679ccfef5d80fcc", "score": "0.51623917", "text": "get allMillennialVampires() {\n let vampires = []; // 1\n if (this.yearConverted > 1980) {\n vampires.push(this); // 2\n }\n // eslint-disable-next-line no-restricted-syntax\n for (const offspring of this.offspring) {\n const newVampires = offspring.allMillennialVampires;\n if (newVampires !== null) {\n vampires = vampires.concat(newVampires);\n }\n }\n return vampires;\n }", "title": "" }, { "docid": "c3525a668a19b0f29d6305f48e1ff1f1", "score": "0.51535016", "text": "get allMillennialVampires() {\n let millenialVampire = [];\n if (this.yearConverted >= 2000) {\n millenialVampire.push(this);\n }\n\n for (const descendent of this.offspring) {\n let millenialDescendent = descendent.allMillennialVampires;\n millenialVampire.push(millenialDescendent)\n }\n return millenialVampire;\n }", "title": "" }, { "docid": "db6a38343b4bc237b842b90b60908426", "score": "0.5139744", "text": "function createfilterfordates() {\n var filter = \"\";\n\n //filter = \"Type:Radio\";\n\n if (datebegin() != null && dateend() == null) {\n // [1995-12-31T23:59:59.999Z TO *]\n //Substract 1 millisecond from date before converting to string.\n filter += \"PubStartDate:[\" + format.getSolrDateStr(new Date(datebegin()), -1) + \" TO *]\";\n } else if (datebegin() == null && dateend() != null) {\n // [* TO 2007-03-06T00:00:00Z]\n //Add 1 millisecond from date before converting to string.\n filter += \"PubStartDate:[* TO \" + format.getSolrDateStr(new Date(dateend()), 1) + \"]\";\n //filter += \"PubStartDate:[1900-01-01T00:00:00.000Z TO \" + format.getSolrDateStr(new Date(dateend())) + \"]\";\n } else if (datebegin() != null && dateend() != null) {\n // [1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z]\n //Substract and add 1 millisecond from/to dates before converting to string.\n filter += \"PubStartDate:[\" + format.getSolrDateStr(new Date(datebegin()), -1) + \" TO \" + format.getSolrDateStr(new Date(dateend()), 1) + \"]\";\n }\n\n return filter;\n }", "title": "" }, { "docid": "d31d2960584fa6a6a8abeee3520e2162", "score": "0.51389766", "text": "function mapSyncoDates(results) {\n var syncoDatesArray = {};\n console.log('mapSyncoDates', results);\n return Array.prototype.reduce.call(results, function(collection, item) {\n var datetime = new Date(item.datetime.getFullYear(), item.datetime.getMonth(), item.datetime.getDate());\n if (!syncoDatesArray[datetime]) {\n syncoDatesArray[datetime] = datetime;\n collection.push(datetime);\n }\n return collection;\n }, []);\n}", "title": "" }, { "docid": "741cfd86e2a71aed9098a8d64b692a4a", "score": "0.5136802", "text": "getAllComments() {\n const now = new Date();\n this.commentProvider.getAll({ url: 'comment' }).subscribe((comments) => {\n this.comments = comments;\n /* this.comments.forEach(comment => {\n const day = this.dateProvider.getDifference(comment.comment.dateComment, now);\n comment.comment.dateComment = this.dateProvider.getStructDate(day, comment.comment.dateComment);\n });*/\n this.commentsTmp = this.comments.slice(this.limit, this.limit + 5);\n this.limit += 5;\n this.hideSpinner = true;\n });\n }", "title": "" }, { "docid": "f007a92e8fab65ccaf598fb4e245db2b", "score": "0.5136738", "text": "function getCurrentTags(name,date){\n let tags = [];\n let events = db.assemblies[name].events;\n for (let i=0;i<events.length;i++) {\n let event = events[i];\n if (event.date >= date) break;\n if (event.verb == 'add-tag') { \n if (!(tags.includes(event.object))) tags.push(event.object);\n } else if (event.verb == 'remove-tag') tags = tags.filter(value => value != event.object );\n else if (event.verb == 'expire-into') tags = [];\n }\n return tags;\n }", "title": "" }, { "docid": "9d5e8a6f97b0dbba7b789ec0c48d2d61", "score": "0.5134352", "text": "function getTheDates (date, until) {\n return new Promise((resolve, reject) => {\n twitter.getSearch({\n 'q': cashTag,\n 'count': 10,\n 'since': date,\n 'until': until,\n }, reject, resolve)\n\n var alchemy_language = watson.alchemy_language({\n api_key:process.env.ALCHEMY_KEY\n })\n })\n}", "title": "" }, { "docid": "0e9ce7d1159f2aa24ad37a6f6ae94043", "score": "0.5133144", "text": "function filtrarAuto(){\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\n \n mostrarAutos(resultado);\n}", "title": "" }, { "docid": "d090f51e928c8bcc184dcbefad35730e", "score": "0.5130638", "text": "function getDateFieldsList() {\n return _domUtils.getQSElementsAsArray(_this.getDOMElement(), 'input').filter(function (inputEl) {\n var id = inputEl.getAttribute('id');\n if (!id) {\n return false;\n }\n return id.indexOf('start') > 0 || id.indexOf('end') > 0;\n });\n }", "title": "" }, { "docid": "51984046b7a751e62d8f2e01b7af8e3b", "score": "0.5128485", "text": "get allMillennialVampires() {\n let millenialVampire = [];\n if (this.yearConverted >= 2000) {\n millenialVampire.push(this);\n }\n\n for (const descendent of this.offspring) {\n let millenialDescendent = descendent.allMillennialVampires;\n millenialVampire.push(millenialDescendent);\n }\n return millenialVampire;\n }", "title": "" }, { "docid": "48b9323cdc5d2902651dbcf8acf30152", "score": "0.51205146", "text": "getMovieProjections(name) {\n let screens = []\n for (const [index, value] of this.state.projectionsInSelectedDate.entries()) {\n if (this.state.projectionsInSelectedDate[index].movie.name == name) {\n screens.push(this.state.projectionsInSelectedDate[index])\n }\n }\n screens.sort((a, b) => parseFloat(a.time) - parseFloat(b.time)) //sorts projections by time\n return screens;\n }", "title": "" }, { "docid": "57c38386e47453cc8308a957c785607e", "score": "0.5105832", "text": "filter(start, end) {\n\t\treturn module.exports(this.data.filter((d) => {\n\t\t\t// return true;\n\t\t\t// return dayjs(d.date, \"DD/MM/YYYY\").isBetween(dayjs(), dayjs().subtract(4, 'months'));\n\t\t\t// return dayjs(d.date, \"DD/MM/YYYY\").isSame(dayjs(), 'year');\n\t\t\treturn dayjs(d.date, \"DD/MM/YYYY\").isBetween(start, end);\n\t\t}));\n\t}", "title": "" }, { "docid": "a76405338510744dd8ca022ffb5d6e8e", "score": "0.509533", "text": "async function filterOffers(req, res) // /:initdate/:enddate\n{\n const data = await Vehicle.find({rented: false}).exec();\n res.status(200).send(data)\n}", "title": "" }, { "docid": "6a96de2ff6258a23f2383142ac063338", "score": "0.5085809", "text": "getItems(forDate) {\n // commit any uncommited changes\n this.flush();\n\n // We are sure that this._fullHistory is sorted based on date (older first)\n // Therefore we iterate and append values together up to the date\n let result = [];\n\n let includedDates = Object.keys(this._fullHistory).filter((itemDate) => {\n // Dates before or equal 'forDate'\n // lexical ordering will be used\n return (itemDate.localeCompare(forDate) <= 0);\n });\n\n for (let date of includedDates) {\n result = result.concat(this._fullHistory[date]);\n }\n\n return result;\n }", "title": "" }, { "docid": "75ffe1d47aca7e7daf1c206c10a21600", "score": "0.50825423", "text": "function extractDates(sentences) {\n let datePattern = /\\b(\\d{1,2})-([A-Z][a-z]{2})-(\\d{4})\\b/g;\n let result = [];\n for (let sentence of sentences) {\n // let dates = sentence.match(datePattern);\n // for (let date of dates) {\n // let [day, month, year] = date.split('-');\n // result.push(`${date} (Day: ${day}, Month: ${month}, Year: ${year})`)\n // }\n\n // second solution\n while (match = datePattern.exec(sentence)) {\n result.push(`${match[0]} (Day: ${match[1]}, Month: ${match[2]}, Year: ${match[3]})`)\n }\n }\n console.log(result.join('\\n'));\n}", "title": "" }, { "docid": "92ce31151edac05cf3910bbe023f8de5", "score": "0.50823873", "text": "function getMorningMood(data) {\n console.log('getMorningMood ran')\n// there are more than 30 entries, it extracts the most recent 30\n if (data.length > 30) {\n for (let i = data.length - 30; i < data.length ; i++) {\n morning.y.push(data[i].morningRating)\n morning.x.push(data[i].created)\n }\n // if there are less than 30, it extracts all of the data\n } else {\n for (let i = 0; i < data.length; i++) {\n morning.y.push(data[i].morningRating)\n morning.x.push(data[i].created)\n }\n }\n console.log(morning)\n}", "title": "" }, { "docid": "f78387d715f88be3807c21d31be73c97", "score": "0.50780725", "text": "addMoments(filteredData, keys) {\n if (filteredData === false) {\n this.moments = false;\n } else {\n this.moments = this.moments.concat(filteredData.map(x => this.newMoment(x, keys)));\n }\n }", "title": "" }, { "docid": "d0eb99acf295db62a96466b10a82161c", "score": "0.50707614", "text": "function getDates() {\n var queryTaskdate = new esri.tasks.QueryTask(AppConfig.MapLayers[3].url);\n\n var querydate = new esri.tasks.Query();\n querydate.outFields = [\"MINDATE, MAXDATE\"];\n querydate.where = \"1 = 1\";\n queryTaskdate.execute(querydate, getMinMaxDate, onError);\n}", "title": "" }, { "docid": "ea8bf792aa56dd1ee9d1f908ee673d9c", "score": "0.5065808", "text": "getTodayMeals() {\n\n var filter = '?date=' + moment().format('YYYYMMDD');\n\n return new TotoAPI().fetch('/diet/meals' + filter)\n .then((response) => response.json());\n\n }", "title": "" }, { "docid": "4327ea8d925668ee88f725ef1162907c", "score": "0.5064035", "text": "function getEventList(str, date)\n{\n\tvar regEvent = new RegExp(\"BEGIN:VEVENT[\\\\s\\\\S]{1,40}DTSTART:\"+date+\"[\\\\s\\\\S]{1,500}END:VEVENT\", \"g\");\n\t//fileContent.innerText = reader.result.match(regEvent);\n\tvar regTmp = new RegExp(\"(,?\\\"[A-Z-]*):\",\"g\");\n\tvar result = str.match(regEvent);\n\tif(result != null && result != \"\")\n\t{\n\t\teventList = []; \n\t\tclass_status = [];\n\t\tresult.forEach(function(e){\n\t\t\tvar json = \"{\"+\n\t\t\t\t\t\t\te.replace(/BEGIN:VEVENT\\r?\\n/g,\"\\\"\") //remove the beginning\n\t\t\t\t\t\t\t.replace(/\\r?\\nEND:VEVENT/g,\"\\\"\")\t //remove the end\n\t\t\t\t\t\t\t.replace(/\\r?\\n([^A-Z])/g, \"$1\")\t //remove illegal new line\n\t\t\t\t\t\t\t.replace(/\\r?\\n/g,\"\\\",\\\"\")\t\t\t //new line to ,\n\t\t\t\t\t\t\t.replace(regTmp, \"$1\\\":\\\"\")\t\t //: to \":\"\n\t\t\t\t\t+\"}\";\n\t\t\tlog(json);\n\t\t\tvar cours = JSON.parse(json);\n\t\t\tcours.TBEGIN = new Date().fromStampICS(cours.DTSTART);\n\t\t\tcours.TEND = new Date().fromStampICS(cours.DTEND);\n\t\t\teventList.push(cours);\n\t\t});\n\t\t\t\t\t\t\n\t\teventList.sort(function(a,b){\n\t\t\treturn a.TBEGIN.getHours() - b.TBEGIN.getHours();\n\t\t});\n\t\t//Now we get all event of today in the list\n\t\tlog(eventList.length);\n\t\t//Now we have eventList, attaching it to rooms\n\t\twindow.top.$(\"#classinfo\").text(\"\")\n\t\teventList.forEach(function(v, ind){\n\t\t\t//debugger\n\t\t\tclass_status.push(getClassStatus(v.TBEGIN, v.TEND));\n\t\t\tlog(\"Cours \"+ind +\":\");\n\t\t\tlog(v.TBEGIN.getHours()+\":\"+v.TBEGIN.getMinutes()+ \" -> \" + (v.TEND.getHours())+\":\"+v.TEND.getMinutes());\n\t\t\tlog(v.SUMMARY);\n\t\t\tlog(v.LOCATION);\n\t\t\tvar info = window.top.$(\"#classinfo\").text() + \"=======\\n\" +\n\t\t\t\tv.TBEGIN.getHours()+\":\"+v.TBEGIN.getMinutes()+ \" -> \" + \n\t\t\t\t(v.TEND.getHours())+\":\"+v.TEND.getMinutes() + \"\\n\" + v.SUMMARY + \"\\n\" +v.LOCATION +\n\t\t\t\t\"\\n\\n\";\n\t\t\twindow.top.$(\"#classinfo\").text(info);\n\t\t\tlog(class_status)\n\t\t\tchange_salle_stats(v.LOCATION, class_status[ind]); //?\n\t\t});\n\n\t\t//Show shortest path\n\t\tsetPathControl();\n\t}\n}", "title": "" }, { "docid": "116374cd75d2882be528baa7324f76f8", "score": "0.505734", "text": "_filterByWatched(movie) {\n return movie.watched;\n }", "title": "" }, { "docid": "6b74d19b4700580b130650665e578493", "score": "0.5053311", "text": "function addDates() {\n var dateArray = [];\n var tempArray = currentReturn.slice($scope.startDate, $scope.endDate + 1);\n for (var i = 0; i < tempArray.length; i++) {\n dateArray.push(tempArray[i].time);\n }\n return dateArray;\n }", "title": "" }, { "docid": "4e47d3a33357bd07b236161d42b902a9", "score": "0.5047722", "text": "async function getCompleteTimesForSimilarDatesInParking(listOfDates, parkingName){\n var datesRanges=[];\n for(let date of listOfDates.values()){\n var dateS=dateFormat(date, \"yyyy-mm-dd\");\n //datesRanges=datesRanges+\"\\n{\\\"range\\\": {\\\"postDate\\\": {\\\"gte\\\": \\\"\"+dateS+\"\\\",\\\"lte\\\": \\\"\"+dateS+\"\\\",\\\"format\\\": \\\"yyyy-MM-dd\\\"}}},\";\n datesRanges.push({\n \"range\": {\n \"postDate\": {\n \"gte\": dateS,\n \"lte\": dateS,\n \"format\": \"yyyy-MM-dd\"\n }\n }\n }); \n }\n\n return await client.search({\n \"index\": index,\n \"body\": {\n \"size\": 1000,\n \"query\": { \n \"bool\": {\n \"must\": [\n {\n \"range\": {\n \"message.actuel\": {\n \"lt\": 3\n }\n }\n }\n ],\n \"filter\": {\n \"bool\": {\n \"must\":[\n {\n \"term\": {\n \"parkingName\": {\n \"value\": parkingName\n }\n }\n }\n , \n {\n \"range\":{\n \"message.ouvert\":{\n \"gte\": 1\n }\n } \n } \n ], \n \"should\": datesRanges,\n \"minimum_should_match\" : 1\n }\n }\n }\n }\n}\n}); \n}", "title": "" }, { "docid": "2d563f4dc434fb79782c0f18dd2d90ae", "score": "0.5046156", "text": "function getEventsByDate(date) {\n service.filters.range = 'custom';\n service.filters.startDate = moment(date).format('YYYY-MM-DD');\n service.filters.endDate = moment(date).format('YYYY-MM-DD');\n }", "title": "" }, { "docid": "5ea457982dc2c31b8bf63b96c3fe4016", "score": "0.5045835", "text": "function choosenDate(day=1) {\n return dati.filter(el => el.data === allDate[day]) \n }", "title": "" }, { "docid": "c85ce6767a6af9bac8ad8396a1d04059", "score": "0.5042696", "text": "addMoments(filteredData, keys) {\n this.moments = this.moments.concat(filteredData.map(x => this.newMoment(x, keys)));\n this.sortMomentsByDate();\n }", "title": "" }, { "docid": "e4f20ec7379c57a714929cca6b113118", "score": "0.50198364", "text": "get() {\n let outList = this.log.filter((point) => {\n return (now() - point.timestamp < this.window);\n });\n\n return outList;\n }", "title": "" }, { "docid": "89aba616698bb6317bf4fa46dc2d9d48", "score": "0.50038266", "text": "function filterByEndDate(doctor) {\n return doctor.end > 2000\n}", "title": "" }, { "docid": "d93fd9ca0a37caaa73e018fb0f74ab87", "score": "0.50015074", "text": "function filterbyDate(filterDate7,filterShift7,filterMachine7){\r\n console.log(filterDate7+filterShift7+filterMachine7);\r\n var serialNum = '';\r\n filterViuw(serialNum,filterDate7,filterShift7,filterMachine7)\r\n}", "title": "" }, { "docid": "3b6a8a167de081a1606ff26e50386fe5", "score": "0.4984918", "text": "function rangeDates(date = new Date(), processCallBack) {\n\n\n\n var todayWithoutTime = moment(date).startOf('day');\n var startOfMonth = moment(todayWithoutTime).startOf('month');\n var diff = (todayWithoutTime.date() - startOfMonth.date());\n var daysOfMonth = [];\n\n for (var i = 0; i <= diff; i++) {\n daysOfMonth.push(processCallBack(startOfMonth));\n startOfMonth = startOfMonth.add(1, 'day');\n }\n\n return daysOfMonth;\n }", "title": "" }, { "docid": "56dec21366466930294d5f951d1119fb", "score": "0.49685225", "text": "getPage(skip = 0, top = 10, filterConfig) {\n let array = messages.slice(skip, top);\n if (filterConfig !== undefined) {\n let { author, dateFrom, dateTo, text } = filterConfig[0];\n let author1 = author,\n text1 = text;\n console.log(\"text: \" + text1 + \"\\ndateFrom: \" + dateFrom + \"\\ndateTo: \" + dateTo + \"\\nauthor: \" + author1);\n if (author1 === true) {\n console.log(\"!!!!!!!!!!!!!!!!!!!!!!!!!!!\");\n array.sort((a, b) => a.author > b.author ? 1 : -1);\n }\n if (text1 === true) {\n console.log(\"!!!!!!!!!!!!!!!!!!!!!!!!!!!\");\n array.sort((a, b) => a.text > b.text ? 1 : -1);\n }\n if ((dateFrom !== undefined) && (dateTo !== undefined)) {\n console.log(\"!!!!!!!!!!!!!!!!!!!!!!!!!!!\");\n //array = array.filter(({ createdAt }) => (createdAt >= dateFrom && createdAt <= dateTo));\n if (array !== undefined) {\n array.sort((a, b) => a.createdAt > b.createdAt ? 1 : -1);\n }\n }\n }\n return array;\n }", "title": "" }, { "docid": "f5670136c83e6186f733baa49b1d7e29", "score": "0.49677727", "text": "function getArrayForDate(currentDate) {\n var result = []\n\n birthdays.forEach(\n function (item) {\n var date = item.date\n \n if (currentDate.getDate() == date.getDate() && currentDate.getMonth() == date.getMonth()) {\n var yearsOld = currentDate.getYear() - date.getYear()\n var res = {text : item.fio + \" \" + item.date.toLocaleDateString() + \" (\" + yearsOld + \")\"}\n result.push(res)\n }\n }\n )\n\n return result\n}", "title": "" }, { "docid": "e7d92da90ca6939265c1ffaf6d5061ba", "score": "0.49541476", "text": "parseDates(data) {\n return data.map(attendee => {\n attendee.dates = attendee.dates.map(date => moment(date));\n return attendee;\n })\n }", "title": "" }, { "docid": "da4a2d97dab9c64bb19978a263d22f25", "score": "0.49502492", "text": "getMeals(date, dateFrom) {\n\n\t\tvar filter = '';\n\t\tif (date != null) filter = '?date=' + date;\n\t\telse if (dateFrom != null) filter = '?dateFrom=' + dateFrom;\n\n\t\treturn new TotoAPI().fetch('/diet/meals' + filter).then((response) => response.json());\n\t}", "title": "" }, { "docid": "ec8761b82aa805de63a85a8b00adaa71", "score": "0.4947969", "text": "function dateSelection(){\n\n d3.event.preventDefault(); //prevent refreshing the page\n\n console.log(dateInput.property(\"value\")); //print the value (info for date that was input)\n //create a new table showing only the filterd data\n var newTableData = tableData.filter(ufosighting => ufosighting.datetime===dateInput.property(\"value\"))\n displayData(newTableData);\n}", "title": "" }, { "docid": "08c02da2fa7ee12b502e2c93ff85cf78", "score": "0.49432892", "text": "function filterTable() {\n let filterDatetime = document.getElementById(\"dateSelector\").value;\n let tableData = Array();\n if (filterDatetime == \"All\")\n tableData = data;\n else\n tableData = data.filter(sighting => sighting.datetime == filterDatetime);\n document.getElementById(\"sightings\").innerHTML = objectList2TableRows(tableData);\n document.getElementById(\"sightingCount\").innerHTML = String(tableData.length) + \" Sightings\"\n}", "title": "" }, { "docid": "bf00fc05ef86b8c727fd5dafcaf32568", "score": "0.49247658", "text": "function getSyncoDates(callback){\n var sampleCollection = database.collection(databaseName);\n\n sampleCollection\n .find({\"_id\": { $gte: 0 }}, {\"_id\":0, \"datetime\": true})\n .sort({\"datetime\":-1})\n .toArray(function(err, docList){\n callback(mapSyncoDates(docList));\n });\n}", "title": "" }, { "docid": "715f32490204020ebf488b0ff212513f", "score": "0.49243155", "text": "dataRange(key, fromDate, toDate) {\n fromDate = this.formatFromDate(fromDate, this.timePeriod.label);\n toDate = this.formatToDate(toDate, this.timePeriod.label);\n let filteredMoments = this.filteredMomentsByDate(fromDate, toDate);\n let dateValues = filteredMoments.map(x => x.dateValue([key]));\n return {dateValues: dateValues}\n }", "title": "" }, { "docid": "e841f90db9da0e6b7483c7512831638a", "score": "0.49242467", "text": "function filterScenes(scenes, metadataInput) {\n filteredScenes = [];\n for (var i=0; i < scenes.length ; i++){\n if (scenes[i].date.getMonth()===metadataInput.to.getMonth() && scenes[i].date.getFullYear() >= metadataInput.to.getFullYear() - nbPastYears){\n filteredScenes.push(scenes[i]);\n }\n } \n return filteredScenes;\n}", "title": "" }, { "docid": "e742ffd61391f95a6b4afd19526e8a42", "score": "0.49056366", "text": "function filterNew() {\n // For each item container\n for (i = 0; i < containers.length; i++) {\n var months = containers[i].getElementsByClassName(\"calendar\")[0].getElementsByClassName(\"month\");\n var monthsArray = [].slice.call(months);\n\n var currentMonth = MONTHS[currentMonthIndex];\n var lastMonth = \"\";\n currentMonth == \"january\" ? lastMonth = \"december\" : lastMonth = MONTHS[currentMonth - 1];\n\n currentMonthDiv = containers[i].getElementsByClassName(\"calendar\")[0].getElementsByClassName(currentMonth)[0];\n var lastMonthDiv = \"\";\n currentMonthDiv.classList.contains(\"january\") ? lastMonthDiv = months[11] : lastMonthDiv = currentMonthDiv.previousSibling;\n\n if (!(currentMonthDiv.classList.contains(\"available\") && !lastMonthDiv.classList.contains(\"available\"))) {\n containers[i].classList.add('is-filtered');\n }\n }\n}", "title": "" }, { "docid": "a25946379aa9f607e15dad9954b6ca97", "score": "0.49032965", "text": "function dateAsStringFilter() {\n return function (date) {\n return moment(date).toDate();\n };\n }", "title": "" }, { "docid": "fb0c0446f53f3e57075d48998a9aa1a2", "score": "0.49022925", "text": "GetAllMotions() {\n this.HelperGetMotions(motionUrl) \n }", "title": "" }, { "docid": "a7874bc66c5ef74c7a2b220b3e1c60b2", "score": "0.4901369", "text": "function filterByDebut(year){\n var date = [],j=0;\n for(i=0;i<players.length; i++)\n { \n if(year==players[i][\"debut\"])\n { \n date[j] = players[i];\n j++;\n }\n }\n return date;\n}", "title": "" }, { "docid": "57ada875a638c214d142dd5c0702e54f", "score": "0.4876283", "text": "function filterArticles(articles) {\n console.log(dateInput.value)\n let articulos = articles[1].docs\n let articleToReturn = articulos.filter(article => {\n if(sectionName.value === \"null\"){\n return article.pub_date.slice(0, 10) === dateInput.value \n }else{\n return (article.pub_date.slice(0, 10) === dateInput.value && article.section_name === sectionName.value)\n }\n })\n \n console.log(articleToReturn)\n console.log(\"filter articles function successful\")\n return articleToReturn\n}", "title": "" }, { "docid": "cdb22f4386cd7e95910f4884a16cc890", "score": "0.48710313", "text": "generateSelectMonths() {\n let allRecords = this.props.allRecords\n let months = []\n let key = \"\"\n\n if (allRecords.length !== 0) {\n let startDate = allRecords.sort((a, b) => (new Date(a.date) - new Date(b.date)))[0].date\n let { startMonth, startYear, currentMonth, currentYear } = this.getDatesSelect(startDate)\n\n for (let year = startYear; year <= currentYear; year++) {\n for (let month = startMonth; month <= currentMonth; month++) {\n month = (month < 10) ? ('0' + month) : month\n key = `${month}/${year}` \n // let m = moment(month).format(\"MMM\")\n // key = `${month} ${year}`\n months.push(key)\n }\n }\n }\n return months;\n }", "title": "" }, { "docid": "4fc651ec9b03aca67763d5b5e1734e78", "score": "0.4870483", "text": "_generateTourDates () {\n return []\n }", "title": "" }, { "docid": "30b3f77171d6f69100fe355a37ef682f", "score": "0.4867672", "text": "filtreDate (key, type) {\n const date = find(this.dateFilters, { key })\n return date ? date[type] : null\n }", "title": "" }, { "docid": "1950894ce5b3d4f5a42a2510afe8f4d2", "score": "0.48675466", "text": "function getDates() {\n clients = Clients.find().fetch();\n var dates = [];\n // var displayDates =[];\n clients.forEach( function(client){\n if(client.drinks){\n\tclient.drinks.forEach( function(drink){\n\t var now = new Date();\n\t var aMonthBack = new Date(now.getFullYear(), now.getMonth()-1, now.getDate()+1).getTime();\n// if( drink.day.getDate() == 1)\n\t// debugger;\n\t if( drink.day && (drink.day.getTime() > aMonthBack) && !datesHasDate(dates,drink.day) ){\n\t dates.push( [drink.day,drink.day.toLocaleDateString()] );\n\t // displayDates.push( drink.day.getTime() );\t \n\t }\n\n\t});\n }\n });\n\n if( !datesHasDate(dates,new Date()) ){\n dates.push([new Date(),(new Date()).toLocaleDateString()]);\n }\n \n return dates.sort(function(arr,arr2){ return arr[0].getTime() - arr2[0].getTime(); } ).reverse();\n // return [displayDates.sort().reverse().map(function(obj){ return ( new Date(obj) ).toLocaleDateString(); }), dates.sort().reverse()]; \n }", "title": "" }, { "docid": "a3548a20eabe67fb14317aa6f674d632", "score": "0.486563", "text": "function fancyDates(){\n\tjQuery(\"#filter_container .dateformat\").each(function(index){\n\t\tjQuery(this).prev(\"input\").datepicker({\n\t\t\tchangeMonth: true,\n\t\t\tchangeYear: true\n\t\t});\n\t});\n}", "title": "" }, { "docid": "b9dda26deb134466cb78106c60853a2f", "score": "0.4864485", "text": "get fullDateArray() {\n let startDate = this.minDate;\n let endDate = this.maxDate;\n // Use moments to generate start and end of array if to set min and max dates\n if (this.minDate === false) {\n startDate = this.firstMomentDate;\n }\n if (this.maxDate === false) {\n endDate = this.lastMomentDate;\n }\n return this.timePeriod.createDateArray(startDate, endDate);\n }", "title": "" }, { "docid": "902498d22af00b57f7728b3f53718ce5", "score": "0.48637623", "text": "availableChartDates() {\n return _.map(this.indicators, indicator => {\n return moment(indicator.created_at).format('M/D');\n });\n }", "title": "" }, { "docid": "e5ca121616df184a7d181f0031eb338e", "score": "0.48609948", "text": "function onlyInThisMillennium () {\n let arr = []\n for (let i = 0; i < movies.length; i++) {\n if (parseInt(movies[i].Year) > 1999) {\n arr.push(movies[i])\n }\n }\n return arr\n}", "title": "" }, { "docid": "0b3d8f8f14327f86fff240978f55a1d7", "score": "0.48551992", "text": "function filter(data) {\n return _.filter(data, function (item) {\n return item.buildStatus == 'Success' && Math.floor(moment(item.endTime).endOf('day').diff(moment(new Date()).endOf('day'), 'days')) >= -15;\n });\n }", "title": "" }, { "docid": "b75271e191b06795dbf4020c26cb8caa", "score": "0.4852079", "text": "function filterLeaving() {\n // For each item container\n for (i = 0; i < containers.length; i++) {\n var months = containers[i].getElementsByClassName(\"calendar\")[0].getElementsByClassName(\"month\");\n var monthsArray = [].slice.call(months);\n\n var currentMonth = MONTHS[currentMonthIndex];\n var nextMonth = \"\";\n currentMonth == \"december\" ? nextMonth = \"january\" : nextMonth = MONTHS[currentMonth + 1];\n\n currentMonthDiv = containers[i].getElementsByClassName(\"calendar\")[0].getElementsByClassName(currentMonth)[0];\n var nextMonthDiv = \"\";\n currentMonthDiv.classList.contains(\"december\") ? nextMonthDiv = months[0] : nextMonthDiv = currentMonthDiv.nextSibling;\n\n if (!(currentMonthDiv.classList.contains(\"available\") && !nextMonthDiv.classList.contains(\"available\"))) {\n containers[i].classList.add('is-filtered');\n }\n }\n}", "title": "" }, { "docid": "5dd262d51c6909d36e7afb8f690bc890", "score": "0.4849673", "text": "function getMensDays(tx) {\n tx.executeSql(\"SELECT * FROM CYCLE_INFO_PREDICTION WHERE is_mens = 'YES' AND cycle_date_unix BETWEEN \"+d1+\" AND \"+d2, [], getMensDays_success, errorCB);\n}", "title": "" }, { "docid": "12f9c23573bff8be651f41d1b73db1bf", "score": "0.4849098", "text": "getRatingsArray(engineerSentiments) {\n let date = new Date();\n date.setMonth(date.getMonth() - 5);\n for (let i = 0; i < 6; i++) {\n let monthYear = this.months[date.getMonth()] + ' ' + date.getFullYear();\n this.sixMonthCsatMap.set(monthYear, 0);\n this.sixMonthDsatMap.set(monthYear, 0);\n date.setMonth(date.getMonth() + 1);\n }\n for (let i = 0; i < engineerSentiments.length; i++) {\n let sentiment = engineerSentiments[i];\n let createdDt = sentiment.createdDate;\n //let monthYear = this.datepipe.transform(createdDt, 'MMM yyyy')\n let monthYear = this.datepipe.transform(new Date(createdDt), 'MMM yyyy');\n if (sentiment.csat > 3) {\n if (this.sixMonthCsatMap.get(monthYear) != undefined) {\n let csatCount = this.sixMonthCsatMap.get(monthYear) + 1;\n this.sixMonthCsatMap.set(monthYear, csatCount);\n }\n }\n else {\n if (this.sixMonthDsatMap.get(monthYear) != undefined) {\n let dsatCount = this.sixMonthDsatMap.get(monthYear) + 1;\n this.sixMonthDsatMap.set(monthYear, dsatCount);\n }\n }\n }\n }", "title": "" }, { "docid": "8a5b5bfce57593bca421708a3d7e5cc4", "score": "0.48471993", "text": "manageFilterDDValues(stockArr) {\r\n let monthYearArr = [];\r\n let filterArr = [];\r\n\r\n stockArr.map((stockObj) => {\r\n let stockDate = stockObj.stockDate ? stockObj.stockDate : stockObj.StockDate;\r\n let dateStr = formatDateTime(stockDate).MMMYYYY;\r\n if (monthYearArr.indexOf(dateStr) === -1) {\r\n monthYearArr.push(dateStr);\r\n }\r\n });\r\n monthYearArr.sort(function (a, b) {\r\n return new Date(a).getTime() - new Date(b).getTime()\r\n });\r\n monthYearArr.map((obj, index) => {\r\n filterArr.push({\r\n id: index.toString(),\r\n value: obj\r\n });\r\n });\r\n return filterArr;\r\n }", "title": "" }, { "docid": "149ba6b5be4169de95f7b20470d9e3e2", "score": "0.48324808", "text": "function getCommentsFromAppbot() {\n // us android\n var query1 = {\n OSandCountry: 892941,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // chile android\n var query2 = {\n OSandCountry: 1265819,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // colombia android\n var query3 = {\n OSandCountry: 1234562,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // spain android\n var query4 = {\n OSandCountry: 1236152,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // mexico android\n var query5 = {\n OSandCountry: 1198698,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // us ios\n var query6 = {\n OSandCountry: 785799,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // chile ios\n var query7 = {\n OSandCountry: 888242,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // colombia ios\n var query8 = {\n OSandCountry: 1235970,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // spain ios\n var query9 = {\n OSandCountry: 468232,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n // mexico ios\n var query10 = {\n OSandCountry: 842231,\n startDate: moment().subtract(1, 'week').day(0).format('YYYY-MM-DD'),\n endDate: moment().subtract(1, 'week').day(6).format(\"YYYY-MM-DD\"),\n page: 1\n }\n\n $scope.comments1to3 = 0;\n\n // us android\n walletFtry.queryForPageCountToHelpGetComments(query1).then(function(res) {\n query1.page = res.total_pages\n walletFtry.queryWalletComments(query1).\n then(function(res) {\n console.log(res);\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 3000)\n $scope.USA1 = res;\n })\n })\n // chile android\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query2).then(function(res) {\n query2.page = res.total_pages\n walletFtry.queryWalletComments(query2).\n then(function(res) {\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 5000)\n $scope.Chile1 = res;\n })\n })\n }, 2000)\n // colombia android\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query3).then(function(res) {\n query3.page = res.total_pages\n walletFtry.queryWalletComments(query3).\n then(function(res) {\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 7000)\n $scope.Colombia1 = res;\n })\n })\n }, 4000)\n // spain android\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query4).then(function(res) {\n query4.page = res.total_pages\n walletFtry.queryWalletComments(query4).\n then(function(res) {\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 9000)\n $scope.Spain1 = res;\n })\n })\n }, 6000)\n // mexico android\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query5).then(function(res) {\n query5.page = res.total_pages\n walletFtry.queryWalletComments(query5).\n then(function(res) {\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 11000)\n $scope.Mexico1 = res;\n })\n })\n }, 8000)\n // us ios\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query6).then(function(res) {\n query6.page = res.total_pages\n walletFtry.queryWalletComments(query6).\n then(function(res) {\n // console.log(res);\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 13000)\n $scope.USA2 = res;\n })\n })\n\n }, 10000)\n // chile ios\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query7).then(function(res) {\n query7.page = res.total_pages\n walletFtry.queryWalletComments(query7).\n then(function(res) {\n // console.log(res);\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 15000)\n $scope.Chile2 = res;\n })\n })\n }, 12000)\n // colombia ios\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query8).then(function(res) {\n query8.page = res.total_pages\n walletFtry.queryWalletComments(query8).\n then(function(res) {\n // console.log(res);\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 17000)\n\n $scope.Colombia2 = res;\n })\n })\n }, 14000)\n // spain ios\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query9).then(function(res) {\n query9.page = res.total_pages\n walletFtry.queryWalletComments(query9).\n then(function(res) {\n // console.log(res);\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 19000)\n $scope.Spain2 = res;\n })\n })\n }, 16000)\n // mexico ios\n $timeout(function() {\n walletFtry.queryForPageCountToHelpGetComments(query10).then(function(res) {\n query10.page = res.total_pages\n walletFtry.queryWalletComments(query10).\n then(function(res) {\n // console.log(res);\n $timeout(function() {\n for (var i = 0; i < res.length; i++) {\n if (res[i].rating <= 3) {\n $scope.comments1to3++;\n }\n }\n }, 21000)\n $scope.Mexico2 = res;\n })\n })\n }, 18000)\n }", "title": "" }, { "docid": "177c1072b4f2f7f8c242383bf407a6ab", "score": "0.48319355", "text": "function gosterSonKullanmaTarihi() {\n let newList = [];\n fishFarm.map((day) => {\n day.entryDate.setDate(day.entryDate.getDate() + day.durationInDays);\n let lastUseDate = new Date(day.entryDate);\n newList.push({ date: lastUseDate, name: day.fishType });\n });\n return newList;\n}", "title": "" }, { "docid": "4d734b0ea437d57eccbaf7b68d81b69f", "score": "0.4825974", "text": "getDeliveriesFrom30Days() {\n var currentDates = this.getCurrentDate(), sortedData = customerData.deliveries.slice(), \n customerDeliveries = [];\n for(var i=0; i<sortedData.length; i++){\n var customerDate = sortedData[i].date.substring(0, 10);\n if(currentDates[1] >= customerDate && currentDates[0] <= customerDate){ \n customerDeliveries.push(sortedData[i]);\n }\n }\n return customerDeliveries;\n }", "title": "" }, { "docid": "5af6b754cd55098f8d2b1b5041129491", "score": "0.48183355", "text": "function filtrarAuto(){\n console.log(\"filtrando..\")\n //soportan chaining o encadenamiento\n\n const resultado = autos.filter( filtrarMarca ). filter( filtrarYear ). filter( filtrarMinimo ).filter ( filtrarMaximo)\n.filter ( filtrarPuertas ) .filter ( filtrarTrasmision) .filter (filtrarColor)\n \n console.log(resultado);\n\n //funcion de mostrar autos arriba definida\n\n if ( resultado.length ){\n mostrarAutos(resultado);\n } else {\n noResultado();\n }\n\n}", "title": "" }, { "docid": "982b90bfa811e026cf5a3faeb306bfd4", "score": "0.4816469", "text": "function filterYours(){\n\t//TODO: fill in!\n}", "title": "" }, { "docid": "a6ec7865945f27fe7290bff198ad15e7", "score": "0.48156556", "text": "function checkDates(){\n hits =[];\n for(var i = 0; i < plans.length; i++){\n var pd = plans[i].datetime.toDateString(),\n cd = searchDate.toDateString();\n\n if(pd === cd){\n hits.push(plans[i]);\n hits.sort(function(x, y){\n var a=new Date(x.datetime),\n b=new Date(y.datetime);\n return a-b;\n });\n }\n }\n calculatePercentage();\n updatePlan();\n}", "title": "" }, { "docid": "ba78e86f85e8be08141a24089c2caf47", "score": "0.48123172", "text": "function getFlights(data) {\n\t\t \t\t$filter('filter')(flights,{date:data.date,})\t\n\t\t \t}", "title": "" }, { "docid": "d070b49782109d183e09112e88790d30", "score": "0.48074126", "text": "function getEvents(){\n\tvar d1 = $('#dc_from').val();\n\tvar d2 = $('#dc_to').val();\n\tif (d1.length+d2.length==0){\n\t\talert(\"Veuillez renseigner au moins une date\");\n\t\treturn;\n\t}\n\tif (d1 != '' && !re_date.test(d1)){\n\t\talert(\"La première date est incorrecte. Veuillez vérifier son format (jj/mm/aaaa) et sa validité !\");\n\t\treturn;\n\t} else if (d1 != '') {\n\t\td1 = convertDate(d1);\n\t}\n\tif (d2 != '' && !re_date.test(d2)){\n\t\talert(\"La deuxième date est incorrecte. Veuillez vérifier son format (jj/mm/aaaa) et sa validité !\");\n\t\treturn;\n\t} else if (d2 != '') {\n\t\td2 = convertDate(d2);\n\t}\n\tvar param = \"action=get_n_premiers_evenements_entre_dates&n=3\";\n\tif (d1!=''){param+=\"&d1=\"+d1;}\n\tif (d2!=''){param+=\"&d2=\"+d2;}\n\t$('#search_event').attr('disabled', 'true');\n\t$('#jq_load').html('<img src=\"design/misc/form_loading.gif\"></img>');\n\t$.ajax({\n\t\ttype:\"GET\",\n\t\turl:\"/dispatcher.php\",\n\t\tdata:param,\n\t\tdataType:\"json\",\n\t\tsuccess:function(data){\n\t\t\t$('#jq_load').html('');\n\t\t\t$('#search_event').removeAttr('disabled');\n\t\t\tif (data.result == false){\n\t\t\t\talert('Impossible de récupérer des événements !');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(data.value == false){\n\t\t\t\talert(\"Aucun événement trouvé.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttmp = \"\";\n\t\t\tfor(var i = 0; i < data.value.length; i++){\n\t\t\t\tif (i%2==0){\n\t\t\t\t\tidi = '';\n\t\t\t\t} else {\n\t\t\t\t\tidi = 'id=\"impair\"'; \n\t\t\t\t}\n\t\t\t\tvar event = data.value[i].Evenement.fields;\n\t\t\t\ttmp += '<a '+idi+' class=\"last_event\" href=\"events.php?ev='+event.EvenementID+'\"><div class=\"event\">';\n\t\t\t\ttmp += '<span id=\"event\">Date : '+convertUSDate(event.Date)+'</span>';\n\t\t\t\ttmp += '<span id=\"event\">Lieu : '+event.Ville.fields.Nom+'('+event.Departement.fields.Nom+')</span><br/>';\n\t\t\t\ttmp += toNchar(event.Description,65)+'</div></a>';\n\t\t\t\tif (i==2){break;}\n\t\t\t}\n\t\t\t$('#events_height').html(tmp);\n\t\t},\n\t\terror:function(XMLHttpRequest, textStatus, errorThrown){\n\t\t\t$('#jq_load').html('');\n\t\t\talert('Error with code 7');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "81f14c3ed2f9e7d06ec8bef7343cdf2e", "score": "0.4806924", "text": "function filterCallback(d) {\n return d.date_listed >= lowerCutoff;\n }", "title": "" }, { "docid": "a201a214145c388bafb697d736069fe4", "score": "0.48062348", "text": "function listaEventosDentista() {\n var requestData = {\n usuarioClinica: vm.usuarioClinica,\n dataInicio: moment(vm.viewDate).startOf(vm.calendarView).valueOf(),\n dataFim: moment(vm.viewDate).endOf(vm.calendarView).valueOf()\n }\n\n return getEventosByDentista(requestData.usuarioClinica, requestData.dataInicio, requestData.dataFim);\n }", "title": "" }, { "docid": "016255571fd5e47e865b588c3508c0f0", "score": "0.48021108", "text": "function filtrarAuto(){\n const resultado = autos.filter( filtrarMarca ).filter( filtrarYear ).filter( filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\n\n if( resultado.length)\n mostrarAutos(resultado);\n else \n noResultado();\n}", "title": "" }, { "docid": "40e65f92adf8c57a634876d494ec4882", "score": "0.47855917", "text": "async function getCasesTimeline () {\n\n let casesTimeline = [];\n\n // let data = await wiki().page('2020_coronavirus_outbreak_in_Canada').then(page => page.html());\n let url = \"https://en.wikipedia.org/wiki/2020_coronavirus_pandemic_in_Canada\";\n let res = await axios.get(url);\n\n if(res.status === 200) {\n const $ = cheerio.load(res.data);\n \n $('p', 'div').each( (index, ele) => {\n if(index > 0) {\n let message = $(ele).text().replace(/\\[\\d{1,3}\\]/g,''); //remove [no] refereneces\n let date = message.match(/^On [A-Z][a-z]{2,10} \\d{1,2}/g);\n let content = message.replace(/^On [A-Z][a-z]{2,10} \\d{1,2},/g, '').trim();\n if(date) {\n date = (date[0].slice(3) + ', 2020').replace(/ ([\\d],)/g, ' 0$1');\n content = content.charAt(0).toUpperCase() + content.substring(1);\n if(content.search('Shopify') > -1) return '';\n if(content.search('TED') > -1) return '';\n if(content.search('Collision') > -1) return '';\n casesTimeline.push({date, content});\n }\n } \n });\n\n let tmp = _.orderBy(casesTimeline, ['date', 'desc']);\n let tmpCases = [];\n\n const getOneMonthReports = (reports, month) => { \n let tmp = []; \n reports.forEach(item => {\n if(item.date.includes(month))\n tmp.push(item);\n });\n return tmp;\n }\n\n tmpCases = [ \n ...getOneMonthReports(tmp, 'January'), \n ...getOneMonthReports(tmp, 'February'),\n ...getOneMonthReports(tmp, 'March'),\n ...getOneMonthReports(tmp, 'April'),\n ...getOneMonthReports(tmp, 'May')\n ];\n\n $('p', 'div').each( (index, ele) => {\n\n if(index < 5 && $(ele).text()) { \n let message = $(ele).text().replace(/\\[[a-z]{0,10}\\d{0,2}\\]/g,'');\n let date = message.match(/As of [A-Z][a-z]{2,10}.*, 2020/g);\n let content = message.replace(/(.*)As of [A-Z][a-z]{2,10}.*, 2020, /g, '').trim();\n if(date) {\n date = date[0];\n content = content.charAt(0).toUpperCase() + content.substring(1);\n tmpCases.push({date, content});\n }\n }\n });\n\n if(tmpCases.length > 0) {\n let jsonData = {\n time: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),\n cases: tmpCases.reverse()\n }\n const timelineString = JSON.stringify(jsonData, null, 4);\n // console.log(timelineString);\n fs.writeFile(\"../public/assets/CanadaTimeline.json\", timelineString, (err, result) => {\n if(err) console.log('Error in writing data into Json file', err);\n console.log(`Updated Canada timeline data at ${jsonData.time}`);\n });\n }\n } else {\n console.log('Failed to get Canada cases from wiki page:', res.status);\n }\n}", "title": "" }, { "docid": "8be8fcea6ee9608bb4a64cd9129620f6", "score": "0.47802213", "text": "filterIncomesByDate(incomes) {\n var date = new Date(incomes.date);\n return date >= this.state.startDate && date <= this.state.endDate;\n }", "title": "" } ]
32b6eaf07786e9ae74a42a9d053f6526
Fallback to the default route to display all the fetched jobLists.
[ { "docid": "123516691342d15b9c8cc35c5eb77f63", "score": "0.0", "text": "fetchAllJobs() {\n pushState(\n {currentJobId: null}, '/'\n );\n\n this.setState({\n currentJob: {},\n currentJobId: null\n })\n }", "title": "" } ]
[ { "docid": "01d2bb2d324586e1a63991bab5cf48ca", "score": "0.62241703", "text": "async function list(req, res) {\n winston.info('jobs-router:list', { payload: req.body });\n\n try {\n const list = await controller.getAll();\n\n res\n .status(Responses.Jobs.List.Success.CODE)\n .json(list);\n } catch (error) {\n winston.error('jobs-router:list', { payload: req.body, error });\n return res\n .status(Responses.Jobs.List.Error.CODE)\n .send(Responses.Jobs.List.Error.MESSAGE);\n }\n}", "title": "" }, { "docid": "d035cef5dd7985594fd58fa89dc5ddbd", "score": "0.5869347", "text": "async function _list(req, res) {\n try {\n const list = await controller.getAll();\n const jobListMessage = slackService.serializeJobList(list);\n\n return res\n .status(Responses.Jobs.Post.SuccessList.CODE)\n .send(jobListMessage);\n\n } catch (error) {\n return res\n .status(Responses.Jobs.Post.Help.CODE)\n .send(Responses.Jobs.Post.Help.MESSAGE);\n }\n}", "title": "" }, { "docid": "3ff6048fdeb2ae7f809c22b8ab99afdb", "score": "0.5673954", "text": "function fetchJobs () {\n JobsAPI.list().then(function(data){\n $scope.jobsList = data.jobs;\n })\n .catch(function(error){\n Notify.error(error);\n });\n }", "title": "" }, { "docid": "e889ec1d22f82aaf1eb5943c88edf683", "score": "0.5590011", "text": "function loadJobs() {\n API.getAllJobs()\n .then(data => setJobList(data.data))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "a0802455861d1793e48b49367da19d74", "score": "0.52942353", "text": "fullList(req, res) {\n res.status(200).send(list);\n }", "title": "" }, { "docid": "09e0d2cafa624e43c92a3611f15a048f", "score": "0.52405155", "text": "handleGetAllJobs (req, res) {\n\n var userId = req.decoded.userId\n\n this.Job.methods.__adminGetAllJobs()\n .then((result) => {\n if (result.length != 0) {\n res.json(result)\n } \n \n else {\n res.json({\n jobs: [],\n questions: [],\n answers: [],\n applicants: [],\n invites: []\n })\n }\n })\n .catch((err) => {\n res.status(500).json({\n error: err.toString()\n })\n })\n }", "title": "" }, { "docid": "31db3679d6c57d5fcf4182224e108758", "score": "0.52130896", "text": "async list (req, res) {\n throw new Error('list: Implementation Missing!')\n }", "title": "" }, { "docid": "ffabc1f68e0698c9b959086ea6d37987", "score": "0.51995856", "text": "list(req, res) {\n this.__readData(__data_source)\n .then(lists => {\n \n \n res.json({ type: \"success\", data: this.__formatter(lists) });\n })\n .catch(err => res.status(412).json({type:\"error\", data:[], message:\"No Data Found\"}));\n }", "title": "" }, { "docid": "9a4e5833d56e6ad1bf09c6e7c14597fc", "score": "0.519021", "text": "function listAll(req, res, next) {\n\tController.listAllInbox()\n\t\t.then((list) => {\n\t\t\tresponse.success(req, res, list, 200)\n\t\t})\n\t\t.catch((err) => {\n\t\t\tresponse.error(req, res, err, 404)\n\t\t})\n}", "title": "" }, { "docid": "35240ff41166f4e108a17f0e5c24810e", "score": "0.5171769", "text": "function JobList() {\n const [jobs, setJobs] = useState(null);\n\n /** fetch jobs data via search through the API */\n useEffect(function getAllJobsOnMount() {\n search();\n }, []);\n\n /** Function used by SearchForm. Triggers when form is submitted. */\n async function search(title) {\n // get job names via search term\n let jobs = await JoblyApi.getJobs(title);\n setJobs(jobs);\n }\n\n // Return loading if no jobs present yet\n if (!jobs) return <LoadingComponent />;\n\n return (\n <div className=\"JobList col-md-8 offset-md-2\">\n <SearchForm searchFor={search} />\n {jobs.length ? (\n <JobCardList jobs={jobs} />\n ) : (\n <p className=\"lead\">Sorry, no results were found!</p>\n )}\n </div>\n );\n}", "title": "" }, { "docid": "ea75eb4ece04fca36eacae2fbedbffe1", "score": "0.5163114", "text": "function renderContactListView() {\n app.router.load('list');\n }", "title": "" }, { "docid": "7e4a3825dece906284ff2971ec6b887d", "score": "0.51622325", "text": "function JobList() {\n console.debug(\"JobList\");\n\n const [jobs, setJobs] = useState(null);\n\n useEffect(function getAllJobsOnMount() {\n console.debug(\"JobList useEffect getAllJobsOnMount\");\n search();\n }, []);\n\n /** Triggered by search form submit; reloads jobs. */\n async function search(search) {\n let jobs = await JoblyApi.getJobs(search);\n setJobs(jobs);\n }\n\n /** Apply for job: save to API and update that job in jobs state. */\n async function apply(id) {\n let message = await JoblyApi.applyToJob(id);\n setJobs(j => j.map(job =>\n job.id === id ? { ...job, state: message } : job\n ));\n }\n\n if (!jobs) return <LoadingSpinner />;\n\n return (\n <div className=\"JobList col-md-8 offset-md-2\">\n <Search searchFor={search} />\n {jobs.length\n ? <JobCardList jobs={jobs} apply={apply} />\n : <p className=\"lead\">Sorry, no results were found!</p>\n }\n </div>\n );\n}", "title": "" }, { "docid": "9526dfde8233a726657c19352b3314e4", "score": "0.5158465", "text": "function getWorkouts() {\n $.get(\"/api/workouts\", renderWorkoutList);\n }", "title": "" }, { "docid": "ce48265f8440102e17489782c5e89ba4", "score": "0.5134804", "text": "function doIt() {\n Promise.all([\n jobPage.show().GET({ include: ['owner'] }),\n jobPage.jobUsers.index().GET({ include: ['ratings'] }),\n jobPage.skills.index().GET(),\n jobPage.comments.index().GET()\n ]).then(function() {\n var job = client.store.find('jobs', jobId)\n console.log('job', job.id, job.name)\n parseComments(job.comments)\n parseJobUsers(job.jobUsers)\n })\n}", "title": "" }, { "docid": "a2c9305ddb4769479e7c3be9b682471b", "score": "0.5112283", "text": "function getTaskList(listRoute) {\n\t// Remove the Load More Tasks button.\n\t$('.more').remove();\n\t// Display the spinner as we wait for the response.\n\t$(\".task-list\").append('<div class=\"loader\"><img src=\"JS/spinner.svg\" class=\"ajax-loader\" /></div>');\n\n\tjso.ajax({\n\t\tdataType: 'json',\n\t\turl: listRoute\n\t})\n\n\t.done(function(object) {\n\t\tcreateTaskList(object);\n\t})\n\n\t.fail(function() {\n\t\tconsole.error(\"REST error. Nothing returned for AJAX.\");\n\t})\n\n\t.always(function() {\n\t\t// Remove the spinner when response is received.\n\t\t$('.loader').remove();\n\t})\n\n}", "title": "" }, { "docid": "64140256c39120cac1f291480089cae9", "score": "0.5106899", "text": "function doList(req, res) {\n function empty() {\n metadata.getManufacturers(req, function(manufacturers) {\n let sets = [];\n manufacturers.forEach(mfr => {\n if (mfr.active) {\n sets.push({\n manufacturer: mfr,\n name: mfr.name,\n abbrev: mfr.abbrev,\n raspLink: setLink + mfr.abbrev + '.eng',\n raspFile: mfr.abbrev + '.eng',\n rockSimLink: setLink + mfr.abbrev + '.rse',\n rockSimFile: mfr.abbrev + '.rse',\n });\n }\n });\n res.render('outbox/empty', locals(req, defaults, {\n sets,\n }));\n });\n }\n if (req.session.outbox && req.session.outbox.length > 0) {\n req.db.SimFile.find({ _id: { $in: req.session.outbox } })\n .populate('_motor _contributor')\n .exec(req.success(function(simfiles) {\n if (simfiles.length != req.session.outbox.length) {\n req.session.outbox = simfiles.map(s => s._id.toString());\n req.session.touch();\n }\n if (simfiles.length < 1) {\n empty();\n } else {\n let raspCount = 0, rocksimCount = 0, otherCount = 0;\n simfiles.forEach(simfile => {\n if (simfile.format === 'RASP')\n raspCount++;\n else if (simfile.format === 'RockSim')\n rocksimCount++;\n else\n otherCount++;\n });\n\n let raspLink, rocksimLink;\n if (raspCount > 0)\n raspLink = downloadLink + downloadBasename + '.eng';\n if (rocksimCount > 0)\n rocksimLink = downloadLink + downloadBasename + '.rse';\n \n res.render('outbox/list', locals(req, defaults, {\n simfiles,\n totalCount: simfiles.length,\n multiFormat: raspCount > 0 && rocksimCount > 0,\n raspCount,\n rocksimCount,\n zipLink: downloadLink + downloadBasename + '.zip',\n raspLink,\n rocksimLink,\n clearLink: '/outbox/clear/',\n }));\n }\n }));\n } else {\n empty();\n }\n}", "title": "" }, { "docid": "be6c6b3c50974eefe1d9a0e6abf25d67", "score": "0.5100893", "text": "renderAllListings() {\n const { sortedListings } = this.props;\n if (!isEmpty(sortedListings)) {\n return this.renderSortedListings();\n }\n return this.renderBatmanListings().concat(this.renderSupermanListings());\n }", "title": "" }, { "docid": "7fc2ae7ed7ddc63f91062202dd2e4fe3", "score": "0.5071527", "text": "function returnRoutes(jobId){\n //construct the url with the job id\n let checkJobUrl = serviceUrl + '/jobs/' + jobId +'/results/out_routes?f=json';\n\n fetch(checkJobUrl)\n .then(function(response){\n return response.json(); \n })\n .then(function(json){\n console.log(\"output\", json);\n routeJson = json;\n displayRoute(json.value);\n })\n .catch(function(err){\n console.log(\"failed to return route with: \", err);\n });\n }", "title": "" }, { "docid": "445dce5ed3b5183d3deb8d17d7b9386b", "score": "0.50670654", "text": "function getRoomListForOverview() {\r\n loadAllRoomData(onLoadAllRoomDataForOverviewSuccess);\r\n switchView('roomsOverview');\r\n}", "title": "" }, { "docid": "3b1e22541b2f51d9b39fb216d07d276c", "score": "0.5055368", "text": "function all(req, res) {\n renderer.renderAndSend('notfound.jade', req, res, {});\n}", "title": "" }, { "docid": "5ccf7ef943c41fdcab0e1fe8c01d5240", "score": "0.5048207", "text": "function getworkouts() {\n $.get(\"/api/workouts\", renderworkoutList);\n }", "title": "" }, { "docid": "d2cd77aa49c79519b382c503c0b57586", "score": "0.50389266", "text": "function listJobs (done) {\n let sql = 'Select * FROM application';\n db.getPool().query(sql, (err, results, fields) => {\n if (err) {\n return done({\n 'message': err,\n 'status': 500,\n }, results);\n }\n return done(err, results);\n });\n}", "title": "" }, { "docid": "f29c87e5503b2fdffc33b7af2d692bd3", "score": "0.5030505", "text": "function showAll(req, res) {\n // On récupère la date demandée.\n const date = req.params.date;\n\n retrieveAll(date, (jsonRes) => {\n var templateParameters = {\n flights: jsonRes,\n date: date\n };\n res.render(__dirname + '/templates/flight_list.ejs', templateParameters);\n });\n}", "title": "" }, { "docid": "84c5f0a2ca566a2028da423f6d340306", "score": "0.5026815", "text": "function JobList() {\n const [jobs, setJobs] = useState(null);\n\n useEffect(function getJobsOnMount() {\n search();\n }, []);\n\n// reloads jobs after search submit\n async function search(title) {\n let jobs = await JoblyApi.getJobs(title);\n setJobs(jobs);\n }\n\n if (!jobs) return \"LOADING...\";\n\n return (\n <div>\n <SearchForm searchFor={search} />\n {jobs.length\n ? <JobDetailList jobs={jobs} />\n : <p>Sorry, no results here!</p>\n }\n </div>\n );\n}", "title": "" }, { "docid": "0510c0050bd2774eaead0073f5bc1505", "score": "0.5013299", "text": "indexAction(req, res) {\n this.jsonResponse(res, 200, { 'message': 'Default API route!' });\n }", "title": "" }, { "docid": "81585a04d8ac755868f312d7c373d172", "score": "0.5010582", "text": "static async getAllJobs(data={}) {\n let res = await this.request('jobs/', data);\n return res.jobs;\n }", "title": "" }, { "docid": "84f0af5ef557f4ef669c9cf758fded3b", "score": "0.4983378", "text": "goDefault() {\n Meteor.call(\"getDefaultRoute\", (error, defaultRoute) => {\n OLog.debug(`ux.js getDefaultRoute server has inferred that default route for ${Util.getUserEmail(Meteor.userId())} ` +\n `should be ${defaultRoute}`)\n UX.initStackAndBackLabels(defaultRoute)\n UX.go(defaultRoute)\n })\n }", "title": "" }, { "docid": "42f0822a020b74ef626906fafbf3c467", "score": "0.4966102", "text": "function all(req, res) {\n res.render('list.ejs', {\n data: data\n })\n}", "title": "" }, { "docid": "c400c9def84820a77859ee59a10bdc2d", "score": "0.49633047", "text": "async function list(req, res) {\n let data = req.body;\n try {\n let result = await Url.find({ status: true }).lean().exec();\n res.render(\"index\", { urls: result });\n } catch (e) {\n console.log(e);\n let errMsg = `There was Error in viewing ${e}`;\n res.render(\"index\", { err: errMsg });\n }\n}", "title": "" }, { "docid": "5ee554d0e4005ee3164209d245cd390d", "score": "0.49577695", "text": "function initialDisplay() {\n \tcountLinks();\n \tgetDropDowns();\n \tgetList(\"id\");\n }", "title": "" }, { "docid": "18098027025572f0110f7a67eba85132", "score": "0.49415264", "text": "function BlogsMainList(req, res, next) {\n blogsOptions.filters = {};\n const blogsApiUrl = parser.getCompleteApi(blogsOptions);\n\n fetchData(blogsApiUrl, 'blogs', req, res, next);\n}", "title": "" }, { "docid": "f007b90ac0a0f0bc7a11ebc32d756d28", "score": "0.49262896", "text": "function listRecords(callbackWhenFinished) {\n var conf = self.settings();\n var spinnerContainer = '#'+conf.containers.list;\n\n $.ajax({\n method: conf.apis.list.method,\n url: conf.apis.list.url,\n //url : $.Casper.getWebContext() + '/api/manager/application',\n data: $('#'+conf.forms.search).serialize(),\n\n beforeSend : function() {\n plugin.spinner(spinnerContainer);\n }\n\n }).done(function(data, status, xhr) {\n\n var payload = {\n data: data\n };\n \n displayRecords(payload);\n\n }).fail(function(xhr, message, exception) {\n plugin.errorHandling(xhr, message, exception);\n\n }).always(function(dataOrXhr, status, xhrOrException) {\n \n registerRecordsActionButtonEvents();\n plugin.hideSpinner(spinnerContainer);\n \n if(callbackWhenFinished) {\n callbackWhenFinished();\n }\n });\n }", "title": "" }, { "docid": "d2908c32aedff4afac4bde5eb3508b73", "score": "0.49147594", "text": "GetDisplayLocationList() {\n // return [displayLocations] to Frontend\n }", "title": "" }, { "docid": "4174c57b81cd94b28e0b8eded903abe0", "score": "0.49041238", "text": "function listingView(source) {\n var wpAPI = '/wp-json/wp/v2/job-listings/';\n var indeedAPI = 'http://api.indeed.com/XXXXXXXXX';\n if (source == 'external') {\n var jobKey = getUrlVars()[\"jobID\"];\n if (jobKey.match(/[a-z]/i)) {\n var jobAPI = indeedAPI + jobKey;\n $.getJSON(jobAPI, function(data) {\n showJob(data, 'indeed', jobKey);\n });\n } else {\n var jobAPI = wpAPI + jobKey;\n $.getJSON(jobAPI, function(data) {\n showJob(data, 'wp', jobKey);\n });\n }\n } else {\n $(\".listing\").on('click', function() {\n var jobKey = $(this).attr('data-key');\n if ($(this).find('.peoplegeek').length == 1) {\n var jobAPI = wpAPI + jobKey;\n $.getJSON(jobAPI, function(data) {\n showJob(data, 'wp', jobKey);\n });\n } else {\n var jobAPI = indeedAPI + jobKey;\n $.getJSON(jobAPI, function(data) {\n showJob(data, 'indeed', jobKey);\n });\n }\n });\n }\n}", "title": "" }, { "docid": "dfafc5ab9cd5ab1c8034c9b1a17ca0e5", "score": "0.49012765", "text": "function home(req,res){\n query.getAll().then(function(resultat,err){\n if(err) throw err;\n res.render('home', {home:resultat});\n });\n}", "title": "" }, { "docid": "81061f12f99d61dab636ff74a2ccf779", "score": "0.48952943", "text": "searchJob(event) {\n event.preventDefault();\n this.setState({searching: true, message: null, jobList: []});\n const query = this.state.job.query;\n const location = this.state.job.location;\n const queryString = JobSearch.getQueryString({query, location});\n api.initJobSearch({queryString}).then(\n resp => {\n this.setState({message: `Loading... Your results will appear here`});\n return api.pollResults({pollId: resp.pollId})\n }\n ).then(\n resp => {\n const appliedJobs = JSON.parse(localStorage.getItem(storageKey));\n const res = resp.map(eachJob => {\n let index = appliedJobs.findIndex(applied => applied === eachJob.id);\n eachJob.applied = index > -1;\n return eachJob;\n });\n this.setState({searching: false, jobList: res, message: null});\n }\n ).catch(\n err => {\n console.error(err);\n this.setState({searching: false, message: err});\n }\n );\n }", "title": "" }, { "docid": "b5c3932b9e1135f045503c04ebb2b656", "score": "0.4895077", "text": "getAll(req, res) {\n this.sendNotFound(req, res);\n }", "title": "" }, { "docid": "4fa1f6c250475848d2855563e8f78027", "score": "0.48879746", "text": "function list(req, res, next){\n controller.list()\n .then((lista) => {\n response.success(req, res,lista,200)\n }).catch(next)\n}", "title": "" }, { "docid": "9f9f608f0837befb3914062bbb872e16", "score": "0.48827535", "text": "function index(req, res) {\n Caller.find({}, function(err, callers) {\n // Return 404 if there's an error:\n if (err) res.status(404).send(err)\n\n // otherwise send json back with 200 success header:\n res.status(200).send(callers)\n })\n}", "title": "" }, { "docid": "5c0304e12cbe8d10d89de8420f43d865", "score": "0.48826432", "text": "componentDidMount() {\n this.retrieveLists();\n }", "title": "" }, { "docid": "e3da010a54f9a1adbc6a247f5e86529b", "score": "0.48696706", "text": "componentDidMount() {\n this.stopList();\n this.routeList()\n }", "title": "" }, { "docid": "cc5ed300c57f1cd40ff1f3bf6dbad762", "score": "0.48669973", "text": "getFullList() {\n axios\n .get(this.BASE_URL + \"/jokes\")\n .then(response => {\n //Clear the Joke Container\n document.getElementsByClassName(\"right-container\")[0].innerHTML = \"\";\n //Prevent the Page from Reloading\n event.preventDefault();\n response.data.forEach(joke => {\n //Display Each Joke\n this.displayJoke(joke);\n });\n })\n .catch(err => {\n console.error(err);\n });\n }", "title": "" }, { "docid": "12f4bc8b1dc6da96e60b8ddb5f1678be", "score": "0.4866002", "text": "function getAllJobInternshipAPI(){\n\t\nvar userId = document.getElementById(\"uId\").value;\n\t\n\tfetch(path+\"/getAllJobInternshipDashboard/\"+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((jobInternships)=>{\n\t\tconsole.log(\"successfully fecth all data\", jobInternships);\n\t\tif(jobInternships){\n\t\t\tpopulateJobInternship(jobInternships);\n\t\t}\n\t})\n\t.then((error)=>{\n\t\t\n\t\treturn null;\n\t\t\n\t});\n}", "title": "" }, { "docid": "14b4b51ff13b63a207ab2c9fb27aff0f", "score": "0.48628622", "text": "function listAllUsers() {\n $location.url('/users');\n }", "title": "" }, { "docid": "dd598ce48d066a66689e3d316f925ae6", "score": "0.4837734", "text": "* index (request, response) {\n const categories = yield Category.all()\n\n yield response.sendView('dashboard/connection/candidates/index', {\n categories\n })\n }", "title": "" }, { "docid": "fb99b70c14ba05ddd70bac24978d8f77", "score": "0.4837344", "text": "function loadLists() {\n\tloadEquipmentSlots();\n\tloadNpcList();\n}", "title": "" }, { "docid": "76df1a7ec28231b6008d672c6697f0d5", "score": "0.4830105", "text": "getJobs() {\n return service\n .get('/jobs/')\n .then((res) => res.data)\n .catch(errorHandler);\n }", "title": "" }, { "docid": "dccfbef97698df3341cef4323d6d089d", "score": "0.48230556", "text": "function index(req, res) {\n res.json([]);\n}", "title": "" }, { "docid": "cb23b3a81b9de18bdc64bee811eb3e06", "score": "0.4814236", "text": "initGetAllEndpoint() {\n this.router.get('/', (req, res) => this.getDAO()\n .getAll({ user: req.user })\n .then(users => res.status(200).send(users))\n .catch(err => {\n debug('[getAll]', err.message);\n return this.sendErr(res, 400, err.message);\n }));\n }", "title": "" }, { "docid": "9bcef6bb48c0fe9ba14caa5dadfa6941", "score": "0.480492", "text": "_list() {\n this._listPromise().then((json) => {\n this._alerts = json;\n this._render();\n this._openOnLoad();\n }).catch(errorMessage);\n }", "title": "" }, { "docid": "215293837af7bfde4528b712fecb3a52", "score": "0.48003575", "text": "requestList() {\r\n fetch('https://localhost:44374/group/list')\r\n .then(response => response.json())\r\n .then(data => this.recievedList(data))\r\n }", "title": "" }, { "docid": "47c74a2670d061b150c91e56538ae061", "score": "0.48003557", "text": "function _index(req, res) {\n var registryList = _getRegistryList(req.user);\n\n _respond(req, res, \"index\", {\n user: registry_utils.formatUserId.call({user: req.user}),\n registry: registryList,\n repositoryBaseURL: config.repositoryBaseURL,\n helpURL: config.helpURL\n });\n}", "title": "" }, { "docid": "0fea65d390e9e5e7c1400552294bca57", "score": "0.4792026", "text": "getJobs () {\n }", "title": "" }, { "docid": "deb11b5b87d18bc20a8b95cb506c2888", "score": "0.4788279", "text": "function wbHomeApplicationGetWorkflowList(){\n\tvar url_failure = wb_utils_gen_home_url();\n\n\tvar url = wb_utils_invoke_ae_servlet('cmd', 'ae_get_workflow_lst', 'url_failure', url_failure, 'stylesheet', 'application_workflow_lst.xsl');\n\twindow.location.href = url;\n}", "title": "" }, { "docid": "5786ff62a8922d15f7b7eb3d78c60e40", "score": "0.47795817", "text": "function showLists(){\r\n $('.actionBtns').css('display', 'none');\r\n $.getJSON(\"http://localhost/todolist/list/read.php\", function(data){\r\n\r\n // html for listing reminders\r\n readListsTemplate(data, \"\");\r\n\r\n // chage page title\r\n changePageTitle(\"Todo Lists\");\r\n });\r\n}", "title": "" }, { "docid": "ced6a608b43786d71c3bcc581b9ef112", "score": "0.47753337", "text": "getAll(req,res,next){\n interestModel.index()\n .then (interests => {\n res.locals.interests = interests;\n next();\n })\n .catch(e => next(e));\n }", "title": "" }, { "docid": "f56fbd7d84767b78654a30e11f4696f1", "score": "0.47731426", "text": "function IndexMain ($scope,StaticResource,CompanyInfo,JobData) {\r\n $scope.ResourceURLs = StaticResource.getResourceURLs('index_page');\r\n\r\n CompanyInfo.TopCompany(function(result){\r\n $scope.TOPcompanys = result.data;\r\n if(result.data != null){\r\n for(var i = 0 ; i < result.data.length; i++){\r\n $scope.TOPcompanys[i].href = \"#/Cpage/\" + $scope.TOPcompanys[i].cid;\r\n }\r\n }\r\n });\r\n\r\n JobData.TopJob(function(result){\r\n $scope.TopJobs = result.data;\r\n });\r\n }", "title": "" }, { "docid": "536c56f4d2bdf4045b47dc9ac0b56bde", "score": "0.4772575", "text": "function fetchAll() {\n appState.setFetchingOffersList(true);\n\n let offersPromise = getOffers();\n\n // when offers are successfully fetched, update the offers list; set fetching flag to false either way\n offersPromise\n .then(offers => {\n appState.setOffersList(fromJS(offers));\n appState.setFetchingOffersList(false, true);\n })\n .catch(() => appState.setFetchingOffersList(false));\n}", "title": "" }, { "docid": "843b1b7ebd44c651ea02e20c40c53c50", "score": "0.4772086", "text": "function view() {\n if (lists.length <= 0) {\n console.log(`The list is empty.`);\n } else {\n lists.forEach((list, index) => {\n console.log(`${index} ${list}\\n`)\n });\n }\n return menu();\n}", "title": "" }, { "docid": "8de0863de6fdb773bff6597f1e766101", "score": "0.4759053", "text": "list(req, res) {\n studentDAO.getStudents(db)\n .then(students => {\n res.status(200).json(students)\n })\n .catch(err => {\n console.error(err)\n res.sendStatus(404)\n })\n }", "title": "" }, { "docid": "e9ede756d2ee7b3dfdf5bf12d4972abe", "score": "0.47376588", "text": "function getAllJobInfoFromServer() {\r\n\tMoCheck.aktJobs = new Array();\r\n\tif(MoCheck.getJobCoords().length > 0) {\r\n\t\t$each(MoCheck.getJobCoords(), function(jobCoords, index) {\r\n\t\t\tMoCheck.getJobInfoFromServer(jobCoords.pos.x, jobCoords.pos.y);\r\n\t\t});\r\n\t} else {\r\n\t\t/* MotivationWindow muss ggf. neu geladen werden, auch wenn die aktuelle Liste keine Jobs hat */\r\n\t\tMoCheck.reloadWindow();\r\n\t}\r\n}", "title": "" }, { "docid": "32209b2ddf554a6111e47ca8e744eb01", "score": "0.47373933", "text": "function showList() {\n\t\t\t$state.go('flight.list');\n\t\t}", "title": "" }, { "docid": "0e059dbb4273c919c13a0898bd2855c4", "score": "0.4734618", "text": "function JobList({ rightJobs }) {\n\n if (!rightJobs) {\n return (<div><p>No jobs available</p></div>)\n }\n return (\n <div className=\"col-md-4\">\n {rightJobs.map(job => (<JobCard job={job} />))}\n </div>\n );\n}", "title": "" }, { "docid": "f712d100dd3430388feb3a2dd786679b", "score": "0.47290158", "text": "showAllMeetups(context) {\n context.commit(\"setLoading\", true);\n context.commit(\"clearError\");\n\n console.log(\"inside showallmeetups action\");\n try {\n return fetch(`/meetups`, { method: \"GET\" })\n .then(res => res.json())\n .then(meetups => {\n if (meetups.error) {\n //error message\n return commit(\"setError\", meetups.error);\n }\n context.commit(\"setAllMeetups\", meetups);\n context.commit(\"setLoading\", false);\n\n router.push(\"/meetups\");\n });\n } catch (err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "88ab8bd0cf578a7bc165dc892076e997", "score": "0.47274503", "text": "index(req, res){\n\n List.find((err, lists) => {\n // captura error\n if(err){\n return res.status(500)\n .json({ error: `Error al obtener datos: ${err}` });\n }\n\n res.status(200)\n .json({ message: 'Datos recuperado', lists });\n });\n }", "title": "" }, { "docid": "58b553891d5a49791da8ead2f92e250a", "score": "0.47237962", "text": "render (options = {}) {\n Page.list(options, (e, response) => {\n if (e === null && response) {\n this.renderProjects(response);\n };\n });\n }", "title": "" }, { "docid": "bfea50ed8197856ff2dde14ec9fd4cf2", "score": "0.47226703", "text": "function initLists () {\n\t\tvar user = User.getCurrent().then(function(user_data) {\n\t\t\tvar username = User.findByEmail(user_data.email);\n\t\t\tusername.$loaded(function() {\n\t\t\t\t// Returns an array. Maybe refactor findByEmail to unwrap?\n\t\t\t\tsetLists(username[0].$id);\n\t\t\t\tsetUser(username[0].$id);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "6999c19a137b2989d85beb819b5de92c", "score": "0.4721904", "text": "function appDefaultView(){\n\t//clears everything on the page\n\t\n\tclearSection();\n\t\n\tvar local_simulation = get_local_simulation();\n\t//sets the top bar to be the default look\n\tdefaultheaderView();\n\tif(getVerified() == false){\n\t\talert('You do not have permission to access this. Please get a token first.');\n\t}else{\n\t\t//sets the page to view to 'user information' page\n\t\tvar apps = DeviceAppsListTemplate(local_simulation.apps);\n\t\tvar content = getContainer();\n\t\tif(local_simulation.apps==''||local_simulation.apps==null){\n\t\t\tapps += \"No applications are registed to this simulation.\";\n\t\t}\n\t\tcontent.innerHTML = apps;\n\t\t//sets the sidebar to the sidebar for when inside a simulation\n\t\tsimulationSideBarView();\n\t\tremoveClass('active');\n\t\tdocument.getElementById('my-apps-link').className='active';\n\t}\n}", "title": "" }, { "docid": "4c8cae2791b119131305a39bc1a91f42", "score": "0.472103", "text": "function getListData() {\n var options = {\n url: \"http://localhost:3000/projects\",\n method: \"GET\",\n data: \"\",\n success: function(result) {\n renderListData(result);\n },\n error: function(error) {\n console.log(\"error\",error);\n }\n }\n ajax(options);\n}", "title": "" }, { "docid": "eb0888a16e021399bd4bf4b38a8245b6", "score": "0.4718745", "text": "function defaultLoad(candidates, dispatch) {\n // 1. check for API call success \n if (!candidates.message) {\n if (candidates._embedded.candidates.length === 0) {\n dispatch(candmoreinfoActions.loadCandMoreinfofailure());\n dispatch(docmoreinfoActions.loadDocMoreinfofailure());\n }\n else {\n //sort and load the first element as default loading\n let sortedCandidates = candidates._embedded.candidates.sort((a, b) => Number(b._links.self.href.split('/').pop(-1)) - Number(a._links.self.href.split('/').pop(-1)));\n sortedCandidates.map((n, index) => {\n const link = n._links.document.href;\n console.log('calling candiates more info using link ' + link);\n if (index === 0) {\n dispatch(candmoreinfoActions.loadCandMoreinfo(link, n));\n }\n return '';\n });\n }\n candidates = candidates._embedded;\n \n }\n // 2 API call not success through appropriate meesage to the user\n else {\n if (candidates.status === 401) {\n dispatch(clientActions.loadSignInPage());\n }\n if (candidates.status === 500) {\n dispatch(clientActions.loadCatsFailure(candidates.message));\n }\n if (candidates.status === 403) {\n dispatch(clientActions.loadNeedAdminAccess(candidates.message));\n }\n }\n return candidates;\n}", "title": "" }, { "docid": "c43f54c17e87db84f071a7dbccfd0c75", "score": "0.47116822", "text": "getAll(req, res){\n Workout.find({})\n .then(workout => {\n res.json(workout);\n })\n .catch(err => {\n res.json(err);\n });\n }", "title": "" }, { "docid": "35304da76c2f6a84079dfbbda4d1ccfe", "score": "0.4711635", "text": "function getTaskLists() {\n\n}", "title": "" }, { "docid": "d5d0472559f2dc769fa07fb3394d4f2e", "score": "0.47098646", "text": "function listQueue(res) {\n if (queue.isEmpty()) {\n res.send('Nobody! Like this: []');\n } else {\n res.send('Here\\'s who\\'s in the queue: ' + _.pluck(queue.get(), 'name').join(', ') + '.');\n }\n }", "title": "" }, { "docid": "383e6c07df06b59063c3bfe8f528e07e", "score": "0.46963742", "text": "list() {\n this._followRelService(\"list\", \"List\");\n }", "title": "" }, { "docid": "e0d1e8b21ecbbd56c8b6f749e6bebcba", "score": "0.46915165", "text": "@appRoute(\"(/)\")\n startIndexRoute () {\n System.import(\"../views/home\").then(View => App.getContentContainer().show(new View.default()) );\n }", "title": "" }, { "docid": "8ac64de33fd8cfc03c5d7cb13b40ffa3", "score": "0.46912485", "text": "queryLists() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_bucketlist_belonging_to_user/\" + this.state.userData.id)\n .then(response => response.json())\n .then(obj => this.loadLists(obj));\n }", "title": "" }, { "docid": "9aba78690c7bba4d85dc039e8d6ed27e", "score": "0.46865678", "text": "function showList() {\n \n var data = $form.formValue();\n \n function ondone(listData) {\n storage.put(\"leadlist\", data); // save settings\n var c = { leads: listData };\n $page.find(\"table.output > tbody\").html(kite(\"#lead-list\",c));\n }\n \n $.get(data.url)\n .done(ondone)\n .fail(function(err,status) { alert(\"communication \" + status); }); \n }", "title": "" }, { "docid": "660ae14a3fd29a6a22302ed40ed40a64", "score": "0.467715", "text": "componentDidMount() {\n\n this.props.getListeRouting()\n\n }", "title": "" }, { "docid": "decd3d11f967d59fec30c5632b090ae3", "score": "0.46771142", "text": "componentDidMount() {\n this.props.fetchJobs();\n }", "title": "" }, { "docid": "538f45c46c8a12ffcb4cd8bc014235b8", "score": "0.4675643", "text": "function getTasks(){\n $.ajax({\n type: 'GET',\n url: '/getTasks',\n success: displayTasks\n });\n}", "title": "" }, { "docid": "33114a21e1a58cb0f777faf0c3301af5", "score": "0.46691623", "text": "function default_1(target, _a) {\n var _b;\n var appJsonPath = _a.appJsonPath, appJsonContent = _a.appJsonContent;\n var staticConfig = appJsonContent;\n if (appJsonPath) {\n var appJSON = appJsonContent || fs.readFileSync(appJsonPath);\n staticConfig = JSON.parse(appJSON);\n }\n if (!staticConfig.routes || !Array.isArray(staticConfig.routes)) {\n throw new Error('routes should be an array in app.json.');\n }\n var routes = staticConfig.routes.filter(function (route) {\n if (Array.isArray(route.targets) && !route.targets.includes(target)) {\n return false;\n }\n return true;\n });\n if ((_b = staticConfig === null || staticConfig === void 0 ? void 0 : staticConfig.tabBar) === null || _b === void 0 ? void 0 : _b.source) {\n routes.push(__assign(__assign({}, staticConfig.tabBar), { __tabBar: true }));\n }\n return routes;\n}", "title": "" }, { "docid": "22e0cc8d399b871736446681517f9022", "score": "0.46670067", "text": "async showAll() {\n await this.model.read((data) => {\n this.view.render('showEntries', data);\n });\n }", "title": "" }, { "docid": "4e0b1cb011de51e61b6470b93d7d82d9", "score": "0.46633062", "text": "function candidateList() {\n history.push(\"/CandidateListAdmin\");\n }", "title": "" }, { "docid": "f1531722d6540cac1efa77f758fa941c", "score": "0.46596768", "text": "viewList() {\n\n // If the clicked list does not exist, we create one instead.\n if(!this.props.cUser.lists[this.state.cID].isCreated) {\n return this.createList();\n }\n\n var allRestaurants = this.props.cUser.lists[this.state.cID].restaurants.map( (restaurant, index) => {\n return <div key={index}>{restaurant}</div>;\n });\n\n if(allRestaurants.length === 0) {\n allRestaurants = \"This collection is empty.\";\n }\n return allRestaurants;\n }", "title": "" }, { "docid": "8be11d0be11f89fa96c97217e9649e53", "score": "0.46581736", "text": "function AuthAndAskForTaskLists() {\n loader.Load(true);\n}", "title": "" }, { "docid": "9f2dfd1545e083436057731d69b59b97", "score": "0.465569", "text": "getFullList() {\n return new Promise((resolve) => {\n // get first page to refresh total page count\n this.getPageData(1).then((firstPage) => {\n const pages = { 1: firstPage };\n // save totalPages as a constant to avoid race condition with pages added during this\n // process\n const { totalPages } = this;\n\n if (totalPages <= 1) {\n resolve(firstPage);\n } else {\n // now fetch all the missing pages\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\n this.getPageData(pageNum).then((newPage) => {\n pages[pageNum] = newPage;\n // look if all pages were collected\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1)\n .filter((i) => !(i in pages));\n if (missingPages.length === 0) {\n // collect all the so-far loaded pages in order (sorted keys)\n // and flatten them into 1 array\n resolve([].concat(...Object.keys(pages).sort().map((key) => pages[key])));\n }\n });\n });\n }\n });\n });\n }", "title": "" }, { "docid": "b57f01646f17e7faefa8a31310b010ee", "score": "0.46385413", "text": "function showList() {\n\t\t\t$state.go('^');\n\t\t}", "title": "" }, { "docid": "b57f01646f17e7faefa8a31310b010ee", "score": "0.46385413", "text": "function showList() {\n\t\t\t$state.go('^');\n\t\t}", "title": "" }, { "docid": "b5035245de5312ddb3f88e6ae7a0ff79", "score": "0.46329862", "text": "fetch () {\n this._makeRequest('GET', resources);\n }", "title": "" }, { "docid": "a4dc2a8b8ff7db77fddb44ec306235dd", "score": "0.4632483", "text": "function setResourceListingPaths(app) {\n for (var key in resources) {\n app.get(\"/\" + key.replace(\"\\.\\{format\\}\", \".json\"), function(req, res) {\n var r = resources[req.url.substr(1).split('?')[0].replace('.json', '.{format}')];\n if (!r) {\n return stopWithError(res, {'description': 'internal error', 'code': 500}); }\n else {\n res.header('Access-Control-Allow-Origin', \"*\");\n res.header(\"Content-Type\", \"application/json; charset=utf-8\");\n var key = req.url.substr(1).replace('.json', '.{format}').split('?')[0];\n var data = applyFilter(req, res, resources[key]);\n data.basePath = basePath;\n if (data.code) {\n res.send(data, data.code); }\n else {\n res.header('Access-Control-Allow-Origin', \"*\");\n res.header(\"Access-Control-Allow-Methods\", \"GET, POST, DELETE, PUT\");\n res.header(\"Access-Control-Allow-Headers\", \"Content-Type\");\n res.header(\"Content-Type\", \"application/json; charset=utf-8\");\n res.send(JSON.stringify(applyFilter(req, res, r)));\n }\n }\n });\n }\n}", "title": "" }, { "docid": "520cc9e7ef59f92fe8acc8ced09e70ae", "score": "0.4632267", "text": "function routeDontFound() {\n var dinamic = dinamicRoutes();\n dinamic.status && __webpack_require__(\"./src/ts/components sync recursive ^\\\\.\\\\/.*\\\\.ts$\")(\"./\" + dinamic.route.component + \".ts\").page();\n}", "title": "" }, { "docid": "00a45d651dc085b5d3bdf84179456b24", "score": "0.4630491", "text": "render () {\n return (\n <div className=\"app\"> \n <Router>\n <div className=\"route-container\">\n <Nav />\n <Switch>\n <Route exact path=\"/\" render={(props) => (\n <JobsCount\n {...props}\n total={this.countDays()}\n accepted={this.countDays('Accepted')}\n pending={this.countDays('Pending')}\n declined={this.countDays('Declined')}\n />\n )}>\n </Route>\n <Route path=\"/list/:filter\" render={(props) => (\n <JobsList \n {...props} \n days={this.state.allJobs}\n /> \n )}/>\n <Route path=\"/list\" render={(props) => (\n <JobsList\n {...props}\n days={this.state.allJobs}\n />\n )} />\n <Route path=\"/add\" render={(props) => (\n <AddJob\n {...props}\n newJob={this.addJob}\n />\n )} />\n <Route component={Error404} />\n </Switch>\n </div> \n </Router> \n </div>\n )\n }", "title": "" }, { "docid": "34ec1c4f0425cd43199b7d811b5b8017", "score": "0.4630354", "text": "function setupQuickRoutes(quickRoutes) {\n quickRoutes.filter(r => r.enabled).map((route, index) => {\n app.route(QuickRoutes.toUrl(route)).get((req, res, next) => {\n QuickRoutes.fetchData(req, res, route.fetchers)\n .then((data) => {\n res.render(route.view, data);\n })\n .catch((err) => {\n if (handleError) {\n handleError(err, req, res);\n } else {\n next(err);\n }\n });\n });\n });\n }", "title": "" }, { "docid": "bc3ec60a138456903a3da1b4fa818520", "score": "0.46299914", "text": "function index(request, response) {\n // PostgreSQL Method\n client.connect(); // Apparently no need to close the connection: https://github.com/brianc/node-postgres/issues/1670\n client.query('SELECT * FROM listings ORDER BY id DESC;', (err, res) => {\n if (err) {\n throw err;\n } else {\n const contextData = {\n title: 'Listings',\n salutation: \"Browse all listings and see what you'd like to rent\",\n listings: res.rows,\n };\n response.render('index', contextData);\n }\n });\n\n}", "title": "" }, { "docid": "edc7330f763cf11743adbb7a5db7c4a6", "score": "0.46222153", "text": "getFullList() {\n return new Promise((resolve) => {\n // get first page to refresh total page count\n this.getPageData(1).then((firstPage) => {\n const pages = { 1: firstPage };\n // save totalPages as a constant to avoid race condition with pages added during this\n // process\n const { totalPages } = this;\n\n if (totalPages === 1) {\n resolve(firstPage);\n }\n\n // now fetch all the missing pages\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\n this.getPageData(pageNum).then((newPage) => {\n pages[pageNum] = newPage;\n // look if all pages were collected\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1).filter(\n i => !(i in pages),\n );\n // eslint-disable-next-line no-console\n console.log('missingPages', missingPages);\n if (missingPages.length === 0) {\n // collect all the so-far loaded pages in order (sorted keys)\n // and flatten them into 1 array\n resolve([].concat(...Object.keys(pages).sort().map(key => pages[key])));\n }\n });\n });\n });\n });\n }", "title": "" }, { "docid": "b50e351aa2288a892d5d25ab2cb3cf05", "score": "0.46188235", "text": "function routeDontFound() {\n var dinamic = dinamicRoutes();\n dinamic.status && __webpack_require__(\"./src sync recursive ^\\\\.\\\\/.*\\\\.ts$\")(\"./\" + project + \"/js/components/\" + dinamic.route.component + \".ts\").page();\n}", "title": "" }, { "docid": "7f3d540451074bcbd57ad36e17b0c67c", "score": "0.46184802", "text": "function getJobs(){\n jobs_notifications.style.display = 'none';\n negotiation.style.display = 'none';\n posted_jobs.style.display = 'block';\n}", "title": "" }, { "docid": "3a1b739c1a67a45b3d16e3e0713bfe8b", "score": "0.46175176", "text": "function tasks_getAndDisplay() {\n communicator.getTasks().then((items) => {\n displayTasks(items)\n }, () => {\n tbTasks.innerHTML = 'Error while listing tasks'\n })\n}", "title": "" }, { "docid": "278601b27da0cb0b3397a6b041375470", "score": "0.46152002", "text": "parseDefaultRoute(url) {\n if (url.trim() === '/')\n throw Error('Url is index!');\n if (url[url.length - 1] === '/')\n url = url.slice(0, -1);\n if (url[0] === '/')\n url = url.slice(1, url.length);\n var indexAnyRoute = -1;\n for (var i = 0; i < this.routes.length; i++) {\n let route = this.routes[i];\n let routePath = route.path;\n if (routePath.trim() === '*')\n indexAnyRoute = i;\n if (routePath.trim() === '/')\n continue;\n if (routePath[routePath.length - 1] === '/')\n routePath = routePath.slice(0, -1);\n if (routePath[0] === '/')\n routePath = routePath.slice(1, routePath.length);\n var rBread = routePath.split('/');\n var urlBread = url.split('/');\n if (rBread.length !== urlBread.length)\n continue;\n for (let k = 0; k < urlBread.length; k++) {\n if (urlBread[k] === rBread[k] && k < urlBread.length - 1)\n continue;\n else if (urlBread[k] !== rBread[k] && k < urlBread.length - 1)\n break;\n else {\n if (k === urlBread.length - 1 && rBread[k].trim() === '*') {\n return i;\n }\n }\n }\n }\n if (indexAnyRoute !== -1)\n return indexAnyRoute;\n throw Error('Test');\n }", "title": "" }, { "docid": "32f7e274d31d9222125cb7b25181197b", "score": "0.4613421", "text": "function getMyRoutes() {\r\n\r\n // Get and return all runs in database\r\n $.ajax({\r\n url: \"/api/getMyRoutes/\" + user.userId,\r\n method: \"GET\"\r\n })\r\n .then(function (response) {\r\n displayMyRoutes(response);\r\n });\r\n}", "title": "" }, { "docid": "f2d637ceeb6aba34caaeee2abe24ace1", "score": "0.46107367", "text": "function defaultCall() {\n return new Promise((resolve, reject) => {\n getCall(url).then((data) => {\n if (data && data.results) {\n resolve(data.results);\n }\n });\n })\n }", "title": "" } ]
08ff0940b0d99446a8b7c63c0d4187d3
Get the mouse position over the canvas
[ { "docid": "54a10e6d8e0e8a86b0511074ef85d7f2", "score": "0.0", "text": "function mousemove(event)\n{\n\tvar rect = canvas.getBoundingClientRect(); // To get the absolute position\n\tvar mousePosX = event.clientX - rect.left;\n\tvar mousePosY = canvas.height - event.clientY - rect.top;\n\n\tvar movementX = event.movementX;\n\tvar movementY = event.movementY;\n\n\t//Horizontal rotation\n\tvec3.rotateY(look, look, eye, 0.002 * -movementX);\n\t//Vertical rotation\n\tvec3.rotateX(look, look, eye, 0.002 * -movementY);\n}", "title": "" } ]
[ { "docid": "4542b910fb78f2bd9b0ee5768cd1cb35", "score": "0.8287696", "text": "function getMousePos(canvas) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: mouseX - rect.left,\n y: mouseY - rect.top\n };\n}", "title": "" }, { "docid": "8e444f1f1ceb4be2f601f745f51b3c78", "score": "0.8226193", "text": "function getMousePositionInCanvas(){\n cvs_rect = cvs.getBoundingClientRect();\n return [mouseX - cvs_rect.left, mouseY - cvs_rect.top];\n}", "title": "" }, { "docid": "7854e8d45440f0cc810bd978f95b89ca", "score": "0.8060584", "text": "function getMousePos(canvas, event) {\r\n var rect = canvas.getBoundingClientRect();\r\n ////console.log(\"get mouse entered\");\r\n return {\r\n x: event.clientX - rect.left,\r\n y: event.clientY - rect.top\r\n };\r\n}", "title": "" }, { "docid": "fff015fb0b2a7e513f1fbbc77cfed3c1", "score": "0.8030265", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n mouse.x = evt.clientX - rect.left;\n mouse.y = evt.clientY - rect.top;\n}", "title": "" }, { "docid": "577752d294a9a98f49b63eeb6a17115b", "score": "0.8020654", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "bf0d7c34afe11026c643107179f2d30c", "score": "0.80190057", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}//end getMousePos", "title": "" }, { "docid": "2f3265194956185f08292dfbcf0fd07f", "score": "0.8015522", "text": "function getMousePosition(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "dd551622263dc0c00fc89dffd3eb6c7a", "score": "0.79599214", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "dd551622263dc0c00fc89dffd3eb6c7a", "score": "0.79599214", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "6b8993c99a7d29c31d6debfac0374519", "score": "0.79572815", "text": "function getMousePos(canvas, evt) {\r\n var rect = canvas.getBoundingClientRect();\r\n return {\r\n x: evt.clientX - rect.left,\r\n y: evt.clientY - rect.top\r\n };\r\n}", "title": "" }, { "docid": "f7c504623a158fa3889133b01239809d", "score": "0.7937062", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "9c27f5767d6f009e7d882e04e4b2125d", "score": "0.79215944", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "953ed25cbc158e65f78ed05e0ba166de", "score": "0.7918485", "text": "function getMousePos(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top\n };\n}", "title": "" }, { "docid": "0f3df83c080d64e2182d5692233aabbe", "score": "0.79024285", "text": "function mouseCoords(e){\n mouseX = e.clientX - canvasPlacement.left;\n mouseY = e.clientY - canvasPlacement.top;\n}", "title": "" }, { "docid": "ece5a17ab8ffd317884c3824be55000c", "score": "0.79017544", "text": "function getMousePos(e){\r\n\t\tvar rect = canvas.getBoundingClientRect();\r\n\t\treturn {x: e.clientX - rect.left, y: e.clientY -rect.top};\r\n\t}", "title": "" }, { "docid": "efd3e8a15a429917c48636b35c2d12c0", "score": "0.7898033", "text": "function getMousePos(canvas, event) {\r\n var rect = canvas.getBoundingClientRect();\r\n return {\r\n x: event.clientX - rect.left,\r\n y: event.clientY - rect.top\r\n };\r\n}", "title": "" }, { "docid": "efd3e8a15a429917c48636b35c2d12c0", "score": "0.7898033", "text": "function getMousePos(canvas, event) {\r\n var rect = canvas.getBoundingClientRect();\r\n return {\r\n x: event.clientX - rect.left,\r\n y: event.clientY - rect.top\r\n };\r\n}", "title": "" }, { "docid": "06fe590b98a8172dd1d07213ec52d1a9", "score": "0.78795755", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "06fe590b98a8172dd1d07213ec52d1a9", "score": "0.78795755", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "44c4f1530774b4fddacdff7cb0e36db7", "score": "0.78764963", "text": "function getMousePosition(canvas, evt){\n var rect = canvas.getBoundingClientRect();\n\n //event.clientX: Get the horizontal coordinate\n //event.cklientY: Get the vertical cordinate\n return{\n x : evt.clientX - rect.left,\n y: evt.clientY - rect.top\n }\n}", "title": "" }, { "docid": "c0e0a47fb7e76ff14f08d9b1ba828214", "score": "0.78622055", "text": "function getMousePos(canvas, evt)\n {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "114e2bc5b94b898bcba74171eb3de73d", "score": "0.78586984", "text": "function getMousePos(canvas, evt) {\r\n\t\tvar rect = canvas.getBoundingClientRect();\r\n\t\treturn {\r\n\t\t\tx: evt.clientX - rect.left,\r\n\t\t\ty: evt.clientY - rect.top\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "a794ff4780ce5fe3f97312f8380e4d0d", "score": "0.78556347", "text": "function getMousePos(canvas, e) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n}", "title": "" }, { "docid": "a794ff4780ce5fe3f97312f8380e4d0d", "score": "0.78556347", "text": "function getMousePos(canvas, e) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n}", "title": "" }, { "docid": "9fb8c1e3bd3836b317a3f97f1f91225a", "score": "0.78550494", "text": "function getMousePos(canvas, evt) {\n\t var rect = canvas.getBoundingClientRect();\n\t return {\n\t x: evt.clientX - rect.left,\n\t y: evt.clientY - rect.top\n\t };\n\t}", "title": "" }, { "docid": "5e743ff295ac17087a917162d63d77ef", "score": "0.78402656", "text": "function getMousePos(canvas, e) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: Math.round((e.clientX - rect.left)/(rect.right - rect.left)*canvas.width),\n y: Math.round((e.clientY - rect.top)/(rect.bottom - rect.top)*canvas.height)\n };\n}", "title": "" }, { "docid": "bbf7839dac4060cb4e439b93cbf33101", "score": "0.78372294", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top,\n };\n}", "title": "" }, { "docid": "5eca2f62a9acffab59adbdc48957d466", "score": "0.7822816", "text": "function getMousePos(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top\n };\n}", "title": "" }, { "docid": "5eca2f62a9acffab59adbdc48957d466", "score": "0.7822816", "text": "function getMousePos(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top\n };\n}", "title": "" }, { "docid": "67c664a1b39a2dc436d0e84d5ed11b5d", "score": "0.7822275", "text": "_getMousePos(event) {\n let canvasContainer = this.getElement().getBoundingClientRect();\n\n // Calculate the offset using the page location and the canvas' offset (also taking scroll into account)\n let x =\n event.pageX - canvasContainer.x - document.scrollingElement.scrollLeft,\n y = event.pageY - canvasContainer.y - document.scrollingElement.scrollTop;\n\n return [x, y];\n }", "title": "" }, { "docid": "9b78e9c6fee596321561ae631ba6c52a", "score": "0.78143144", "text": "function getMousePos (canvas, evt) {\n\tvar rect = canvas.getBoundingClientRect();\n\t\treturn {\n\t\t\tx: evt.clientX - rect.left,\n\t\t\ty: evt.clientY - rect.top\n\t\t};\n}", "title": "" }, { "docid": "c605ffa9bc373f5873fe70e774c899de", "score": "0.7798057", "text": "function calculateMousePos (evt) {\n var rect = canvas.getBoundingClientRect(); //the black area which are game is in\n var root = document.documentElement; //handling the document that the canvas is on\n\n // this is getting where the mouse is in context of where the mouse is in the canvas element\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n return {\n x:mouseX,\n y:mouseY\n };\n}", "title": "" }, { "docid": "df647f5eea5f724d9f36394f28a52c39", "score": "0.7791718", "text": "function getMousePos(canvas, evt) {\n let rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "2d34b846d16a882163b1920e556c37b8", "score": "0.77878493", "text": "function getMousePos(canvas, e) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: Math.round((e.clientX - rect.left)/(rect.right - rect.left)*canvas.width),\n y: Math.round((e.clientY - rect.top)/(rect.bottom - rect.top)*canvas.height)\n };\n }", "title": "" }, { "docid": "78d918ab14da7106478798455eaa2940", "score": "0.77876806", "text": "function getMousePos(canvas, event) {\n const mouse = {\n x: event.clientX - ctx.canvas.offsetLeft,\n y: event.clientY - ctx.canvas.offsetTop\n };\n return {\n x: (mouse.x * canvas.width) / canvas.clientWidth,\n y: (mouse.y * canvas.height) / canvas.clientHeight\n };\n }", "title": "" }, { "docid": "a476ad5c0a6239ecf66ec66d819a59ec", "score": "0.7784827", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect(), root = document.documentElement;\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n \n return {\n x: mouseX,\n y: mouseY\n };\n }", "title": "" }, { "docid": "2e689974dcf8a39a46aadafde066a452", "score": "0.7779945", "text": "function getMousePos(canvas, e) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: (e.clientX - rect.left) / (rect.right - rect.left) * canvas.width,\n y: (e.clientY - rect.top) / (rect.bottom - rect.top) * canvas.height\n };\n}", "title": "" }, { "docid": "9796e1b1117bfedc4d7738dc92723002", "score": "0.77795917", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: (evt.clientX - rect.left) / rect.width,\n y: (evt.clientY - rect.top) / rect.height\n };\n }", "title": "" }, { "docid": "55e1682874d79903461ed0ed6e2803df", "score": "0.7778193", "text": "function getMousePosition(canvas, event){\n const rect = canvas.getBoundingClientRect()\n const x = event.clientX - rect.left\n const y = event.clientY - rect.top\n \n var pos = [x, y];\n\n return pos;\n}", "title": "" }, { "docid": "f9bbbd259687a9e5116446297db565a4", "score": "0.7758306", "text": "function getMousePos(canvas, e) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: Math.round((e.clientX - rect.left) / (rect.right - rect.left) * canvas.width),\n y: Math.round((e.clientY - rect.top) / (rect.bottom - rect.top) * canvas.height)\n };\n }", "title": "" }, { "docid": "fbb3cfa5b30222ec20268a5086d2aedc", "score": "0.7751271", "text": "function getMousePos(canvas, evt) {\n\t\t\tvar rect = canvas.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\tx : evt.clientX - rect.left,\n\t\t\t\ty : evt.clientY - rect.top\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "35666d41c8ed2c53c52ddf67c6896d6f", "score": "0.774866", "text": "function getMousePosition(canvas, event) {\n\tvar rect = canvas.getBoundingClientRect();\n\tvar xL = event.clientX - rect.left;\n\tvar yL = event.clientY - rect.top;\n\treturn {\n\t\tx:xL,\n\t\ty:yL\n\t};\n}", "title": "" }, { "docid": "7c7eccf81246147416882f7675bd9839", "score": "0.7743026", "text": "getCanvasMousePos(mouseEvent, canvasRect) {\n return {\n x: mouseEvent.clientX - canvasRect.left,\n y: mouseEvent.clientY - canvasRect.top\n };\n }", "title": "" }, { "docid": "6d82ad7c19494b2b84f9e0a4029fd342", "score": "0.7729476", "text": "function getMousePos(stage, evt) {\n\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}", "title": "" }, { "docid": "aba97496e36d64bed56a0672c38e068c", "score": "0.7720937", "text": "function getMousePos(canvas, event) {\n\tvar rect = canvas.getBoundingClientRect();\n\treturn {\n\t\tx: event.clientX - rect.left,\n\t\ty: event.clientY - rect.top\n\t};\n}", "title": "" }, { "docid": "75b186915326d047410e02fa201deebe", "score": "0.77193207", "text": "function getMouseXY(e, canvas) {\r\n var canvas = document.getElementById('canvas_board');\r\n var boundingRect = canvas.getBoundingClientRect();\r\n var offsetX = boundingRect.left;\r\n var offsetY = boundingRect.top;\r\n var w = (boundingRect.width-canvas.width)/2;\r\n var h = (boundingRect.height-canvas.height)/2;\r\n offsetX += w;\r\n offsetY += h;\r\n var mx = Math.round(e.clientX-offsetX);\r\n var my = Math.round(e.clientY-offsetY);\r\n return {x: mx, y: my}; \r\n}", "title": "" }, { "docid": "76b812303b2dc3600bbf3d7b52d28c32", "score": "0.77111083", "text": "function getMousePosition(canvas, event) {\n let rect = canvas.getBoundingClientRect();\n let x = event.clientX - rect.left;\n let y = event.clientY - rect.top;\n let res = [x,y];\n return res;\n \n}", "title": "" }, { "docid": "db17cd1a3ae4359dc5167a1a5da8f993", "score": "0.7707211", "text": "function getMousePos(e) {\n let rect = canvas.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n}", "title": "" }, { "docid": "86ebac718183e5050b615d92df811cd2", "score": "0.77010727", "text": "function getMousePos(evt){\n var rect = document.getElementsByTagName('canvas')[0].getBoundingClientRect();\n return{\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n }\n}", "title": "" }, { "docid": "4c97b2ae7c6646efb03970592da15b74", "score": "0.76984674", "text": "function mouseCoords() {\r\n\tlet rect = canvas.getBoundingClientRect();\r\n\r\n\treturn {\r\n\t\tx: Math.floor((mouseClientX - rect.left) * (bufWidth / rect.width)),\r\n\t\ty: Math.floor((mouseClientY - rect.top) * (bufHeight / rect.height))\r\n\t}\r\n}", "title": "" }, { "docid": "72fd644f7ee973854b5b21e425d6f47f", "score": "0.7697002", "text": "function getMousePos(e) {\n var elem = $(e.target), pos = elem.offset(), g = getCanvasGap(e);\n return {\n x: e.pageX - pos.left - g.left,\n y: e.pageY - pos.top - g.top,\n }\n }", "title": "" }, { "docid": "d99c7211064ebcfc83c4cb146d15a79f", "score": "0.7691834", "text": "function getMousePos(e) \n{\n var rect = piano_canvas.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n}", "title": "" }, { "docid": "b4b18cc6ea0510048b07d4a4fcd20366", "score": "0.76815593", "text": "function getMousePos(e) {\n\tlet rect = canvas.getBoundingClientRect();\n\treturn {\n\t\t\tx: e.clientX - rect.left,\n\t\t\ty: e.clientY - rect.top\n\t\t};\n}", "title": "" }, { "docid": "abd1bdb8b22a0f0069290fec56ad2fe1", "score": "0.7678312", "text": "function getMousePos(canvas, evt) {\n\tvar rect = canvas.getBoundingClientRect();\n\treturn {\n\t\tx: Math.round((evt.clientX-rect.left)/(rect.right-rect.left)*canvas.width),\n\t\ty: Math.round((evt.clientY-rect.top)/(rect.bottom-rect.top)*canvas.height)\n\t};\n}", "title": "" }, { "docid": "3ed6116250cb6379e2e1d3a40ce5a721", "score": "0.76768315", "text": "function getMousePos(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n // console.log(event.clientX, event.clientY);\n // console.log(rect);\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top\n }\n}", "title": "" }, { "docid": "5f273216b568dd68d151bbaf53312a09", "score": "0.7669764", "text": "function getMousePos(canvas, evt) {\n var scroll = document.body.scrollTop;\n if (typeof (canvas.offsetParent) != 'undefined') {\n for (var posX = 0, posY = 0; canvas; canvas = canvas.offsetParent) {\n posX += canvas.offsetLeft;\n posY += canvas.offsetTop;\n }\n return { x: evt.clientX - posX, y: evt.clientY - (posY - scroll) };\n } else {\n return { x: evt.clientX - canvas.offsetLeft, y: evt.clientY - (canvas.offsetTop - scroll) };\n }\n}", "title": "" }, { "docid": "b2b71ffdf2aca0bf9f095d2f41af3b0a", "score": "0.76380634", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: (evt.clientX - rect.left) / (rect.right - rect.left) * canvas.width,\n y: (evt.clientY - rect.top) / (rect.bottom - rect.top) * canvas.height\n };\n }", "title": "" }, { "docid": "8dcf786979cfee972e03957b7e619c61", "score": "0.76290935", "text": "function getXY(canvas, event){ //shape \n const rect = canvas.getBoundingClientRect()\n const y = event.clientY - rect.top //mouse event\n const x = event.clientX - rect.left \n return {x:x, y:y}\n }", "title": "" }, { "docid": "d55caa9b219e1ba9f6bf3b2e79dc94cf", "score": "0.76284665", "text": "function getMousePos(canvasDom, e) {\n var canvas = canvasDom.getBoundingClientRect();\n return {\n x: e.clientX - canvas.left,\n y: e.clientY - canvas.top\n };\n}", "title": "" }, { "docid": "62a6f15c50bdeb34cd0e156afba81929", "score": "0.7607917", "text": "function mousePos(e) {\n\t\t\t\tvar rect = canvas.getBoundingClientRect();\n\t\t\t\treturn new mapboxgl.Point(\n\t\t\t\t\te.originalEvent.clientX - rect.left - canvas.clientLeft,\n\t\t\t\t\te.originalEvent.clientY - rect.top - canvas.clientTop\n\t\t\t\t);\n\t\t\t}", "title": "" }, { "docid": "62a6f15c50bdeb34cd0e156afba81929", "score": "0.7607917", "text": "function mousePos(e) {\n\t\t\t\tvar rect = canvas.getBoundingClientRect();\n\t\t\t\treturn new mapboxgl.Point(\n\t\t\t\t\te.originalEvent.clientX - rect.left - canvas.clientLeft,\n\t\t\t\t\te.originalEvent.clientY - rect.top - canvas.clientTop\n\t\t\t\t);\n\t\t\t}", "title": "" }, { "docid": "d862ed7cdd7a0346c78bc852c9c7e006", "score": "0.7595435", "text": "function getMousePos(canvasDom, evt) {\r\n var rect = canvasDom.getBoundingClientRect();\r\n return {\r\n x: evt.clientX - rect.left,\r\n y: evt.clientY - rect.top\r\n };\r\n}", "title": "" }, { "docid": "abaab1a767fc1e5dd8bfa24dc05326e0", "score": "0.7589076", "text": "function getMousePosition(event) {\n// This getBoundingClientRect() function will return the X and Y coordinates \n// Reference: https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect\n// \"canvas.getBoundingClientRect();\" will get the boundaries of this \"canvas\" element\nconst boundaries = canvas.getBoundingClientRect();\nreturn {\n x: event.clientX - boundaries.left,\n y: event.clientY - boundaries.top,\n};\n}", "title": "" }, { "docid": "efd9b30bf8206c82c56cdb0e77da21c9", "score": "0.7588341", "text": "function getPos(e) {\r\n var r = canvas.getBoundingClientRect();\r\n return {x: e.clientX - r.left, y: e.clientY - r.top}\r\n }", "title": "" }, { "docid": "4f06cfc69be711a0ee46304479ad6dc5", "score": "0.7585119", "text": "function getMousePos(canvas, evt) {\n\t var rect = canvas.getBoundingClientRect();\n\t return {\n\t x: evt.clientX - rect.left\n\t };\n\t}", "title": "" }, { "docid": "d20697ef2c3186bd1bd6652ef16d3e28", "score": "0.75760233", "text": "function oMousePos(canvas, evt) {\n var ClientRect = canvas.getBoundingClientRect();\n return { //objeto\n x: Math.round(evt.clientX - ClientRect.left),\n y: Math.round(evt.clientY - ClientRect.top)\n }\n}", "title": "" }, { "docid": "ced3eadc69afdc90b00a68808cae53c1", "score": "0.757578", "text": "function getMousePos(evt) {\n\n var rect = canvas.getBoundingClientRect();\n\n\treturn {\n x: Math.floor((evt.clientX-rect.left)/(rect.right-rect.left)*canvas.width),\n y: Math.floor((evt.clientY-rect.top)/(rect.bottom-rect.top)*canvas.height)\n\t};\n}", "title": "" }, { "docid": "0b88ada6b7b4695856653a703375f99f", "score": "0.75718904", "text": "function getCanvasPosition(e) {\n var rect = theCanvas.getBoundingClientRect();\n return new Point(e.clientX - rect.left, e.clientY - rect.top);\n}", "title": "" }, { "docid": "55021391ce3aa083e17c5e0458e4201f", "score": "0.7554082", "text": "function getMousePos(canvasRef, e) {\n const cvs = canvasRef.current;\n const rect = cvs.getBoundingClientRect();\n return {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top,\n };\n}", "title": "" }, { "docid": "859b24003a1b5bb41eae0b5fe6f10d30", "score": "0.7554039", "text": "function getMousePos(event) {\n\t\t var rect = canvas.getBoundingClientRect();\n\t\t x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n\t\t y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n\t\t return {\n\t\t X: x - rect.left,\n\t\t Y: y - rect.top\n\t\t };\n\t\t}", "title": "" }, { "docid": "90f252e1694bafaf3a22e490d80d8c7b", "score": "0.75474745", "text": "function getActualMousePos(canvas, position) {\n var rect = canvas.getBoundingClientRect();\n\n return new Position(position.x - rect.left, position.y - rect.top);\n}", "title": "" }, { "docid": "e925e68fea5ca8ce1b3b57a3646188f6", "score": "0.75468904", "text": "function getCanvasCoordsFromMouseEvent(mouseEvent, canvas) {\n var rect = canvas.getBoundingClientRect();\n return [mouseEvent.x - rect.left, mouseEvent.y - rect.top];\n }", "title": "" }, { "docid": "620dd2e8cb70019b8145a498820964cd", "score": "0.75404096", "text": "function getPointerPositionOnCanvas(canvas, event) {\r\n var boundingRect = canvas.getBoundingClientRect();\r\n var xPos = event.clientX - boundingRect.left;\r\n var yPos = event.clientY - boundingRect.top;\r\n return {x:xPos, y:yPos};\r\n}", "title": "" }, { "docid": "4bd92e0b1abb219d267f84d1d310bd85", "score": "0.75351065", "text": "function getMousePosition(x,y){\n let canvasSizeData = canvas.getBoundingClientRect();\n return { x: (x-canvasSizeData.left)*(canvas.width/canvasSizeData.width),\n y: (y-canvasSizeData.left)*(canvas.height/canvasSizeData.height)+41\n }\n // let rect = canvas.getBoundingClientRect();\n // return {\n // x: x - rect.left,\n // y: y - rect.top\n // }\n \n}", "title": "" }, { "docid": "5ef68cc2c131d628eb4c17ab3011d537", "score": "0.7519663", "text": "function getMousePos(canvas, evt) {\n var rect \t\t= canvas.getBoundingClientRect();\n\tvar mousePos \t= new vec(evt.clientX - rect.left,evt.clientY - rect.top);\n\treturn mousePos;\n}", "title": "" }, { "docid": "9a1c4facc729a5a078114d62de4e30dc", "score": "0.7508886", "text": "function getMousePositions(canvas, event) {\n\n var bounds = canvas.getBoundingClientRect();\n return {\n\n x: event.clientX - bounds.left,\n y: event.clientY - bounds.top\n\n };\n\n }", "title": "" }, { "docid": "aadc124082f64c89b34666685b881866", "score": "0.749256", "text": "function getMouse(e) {\n var element = canvas, offsetX = 0, offsetY = 0;\n\n if (element.offsetParent) {\n do {\n offsetX += element.offsetLeft;\n offsetY += element.offsetTop;\n } while ((element = element.offsetParent));\n }\n\n // Add padding and border style widths to offset\n offsetX += stylePaddingLeft;\n offsetY += stylePaddingTop;\n\n offsetX += styleBorderLeft;\n offsetY += styleBorderTop;\n\n mx = e.pageX - offsetX;\n my = e.pageY - offsetY\n}", "title": "" }, { "docid": "ddf36b9b418397178958020c6a496a01", "score": "0.7480599", "text": "function getMousePos(evt)\n{\n var rect = canvas.getBoundingClientRect(),\n scaleX = canvas.width / rect.width,\n scaleY = canvas.height / rect.height;\n\n return {\n x: Math.floor(((evt.clientX - rect.left) * scaleX) / pixelSize - 1), //-0.5\n y: Math.floor(((evt.clientY - rect.top) * scaleY) / pixelSize - 1)\n }\n}", "title": "" }, { "docid": "197ac7d14177b45af6acb9ed8e079517", "score": "0.748006", "text": "function getMouse(e, canvas) {\n var element = canvas[0], offsetX = 0, offsetY = 0, mx, my;\n\n // Compute the total offset. It's possible to cache this if you want\n if (element.offsetParent !== undefined) {\n do {\n offsetX += element.offsetLeft;\n offsetY += element.offsetTop;\n } while ((element = element.offsetParent));\n }\n\n // Add padding and border style widths to offset\n // Also add the <html> offsets in case there's a position:fixed bar (like the stumbleupon bar)\n // This part is not strictly necessary, it depends on your styling\n // offsetX += stylePaddingLeft + styleBorderLeft + htmlLeft;\n // offsetY += stylePaddingTop + styleBorderTop + htmlTop;\n\n mx = e.pageX - offsetX;\n my = e.pageY - offsetY;\n\n // We return a simple javascript object with x and y defined\n return {x: mx / canvas.scaleX, y: my / canvas.scaleY};\n}", "title": "" }, { "docid": "9fda41286182c41b2014d4c84ab4d954", "score": "0.746329", "text": "function calculateMousePos(evt) {\n var rect = canvas.getBoundingClientRect();\n var root = document.documentElement;\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n return {\n x:mouseX,\n y:mouseY\n };\n}", "title": "" }, { "docid": "10037d1c5c745581195808ded6a76aa2", "score": "0.74358505", "text": "function getMousePosition(e, obj) {\n debug = document.getElementById(\"point\");\n var x;\n var y;\n x = e.pageX - $(canvas).offset().left;\n y = e.pageY - $(canvas).offset().top;\n\n z = new Point(x, y);\n debug.innerHTML = \"x=\" + x + \",y=\" + y + \":\" + gState.name\n return z;\n}", "title": "" }, { "docid": "ad8afd927db416f21be395593e0d1d42", "score": "0.7435821", "text": "function getCursorPosition(e) {\n var rect = canvas.getBoundingClientRect();\n var x = e.clientX - rect.left - woff - 1;\n var y = e.clientY - rect.top - hoff - 1;\n return {x:x,y:y};\n}", "title": "" }, { "docid": "27d85d4f9c5f1044f2850055395f8193", "score": "0.7433421", "text": "function calcMousePos(e){\n\t\t\tlet rect = canvas.getBoundingClientRect();\n\t\t\tlet root = document.documentElement;\n\t\t\tlet mouseX = e.clientX - rect.left - root.scrollLeft;\n\t\t\tlet mouseY = e.clientY - rect.top - root.scrollTop;\n\t\t\treturn {\n\t\t\t\tx: mouseX,\n\t\t\t\ty: mouseY\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7367454eb60ffcc61367c0ad415d3003", "score": "0.7429942", "text": "function getMousePos(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX*devPixelRatio - rect.left,\n y: event.clientY*devPixelRatio - rect.top\n };\n }", "title": "" }, { "docid": "3dd3f02a7a52923c7340883a79287d88", "score": "0.7424871", "text": "function calculateMousePos(evt){\n var rect = canvas.getBoundingClientRect(); // black game area\n var root = document.documentElement;\n // taking position of mouse within playing space.\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n // returning a pair of variables\n return {\n x:mouseX,\n y:mouseY\n };\n}", "title": "" }, { "docid": "34b450957fb81a93c7eb0270176f9c0d", "score": "0.7422244", "text": "function getCanvasCoordinates(ev, canvas){\r\n var x = ev.clientX; // x coordinate of a mouse pointer\r\n var y = ev.clientY; // y coordinate of a mouse pointer\r\n var rect = ev.target.getBoundingClientRect() ;\r\n\r\n x = ((x - rect.left) - canvas.width/2)/(canvas.width/2);\r\n y = (canvas.height/2 - (y - rect.top))/(canvas.height/2);\r\n return [x, y];\r\n}", "title": "" }, { "docid": "d74839e1ee560849f157c5e5f839b1e3", "score": "0.74186236", "text": "function calculateMousePos(evt) {\n var rect = canvas.getBoundingClientRect();\n var root = document.documentElement;\n var mouseX = evt.clientX - rect.left - root.scrollLeft;\n var mouseY = evt.clientY - rect.top - root.scrollTop;\n return {\n x: mouseX,\n y: mouseY\n }\n }", "title": "" }, { "docid": "b2ab747bb2b3931919868d8ed19dbe03", "score": "0.74012035", "text": "function getCursorPosition(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n var x = event.clientX - rect.left;\n var y = event.clientY - rect.top;\n\treturn [x, y]\n}", "title": "" }, { "docid": "7d2b6c94bd2e8fbe205658c1bf3df820", "score": "0.73918694", "text": "function getMousePos(canvasDom, mouseEvent) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: mouseEvent.clientX - rect.left,\n y: mouseEvent.clientY - rect.top\n };\n }", "title": "" }, { "docid": "e4d6df87e89604b02f685e43573e694e", "score": "0.73914427", "text": "function getMousePos (e) {\n posX_color = e.offsetX;\n posY_color = e.offsetY;\n getColorRGB();\n canvas_color.addEventListener('click', ()=> {document.getElementById('canvas_color').classList.add(\"show_selector\")})\n}", "title": "" }, { "docid": "56789fe7f87d4670bcd1c70a86278dc1", "score": "0.7390176", "text": "function mouseCoords(e){\r\n var totalOffsetX = 0;\r\n var totalOffsetY = 0;\r\n var canvasX = 0;\r\n var canvasY = 0;\r\n var currentElement = this;\r\n\r\n do {\r\n totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft;\r\n totalOffsetY += currentElement.offsetTop - currentElement.scrollTop;\r\n }\r\n while (currentElement = currentElement.offsetParent);\r\n\r\n canvasX = e.pageX - totalOffsetX;\r\n canvasY = e.pageY - totalOffsetY;\r\n\r\n return { x: canvasX, y: canvasY };\r\n}", "title": "" }, { "docid": "cb5c8a2387e6e3226b4a9d367bf1ecfc", "score": "0.73822767", "text": "function getCanvasCoordinates(event) {\n var x = event.clientX - BymouseCanvas.getBoundingClientRect().left,\n y = event.clientY - BymouseCanvas.getBoundingClientRect().top;\n\n return {x: x, y: y};\n}", "title": "" }, { "docid": "5e27fcedcbbdc1a1ce9cefa8b6228c3c", "score": "0.7381518", "text": "function getMouse(e) \n{\n var element = canvas, offsetX = 0, offsetY = 0;\n\n if (element.offsetParent) {\n do {\n offsetX += element.offsetLeft;\n offsetY += element.offsetTop;\n } while ((element = element.offsetParent));\n }\n\n // Add padding and border style widths to offset\n offsetX += stylePaddingLeft;\n offsetY += stylePaddingTop;\n\n offsetX += styleBorderLeft;\n offsetY += styleBorderTop;\n\n mx = e.pageX - offsetX;\n my = e.pageY - offsetY\n}", "title": "" }, { "docid": "8bdea8ddb1e8772e1a0fa6bc3241b440", "score": "0.73720175", "text": "function getMousePos(canvasDom, mouseEvent) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: mouseEvent.clientX - rect.left,\n y: mouseEvent.clientY - rect.top\n };\n }", "title": "" }, { "docid": "5097d42181d36cd592203f92adf09fed", "score": "0.7345455", "text": "function getMousePos(canvasDom, mouseEvent) {\n var rect = canvasDom.getBoundingClientRect();\n return {\n x: mouseEvent.clientX - rect.left,\n y: mouseEvent.clientY - rect.top\n };\n}", "title": "" }, { "docid": "f6e84201ed7545b665e8e5d132456084", "score": "0.7345296", "text": "mousePos(mouse){\n\t\treturn {\n\t\t\tx: mouse.x - this.canvasPos.left,\n\t\t\ty: mouse.y - this.canvasPos.top\n\t\t}\n\t}", "title": "" }, { "docid": "ed0d768b7637c2b4a70312ee986a8854", "score": "0.73282623", "text": "function currentCursorPos(e) {\n\n\tvar p = e.containerPoint;\n\treturn {\n\t\tx: p.x - M_HOVER_OFFSET.l,\n\t\ty: p.y - M_HOVER_OFFSET.t\n\t};\n}", "title": "" }, { "docid": "e369f3c6a601ac3e9f15aabba5512fee", "score": "0.7326482", "text": "function getXY(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top\n }\n }", "title": "" }, { "docid": "4ebcf59bb2d4c98aeeeebb1e4b641975", "score": "0.7324116", "text": "function mousePosition(evt) {\n var pos = { x: 0, y: 0 };\n var elem = evt.target.offsetParent; //canvas\n\n var box = elem.getBoundingClientRect();\n var compStyle = document.defaultView.getComputedStyle(elem, null);\n\n var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;\n var scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n\n var paddingLeft = parseFloat(compStyle.getPropertyValue('padding-left'));\n var borderLeftWidth = parseFloat(compStyle.getPropertyValue('border-left-width'));\n\n var paddingTop = parseFloat(compStyle.getPropertyValue('padding-top'));\n var borderTopWidth = parseFloat(compStyle.getPropertyValue('border-top-width'));\n\n pos.x = Math.round(evt.pageX - (box.left + paddingLeft + borderLeftWidth + scrollLeft));\n pos.y = Math.round(evt.pageY - (box.top + paddingTop + borderTopWidth + scrollTop));\n\n return pos;\n}", "title": "" }, { "docid": "00221170b60e7984732262063419afdf", "score": "0.7311931", "text": "function getMouse(e) {\n\t var element = canvas, offsetX = 0, offsetY = 0;\n\t\n\t if (element.offsetParent) {\n\t do {\n\t offsetX += element.offsetLeft;\n\t offsetY += element.offsetTop;\n\t } while ((element = element.offsetParent));\n\t }\n\t\n\t // Add padding and border style widths to offset\n\t offsetX += stylePaddingLeft;\n\t offsetY += stylePaddingTop;\n\t\n\t offsetX += styleBorderLeft;\n\t offsetY += styleBorderTop;\n\t\n\t mx = e.pageX - offsetX;\n\t my = e.pageY - offsetY\n\t}", "title": "" }, { "docid": "285fa943e907c83be1d926ef09f94b53", "score": "0.7299962", "text": "function getPointerCoordinates(e) {\n\t\tvar x = e.clientX - canvas.getBoundingClientRect().left,\n\t\ty = e.clientY - canvas.getBoundingClientRect().top;\n\t\treturn {x: x, y: y};\n \t}", "title": "" } ]
210e3fa6939bdf60ac014ad6655802e0
Function for Upload File
[ { "docid": "fe590f70a9460a56a177d58a3f0085e5", "score": "0.6599376", "text": "function uploadFile(fileData) { \r\n\r\n var Action, FileId; \r\n\r\n var findFolder = getFolder('OCR Pro - Desktop'); \r\n if(findFolder == \"null\"){\r\n var folder = DriveApp.createFolder('OCR Pro - Desktop');\r\n }else{\r\n folder = findFolder;\r\n }\r\n \r\n \r\n try { \r\n //var img = form.imageFile; \r\n var OCRlang = fileData.ocrLang;\r\n var isSecretFile = fileData.ocrSecret;\r\n\r\n var fileBlob = Utilities.newBlob(fileData.bytes, fileData.mimeType, fileData.filename);\r\n var OCRimage = DriveApp.createFile(fileBlob);\r\n //var OCRimage = folder.createFile(img);\r\n\r\n var UploadStatus = \"File Uploaded Successfully!\";\r\n Action = 'success';\r\n FileId = OCRimage.getId();\r\n \r\n } catch (m) {\r\n UploadStatus = m.toString();\r\n Logger.log( m.toString());\r\n Action = 'error';\r\n }\r\n \r\n return [Action, FileId, OCRlang, isSecretFile];\r\n}", "title": "" } ]
[ { "docid": "9cdc00f55458bdeae9c24fefcaba0ab7", "score": "0.7410391", "text": "function uploadFile() {\n var xhr = new XMLHttpRequest();\n xhr.open('POST', _options[_mode].uploadUrl, true);\n xhr.onreadystatechange = function (e) {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n var resText = xhr.responseText;\n resText = resText.replace(/\"/g, \"\");\n //get the url and add the picture to the context\n _options[_mode].uploadCallback(resText);\n stopLoading();\n eluploader.hideAndClear();\n }\n }\n\n xhr.send(formData);\n }", "title": "" }, { "docid": "8db2581f5cb48869a6c4da5796caf862", "score": "0.73780096", "text": "async upload({ filename, content, cancelSource, onProgress }) { throw new NotImplementedError('upload'); }", "title": "" }, { "docid": "18fa27087dfdac99453465ee718a54a2", "score": "0.73293054", "text": "upload(file) {\n console.log(\"upload service ran\");\n console.log(file);\n return Api().post(\"upload\", file);\n }", "title": "" }, { "docid": "f04fdea5e081fc8632b1ffd6b6cc3984", "score": "0.71440506", "text": "function uploadFile(mediaFile) {\n\n var uri = encodeURI(\"http://www.ivanball.com/Web/api/FileTransfer/UploadFile\");\n\n var options = new FileUploadOptions();\n //options.fileKey = \"file\";\n options.fileName = mediaFile.name;\n //options.mimeType = \"text/plain\";\n //options.chunkedMode = false;\n\n //var headers = { 'headerParam': 'headerValue' };\n //options.headers = headers;\n\n var ft = new FileTransfer();\n ft.onprogress = function (progressEvent) {\n var element = document.getElementById('ft-status');\n if (progressEvent.lengthComputable) {\n var perc = Math.floor(progressEvent.loaded / progressEvent.total * 100);\n document.getElementById(\"ft-prog\").value = perc;\n element.innerHTML = perc + \"% uploaded... (\" + mediaFile.name + \")\";\n } else {\n if (element.innerHTML == \"\") {\n element.innerHTML = \"Uploading \" + mediaFile.name;\n } else {\n element.innerHTML += \".\";\n }\n }\n };\n ft.upload(mediaFile.fullPath, uri, uploadSuccess, uploadError, options, true);\n }", "title": "" }, { "docid": "09d10c54534de73230d921939ebedb2c", "score": "0.714135", "text": "function uploadDealcsv() {}", "title": "" }, { "docid": "388e97654dc22e1b0d588e3df8593df4", "score": "0.7109391", "text": "function upload() {\n\tif (fileList != null) {\n\t\tuploader.setSimUploadLimit(parseInt(document.getElementById(\"simulUploads\").value));\n\t\tuploader.uploadAll(\"/create\", \"POST\", null, \"Filedata\");\n\t}\t\n\t}", "title": "" }, { "docid": "0e7b75c0390ad30fa5ede2aeaa0a2987", "score": "0.6981334", "text": "function uploadFile () {\n return OvhApiMe.Document().v6().upload(self.model.icsFile.name, self.model.icsFile);\n }", "title": "" }, { "docid": "ecb829e0fa0e6cc4eba2ad35bb511496", "score": "0.6968911", "text": "function uploadFile(evt) {\n\tgapi.client.load('drive', 'v2', function() {\n\t\t// var file = File object;\n\t\t// insertFile(file);\n\t});\n}", "title": "" }, { "docid": "20fa2955cf4f9bd60110979e2692ee9d", "score": "0.6948212", "text": "function fileUpload(imageElement, buttonElement, successPathDiv){\n runDocumentPost(imageElement, buttonElement, successPathDiv);\n}", "title": "" }, { "docid": "42ae50020d2fe92122b2274d7bb78e9a", "score": "0.69432056", "text": "static upload (path, text) {\n Nofan._upload(path, text, (e) => {\n if (e) console.log(e)\n })\n }", "title": "" }, { "docid": "a2bc09dada381ccedc95b284f7c56f63", "score": "0.69273", "text": "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}", "title": "" }, { "docid": "629c122c7808582fc41653c25faea479", "score": "0.6913549", "text": "function uploadPhoto() {\n \n\t// zakomentowane zeby nie zrzeralo transferu\n\tvar options = new FileUploadOptions();\n\toptions.fileKey=\"file\";\n\toptions.fileName=MyPinId+\".jpeg\";\n\toptions.mimeType=\"image/jpeg\";\n\n\tvar params = {RequestMethodId : 12};\t\t//RequestMethodId:12 id ladowania pliku\n\toptions.params = params;\n\n\tvar ft = new FileTransfer();\n\tft.upload(MyNewPhotoLocation, LeathingEventsAjax, win, fail, options);\n\t\n}", "title": "" }, { "docid": "60b4ffcbebcfdca7a4038aa602713c20", "score": "0.6897349", "text": "function uploadFile(){\r\r\n\r\r\n\r\r\n\r\r\n\r\r\ntitle = _('title');\r\r\ndescription =_('description');\r\r\nfile = _('file').files[0];\r\r\n\r\r\n category = _('category');\r\r\n tag = _('tag');\r\r\n content = _('content');\r\r\n\r\r\n\r\r\nvar formdata = new FormData();\r\r\n\r\r\nformdata.append('title', title.value);\r\r\nformdata.append('description', description.value);\r\r\nformdata.append('category', category.value);\r\r\nformdata.append('tag', tag.value);\r\r\nformdata.append('content', content.value);\r\r\nformdata.append('file', file);\r\r\n\r\r\n\r\r\nif (window.XMLHttpRequest) {\r\r\n // code for modern browsers\r\r\n var ajax = new XMLHttpRequest();\r\r\n } else {\r\r\n // code for old IE browsers\r\r\n var ajax = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\r\n}\r\r\n\r\r\n\r\r\najax.upload.addEventListener('progress', progressHandle, false);\r\r\najax.addEventListener('load', completeHandle, false);\r\r\najax.addEventListener('error', errorHandle, false);\r\r\najax.addEventListener('abort', abortHandle, false);\r\r\najax.open(\"POST\", \"addpost_server.php\");\r\r\najax.send(formdata);\r\r\n\r\r\n\r\r\n\r\r\n\r\r\n}", "title": "" }, { "docid": "bc9e75e64320662fc5b4b11736de022f", "score": "0.6873573", "text": "function upload(file) {\n formData.append('file', file) // (3) Create form for send to server\n\n xhr.open('POST', url); // Open request with post method and upload url (1)\n xhr.send(formData); // Send our created form (3) with file (2) to server\n }", "title": "" }, { "docid": "e3b84b52c2b69cba0eb2f75c18f38646", "score": "0.6857093", "text": "function uploadFileAction(){\n\t\n\tonImagewin( 1 );\t\n\treturn null;\n}", "title": "" }, { "docid": "bba7c60fee6165361d4c4de042773651", "score": "0.6854489", "text": "function uploadFile(mediaFile,intSumbitIssuesID,intImageSize) \r\n{\r\n var options = new FileUploadOptions();//holds the file upload options\r\n\tvar strFileID = mediaFile.id;//holds the media file id\r\n\t\r\n options.fileKey = \"recMedia\";//the key need to get the data when it arrives on the server\r\n options.fileName = Number(new Date()) + mediaFile.src.name;//holds the name of the file\r\n\t\t\r\n\t//checks if the mediaFile is imgSumbitThumb and the intImageSize is 410 meaning it should go to the Photo 1\r\n\t//as thumbnail has to go to both the thumbnail and the intImageSize\r\n\tif(strFileID == \"imgSumbitThumb\" && intImageSize == 410)\r\n\t\tstrFileID = \"imgSumbitPhoto1\";\r\n\t\t\r\n\tconsole.log(\"File Name = \" + mediaFile.src.name);\r\n\tconsole.log(\"Image Size = \" + intImageSize);\r\n\tconsole.log(\"File ID = \" + strFileID);\r\n\r\n var params = new Object();//adds the any optionly perments\r\n params.IssueID = intSumbitIssuesID;\r\n\tparams.ImageFieldID = strFileID;\r\n\tparams.ImageSize = intImageSize;\r\n options.params = params;\r\n\t\r\n\t//adds the amount that was sent to the sever in order to know when how many photos is being uploaded\r\n\twindow.localStorage.setItem(\"intFileSent\", (parseInt(window.localStorage.getItem(\"intFileSent\")) + 1) + '');\r\n\t\r\n\tconsole.log(\"File sent being uploaded success: \" + window.localStorage.getItem(\"intFileSent\"));\r\n\t\r\n var ft = new FileTransfer();//holds the object ot send data to the server\r\n\r\n\t//sends the data to the server\r\n\tft.upload(mediaFile.src, \"Upload\", uploadSuccess, onUploadFail, options);\r\n}//end of uploadFile()", "title": "" }, { "docid": "2243a461da91fab2dfcca7087fa61947", "score": "0.68541193", "text": "function handleUpload(event) {\n setFile(event.target.files[0]);\n\n // Add code here to upload file to server\n // ...\n }", "title": "" }, { "docid": "5473eb38c797b02cd9a9b0c1350847f1", "score": "0.68480915", "text": "function uploadWithFileTransfer(file, url, options) { }", "title": "" }, { "docid": "a6f0026c9c67f8f521be6abbfb5e120e", "score": "0.68377817", "text": "function uploadFile(mediaFile) {\n try {\n var min = 1;\n var max = 9000\n var Image\n //alert(sessionStorage[\"Policy_Desc\"]);\n var win = function (r) {\n //alert('Uploaded');\n console.log(\"Code = \" + r.responseCode);\n console.log(\"Response = \" + r.response);\n console.log(\"Sent = \" + r.bytesSent);\n }\n\n var fail = function (error) {\n alert(\"An error has occurred: Code = \" + error.code);\n console.log(\"upload error source \" + error.source);\n console.log(\"upload error target \" + error.target);\n }\n\n var options = new FileUploadOptions();\n var ImageName = mediaFile.substr(mediaFile.lastIndexOf('/') + 1);\n var ImageWithoutExt = ImageName.substring(0, ImageName.length - 4);\n var ImageExt = ImageName.substring(ImageName.length - 4);\n options.fileKey = \"file\";\n options.fileName = ImageWithoutExt + '_' + Math.floor(Math.random() * (max - min + 1) + min) + '_' + sessionStorage[\"Policy_Desc\"] + ImageExt;\n options.mimeType = \"text/plain\";\n\n var params = {};\n params.value1 = \"test\";\n params.value2 = \"param\";\n\n options.params = params;\n\n var ft = new FileTransfer();\n ImageUploaded += options.fileName + '~';\n ImageCounter++;\n //alert('upload 2');\n ft.upload(mediaFile , encodeURI(\"http://mobile.victoire.com.lb/CameraHandler.ashx\"), win, fail, options);\n //jq_HideMobileLoader();\n jq_HideMobileLoaderAdv(\"pg_ClaimForm\");\n }\n catch (e) {\n alert(\"uploadFile:\" + e.message);\n }\n\n}", "title": "" }, { "docid": "6e2886b966f10367b6e62c057a53c64e", "score": "0.68315357", "text": "async uploadImage() {\n\n\n \n\n\n }", "title": "" }, { "docid": "a4544d0bbe52ce9c51a12dfe3ee7b84c", "score": "0.6822612", "text": "function handleUpload(event) {\n setFile(event.target.files[0]);\n\n // Add code here to upload file to server\n // ...\n }", "title": "" }, { "docid": "a4544d0bbe52ce9c51a12dfe3ee7b84c", "score": "0.6822612", "text": "function handleUpload(event) {\n setFile(event.target.files[0]);\n\n // Add code here to upload file to server\n // ...\n }", "title": "" }, { "docid": "797d9014b6b86ba9f93dfbedc5256fa4", "score": "0.6805531", "text": "upload(tempName) {\n\t\t// Get the upload settings\n\t\tswitch (settings.get('user.upload.type')) {\n\t\t\tcase 0:\n\t\t\t\tthis.imgurUpload(tempName);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tthis.ftpUpload(tempName);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log('None upload selected');\n\t\t}\n\n\t\t// Check if we should save the picture\n\t\tif (settings.get('user.general.saveToFolder.active')) {\n\t\t\tif (settings.get('user.general.saveToFolder.folder')) {\n\t\t\t\tfs.createReadStream(tempName).pipe(fs.createWriteStream(settings.get('user.general.saveToFolder.folder') + '/' + String(Date.now())));\n\t\t\t} else {\n\t\t\t\tconsole.log('No path');\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a6f96184ecb830b9cdd6f5273c7e1db9", "score": "0.67842263", "text": "function UploadFile2(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(\"upload2\").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}", "title": "" }, { "docid": "fc6386f9a1fe2577e11f47f78eeda737", "score": "0.6783187", "text": "onFinishUpload(file){}", "title": "" }, { "docid": "cf1505acfb6c50a478536b5ad66fa5c1", "score": "0.6768562", "text": "function uploadFile(file, signedRequest, dataUrl) {\n Nasijona.makeRequest(signedRequest, 'PUT', file, function(err, response) {\n if (err) return console.log(err);\n\n // adjust form view\n document.getElementById('preview-image').style.backgroundImage = 'url(' + dataUrl + ')';\n document.getElementById('preview-image').classList.remove('fa', 'fa-file-image-o');\n document.getElementById('image-url').value = dataUrl;\n imageLabel.childNodes[0].nodeValue = file.name;\n });\n }", "title": "" }, { "docid": "331fa20537e40985551f0dfdcdeaf811", "score": "0.6762954", "text": "function uploadFile () {\r\n\tvar file = getElem('uploadFile').files[0];\r\n\tvar reader = new FileReader();\r\n\treader.readAsText(file);\r\n\treader.onload = function () {\r\n\t\tparseFile(reader.result);\r\n\r\n\t\t //reminder for popout - update: no idea what this is supposed to mean\r\n\t};\r\n}", "title": "" }, { "docid": "f47327b27021f8283bf49ee70d5f7700", "score": "0.6743006", "text": "function uploadFileAndParam() {\n\t\tvar f = sessionStorage.getItem(\"fpath\");\n\t\tif (f == null || f == '') {\n\t\t\talert(\"먼저 파일을 선택 해 주십시오.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar config = {\n\t\t\ttype: \"fileupload\",\n\t\t\tparam: {\n\t\t\t\tparams: {\n\t\t\t\t\ta: 1,\n\t\t\t\t\tb: 2,\n\t\t\t\t\tc: 3\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\tfiles:[\n\t\t\t {path: sessionStorage.getItem(\"fpath\")}\n\t\t\t ],\n\t\t\t pathname:'/minkSvc'\n\t\t\t},\n\t\t\tcallback: \"_cb.cbFileUpload\"\n\t\t};\n\t\t\n\t\tmiaps.mobile(config, _cb.cbFileUpload);\n\t}", "title": "" }, { "docid": "de5acfb4c186a5256a8e47fdcccaaf72", "score": "0.6729025", "text": "function uploadCSVAction(){\n let url = '/uploadCSV';\n uploadButtonObj.disabled = true;\n msgDivObj.innerHTML = \"Uploading .....\";\n let csvFile = fileChooserObj.files[0];\n // FormData is a dictionary that allows key-value pairs to be put into one object\n let formData = new FormData;\n // Put a key-value pair into the FormData object. Key = \"filechooser\", value = csvFile\n formData.append(\"filechooser\", csvFile, csvFile.name);\n\n postRequest(url, formData)\n .then(responseText => displayResponseHTML(responseText))\n .catch(error => console.error(error))\n}", "title": "" }, { "docid": "915a61a676f63f92f17644d9e9bddcb1", "score": "0.6710332", "text": "function uploadFile(post_url, file)\n{\n // Uploading - for Firefox, Google Chrome and Safari\n var xhr = new XMLHttpRequest();\n\n // File uploaded\n xhr.addEventListener(\"load\", function ()\n {\n alert('upload finish');\n }, false);\n\n xhr.open(\"post\", post_url, true);\n\n // Set appropriate headers\n xhr.setRequestHeader(\"Content-Type\", \"multipart/form-data\");\n xhr.setRequestHeader(\"X-File-Name\", file.fileName);\n xhr.setRequestHeader(\"X-File-Size\", file.fileSize);\n xhr.setRequestHeader(\"X-File-Type\", file.type);\n\n // Send the file\n xhr.send(file);\n}", "title": "" }, { "docid": "a5aae4ac468738d05356a8027509aeaa", "score": "0.67095655", "text": "function manualFileUpload(){\r\r\n\tvar fileInput = document.getElementById('file-input');\r\r\n\tvar files = fileInput.files;\r\r\n\treadfiles(files);\r\r\n}", "title": "" }, { "docid": "7a3de57e128e7f95ab41ab93098b10ad", "score": "0.67044526", "text": "function uploadFile(file){\r\n\t\r\n\tformData = new FormData();\r\n\t\r\n\tformData.append('file', file);\r\n\t\r\n\tvar xhr = new XMLHttpRequest();\r\n xhr.open('POST', 'http://www.rutadaki.com/UploadServlet');\r\n xhr.onload = function() {\r\n //progress.value = progress.innerHTML = 100;\r\n };\r\n \r\n// xhr.upload.onprogress = function (event) {\r\n// if (event.lengthComputable) {\r\n// var complete = (event.loaded / event.total * 100 | 0);\r\n// progress.value = progress.innerHTML = complete;\r\n// }\r\n// }\r\n xhr.send(formData);\r\n}", "title": "" }, { "docid": "950aaa23856639e7de6470638e76dba4", "score": "0.6690307", "text": "function package_tour_train_ticket()\n{ \n var type = \"travel\"; \n var btnUpload=$('#package_train_upload');\n var status=$('#package_train_status');\n new AjaxUpload(btnUpload, {\n action: '../upload_travel_ticket_file.php',\n name: 'uploadfile',\n onSubmit: function(file, ext){\n \n if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ \n // extension is not allowed \n status.text('Only JPG, PNG or GIF files are allowed');\n //return false;\n }\n status.text('Uploading...');\n },\n onComplete: function(file, response){\n //On completion clear the status\n status.text('');\n //Add uploaded file to list\n if(response===\"error\"){ \n alert(\"File is not uploaded.\"); \n //$('<li></li>').appendTo('#files').html('<img src=\"./uploads/'+file+'\" alt=\"\" /><br />'+file).addClass('success');\n } else{\n ///$('<li></li>').appendTo('#files').text(file).addClass('error');\n document.getElementById(\"txt_train_upload_dir\").value = response;\n alert(\"File Uploaded Successfully.\"); \n }\n }\n });\n \n}", "title": "" }, { "docid": "63ec5a181754b7a83514813a107cb7b3", "score": "0.66755706", "text": "function processInsertion(){\n //e.preventDefault();\n $.ajaxFileUpload({\n url :'foodManager/addFood',\n secureuri :false,\n fileElementId :'userfile',\n dataType : 'json',\n data : {},\n\n success : function (data, status)\n {\n if(data.status != 'error')\n {\n //alert(data.status);\n }\n //alert(data.msg);\n $(\"#queryMessage\").html(data.msg);\n }\n });\n}", "title": "" }, { "docid": "0a8db6bb93a1648bd166b23a09be5fea", "score": "0.6674934", "text": "function uploadFile() {\n\tvar buttons = document.getElementsByClassName(\"label_upload\"); //hide all select file buttons\n\tfor(i=0;i<buttons.length;i++)\n\t\tbuttons[i].style.visibility = \"hidden\";\n\tdocument.getElementById(\"uploadButton2\").style.display=\"none\"; //hide upload button in the preivew modal\n\n\tpostuploads = document.getElementsByClassName(\"post_upload\");\n\tfor(i=0;i<postuploads.length;i++)\n\t\tpostuploads[i].innerHTML = ''; //empty file selected text\n\n\t//display the progress bar\n\tvar num = document.getElementsByClassName('progressNumber')\n\tfor(i=0;i<num.length;i++)\n\t\tnum[i].style.visibility='visible';\n\t\t\n\tfileQueue = document.getElementById(\"fileToUpload\").files;\n\tcurrentFile = 0;\n\tupload();\n}", "title": "" }, { "docid": "a8d1038e34d0e828e01a7cd3fae02ff3", "score": "0.6674681", "text": "function uploadFile(file, signedRequest, url) {\n console.log(\"Upload File\");\n const xhr = new XMLHttpRequest();\n xhr.open('PUT', signedRequest);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n document.getElementById('preview').src = url;\n document.getElementById('avatar-url').value = url;\n }\n else {\n alert('Could not upload file.');\n }\n }\n };\n xhr.send(file);\n }", "title": "" }, { "docid": "0a953fd88e088d6dadae6bca421a04d0", "score": "0.66689837", "text": "function uploadFile(file, callback) {\n file = file.replace('\\\\', '/');\n var slashIndex = file.lastIndexOf('/');\n var path = file.substring(0, slashIndex);\n var filename = file.substring(parseInt(slashIndex) + 1, file.length);\n clipboard.copy(path, function () {\n browser.pause(2000);\n NavigateToFolderLocation(function () {\n browser.pause(2000);\n TypeFileName(filename, function () {\n browser.pause(2000);\n callback('File uploading Completed!!');\n });\n });\n });\n}", "title": "" }, { "docid": "e19f2754f7fdf4d3e8ec06ef497199e7", "score": "0.6658332", "text": "function upload(filename, filedata) {\n // By calling the files action with POST method in will perform \n // an upload of the file into Backand Storage\n return $http({\n method: 'POST',\n url : Backand.getApiUrl() + baseActionUrl + objectName,\n params:{\n \"name\": filesActionName\n },\n headers: {\n 'Content-Type': 'application/json'\n },\n // you need to provide the file name and the file data\n data: {\n \"filename\": filename,\n \"filedata\": filedata.substr(filedata.indexOf(',') + 1, filedata.length) //need to remove the file prefix type\n }\n });\n }", "title": "" }, { "docid": "9117147a672e868dc20927dcb5d9e320", "score": "0.6656118", "text": "function upload () {\n //alert('Not implemented yet')\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = 'text/plain';\n input.multiple = 'multiple';\n input.onchange = function () {\n for (const file of this.files || []) {\n if (file) {\n parseFile(file);\n }\n }\n };\n document.body.appendChild(input);\n\n input.click();\n setTimeout(function() {\n document.body.removeChild(input);\n }, 0);\n}", "title": "" }, { "docid": "00b401928bdb270a310404ad3925b1cb", "score": "0.66510063", "text": "function onSimpleUpload(fields, file, path, successCb, failureCb) {\n var uuid = fields.qquuid;\n\n file.name = fields.qqfilename;\n\n if(isValid(file.size)) {\n moveUploadedFile(file, uuid, path, successCb, failureCb);\n } else {\n failWithTooBigFile(responseData, res);\n }\n}", "title": "" }, { "docid": "95c9506094aa765b242e47492c330423", "score": "0.66405344", "text": "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 }", "title": "" }, { "docid": "7a16480cb95b842dc78d0f90c5f758bc", "score": "0.66262525", "text": "function upload(file) {\n \n $scope.fileName = file.name;\n files.push(file.name);\n \n vm.appointments.browse = files.toString();\n \n // Upload.upload({\n // url: url+'/upload.php',\n // data: {file: file, 'username': $scope.username}\n\n // }).then(function (resp) {\n // //console.log(resp);\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\n }", "title": "" }, { "docid": "9df66a1c30940f58e7455e9532611607", "score": "0.66149694", "text": "function uploadFile(that) {\n // Define the folder path for this example.\n\n var serverRelativeUrlToFolder = '/Shared%20Documents';\n // Get test values from the file input and text input page controls.\n\n var fileInput = $(\"#ShiftFileUpload\");\n var newName = \"\";\n if (!fileInput || !fileInput[0].files[0]) {\n alert(that.Settings.InputFileErrorMessage);\n $(\".se-pre-con\").fadeOut(0);\n return;\n }\n else {\n newName = fileInput[0].files[0].name.toString();\n }\n if (newName == \"\")\n return;\n var currentTime = new Date().format('mdyhms');\n newName = (currentTime + newName);\n // Get the server URL.\n var serverUrl = _spPageContextInfo.webAbsoluteUrl;\n\n // Initiate method calls using jQuery promises.\n // Get the local file as an array buffer.\n var getFile = getFileBuffer();\n getFile.done(function (arrayBuffer) {\n // Add the file to the SharePoint folder.\n var addFile = addFileToFolder(arrayBuffer);\n addFile.done(function (file, status, xhr) {\n // Get the list item that corresponds to the uploaded file.\n var getItem = getListItem(file.d.ListItemAllFields.__deferred.uri);\n getItem.done(function (listItem, status, xhr) {\n that.ProcessUploading(newName);\n\n //// Change the display name and title of the list item.\n //var changeItem = updateListItem(listItem.d.__metadata);\n //changeItem.done(function (data, status, xhr) {\n // that.ProcessUploading(newName);\n // // alert('file uploaded and updated');\n //});\n\n //changeItem.fail(onError);\n });\n getItem.fail(onError);\n });\n addFile.fail(onError);\n });\n getFile.fail(onError);\n\n // Get the local file as an array buffer.\n function getFileBuffer() {\n var deferred = jQuery.Deferred();\n var reader = new FileReader();\n reader.onloadend = function (e) {\n deferred.resolve(e.target.result);\n }\n reader.onerror = function (e) {\n deferred.reject(e.target.error);\n }\n reader.readAsArrayBuffer(fileInput[0].files[0]);\n return deferred.promise();\n }\n\n // Add the file to the file collection in the Shared Documents folder.\n function addFileToFolder(arrayBuffer) {\n // Get the file name from the file input control on the page.\n var parts = fileInput[0].value.split('\\\\');\n //var fileName = parts[parts.length - 1];\n var fileName = newName;\n // Construct the endpoint.\n var fileCollectionEndpoint = String.format(\n \"{0}/_api/web/getfolderbyserverrelativeurl('{1}')/files\" +\n \"/add(overwrite=true, url='{2}')\",\n serverUrl, serverRelativeUrlToFolder, fileName);\n\n // Send the request and return the response.\n // This call returns the SharePoint file.\n return jQuery.ajax({\n url: fileCollectionEndpoint,\n type: \"POST\",\n data: arrayBuffer,\n processData: false,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-length\": arrayBuffer.byteLength\n }\n })\n }\n\n // Get the list item that corresponds to the file by calling the file's ListItemAllFields property.\n function getListItem(fileListItemUri) {\n\n // Send the request and return the response.\n return jQuery.ajax({\n url: fileListItemUri,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" }\n });\n }\n\n // Change the display name and title of the list item.\n function updateListItem(itemMetadata) {\n\n // Define the list item changes. Use the FileLeafRef property to change the display name. \n // For simplicity, also use the name as the title. \n // The example gets the list item type from the item's metadata, but you can also get it from the\n // ListItemEntityTypeFullName property of the list.\n var body = String.format(\"{{'__metadata':{{'type':'{0}'}},'FileLeafRef':'{1}','Title':'{2}'}}\",\n itemMetadata.type, newName, newName);\n\n // Send the request and return the promise.\n // This call does not return response content from the server.\n return jQuery.ajax({\n url: itemMetadata.uri,\n type: \"POST\",\n data: body,\n headers: {\n \"X-RequestDigest\": jQuery(\"#__REQUESTDIGEST\").val(),\n \"content-type\": \"application/json;odata=verbose\",\n \"content-length\": body.length,\n \"IF-MATCH\": itemMetadata.etag,\n \"X-HTTP-Method\": \"MERGE\"\n }\n });\n }\n }", "title": "" }, { "docid": "ef20e424c317472b194b0c613a6e15fd", "score": "0.6613951", "text": "function uploadFile(){\t\n\t\n\t// Les donnees de la forme pour la methode POST.\n\tvar formData = new FormData();\n\t\n\t// Verifie que le fichie est une image bmp.\n\n\tif (file && ( file.type.match('image.bmp') || file.type.match('image.png') || file.type.match('image.jpg') || file.type.match('image.jpeg') ) ){\n\t\t\n\t\t// Ajouter le fichier a la requête\n\t\tformData.append('fileToUpload', file, file.name);\n\t\n\t\t// instancer la requete ajax.\n\t\txhr_upload = new self.XMLHttpRequest();\n\t\n\t\t// traimtement de la requete qu'on elle termine.\n\t\txhr_upload.onreadystatechange= function () {\n\t\t\tif (xhr_upload.readyState == 4 ){\n\t\t\t\tif ( xhr_upload.status == 200) {\n\t\t\t\t\tif(xhr_upload.responseText == \"Le fichier \"+ file.name+\" est uploadé.\"){\n\t\t\t\t\t\t// averti le script principal que l'image est uploade pour l'affichier\n\t\t\t\t\t\tpostMessage(200);\n\t\t\t\t\t\t//traimtement du fichie uploadé\n\t\t\t\t\t\ttraiter(file.name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpostMessage(401);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tpostMessage('Une erreur est survenue dans le script de la fonction uploadFile dans le fichier worker.js !');\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t\t// créer une connexion\n\t\txhr_upload.open('POST', config[\"rootLink\"] + config[\"includes\"] + 'application/upload.php', true);\n\t\t// envoyer les données.\n\t\txhr_upload.send(formData);\t\n\t} else {\n\t\tpostMessage(401);\n\t}\n\t\n } // Fin uploadFile();", "title": "" }, { "docid": "327c73598c2ea0f74d053f3f916c27ff", "score": "0.66096276", "text": "function upload_file() {\n\t\t\tif (this._pos >= this.files.length) {\n\t\t\t\tthis._pos = 0;\n\t\t\t\topts.onComplete.call(this);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//check file type an file size\n\t\t\tvar typeTest = true,\n\t\t\t\tsizeTest = true;\n\n\t\t\t//check file type\n\t\t\tif (typeReg)\n\t\t\t\tif (!typeReg.test(this.files[this._pos].name)) {\n\t\t\t\t\topts.onFileTypeError.call(this, this.files[this._pos]);\n\t\t\t\t\tthis._pos++;\n\t\t\t\t\ttypeTest = false;\n\t\t\t\t\tupload_file.call(this);\n\t\t\t\t}\n\n\t\t\t//check file size\n\t\t\tif (opts.maxFileSize)\n\t\t\t\tif (opts.maxFileSize < this.files[this._pos].size) {\n\t\t\t\t\topts.onFileSizeError.call(this, this.files[this._pos]);\n\t\t\t\t\tthis._pos++;\n\t\t\t\t\tsizeTest = false;\n\t\t\t\t\tupload_file.call(this);\n\t\t\t\t}\n\n\t\t\t//ajax submit\n\t\t\tif (typeTest && sizeTest) {\n\t\t\t\tvar self = this,\n\t\t\t\t\t$self = $(this),\n\t\t\t\t\tfile = self.files[self._pos],\n\t\t\t\t\tfd = new FormData();\n\t\t\t\topts.onNewFile.call(self, file, opts);\n\t\t\t\tfor (var key in opts.extData)\n\t\t\t\t\tfd.append(key, opts.extData[key]);\n\t\t\t\tfd.append(opts.fileName, file);\n\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: opts.url,\n\t\t\t\t\ttype: opts.method,\n\t\t\t\t\tdataType: opts.dataType,\n\t\t\t\t\tdata: fd,\n\t\t\t\t\tcache: false,\n\t\t\t\t\tcontentType: false,\n\t\t\t\t\tprocessData: false,\n\t\t\t\t\tforceSync: false,\n\t\t\t\t\txhr: function () {\n\t\t\t\t\t\tvar xhrobj = $.ajaxSettings.xhr();\n\t\t\t\t\t\tif (xhrobj.upload) {\n\t\t\t\t\t\t\txhrobj.upload.addEventListener('progress', function (event) {\n\t\t\t\t\t\t\t\tvar percent = 0;\n\t\t\t\t\t\t\t\tvar position = event.loaded || event.position;\n\t\t\t\t\t\t\t\tvar total = event.total || event.totalSize;\n\t\t\t\t\t\t\t\tif (event.lengthComputable) {\n\t\t\t\t\t\t\t\t\tpercent = Math.ceil(position / total * 100);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\topts.onUploadProgress.call(self, file, percent);\n\t\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn xhrobj;\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function (data, textStatus, xhr) {\n\t\t\t\t\t\topts.onUploadSuccess.call(self, file, data, textStatus, xhr);\n\t\t\t\t\t},\n\t\t\t\t\terror: function (xhr, textStatus, errorThrown) {\n\t\t\t\t\t\topts.onUploadError.call(self, file, xhr, textStatus, errorThrown);\n\t\t\t\t\t},\n\t\t\t\t\tcomplete: function (xhr, textStatus) {\n\t\t\t\t\t\tself._pos++;\n\t\t\t\t\t\tupload_file.call(self);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f8291e5da38e989eb8c6324c30949c93", "score": "0.66078645", "text": "function uploadFile(file) {\n //on s'abonne à l'événement progress pour savoir où en est l'upload\n if (xhr.upload && options.beforeUpload()) {\n var fd = new FormData();\n fd.append('file', file);\n\n xhr.open(\"POST\", options.url);\n\n // on s'abonne à tout changement de statut pour détecter\n // une erreur, ou la fin de l'upload\n //xhr.onreadystatechange = onStateChange;\n\n /* event listners */\n xhr.upload.addEventListener('progress', onUploadProgress, false);\n xhr.addEventListener(\"loadstart\", uploadStarted, false);\n xhr.addEventListener(\"load\", uploadComplete, false);\n xhr.addEventListener(\"error\", uploadFailed, false);\n xhr.addEventListener(\"abort\", uploadCanceled, false);\n\n //xhr.setRequestHeader(\"Content-Type\", \"multipart/form-data\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n //xhr.setRequestHeader(\"X-File-Name\", file.name);\n //xhr.setRequestHeader(\"X-File-Size\", file.size);\n //xhr.setRequestHeader(\"X-File-Type\", file.type);\n\n xhr.send(fd);\n }\n }", "title": "" }, { "docid": "621bd2c49a1bb454389ef4145938d462", "score": "0.66071135", "text": "function uploadFile(server, filePath, options){\n $cordovaFileTransfer.upload(server, filePath, options)\n .then(function(result) {\n alert(\"Logfile was send succesfuly\");\n }, function(err) {\n console.log(\"Logfile problem\");\n }, function (progress) {\n // constant progress updates\n });\n }", "title": "" }, { "docid": "3c289b62658338a7dc6854feb7f105a7", "score": "0.65924", "text": "function uploader($http, $timeout, Upload) {\n\n\t\tvar upload = function upload(url, file, errFiles) {\n\t\t\t/*let f = file;\n\t let errFile = errFiles && errFiles[0];*/\n\t\t\tif (file) {\n\t\t\t\tconsole.log(file);\n\t\t\t\t//console.log(file)\n\t\t\t\treturn file.upload = Upload.upload({\n\t\t\t\t\turl: url,\n\t\t\t\t\tdata: { file: file }\n\t\t\t\t});\n\t\t\t} else return Promise.reject();\n\t\t};\n\n\t\treturn {\n\t\t\tupload: upload\n\t\t};\n\t}", "title": "" }, { "docid": "6f67cb1cbd0e0b7b7d62da3a9e044afd", "score": "0.65851647", "text": "async _onFileInputChange() {\n const { action, model, id } = this.props;\n const params = {\n csrf_token: odoo.csrf_token,\n ufile: [...this.fileInputRef.el.files],\n };\n if (model) {\n params.model = model;\n }\n if (id) {\n params.id = id;\n }\n const fileData = await this.env.services.httpRequest(action, params, 'text');\n const parsedFileData = JSON.parse(fileData);\n if (parsedFileData.error) {\n throw new Error(parsedFileData.error);\n }\n this.trigger('uploaded', { files: parsedFileData });\n }", "title": "" }, { "docid": "c5232be915354e6ed6b9e794043ce35d", "score": "0.65847325", "text": "function initUpload(files){\n //const files = document.getElementById('image_to_upload').files;\nconst file = files[0];\n if(file == null){\n return alert('No file selected.');\n }\n getSignedRequest(file);\n \n}", "title": "" }, { "docid": "57e59e640d0909293fefef3f27e5380f", "score": "0.65834665", "text": "afterUpload() {}", "title": "" }, { "docid": "0e48db82181de9b9de9e67604fe51d28", "score": "0.6570769", "text": "function start_upload(fil) {\n file = fil; \n var req = new XMLHttpRequest();\n req.open(\"POST\", \"/admin/upload/\", true);\n boundary = \"---------------------------7da24f2e50046\";\n req.setRequestHeader(\"Content-Type\", \"multipart/form-data, boundary=\"+boundary);\n var reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = (function(theFile) {\n return function(e) {\n if(e.target.result.substr(0,40).match(/image\\//i)) {\n if(!file_exists(upload[uploadItem].name)) {\n $(\"#data-uploaded-\"+uploadItem).html(\"<img src='\"+e.target.result+\"' title='\"+file.name+\"' style='height:130px;'/>\");\n $(\"#data-info-\"+uploadItem).html(\"<input type='hidden' class='cover' name='cover[\"+uploadItem+\"]' id='cover-\"+uploadItem+\"' value='0'/><span class='label label-info label-\"+uploadItem+\"' style='float:left;cursor:pointer;'>ScreenShot</span><input type='hidden' value='\"+file.name+\"' name='saveImage[\"+uploadItem+\"]' id='saveImage-\"+uploadItem+\"'><a href='javascript:removeImage(\"+uploadItem+\")' style='float:right;'>Remove</a>\");\n addLabelClick();\n var body = \"--\" + boundary + \"\\r\\n\";\n body += \"Content-Disposition: form-data; name='upim'; filename='\" + file.name + \"'\\r\\n\";\n body += \"Content-Type: application/octet-stream\\r\\n\\r\\n\";\n body += e.target.result + \"\\r\\n\";\n body += \"--\" + boundary + \"--\";\n req.send(body);\n uploadItem++;\n if(upload[uploadItem] instanceof File) { doUpload(); }\n } else {\n alert(\"file: \"+upload[uploadItem].name+\" already exists in uploaded files\");\n removeImage(uploadItem);\n uploadItem++;\n if(upload[uploadItem] instanceof File) { doUpload(); }\n }\n } else {\n alert(\"this aint image\");\n removeImage(uploadItem);\n uploadItem++;\n if(upload[uploadItem] instanceof File) { doUpload(); }\n }\n };\n })(file);\n}", "title": "" }, { "docid": "8ba6b6eac3068b8d2540bb4207dd93e5", "score": "0.65686476", "text": "function uploadFile(fileUpload, file, fileData) {\n\n\t\t// Create an error reflecting the fact that the file is being uploaded\n\t\tvar uploadError = new ExoWeb.Model.Condition(uploadInProgress, null, fileUpload.adapter.get_target(), [fileUpload.adapter.get_propertyPath()]);\n\n\t\t// Create success function to update the model when the file upload is complete\n\t\tvar success = function (data) {\n\n\t\t\t// Deserialize the successfully uploaded file data reference\n\t\t\tvar newFileData = Cognito.deserialize(Cognito.FileDataRef, data);\n\n\t\t\t// Validate the file one more time\n\t\t\tif (!validate(fileUpload, newFileData)) {\n\t\t\t\tdeleteFile(fileUpload, fileData);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Find the existing file entry to update\n\t\t\tif (fileUpload.adapter.get_isEntityList()) {\n\t\t\t\tvar fileList = fileUpload.adapter.get_rawValue();\n\t\t\t\tvar index = fileList.indexOf(fileData);\n\t\t\t\tfileList.beginUpdate();\n\t\t\t\tfileList.removeAt(index);\n\t\t\t\tfileList.insert(index, newFileData);\n\t\t\t\tfileList.endUpdate();\n\t\t\t}\n\n\t\t\t// Or set the file data property\n\t\t\telse {\n\t\t\t\tfileUpload.adapter.get_propertyChain().value(fileUpload.adapter.get_target(), newFileData);\n\t\t\t}\n\n\t\t\t// Destroy the upload in progress error\n\t\t\tuploadError.destroy();\n\n\t\t\t// Optionally hide the upload button if this is a single file upload\n\t\t\tif (fileUpload.maxFileCount == 1 || !fileUpload.adapter.get_isEntityList()) {\n\t\t\t\tfileUpload.editor.find(\".c-fileupload-dropzone:not(.c-fileupload-dropzone-replace)\").hide();\n\t\t\t\tfileUpload.editor.find(\".c-fileupload-dropzone.c-fileupload-dropzone-replace\").show();\n\t\t\t}\n\n\t\t\tvar jqEvent = Cognito.fire(\"uploadFile.cognito\", { data: { file: { name: newFileData.get_Name(), id: newFileData.get_Id(), size: newFileData.get_Size() } } });\n\t\t}\n\n\t\t// Create error function to remove files from the model that fail to upload\n\t\tvar error = function (jqXHR) {\n\n\t\t\t// If the session has timed out, renew the session token\n\t\t\tif (jqXHR.status === 401 && Cognito.renewToken) {\n\t\t\t\tCognito.renewToken(function () { uploadFile(fileUpload, file, fileData); });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Remove the file that failed to upload\n\t\t\tif (fileUpload.adapter.get_isEntityList()) {\n\t\t\t\tvar fileList = fileUpload.adapter.get_rawValue();\n\t\t\t\tvar index = fileList.indexOf(fileData);\n\t\t\t\tfileList.removeAt(index);\n\t\t\t}\n\t\t\telse\n\t\t\t\tfileUpload.adapter.get_propertyChain().value(fileUpload.adapter.get_target(), null);\n\n\t\t\t// Destroy the upload in progress error\n\t\t\tuploadError.destroy();\n\n\t\t\t// Display an error message\n\t\t\tshowError(fileUpload, Cognito.resources[\"fileupload-failed-upload-message\"].replace(\"{fileName}\", file.name));\n\t\t\tif (fileUpload.validation.height() == 0)\n\t\t\t\tfileUpload.validation.slideDown();\n\t\t}\n\n\t\t// Initiate the file upload\n\t\tif (window.FormData) {\n\t\t\tvar formData = new FormData();\n\t\t\tformData.append(\"file\", file);\n\n\t\t\t// Asynchronously post the file to the server\n\t\t\tCognito.serviceRequest({\n\t\t\t\tendpoint: \"forms/\" + Cognito.config.mode + \"/file\" + (Cognito.config.encryptUploads ? \"?encrypt=\" : \"\"),\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tdata: formData,\n\t\t\t\tprocessData: false,\n\t\t\t\tcontentType: false,\n\t\t\t\toverrideContentType: true,\n\n\t\t\t\t// Update the progress bar during the upload\n\t\t\t\tuploadProgress: function (event, position, total, percentComplete) {\n\t\t\t\t\tfileData.set_Progress((percentComplete > 98 ? 98 : percentComplete) + \"%\");\n\t\t\t\t},\n\n\t\t\t\t// Replace the pending file data reference with the file returned from the server\n\t\t\t\tsuccess: success,\n\n\t\t\t\t// Display an error informing the user that the upload failed\n\t\t\t\terror: error\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\t// Create a form element to post the file and move the file upload field into that form element\n\t\t\tvar $form = $(\"<form>\").appendTo(fileUpload.editor.find((\".c-upload-button\")));\n\t\t\tfileUpload.editor.find(\"input\").appendTo($form);\n\t\t\tfileUpload.form = $form;\n\n\t\t\t// Create a unique id to represent the file upload\n\t\t\tvar fileId = \"c-file-\" + (new Date().getTime());\n\t\t\tvar filePostUrl = Cognito.config.baseUrl + \"forms/\" + Cognito.config.mode + \"/file?token=\" + encodeURIComponent(Cognito.config.sessionToken);\n\n\t\t\t// Create an iframe that is positioned outside the viewing area\n\t\t\tvar iframe = $(\"<iframe class='c-fileupload-frame' name='\" + fileId + \"' />\")\n\t\t\t\t.css({ position: 'absolute', top: '-1000px', left: '-1000px' })\n\t\t\t\t.appendTo(window.document.body);\n\n\t\t\t// Set the form action and target\n\t\t\tfileUpload.form.attr(\"method\", \"post\");\n\t\t\tfileUpload.form.attr(\"enctype\", \"multipart/form-data\");\n\t\t\tfileUpload.form.attr(\"action\", filePostUrl);\n\t\t\tfileUpload.form.attr(\"target\", fileId);\n\n\t\t\t// Subscribe to the frame load event to be notified when the file is uploaded\n\t\t\tiframe.bind(\"load\", function () {\n\t\t\t\t// Defer execution to ensure correct timing in IE9\n\t\t\t\twindow.setTimeout(function () {\n\n\t\t\t\t\t// By this point the file should have been successfully deserialized\n\t\t\t\t\tfor (var i = 0; i < uploadedFiles.length; i++) {\n\t\t\t\t\t\tvar uploadedFile = uploadedFiles[i];\n\t\t\t\t\t\tif (file.name.toLowerCase().endsWith(uploadedFile.Name.toLowerCase())) {\n\t\t\t\t\t\t\tsuccess(uploadedFile);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\terror();\n\n\t\t\t\t}, 100);\n\t\t\t});\n\n\t\t\t// Submit the form\n\t\t\tfileUpload.form[0].submit();\n\t\t}\n\t}", "title": "" }, { "docid": "97cd1b845f2501199117b85a7f3fa2e8", "score": "0.6555919", "text": "function file_upload_error(){\n alert('Error occured communicating to API. Please submit again.');\n}", "title": "" }, { "docid": "8e1725e45a9d89e7f7fe2d655e6b6b53", "score": "0.65553683", "text": "function afterFileUpload( MessageFromServer , name ) {\n\t//when I upload the file\n\tif( MessageFromServer != '0' ) {\n\t\tvar fileAry = MessageFromServer.split('|');\n\t\tvar extension = getExtension(fileAry[0]) ;\n\t\tswitch(extension) {\n\t\t\tcase 'gif': case 'png':\tcase 'jpg': case 'jepg':\n\t\t\tthumb = '<div class=\"cms-thumb\"><img src=\"tmp/_'+fileAry[0]+'\" /><div class=\"cms-thumb-imagename\">'+unExtension( fileAry[1] )+'</div></div>' ;\n\t\t\tbreak ;\n\t\t\tdefault:\n\t\t\tthumb = '<div class=\"cms-thumb cms-thumb-'+extension+'\"><div class=\"cms-thumb-filename\">'+unExtension( fileAry[1] )+'</div></div>' ;\n\t\t}\n\t $('#'+name+'_container').append(thumb) ;\n\t $('.cms-upload-button').css({ display : 'block'});\n\t $('#'+name+'_loader').css({display:'none'});\n\t js_vars[name+'_count']++ ;\n\t if( js_vars[name+'_count'] == js_vars[name+'_max'] ) $('#'+name+'_button').css({visibility:'hidden'}) ;\n\t //add the file name\n\t var fileNames = $('#'+name).val() ;\n\t if( fileNames == '' ) $('#'+name).val(fileAry[0]) ; else $('#'+name).val(fileNames+'|'+fileAry[0])\n\t} else alert( 'Error' ) ;\n\t//can submit the form now\n\tjs_vars['valid_form'] = true ;\n}", "title": "" }, { "docid": "601abac279955ba1ab34722deaf9cd63", "score": "0.6553161", "text": "function UploadFile() {\n //Get all data from input file.\n var property = document.getElementById(\"file\").files[0];\n var file_name = property.name;\n var file_extension = file_name.split('.').pop().toLowerCase();\n\n //Check if file is image/pdf.\n if(jQuery.inArray(file_extension, ['jpg','jpeg','png','pdf']) == -1) {\n $(\".files-alert-messages\").html(\"<p class='alert alert-danger' role='alert'>This file is not an image or a pdf file.</p>\");\n Toggleoverlay('close',0);\n return false;\n }\n \n //Check if file is not too big.\n var file_size = property.size;\n if (file_size > 5000000) {\n $(\".files-alert-messages\").html(\"<p class='alert alert-danger' role='alert'>File is too big.</p>\");\n Toggleoverlay('close',0);\n return false;\n }\n\n //Get path to the current directory in assets.\n aPath = CreatePath();\n aPath.join(',');\n \n //Add all the data to the formdata.\n var form_data = new FormData();\n form_data.append('file', property);\n form_data.append('aPath', aPath);\n form_data.append('uploadFile', aPath);\n\n //Call ajax.\n $.ajax({\n url: linkUrl+\"classes/handler.class.php\",\n method: \"POST\",\n data: form_data,\n contentType: false,\n cache: false,\n processData: false,\n success:function(data){\n $(\".files-alert-messages\").html(data);\n Toggleoverlay('close',0);\n DirClick(undefined,true);\n }\n });\n}//Function UploadFile.", "title": "" }, { "docid": "f452ad6d7909acee44325d3ee1f9f8a3", "score": "0.6541159", "text": "function UploadToServer() {\n var restUrl = \"http://localhost:8080/rest/uploadFile\";\n var form = $('#fileUploadForm')[0];\n var fileData = new FormData(form);\n fileData.append('file', jQuery('#my_file')[0].files[0] );\n fileData.append('language',targetLanguage);\n var payload = {'file':jQuery('#my_file')[0].files[0],'language':targetLanguage};\n $.ajax({\n url: restUrl,\n type: \"POST\",\n headers: {\n \"Authorization\": usrToken\n },\n data: fileData,\n processData: false, //prevent jQuery from automatically transforming the data into a query string\n contentType: false,\n success: function (data) {\n if(data.status==\"accepted\")\n {\n window.location.href=\"dashboard.html?token=\"+navToken;\n }\n else\n {\n console.log(\"error\");\n $('#errorMsg2').css(\"display\",\"block\");\n }\n },\n error: function (ex) {\n console.log(\"Error in Uploading Files\");\n $('#errorMsg2').css(\"display\",\"block\");\n }\n });\n var inputFiles = $(\"input[id='my_file']\");\n inputFiles.replaceWith(inputFiles.val('').clone(true));// for resetting the file upload\n $('#uploadedFiles').text(\"\");\n}", "title": "" }, { "docid": "770947a4fe85007b0c19aed0c3a0563c", "score": "0.6538194", "text": "function uploadImage(data) {return data;}", "title": "" }, { "docid": "cc1f279b217ce95ea97a06f2e8982b2c", "score": "0.6532828", "text": "function _upload_signature_image_file(local_id){\n try{\n self.update_message('Uploading Signature File ...');\n var temp_flag = false;\n var db = Titanium.Database.open(self.get_db_name());\n //get record which need to upload server\n var temp_row = db.execute('SELECT * FROM my_'+_type+'_custom_report_signature '+' WHERE local_id=?',local_id);\n if((temp_row.getRowCount() > 0) && (temp_row.isValidRow())){\n temp_flag = true; \n var temp_mime_type = temp_row.fieldByName('mime_type');\n var temp_width= temp_row.fieldByName('width');\n var temp_height = temp_row.fieldByName('height');\n var temp_file_size = temp_row.fieldByName('file_size');\n var temp_status_code = temp_row.fieldByName('status_code');\n var temp_path_original = ((temp_row.fieldByName('path') === null)||(temp_row.fieldByName('path') === ''))?temp_row.fieldByName('path_original'):temp_row.fieldByName('path');\n }\n temp_row.close();\n db.close();\n if(temp_flag){\n var is_exist_media_file = false;\n var temp_arr = temp_path_original.split('/');\n var folder_name = '';\n for(var i=0,j=temp_arr.length-1;i<j;i++){\n if(i=== 0){\n folder_name+=temp_arr[i];\n }else{\n folder_name+='/'+temp_arr[i];\n }\n }\n var file_name = temp_arr[temp_arr.length-1];\n var mediafile = Ti.Filesystem.getFile(self.file_directory+folder_name,file_name);\n if(mediafile.exists()){\n is_exist_media_file = true;\n } \n var xhr = null;\n if(self.set_enable_keep_alive){\n xhr = Ti.Network.createHTTPClient({\n enableKeepAlive:false\n });\n }else{\n xhr = Ti.Network.createHTTPClient();\n }\n xhr.onload = function(){\n try{ \n if((xhr.readyState === 4)&&(this.status === 200)){ \n var temp_result = JSON.parse(this.responseText); \n if((temp_result.error != undefined)&&(temp_result.error.length >0)){ \n var error_string = '';\n for(var i=0,j=temp_result.error.length;i<j;i++){\n if(i==j){\n error_string+=temp_result.error[i];\n }else{\n error_string+=temp_result.error[i]+'\\n';\n }\n }\n self.hide_indicator();\n self.show_message(error_string);\n }else{\n _download_report_file(); \n } \n }else{\n self.hide_indicator();\n var params = {\n message:'Upload signature file failed.',\n show_message:true,\n message_title:'',\n send_error_email:true,\n error_message:'',\n error_source:window_source+' - _upload_signature_image_file - xhr.onload -1',\n server_response_message:this.responseText\n };\n self.processXYZ(params); \n }\n }catch(e){\n self.hide_indicator();\n params = {\n message:'Upload signature file failed.',\n show_message:true,\n message_title:'',\n send_error_email:true,\n error_message:e,\n error_source:window_source+' - _upload_signature_image_file - xhr.onload -2',\n server_response_message:this.responseText\n };\n self.processXYZ(params); \n }\n }; \n xhr.onerror = function(e){\n self.hide_indicator();\n var params = {\n message:'Upload signature file failed.',\n show_message:true,\n message_title:'',\n send_error_email:true,\n error_message:'',\n error_source:window_source+' - _upload_signature_image_file - xhr.onerror',\n server_response_message:this.responseText\n };\n self.processXYZ(params); \n };\n xhr.setTimeout(self.default_download_time_out);\n xhr.open('POST',self.get_host_url()+'update',true); \n xhr.send({\n 'type':'upload_asset_file',\n 'media':(is_exist_media_file)?mediafile.read():'',\n 'host':self.get_host(),\n 'hash':_selected_user_id,\n 'company_id':_selected_company_id,\n 'path':temp_path_original,\n 'mime_type':temp_mime_type,\n 'table_name':'my_'+_type+'_custom_report_signature',\n 'width':temp_width,\n 'height':temp_height,\n 'file_size':temp_file_size,\n 'status_code':temp_status_code,\n 'app_security_session':self.is_simulator()?self.default_udid:Titanium.Platform.id,\n 'app_version_increment':self.version_increment,\n 'app_version':self.version,\n 'app_platform':self.get_platform_info()\n });\n }else{\n self.hide_indicator();\n win.close();\n }\n }catch(err){\n self.hide_indicator();\n self.process_simple_error_message(err,window_source+' - _upload_signature_image_file');\n } \n }", "title": "" }, { "docid": "f00254034615a7b9beb525fa05640542", "score": "0.6519964", "text": "function AjaxUpload(fileHandler, name){// done and functional\n \tif(fileHandler.files[0].set != undefined && fileHandler.files[0].set){\n\t\treturn;\n\t}\t\n\tvar url = getJsonFromUrl();\n var http = new XMLHttpRequest();\n http.onreadystatechange=function(){\n if(http.readyState==4 && http.status==200){\n console.log(\"UPLOADED---------------\");\n\t\t\tconsole.log(http.responseText);\n }\n }\n \t\n\t/* Create a FormData instance */\n \tvar formData = new FormData();\n\n\t/* Display the progress of the upload */\n\thttp.upload.onprogress = function(e) {\n\t if (e.lengthComputable) {\n\t var percentComplete = (e.loaded / e.total) * 100;\n\t console.log(percentComplete + '% uploaded');\n\t }\n\t };\n\n \tformData.append(\"file\", fileHandler.files[0]);\n \tformData.append(\"name\", name);\n\t\n\t/* Send the Request to the server */\n urlBase = \"http://demo.philadelphiagamelab.org/Lux/\";\n http.open(\"POST\", urlBase + \"Upload/upload.php?access_token=\"+url.access_token);\n \thttp.send(formData); /* Send to server */ \n}", "title": "" }, { "docid": "27773d2040602218f7dd7672881e265b", "score": "0.6515845", "text": "function UploadFile(nombreArchivo, id, tipoFoto) {\r\n var fd = new FormData();\r\n fd.append(\"fileupload\", document.getElementById(id).files[0]);\r\n fd.append(\"filename\", nombreArchivo);\r\n fd.append(\"tipo\", 1);\r\n fd.append(\"carpetaFoto\", tipoFoto);\r\n var xhr = new XMLHttpRequest();\r\n xhr.upload.addEventListener('progress', UploadProgress, false);\r\n xhr.onreadystatechange = StateChange;\r\n xhr.open('POST', '../Fakes/fileupload.aspx');\r\n xhr.send(fd);\r\n\r\n}", "title": "" }, { "docid": "085a8110d73bd08e46ea88350a4a38f3", "score": "0.65106934", "text": "function uploadFile() {\n var url = \"http://138.68.25.50:13011\";\n\n // where we find the file handle\n var selectedFile = document.getElementById('fileSelector').files[0];\n var formData = new FormData(); \n // stick the file into the form\n formData.append(\"userfile\", selectedFile);\n\n // more or less a standard http request\n var oReq = new XMLHttpRequest();\n // POST requests contain data in the body\n // the \"true\" is the default for the third param, so \n // it is often omitted; it means do the upload \n // asynchornously, that is, using a callback instead\n // of blocking until the operation is completed. \n oReq.open(\"POST\", url, true); \n oReq.onload = function() {\n\t// the response, in case we want to look at it\n\tconsole.log(oReq.responseText);\n }\n oReq.send(formData);\n}", "title": "" }, { "docid": "56771c54c7148725a9e37a642171266e", "score": "0.650969", "text": "function uploadFile() {\n console.log(\"Entered Upload Fn!\");\n\n // get the file chosen by the file dialog control\n const selectedFile = document.getElementById(\"fileChooser\").files[0];\n console.log(selectedFile);\n // store it in a FormData object\n const formData = new FormData();\n // name of field, the file itself, and its name\n formData.append(\"newImage\", selectedFile, selectedFile.name);\n\n // build a browser-style HTTP request data structure\n const xhr = new XMLHttpRequest();\n // it will be a POST request, the URL will this page's URL+\"/upload\"\n xhr.open(\"POST\", \"/upload\", true);\n setFilename(null);\n // callback function executed when the HTTP response comes back\n xhr.onloadend = function(e) {\n // Get the server's response body\n console.log(xhr.responseText);\n // now that the image is on the server, we can display it!\n\n // let newImage = document.getElementById(\"serverImage\");\n //newImage.src = \"http://ecs162.org:3000/images/ochib/\" + selectedFile.name;\n setFilename(selectedFile.name);\n };\n\n // actually send the request\n xhr.send(formData);\n }", "title": "" }, { "docid": "51c5a2cd8303d3e8e17fda97fba4b143", "score": "0.6507254", "text": "function FileUpload(file, user_options) {\r\n\r\n\t/* Settings */\r\n\tvar options = {\r\n\t\taction: 'process',\r\n\t\tsuccess: function(){},\r\n\t\tprogressBar: null\r\n\t};\r\n\r\n\tfor (var key in user_options) \r\n { \r\n if (user_options.hasOwnProperty(key))\r\n {\r\n options[key] = user_options[key];\r\n }\r\n }\r\n\r\n\t/* Uploading */\t\r\n\tvar xhr = new XMLHttpRequest();\r\n\r\n\t// Open request and pass the filename in the header\r\n\txhr.open(\"POST\", options.action, true);\t\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n xhr.setRequestHeader('X-File-Name', encodeURIComponent(file.name));\r\n xhr.setRequestHeader('X-File-Size', file.size);\r\n\r\n\txhr.upload.addEventListener(\"progress\", function(event)\r\n {\t\r\n\t\tif (event.lengthComputable)\r\n\t\t{ \r\n\t\t\tvar percentage = Math.round((event.loaded * 100) / event.total);\r\n\t\t\toptions.progressBar.update(percentage);\r\n\t\t} \r\n\t}, false); \r\n \r\n\t// Response received\r\n\txhr.onreadystatechange = function()\r\n\t{\r\n\t\tif (xhr.readyState === 4)\r\n\t\t{\r\n\t\t\tif ((xhr.status >= 200 && xhr.status <= 200) || xhr.status === 304)\r\n\t\t\t{\r\n options.progressBar.success();\r\n\t\t\t\toptions.success(JSON.parse(xhr.response), options.progressBar);\r\n\t\t\t} \r\n\t\t} \r\n\t};\r\n\r\n if (navigator.userAgent.indexOf(\"Firefox\") !== -1)\r\n {\r\n // AFAIK, this is the right way. But only supported by Mozilla Firefox\r\n var fileReader = new FileReader();\r\n fileReader.onload = function(event)\r\n { \r\n xhr.sendAsBinary(event.target.result);\r\n };\r\n fileReader.readAsBinaryString(file); // Read the file \r\n } else {\r\n /* Chrome way */\r\n xhr.send(file); \r\n }\r\n}", "title": "" }, { "docid": "12b2cb3e22d5d2765214c60622785d20", "score": "0.65067625", "text": "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}", "title": "" }, { "docid": "0b74c01c878a27b507d0855db2949439", "score": "0.6503984", "text": "function uploadFile(name){\n\tconsole.log('change');\n\tvar file = event.target.files[0];\n\tvar fData = new FormData;\n\tfData.append(name, file, name+'.csv');\n\t$.ajax({\n\t\turl: \"run/OD/\" + name,\n\t\ttype: \"POST\",\n\t\tdata: fData,\n\t\tcontentType: false,\n\t\tcache: false,\n\t\tfetchData: false,\n\t\tprocessData: false\n\t})\n}", "title": "" }, { "docid": "3336a867aae0647044b494da86acb1b8", "score": "0.65034974", "text": "upload() {\n return this.loader.file\n .then( file => new Promise( ( resolve, reject ) => {\n this._initRequest();\n this._initListeners( resolve, reject, file );\n this._sendRequest( file );\n } ) );\n }", "title": "" }, { "docid": "3336a867aae0647044b494da86acb1b8", "score": "0.65034974", "text": "upload() {\n return this.loader.file\n .then( file => new Promise( ( resolve, reject ) => {\n this._initRequest();\n this._initListeners( resolve, reject, file );\n this._sendRequest( file );\n } ) );\n }", "title": "" }, { "docid": "720fcf44a87c17f7d37abcdf9c8ed439", "score": "0.64981806", "text": "function fileInputHandler(input) {\n if(input.files && input.files[0]) {\n document.getElementById(\"upload-form\").submit(); \n }\n}", "title": "" }, { "docid": "cde3635c59fe76760bf8b056f138fe4c", "score": "0.64886737", "text": "function upload_file (UploadFile, homedir, File_Server_Path, DestPath,DestFileName,user, ipaddress,date,mydebug) {\n\treturn new Promise( (resolve,reject) => {\n\t\t//Folder: compose and create if not existing\n\t/*\tif (!fs.existsSync(File_Server_Path + '/' +DestPath)) \n\t\t\tfs.mkdirSync(File_Server_Path+ '/' +DestPath); */\n\t\tvar myres = { code: \"400\", text: \"\" };\n\t\ttry{\n\t\t\tsupportmkdir.mkDirFullPathSync(os.homedir()+File_Server_Path+ '/' +DestPath);\n\t\t}catch(e){\n\t\t\tmyres.code=\"400\";\n\t\t\tmyres.text=\"error mkdir \"+e ;\n\t\t\treject (myres);\n\t\t}\n\t\t// Use the mv() method to place the file somewhere on your server\n\t\t// Upload the file, after create the folder if not existing\n\t\tif (UploadFile == undefined){ \n\t\t\tresultlog = LogsModule.register_log( 400,ipaddress,\"UPLOAD Error \", date, user);\n\t\t\tresultlog.then((resultreg) => {\n\t\t\t\tmyres.code=\"400\";\n\t\t\t\tmyres.text=\"param UploadFile undefined .\" ;\n\t\t\t\treject (myres);\n\t\t\t},(resultReject)=> { \n\t\t\t\tmyres.code=\"400\";\n\t\t\t\tmyres.text=\"param UploadFile undefined .\" ;\n\t\t\t\treject (myres);\n\t\t\t});\n\t\t}else{\n\t\t\tvar dir = DestPath + '/';\n\t\t\tUploadFile.mv( os.homedir()+File_Server_Path + '/' + dir + DestFileName, function(err) { \n\t\t\t\tif (err) { \n\t\t\t\t\tresultlog = LogsModule.register_log( es_servername+\":\"+es_port,SERVERDB,400,ipaddress,\"UPLOAD Error \"+err, date, user); \n\t\t\t\t\tresultlog.then((resultreg) => {\n\t\t\t\t\t\tmyres.code=\"400\";\n\t\t\t\t\t\tmyres.text=\" .\"+err ;\n\t\t\t\t\t\treject (myres);\n\t\t\t\t\t},(resultReject)=> {\n\t\t\t\t\t\tmyres.code=\"400\";\n\t\t\t\t\t\tmyres.text=\".\"+err ;\n\t\t\t\t\t\treject (myres);\n\t\t\t\t\t});\n\t\t\t\t} else{ \n\t\t\t\t\tresultlog = LogsModule.register_log( es_servername+\":\"+es_port,SERVERDB,200,ipaddress,'File UPLOADED at path: '+\n\t\t\t\t\t\tos.homedir()+File_Server_Path+ '/' + dir + DestFileName , date, user);\n\t\t\t\t\tresultlog.then((resultreg) => {\n\t\t\t\t\t\tmyres.code=\"200\";\n\t\t\t\t\t\tif ( (mydebug.localeCompare(\"true\")==0) || (mydebug.localeCompare(\"TRUE\")==0) ){//strings equal, in other case returns the order of sorting\n\t\t\t\t\t\t\tmyres.text='\\n' + colours.FgYellow + colours.Bright +\n\t\t\t\t\t\t\t\t'File uploaded at path: '+ colours.Reset +os.homedir()+File_Server_Path+ '/' + '\\n\\n' ;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmyres.text=\"UPLOAD: succeed\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(myres);\n\t\t\t\t\t},(resultReject)=> { \n\t\t\t\t\t\tmyres.code=\"400\";\n\t\t\t\t\t\tmyres.text=\"400: Error on registering the Log\\n\";\n\t\t\t\t\t\treject (myres);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n} //end register", "title": "" }, { "docid": "09dd067b84ea4ac9ff3ab1d12ba5152a", "score": "0.64856786", "text": "function process_inbound_files(file) {\n\n file_to_upload = file;\n meta ={};\n meta.name = file.name;\n meta.size = file.size;\n meta.filetype = file.type;\n meta.browser = isChrome ? 'chrome' : 'firefox';\n meta.uname = MeetingRoomData.getusername();\n meta.fid = fileCount; //to store file id;\n meta.senderid = MeetingRoomData.getcurrentid();\n console.log(meta);\n\n send_meta(meta);\n document.getElementById('file').value = '';\n\n// MeetingRoom.sendChat(\"You have received a file. Download and Save it.\");\n\n /* user 0 is this user! */\n create_upload_stop_link(meta.name, meta.fid);//, username);\n }", "title": "" }, { "docid": "33a54723d2884b6d4cbb8349e1069b08", "score": "0.6483776", "text": "function uploadImage() {\n\tvar cloudinaryFolderName = '/default/images/Cloudinary/';\n\tvar cloudinaryFolder = new File(File.STATIC + cloudinaryFolderName);\n\tif (!cloudinaryFolder.exists()) {\n\t\tcloudinaryFolder.mkdir();\n\t}\n\tvar result;\n\tvar file;\n\tvar action = request.triggeredFormAction;\n\tif (action.formId == \"submit\") {\n\t\tvar params = request.httpParameterMap;\n\t\tvar files = params.processMultipart((function (field, ct, oname) {\n\n\t\t\tif (oname != '') {\n\n\t\t\t\tvar fileType = oname.substring(oname.lastIndexOf('.') + 1);\n\t\t\t\tif ((imageFormats.indexOf(fileType) == -1) && (videoFormats.indexOf(fileType) == -1)) {\n\t\t\t\t\tresult = \"FAILED: file format '\" + fileType + \"' not allowed\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\tvar folder = new File(File.STATIC + cloudinaryFolderName);\n\t\t\t\tvar existingFiles = folder.listFiles();\n\t\t\t\tfor (var i = 0; i < existingFiles.length; i++) {\n\t\t\t\t\tif (existingFiles[i].name == oname.toString()) {\n\t\t\t\t\t\tresult = \"FAILED: \" + oname + \" already exists\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult = \"success\";\n\t\t\t\treturn file = new File(File.STATIC + cloudinaryFolderName + oname);\n\t\t\t} else {\n\t\t\t\tresult = \"error\";\n\t\t\t}\n\t\t}));\n\n\t} else {\n\t\tresult = \"error\";\n\t}\n\t// checks if file exists upload it to cloudinary\n\tif (file) {\n\t\tCalls.uploadFileToCloudinary(file, 'static');\n\t}\n\t// execute main controller for managing images and videos with result message\n\treturn imageManager(result);\n\n}", "title": "" }, { "docid": "0db68ab2bd6c173f0ad916c687e93d30", "score": "0.6481671", "text": "uploadFile() {\n console.log(\"FRONT: Upload File...\");\n const formData = new FormData();\n formData.append('plantilla_xlsx', this.form.get('profile').value);\n this.uploadFileService.upload(formData).subscribe((res) => {\n this.response = res;\n }, (err) => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "dd10f0a253acf7acbd2b1c8251a8eecb", "score": "0.647912", "text": "function uploadPhoto() {\n \n \timageData = sessionStorage.getItem(\"imageData\");\n \n var options = new FileUploadOptions();\n\t\toptions.headers = {\n\t\t\tConnection: \"close\"\n\t\t}\n var options = new FileUploadOptions();\n \n options.fileKey=\"file\";\n options.fileName=imageData.substr(imageData.lastIndexOf('/')+1);\n options.mimeType=\"image/jpeg\";\n\n var params = new Object();\n \n params.lat \t\t = sessionStorage.getItem(\"lat\");\n params.lng \t\t = sessionStorage.getItem(\"lng\");\n\t\tparams.uuid = sessionStorage.getItem(\"uuid\");\n\t\tparams.ampleur = sessionStorage.getItem(\"ampleur\");\n\t\tparams.impact = sessionStorage.getItem(\"impact\");\n\t\t\n\n\n options.params = params;\n\t\toptions.chunkedMode = false;\n //console.log('transferring...');\n\t\t\n\t\t//console.log(options);\n \n \t var url=\"http://7eco.cerivan.com/app/post.php\";\n var ft = new FileTransfer();\n ft.upload(imageData, url, win, fail, options,true);\n\t\t\n\t\t \t\n }", "title": "" }, { "docid": "5d18598216092ee57550a19c0af7df1c", "score": "0.6467977", "text": "async function handleUploadClick(evt) {\n evt.preventDefault();\n if (!filePathField.value || !lectureNameField.value || !lectureNumberField.value) {\n return;\n }\n ipcRenderer.send(\"video:upload:submit\", {\n filePath: filePathField.value,\n lectureNumber: parseInt(lectureNumberField.value, 10),\n lectureName: lectureNameField.value\n });\n}", "title": "" }, { "docid": "e57299366de96b424f632ff849fbfb6f", "score": "0.64667535", "text": "function uploadFileInput(successFunc, failFunc) {\n $('#input-image').get(0).files;\n uploadFile($('#input-image').get(0).files, 'uploadfile', function(data, textStatus, jqXHR, uploaded_url) {\n uploaded_url = uploaded_url.substring(uploaded_url.indexOf(\"image_\"));\n successFunc(uploaded_url);\n }, function(jqXHR, textStatus, errorThrown) {\n failFunc(uploaded_url);\n });\n}", "title": "" }, { "docid": "18a8b1d72aa600d4f7f50a54319e75bc", "score": "0.6453983", "text": "function uploadFile(req, callback) {\n new formidable.IncomingForm().parse(req)\n .on('fileBegin', (name, file) => {\n\n file.path = basedir + '/uploads/' + file.name\n })\n .on('file', (name, file) => {\n callback(file.name)\n })\n}", "title": "" }, { "docid": "c9d0f351cf0fd1f663cab77945b40483", "score": "0.6450613", "text": "function uploadDocument(file, fileName, itemProperties, fileUploadControlID) {\r\n var fileUploadService = new FileUploadService();\r\n fileUploadService.fileUpload(file, masterLibraryName, fileName).then(addFileToFolder => {\r\n console.log(\"File Uploaded Successfully\");\r\n var parsedData = JSON.parse(addFileToFolder.body);\r\n var listItemAllFieldsURL = parsedData.d.ListItemAllFields.__deferred.uri;\r\n var getItem = getListItem(listItemAllFieldsURL);\r\n getItem.done(function (listItem, status, xhr) {\r\n var savedItemId = listItem.d.Id;\r\n saveMetadataToList(savedItemId, itemProperties, fileUploadControlID);\r\n });\r\n getItem.fail(onError);\r\n }).catch(addFileToFolderError => {\r\n console.log(addFileToFolderError);\r\n });\r\n}", "title": "" }, { "docid": "af5b02228ff2efddcd36f8b163ec1438", "score": "0.64396733", "text": "function onUploadStart(event) {\n\t\n\t}", "title": "" }, { "docid": "bf41481a7e8cb621cedfd0b1a04bc5ce", "score": "0.643955", "text": "async handleSubmitFile(event) {\n event.preventDefault();\n\n if (!this.state.selectedFile)\n return;\n\n const reader = new FileReader();\n reader.readAsDataURL(this.state.selectedFile);\n reader.onloadend = () => {\n this.uploadImage(reader.result);\n };\n reader.onerror = () => {\n console.error('error on submit');\n };\n }", "title": "" }, { "docid": "ca7f84d8879d337fc6eba92d52c313e9", "score": "0.64390796", "text": "function uploadImage(event) {\n\tvar input = event.target;\n\tvar formData = new FormData();\n formData.append(\"image\", input.files[0]);\n showWaitAnimation(\"Uploading\", \"Uploading \" +input.files[0].name);\n\t$.ajax({\n\t\turl: serverURL + \"workspaces/\" + queryString[\"wsId\"] + \"/projects/\"\n\t\t\t+ queryString[\"ptId\"] + \"/functions/\" + queryString[\"vnfId\"]+ \"/upload\",\n\t\ttype: 'POST',\n\t\tdata: formData,\n\t\txhrFields : {\n\t\t\twithCredentials : true\n\t\t},\n\t\tprocessData: false, // tell jQuery not to process the data\n\t\tcontentType: false, // tell jQuery not to set contentType\n\t\tsuccess: function (message) {\n\t\t \tcloseWaitAnimation();\n\t\t\t$('#uploadSuccess').dialog({\n\t\t\t\tmodal: true,\n\t\t\t\tdraggable: false,\n\t\t\t\tbuttons: {\n\t\t\t\t\tok: function () {\n\t\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}).text(message);\n\t\t}\n\t});\n\t$(input).filestyle('clear');\n}", "title": "" }, { "docid": "2c76e60526c74b1f684f9670b88c63ed", "score": "0.64368266", "text": "function upload_file(file, signed_request, url){\n\t\tconsole.log(file)\n\t\tconsole.log(signed_request)\n\t\tconsole.log(url)\n\t\t$window.localStorage.setItem('url', url)\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"PUT\", signed_request);\n\t\txhr.setRequestHeader('x-amz-acl', 'public-read');\n\t\txhr.onload = function() {\n\t\t\tif (xhr.status === 200) {\n\t\t\t\t\tdocument.getElementById(\"preview\").src = url;\n\t\t\t\t\tdocument.getElementById(\"avatar_url\").value = url;\n\t\t\t\t\tvm.newProduct.avatar_url = url\n\t\t\t}\n\t\t};\n\t\txhr.onerror = function() {\n\t\t\t\tconsole.log(\"vanilla AJax call : \" + JSON.stringify(xhr))\n\t\t\t\talert(\"Could not upload file.\");\n\t\t};\n\t\txhr.send(file);\n\t}", "title": "" }, { "docid": "6b373583229bff4eade8a240ca6d16ae", "score": "0.64362216", "text": "function handleFileSelect(evt) \n{\n //console.log('file uploaded'); //debugg\n file = evt.target.files[0]; // FileList object\n}", "title": "" }, { "docid": "62b552e3efae9da3cd3b8eda6b648180", "score": "0.6433631", "text": "function uploadFile(target, file, fullpath, successCallback, failureCallback) {\n \"use strict\"\n $.ajax({\n method: \"POST\",\n url: apiPrefix + \"/filedrop/\" + file.name,\n data: file,\n contentType: false,\n processData: false,\n headers: {\n Authorization: Cookies.get(cookieName)\n }\n }).done(function (data) {\n submitTask(target, {type: \"downloadfile\", url: String(data), out: fullpath}, successCallback, failureCallback) \n }).fail(function (resp) {\n failureCallback(getErrorMessage(resp))\n })\n}", "title": "" }, { "docid": "1a0275c73aed55f3ca0740b76853b4d4", "score": "0.6431712", "text": "function sendFile(e){\n var file = e.target.files[0];\n var filename = file.name;\n //----| make the upload request |----/\n ajax.open(\"POST\",\"getfile.php\", true);\n ajax.setRequestHeader(\"filename\", filename);\n ajax.send(file); \n }", "title": "" }, { "docid": "3b29241bd0606cd44487509e9ac4c45c", "score": "0.64232296", "text": "function sendImage(chat_id,image_file,uploadFuncion){\n/*\n\tvar req = request.post(url, function (err, resp, body) {\n\t if (err) {\n\t console.log('Error!');\n\t } else {\n\t console.log('URL: ' + body);\n\t }\n\t});\n\tvar form = req.form();\n\tform.append('file', '<FILE_DATA>', {\n\t filename: 'myfile.txt',\n\t contentType: 'text/plain'\n\t});\n*/\nconsole.log(\"TENTANDO UPLOAD\")\n\tuploadFuncion(image_file,function(a){\n\t\tconsole.log(a)\n\tconsole.log(\"RESPONDENDO\")\n\tconsole.log(chat_id)\n\tconsole.log(image_file)\t\n\t})\n\t\n}", "title": "" }, { "docid": "bdb09be6fee9b38061ad343212852167", "score": "0.6414779", "text": "async function fileUpload(e, form) {\n\n let fileInput = document.getElementById(\"fileUploadInput\");\n file_size = fileInput.files[0].size // Size in bytes\n\n fetch(`${form.action}${file_size}`, {method:'post', body: new FormData(form)});\n\n e.preventDefault();\n}", "title": "" }, { "docid": "06d848c966ec40e47f0634537722f5d3", "score": "0.64109886", "text": "async _upload (){\n try {\n const { file, fileLastModified, fileType } = this\n const metadata = {\n contentType: fileType,\n customMetadata: {fileLastModified}\n };\n\n // could do it firestore way:\n //but this way is consistent with our api\n await this._sendAndTrackFile(file, metadata)\n await this.logEvent(TRANSCRIPTION_STATUSES[1]) // uploaded\n\n } catch (err) {\n console.error('error uploading to storage: ', err)\n // throw it up the chain\n throw err\n }\n }", "title": "" }, { "docid": "0aeee37344addba5793f6f224c623b82", "score": "0.64079434", "text": "async upload() {\n const fd = new FormData();\n fd.append('file',this.state.selectedFile);\n axios.post('http://localhost:8080/items/1/image',fd).then(res =>{\n alert(res.data.message);\n })\n \n }", "title": "" }, { "docid": "d7f2448536fec61a0cfbb27c00b5fdbf", "score": "0.64030975", "text": "getUploadFilePath(filePath) {\n console.log(\"FilePath :\"+filePath);\n return browser.uploadFile(filePath);\n }", "title": "" }, { "docid": "9cd4c43b0b0771a405a876f9f439d8ad", "score": "0.64018655", "text": "function upload(heading, punkt)\n\t{\n\t\tdocument.getElementById(\"heading\").value = heading;\n\t\tdocument.getElementById(\"punkt\").value = punkt;\n\t\tpokazUpload();\n\t}", "title": "" }, { "docid": "9c0d8365cff7e4b1523159c7920c48ff", "score": "0.6399746", "text": "function handleUpload() {\n setLoading(true);\n const transformation = `${croppedPixels.x},${croppedPixels.y},${croppedPixels.width},${croppedPixels.height}`;\n\n const url = `https://api.cloudinary.com/v1_1/${CLOUD_NAME}/upload`;\n const xhr = new XMLHttpRequest();\n const fd = new FormData();\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n\n xhr.onreadystatechange = function (e) {\n if (xhr.readyState === 4 && xhr.status === 200) {\n // File uploaded successfully\n const response = JSON.parse(xhr.responseText);\n const url = response.secure_url;\n setImage(url);\n setFile(null);\n dispatch(updateCurrentUser({ imageUrl: url, id: userId }));\n setLoading(false);\n handleToastOpen(\"Image updated!\");\n }\n if (xhr.readyState === 4 && xhr.status !== 200) {\n // File failed to upload\n setLoading(false);\n setFile(null);\n setImage(currentImage);\n handleToastOpen(\"Image upload failed. Try again later\")\n }\n };\n\n fd.append(\"file\", file);\n fd.append(\"custom_coordinates\", transformation);\n fd.append(\"upload_preset\", UPLOAD_PRESET);\n xhr.send(fd);\n }", "title": "" }, { "docid": "a9973010af7912ee86196efef04454f7", "score": "0.63979864", "text": "beforeUpload() {}", "title": "" }, { "docid": "420930f11fee07aac71c819233b690c8", "score": "0.63936245", "text": "function attachFile() {\n self.uploadCtrl.triggerFileInput();\n }", "title": "" }, { "docid": "46b35ee6920e751910f257d5abd7fc37", "score": "0.6389503", "text": "function _uploadFile(makeupId, cb){\n console.log('sent to s3')\n if (vm.files){\n var file = vm.files[0];\n upload.uploadPhoto(file, $rootScope.user.uid, makeupId , function(s3link){\n console.log(\"sent to s3\")\n var linkId = s3link + \"/\" + makeupId + \".jpg\";\n cb(linkId);\n console.log(cb);\n });\n } else {\n\n var file = _b64toBlob($scope.photo);\n file.name = makeupId + \".jpg\";\n\n upload.uploadWebcam(file, $rootScope.user.uid, makeupId, function(s3link){\n\n console.log('sent to s3')\n var linkId = s3link ;\n cb(linkId);\n console.log(cb);\n\n\n });\n }\n\n }", "title": "" }, { "docid": "ff01a7aa6136e9952b28b91d8ae94707", "score": "0.63803154", "text": "function uploadFile(mediaFile, filetype) {\n var ImageType = filetype;\n var imageURI = mediaFile.fullPath;\n var fileName = mediaFile.name;\n\n databaseHandler.createDatabase();\n\n databaseHandler.db.transaction(\n function (tx) {\n tx.executeSql(\n \"insert into ReportVideos(ReportNumber,ReportID, UserId,UpdatedDate,Videoname,VideoType,VideoPath, VideoPhonePath, Longitude,Latitude,ClientLocation) values(?,?,?,DateTime('now'),?,?,?,?,?,?,?)\",\n [ReportNumber, ReportID, userid, fileName, ImageType, imageURI, imageURI, longitude, latitude, ClientLocation],\n function (tx, results) {\n //console.log(\"add image\" + ImageType+\"Added\");\n window.location.href = \"stepdocument.html\";\n },\n function (tx, error) {\n console.log(\"add Categories error\");\n }\n );\n },\n function (error) { },\n function () { }\n );\n\n\n \n\n\n\n //$(\"#success\").html(\"<b>Please wait while uploading...</b>\");\n //var imageURI = mediaFile.fullPath;\n\n //var options = new FileUploadOptions();\n //options.fileKey = \"file\";\n //options.fileName = mediaFile.name;\n\n //var params = new Object();\n //params.reportnumber = ReportNumber;\n //params.userid = userid;\n\n //params.ReportId = ReportID;\n //params.VideoType = ImageType;\n //params.VideoPathPhone = imageURI;\n //params.longitude = longitude;\n\n //params.mobile = MobileNumber;\n //params.datetime = new Date();\n\n //params.latitude = latitude;\n //params.ClientLocation = \"\";// ClientLocation;\n\n\n //options.params = params;\n ////options.contentType = 'video/mp4';\n //options.chunkedMode = false;\n\n //var ft = new FileTransfer();\n //ft.upload(imageURI, \"http://autoinsurance.flashcontacts.org/appservices/SaveReportVideo\", function (result) {\n // $(\"#success\").html(\"<b>Uploaded Sucessfuly.</b>\");\n // window.location.href = \"videos.html\";\n\n //}, function (error) {\n // $(\"#success\").html(JSON.stringify(error));\n //}, options);\n }", "title": "" }, { "docid": "f3f4f5869de1af09e65a89970ca3f553", "score": "0.63796365", "text": "_upload() {\n const cls = this.constructor\n\n // If there's a semaphore attempt to acquire a resource (e.g check we\n // haven't reached the maximum number of uploads).\n if (this._semaphore && !this._semaphore.acquire()) {\n return\n }\n\n // Prevent any future upload requests\n clearInterval(this.__uploadInterval)\n\n // Remove the pending CSS class from the uploader and add the\n // uploading class.\n this.uploader.classList.remove(cls.css['pending'])\n this.uploader.classList.add(cls.css['uploading'])\n\n // Send the file\n //\n // REVIEW: Since `fetch` currently doesn't provide a mechanism for\n // querying the progress of an upload we are forced to use\n // `XMLHttpRequest`. Once progress can be queries for `fetch` this\n // code should be updated to use the more modern approach.\n //\n // ~ Anthony Blackshaw <[email protected]>, 23rd April 2018\n this._xhr = new XMLHttpRequest()\n\n // Add event listeners to the request\n $.listen(\n this._xhr,\n {\n 'abort': this._handlers.reqAbort,\n 'error': this._handlers.reqError,\n 'load': this._handlers.reqLoad\n }\n )\n\n $.listen(\n this._xhr.upload,\n {'progress': this._handlers.reqProgress}\n )\n\n // Send the request\n this._xhr.open('POST', this._url, true)\n this._xhr.send(this._formData)\n }", "title": "" }, { "docid": "10406242dabeffef6b2f9cedf4398db4", "score": "0.63764906", "text": "function uploadFile(){\r\n var x = document.getElementById(\"myFile\");\r\n var txt = \"\";\r\n if ('files' in x) {\r\n if (x.files.length == 0) {\r\n txt = \"Select one or more files.\";\r\n } else {\r\n for (var i = 0; i < x.files.length; i++) {\r\n txt += \"<br><strong>\" + (i+1) + \". file</strong><br>\";\r\n var file = x.files[i];\r\n if ('name' in file) {\r\n txt += \"name: \" + file.name + \"<br>\";\r\n }\r\n if ('size' in file) {\r\n txt += \"size: \" + file.size + \" bytes <br>\";\r\n }\r\n }\r\n }\r\n } \r\n else {\r\n if (x.value == \"\") {\r\n txt += \"Select one or more files.\";\r\n } else {\r\n txt += \"The files property is not supported by your browser!\";\r\n txt += \"<br>The path of the selected file: \" + x.value; // If the browser does not support the files property, it will return the path of the selected file instead. \r\n }\r\n }\r\n}", "title": "" }, { "docid": "ec9f847f49f4b129de169bf288ff740c", "score": "0.63526535", "text": "function handleUpload(event) {\n setFile(event.target.files[0]);\n event.preventDefault()\n }", "title": "" }, { "docid": "677f1cc41893e3f0cde4c913a8dca013", "score": "0.6351531", "text": "_fileuploadadd(e, data, _self) {\n _self.sendAction('onFileuploadadd', e, data);\n\n if (isPresent(get(_self, 'autoUpload')) && !get(_self, 'autoUpload')) {\n return;\n }\n\n data.submit()\n .success((result, textStatus, jqXHR) => {\n _self.sendAction('onFileuploadsuccess', e, { result, textStatus, jqXHR });\n })\n .error((jqXHR, textStatus, errorThrown) => {\n _self.sendAction('onFileuploaderror', jqXHR, textStatus, errorThrown);\n })\n .done((result, textStatus, jqXHR) => {\n _self.sendAction('onFileuploaddone', e, { result, textStatus, jqXHR });\n });\n }", "title": "" } ]
b5b94a22529ceeb0911e717651b10a07
Total Transactions per second
[ { "docid": "39a0e99cad500ae91c7ac852a195989b", "score": "0.0", "text": "function refreshTotalTPS(fixTimestamps) {\n var infos = totalTPSInfos;\n // We want to ignore seriesFilter\n prepareSeries(infos.data, false, true);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if(isGraph($(\"#flotTotalTPS\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesTotalTPS\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotTotalTPS\", \"#overviewTotalTPS\");\n $('#footerTotalTPS .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" } ]
[ { "docid": "1fdaeaa5d12b354292bea425a4012bf0", "score": "0.65046084", "text": "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "title": "" }, { "docid": "7530d6c24fcfe48771c51f8a9cd00a7c", "score": "0.6479991", "text": "function updateValues() {\n\tconst amounts = transactions.map((transaction) => transaction.time);\n\n\tconst total = amounts.reduce((acc, item) => (acc += item), 0);\n\t//console.log(time, amounts, total);\n\n\tbalance.innerText = `${total} min`;\n}", "title": "" }, { "docid": "58c34f6cb9f3a06dd4dd0d41e64f13d2", "score": "0.6461238", "text": "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "title": "" }, { "docid": "936025467e71a82dcda6b6c37b5938dc", "score": "0.6340553", "text": "getTrafficLogTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficLogs()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_LOG_COUNT', count)\n }\n\n getItems()\n }", "title": "" }, { "docid": "47e1b886e88ce39d95d423ecae6d0386", "score": "0.63175285", "text": "getTrafficTraceTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficTraces()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_TRACE_COUNT', count)\n }\n\n getItems()\n }", "title": "" }, { "docid": "60d397c45e652247850f413ad0fbd303", "score": "0.62999165", "text": "getTotalCost() {\n return this.transactions.map(t => t.cost).reduce((acc, value) => acc + value, 0);\n }", "title": "" }, { "docid": "4653f02d16225cd314e526284e9f1bc1", "score": "0.6285214", "text": "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "title": "" }, { "docid": "4653f02d16225cd314e526284e9f1bc1", "score": "0.6285214", "text": "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "title": "" }, { "docid": "07b9ae7ab185ba40f2da9e9f8429ff5d", "score": "0.6269029", "text": "totalTime() {\n return this.duration() / (this.tempo() / 60)\n }", "title": "" }, { "docid": "0ec7302f8f4e26eaf5e8f63a330a5e24", "score": "0.62109965", "text": "@computed get priceFetchDiffSeconds() {\n return (this.lastPriceFetchTime - Date.now()) / 1000;\n }", "title": "" }, { "docid": "eeb84526565e43072b11ccb4fb476714", "score": "0.6122031", "text": "calculateSeconds() {\n const millisecondsToSeconds = 0.001;\n let totalmilliseconds = Date.now() - this.birthday.getTime();\n this.secondsCount = totalmilliseconds * millisecondsToSeconds;\n\n return this.secondsCount;\n }", "title": "" }, { "docid": "691092ce3d0d1f424e023b2a0631c04a", "score": "0.611619", "text": "static getTotalTime() {\r\n let totalTimer = 0;\r\n const profiles = Store.getProfiles();\r\n if (localStorage.getItem('profiles') !== null) {\r\n profiles.forEach((profile) => {\r\n totalTimer += profile.monthTime;\r\n });\r\n }\r\n return totalTimer;\r\n }", "title": "" }, { "docid": "3ac9284da8417a216d9fa1e7fd3d33ea", "score": "0.5952385", "text": "get total_time() { return this._total_time; }", "title": "" }, { "docid": "ba9476963032464a9f651b3ccb8c5df1", "score": "0.587621", "text": "async getTotalPayouts() {\n // todo pass blockchain identity\n const totalAmount = await this.blockchain\n .getTotalPayouts(this.profileService.getIdentity()).response;\n this.socket.emit('total_payouts', totalAmount);\n }", "title": "" }, { "docid": "e15b28857f8295b828e128e3f69fae86", "score": "0.5870545", "text": "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "title": "" }, { "docid": "ec4c3e0489b6518548b73b8d12fb6140", "score": "0.584586", "text": "getTotalProductionPerSecond() {\n var productionPerSecond = 0;\n Object\n .keys(this.Model.upgrades)\n .forEach( (key, index) => {\n productionPerSecond += this.getProductionPerSecond(key);\n });\n return Math.round(productionPerSecond * 10) / 10;\n }", "title": "" }, { "docid": "5136e640f24005129b4b3951cb377414", "score": "0.58369875", "text": "totalUpdates() {\n return 30;\n }", "title": "" }, { "docid": "c13f6c23c1b62d7628b180869d57b09c", "score": "0.58181375", "text": "function ReduceTime() {\n totalSeconds = totalSeconds - 30;\n return totalSeconds;\n }", "title": "" }, { "docid": "d32e11bed3afbc5732d6c7e75e8a42e4", "score": "0.5804055", "text": "function Total(DailyRent, time) {\r\n TotalRent = DailyRent * time;\r\n }", "title": "" }, { "docid": "56f181afffc1790a8cbf931c485ce046", "score": "0.5803499", "text": "get messagesPerSecond() {\n return this.getNumberAttribute('messages_per_second');\n }", "title": "" }, { "docid": "3d77713659c5a1ed5296d7d999ba02b0", "score": "0.579104", "text": "getTotalMilliseconds() {\n return this._quantity;\n }", "title": "" }, { "docid": "8027b97ac583968ca0278f1853c9cfde", "score": "0.5776333", "text": "function utregningTid() {\n spentMilliseconds = Math.floor(finishTime - startTime);\n //spentSeconds = spentMilliseconds / 1000;?\n totalTider.push(spentMilliseconds);\n total = totalTider.reduce((a, b) => a + b, 0);\n snitt = total / totalTider.length;\n}", "title": "" }, { "docid": "be0f7e11acb1c35858be4c429dda0b63", "score": "0.5758213", "text": "seconds(prevTime, curTime){\n let time = curTime - prevTime;\n let seconds = time/1000;\n return seconds.toFixed(2);\n}", "title": "" }, { "docid": "22ee83534d25bcd678cfe2eabdee1ffd", "score": "0.5746034", "text": "getTotal(transaction){\n var total = 0;\n for(var i = 0;i<transaction.details.recipients.length;i++){\n total += transaction.details.recipients[i].amount;\n }\n\n return total + transaction.details.fee;\n }", "title": "" }, { "docid": "5870a2646a7c51de411600ea89553625", "score": "0.57080793", "text": "getTotalPayment() {\n let total = 0;\n this.operations.forEach(op => {\n total += op.amount;\n });\n return total;\n }", "title": "" }, { "docid": "7b5c611ef61e8ab1ba31284b2522b5c6", "score": "0.56842583", "text": "function TotalSeconds(date) {\n return parseInt((date.getTime() - datedefault.getTime()) / 1000);\n}", "title": "" }, { "docid": "7cb13a5e65a0c4c785e744c9ad55544f", "score": "0.56750053", "text": "function calcularPorcentajeTranscurrido(tiempoTrans, tiempoTotal){\n return (tiempoTrans/tiempoTotal)*100;\n}", "title": "" }, { "docid": "c3bed48025b5efb32df318a2c58fc1d1", "score": "0.56723386", "text": "function calculateTransactionTotal(transData) {\n\t\t\tlet fromTotal = transData.from.amount,\n\t\t\t\tfromLoading = transData.from.loading,\n\t\t\t\ttoTotal = transData.to.amount,\n\t\t\t\ttoLoading = transData.to.loading;\n\n\t\t\tlet fromCommission = 0,\n\t\t\t\ttoCommission = 0,\n\t\t\t\tcommissionLoading = false;\n\n\t\t\tif (commission) {\n\t\t\t\tfor (let commId in transData.commission) {\n\t\t\t\t\tlet commData = transData.commission[commId];\n\n\t\t\t\t\tfromCommission += (commData.feeInAccountCurrency || 0);\n\t\t\t\t\ttoCommission += (commData.feeInPaymentCurrency || 0);\n\t\t\t\t\tcommissionLoading = commissionLoading || commData.loading;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcommission: {\n\t\t\t\t\tfrom: fromCommission,\n\t\t\t\t\tto: toCommission,\n\t\t\t\t\tloading: commissionLoading\n\t\t\t\t},\n\t\t\t\tfrom: {\n\t\t\t\t\tcurrency: transData.from.currency,\n\t\t\t\t\tamount: transData.from.amount + fromCommission,\n\t\t\t\t\tloading: transData.from.loading || commissionLoading,\n\t\t\t\t},\n\t\t\t\tto: {\n\t\t\t\t\tcurrency: transData.to.currency,\n\t\t\t\t\tamount: transData.to.amount + toCommission,\n\t\t\t\t\tloading: transData.to.loading || commissionLoading,\n\t\t\t\t},\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ac48895fb66657cc446555134887a2e2", "score": "0.56606287", "text": "function printTotals(){\n var endMilliseconds = new Date().getTime();\n var totalMilliseconds = endMilliseconds - pound.startMilliseconds;\n console.log('pound completed %s requests in %s ms. \\nreceived responses: %s. \\nhighest number of open connections was: %s. \\nrequest errors: %s' +\n '\\nrequests per second: %s. \\nresponses per second: %s',\n pound.requestsGenerated, totalMilliseconds,\n pound.responsesReceived,\n pound.highestOpenConnectionsAtOneTime,\n pound.requestErrorCount,\n pound.requestsPerSecond,\n pound.responsesPerSecond);\n }", "title": "" }, { "docid": "820ec57163806d38762a39ee0f4301d4", "score": "0.56287557", "text": "get uptime() {\n if (this._state === exports.ClientState.ACTIVE\n && this._currentConnectionStartTime) {\n return Date.now() - this._currentConnectionStartTime;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "8c2636b4eb59f5f0410822d8bf3f9a58", "score": "0.5615434", "text": "_getTime () {\r\n return (Date.now() - this._startTime) / 1000\r\n }", "title": "" }, { "docid": "b6c53feb2dbdca57cefaa5a1402eeb71", "score": "0.5593544", "text": "function CalculateTime(){\n now = Date.now();\n deltaTime = (now - lastUpdate) / 1000;\n lastUpdate = now;\n}", "title": "" }, { "docid": "9f24ec13310a290075715aa189ed43b8", "score": "0.55725527", "text": "getTotalTime(){\n return this.totalTime;\n }", "title": "" }, { "docid": "1f058cef0a2a17d3e74db39588ec6285", "score": "0.556448", "text": "function statistics() {\n\t/*var time = Date.now() - startTime - pauseTime;\n\t\tvar seconds = (time / 1000 % 60).toFixed(2);\n\t\tvar minutes = ~~(time / 60000);\n\t\tstatsTime.innerHTML = (minutes < 10 ? '0' : '') + minutes +\n\t(seconds < 10 ? ':0' : ':') + seconds;*/\n}", "title": "" }, { "docid": "77fd9a007b00f419c167658c6c03e981", "score": "0.55434215", "text": "function recordSegmentDownloadRate() {\r\n\ttotalEndTime = performance.now();\r\n\tvar totalTime = totalEndTime - totalStartTime;\r\n\tdocument.getElementById(\"result\").events_textarea.value += \"TotalTime:\" + totalTime + \"\\n\";\r\n}", "title": "" }, { "docid": "1cc2c69f37dbae09b4473d3d9ea32997", "score": "0.55409557", "text": "function seconds_elapsed() {\n var date_now = new Date();\n var time_now = date_now.getTime();\n var time_diff = time_now - startTime;\n var seconds_elapsed = Math.floor(time_diff / 1000);\n return (seconds_elapsed);\n}", "title": "" }, { "docid": "3d2f5535d5deea81180c0b00bbab9e82", "score": "0.5540938", "text": "totalSpent(){\n return this.meals().reduce((a,b)=>(a += b.price), 0);\n }", "title": "" }, { "docid": "daa625783271b1018ad933e0a36c2250", "score": "0.5532406", "text": "function statistics() {\n var time = Date.now() - startTime - pauseTime;\n var seconds = (time / 1000 % 60).toFixed(2);\n var minutes = ~~(time / 60000);\n statsTime.innerHTML = (minutes < 10 ? '0' : '') + minutes +\n (seconds < 10 ? ':0' : ':') + seconds;\n}", "title": "" }, { "docid": "6d8c9b27a5ef7d6ad71f05bd5312c143", "score": "0.5524011", "text": "getTrafficRouteTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficRoutes()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_ROUTE_COUNT', count)\n }\n\n getItems()\n }", "title": "" }, { "docid": "8ad0cf3f4555851338f2778085948460", "score": "0.5515253", "text": "total() {\n return transactionObj.incomes() + transactionObj.expenses()\n }", "title": "" }, { "docid": "339a178585312f641e940afdc245f6c8", "score": "0.55125326", "text": "function MilliSecondsElapsed()\r\n{\r\n\toTimeNow = new Date();\r\n\treturn (oTimeNow - ACROSDK.oTimeStart);\r\n}", "title": "" }, { "docid": "15ca256c66ec92464401ebdcb2687a8b", "score": "0.55079913", "text": "function getTimeSecs()\n{\n return (new Date()).getTime() / 1000;\n}", "title": "" }, { "docid": "fcaff379c8bc9e716783fa245dcbb4b8", "score": "0.5485764", "text": "function billsTotal(){\n totally = totalCall + totalSms;\n }", "title": "" }, { "docid": "5a7f7ccdc9e9fec6607004bb15338a81", "score": "0.54848737", "text": "function spendSomeTime() {\n let total = 0;\n for (let i = 0; i < 10000; i++) {\n total += i;\n }\n}", "title": "" }, { "docid": "798f9465c82bd1e83aba5885f78bec38", "score": "0.54816073", "text": "function calcularTiempoEjecucion(){\n\t\tvar tiempo = new Date().getTime() - tiempo_ejecucion;\n\t\tvar div = find(\"//div[@class='div3']\", XPFirst);\n\t\tdiv.appendChild(elem(\"P\", \"TB: \" + tiempo + \" ms\"));\n\t}", "title": "" }, { "docid": "8b42a90eae2f584df2e551953032e92d", "score": "0.54778105", "text": "getCumulativeTotal() {\n var transactions = fake_data.transactions.sort((a, b) => {\n return new Date(a.date) - new Date(b.date);\n });\n console.log(transactions);\n var starting_balance = fake_data.balance;\n var totalValues = [];\n var total = 0;\n transactions.forEach((t) => {\n starting_balance += t.amount;\n totalValues.push(starting_balance);\n });\n return totalValues;\n }", "title": "" }, { "docid": "94bd5537c989227044f4c38cb1711d82", "score": "0.5465797", "text": "function calcTimeComplete(log) {\n let timeComplete = 0;\n for (let entry of log) {\n timeComplete += entry.timeInMinutes;\n }\n return timeComplete;\n }", "title": "" }, { "docid": "c30581e16cc0e902b2e27249ab308c07", "score": "0.5464079", "text": "function timeSeconds() {\n return timeMS() / 1000;\n}", "title": "" }, { "docid": "6cbaf265abb892dff3de15208898673a", "score": "0.5458355", "text": "total(){\n return Transaction.incomes() + Transaction.expenses();\n }", "title": "" }, { "docid": "85cc076bb82fb4fcce28585f095d7857", "score": "0.5450182", "text": "function getTotalThreat(){\n\t\tvar total = 0;\n\t\t/* Rate multiplier */\n\t\tswitch ( (amounts || defaultParams).rateMultiplier ){\n\t\t\tcase RateMultiplier.TIMES1:\n\t\t\t\tbreak;\n\t\t\tcase RateMultiplier.TIMES2:\n\t\t\t\ttotal += 10;\n\t\t\t\tbreak;\n\t\t\tcase RateMultiplier.TIMES4:\n\t\t\t\ttotal += 20;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn total;\n\t}", "title": "" }, { "docid": "63e33adceaa724d0c6284c956561d464", "score": "0.5434956", "text": "get dailyUsage() {\n if (this.transactionBatches.length === 0) return 0;\n\n // Get all transaction batches confirmed in the last three months\n const sinceDate = new Date();\n sinceDate.setTime(sinceDate.getTime() - USAGE_PERIOD_MILLISECONDS);\n const transactionBatches = this.transactionBatches\n .filtered('transaction.confirmDate >= $0', sinceDate);\n\n // Get the total usage over that period\n const totalUsage = getTotal(transactionBatches, 'usage');\n\n\n // Calculate and return the daily usage over either the usage period, or since this batch was\n // added if that is shorter\n const currentDate = new Date();\n let usagePeriod = millisecondsToDays(USAGE_PERIOD_MILLISECONDS);\n if (transactionBatches.length === this.transactionBatches.length) {\n // This item batch has no transaction batches older than the usage period constant,\n // use the actual amount of time it has been around for as the usage period\n usagePeriod = millisecondsToDays(currentDate.getTime() - this.addedDate.getTime());\n }\n const dailyUsage = usagePeriod ? totalUsage / usagePeriod : 0;\n return dailyUsage;\n }", "title": "" }, { "docid": "37a0d9f28ac9d241c501e8f58d11d373", "score": "0.5432739", "text": "function getTotal() {\n const { cart } = state;\n\n const res = cart.reduce((prev, product) => {\n return (prev + (product.price * product.count));\n }, 0);\n\n dispatch({\n type: 'TOTAL',\n payload: res\n });\n }", "title": "" }, { "docid": "98600bd89c13be0bb8c2b34fa2f08323", "score": "0.5419642", "text": "function getCall() {\n return callTot.toFixed(2);\n }", "title": "" }, { "docid": "f424d8a4a0200901971e63a828937b8a", "score": "0.5417567", "text": "function Calls() {\n return callTotal.toFixed(2);\n }", "title": "" }, { "docid": "7164c3fb7d82e9e506e8248deea0ed4b", "score": "0.54153883", "text": "function getTotalTime(songs) {\n var total = 0;\n for(var i = 0; i < songs.length; i++) {\n total += (parseInt(songs[i].length1) + parseInt(songs[i].length2));\n }\n return total;\n}", "title": "" }, { "docid": "843e3d1ccf58feb762b49a8719d44016", "score": "0.5409912", "text": "function calcTotalTotal() {\n totalTotal = 0;\n for (var i = 0; i < hours.length; i++) {\n totalTotal += combinedHourlyCookies[i];\n }\n}", "title": "" }, { "docid": "3ba847bb18b065832c6c54d82e5be350", "score": "0.5408442", "text": "function getTotalBalance (s, cb) {\n s.exchange.getBalance(s, function (err, balance) {\n if (err) {\n console.log(err)\n return cb(err)\n \n }\n \n var summary = {product: s.product_id, asset: balance.asset, currency: balance.currency}\n\n s.exchange.getQuote({product_id: s.product_id}, function (err, quote) {\n if (err) return cb(err)\n asset_value = n(balance.asset).multiply(quote.ask)\n summary.currency_value = n(balance.currency)\n //myLog(s.product_id + \": \" + n(balance.asset).format('0.00') + \" \" + quote.ask + \" Total: \" + asset_value.format('0.00'))\n summary.ask = quote.ask\n summary.asset_value = asset_value\n cb(summary)\n })\n })\n \n }", "title": "" }, { "docid": "91e69c7fece61feb6eab24427de2e236", "score": "0.540397", "text": "_getChangePercentPerMinute(currTrade, prevTrade) {\n this.logger.log(base_1.LogLevel.TRACE, `currQuote: ${currTrade.p} prevQuote: ${prevTrade.p} -- currQuote.t = ${currTrade.t} --- prevQuote.t = ${prevTrade.t}`);\n this.logger.log(base_1.LogLevel.TRACE, `Time difference in seconds: ${((currTrade.t / 1000) - (prevTrade.t / 1000))}`);\n let currTradePrice = new decimal_js_1.Decimal(currTrade.p);\n let prevTradePrice = new decimal_js_1.Decimal(prevTrade.p);\n // This gets the difference between the two quotes, and get's the % of that change of a share price. i.e (11 - 10) / 11 = 10%;\n let changePercent = new decimal_js_1.Decimal(currTradePrice.minus(prevTradePrice)).dividedBy(currTradePrice).times(100);\n console.log(`ChangePercent: ${changePercent.toString()}`);\n //Gets time difference in seconds, and translate to minutes\n let currTradeSeconds = new decimal_js_1.Decimal(currTrade.t).dividedBy(1000);\n let prevTradeSeconds = new decimal_js_1.Decimal(prevTrade.t).dividedBy(1000);\n let timeDifferenceInMinutes = new decimal_js_1.Decimal(new decimal_js_1.Decimal(currTradeSeconds).minus(prevTradeSeconds)).dividedBy(60);\n console.log(`TimeDifferenceInSeconds: ${timeDifferenceInMinutes.toString()}`);\n //Returns the rate of increase (as a percentage) per minute;\n return changePercent.dividedBy(timeDifferenceInMinutes).toNumber();\n }", "title": "" }, { "docid": "62fa1016d23d67dc8a473e7e8da66d0a", "score": "0.5401974", "text": "function timeToRead(array) {\n\t\tvar total = 0;\n\n\t\tarray.each(function() {\n\t\t\ttotal += Math.round(60*$(this).text().split(' ').length/200); // 200 = number of words per minute\n\t\t});\t\n\n\t\treturn total; \n\t}", "title": "" }, { "docid": "a6a84eda4351d9ecffa2d8da26e236e5", "score": "0.5397221", "text": "function TotalCount()\n{\n\tvar totalcount = 0;\n\tfor (var i in Cart) {\n\t totalcount += Cart[i].count;\n\t}\n\treturn totalcount;\n}", "title": "" }, { "docid": "cbb403de56400484db8246eeb1d232de", "score": "0.5388144", "text": "function getProgress() {\n if (_currSec < 0) {\n return 0;\n } else {\n return Math.floor((_currSec / _totalSecs) * 100);\n }\n }", "title": "" }, { "docid": "04a84abb29774ebc2c69e3b579151735", "score": "0.5387058", "text": "computeTotals()\n {\n if (this.file.transactions.length == 0)\n return\n\n this.totalSpendings = this.file.transactions\n .map(x => Math.min(x.amount, 0))\n .reduce((acc, x) => acc + x)\n\n this.totalIncome = this.file.transactions\n .map(x => Math.max(x.amount, 0))\n .reduce((acc, x) => acc + x)\n }", "title": "" }, { "docid": "aa329b83c4f875773f9bb79c4be10fdd", "score": "0.53807014", "text": "function rxFetchUserCount() {\n logger.info(`shortDelay: ${shortDelay} shortUpdateDuration:${shortUpdateDuration}`);\n rx.Observable.timer(shortDelay, shortUpdateDuration).flatMap(() => {\n logger.info(`[time task] rxFetchUserCount :::`);\n return user.getUserCount();\n }).subscribe(data => {\n logger.info(`[time task] fetch user count next ${JSON.stringify(data)}`);\n global.userCount = data;\n ServerConfig.userCount = data;\n }, error => {\n logger.error(`[time task] fetch user count error ${error}`);\n })\n}", "title": "" }, { "docid": "41279fb07f0511381c13d64a6e5d5ac2", "score": "0.5379493", "text": "async fetchTotalSupply() {\n return Number(200000000);\n }", "title": "" }, { "docid": "5531fa56ccdb812008258b531fff9df7", "score": "0.5377937", "text": "function calculateAcitivtyTotalAndUpdate(activityAmount) {\n let currentAmount = parseInt($(\"span#total-activities\").text());\n currentAmount += activityAmount;\n $(\"span#total-activities\").empty().text(currentAmount);\n\n }", "title": "" }, { "docid": "6783f6f199b8b28d16d0e61c108b8c3a", "score": "0.5376146", "text": "getTrafficPermissionTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficPermissions()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_PERMISSION_COUNT', count)\n }\n\n getItems()\n }", "title": "" }, { "docid": "cdd1ac22e7c2460c40d20da228974e34", "score": "0.53732014", "text": "calcTime(){\n const numIng=this.ingredients.length;//ingredients is an array \n const periods= Math.ceil(numIng/3);\n this.time=periods*15;\n }", "title": "" }, { "docid": "5045eec4fd37e7c101f17f73bd48ddc2", "score": "0.5360195", "text": "getCompletedPerUnit() {\n return this.recentProgress / this.windowLength;\n }", "title": "" }, { "docid": "4ceb8c7d26b0bc7403ce54249fbe4413", "score": "0.53541917", "text": "get progress() {\n if (this.loop) {\n const now = this.now();\n const ticks = this._clock.getTicksAtTime(now);\n return ((ticks - this._loopStart) / (this._loopEnd - this._loopStart));\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "86d31d19bd0fbb3cf86886ab47e86ed0", "score": "0.53532445", "text": "function totalAutoMoneyPerSecond() {\n MoneyForThisRound += MoneyPerSecondForThisRound / 10; //add money per sec to money for this round\n totalMoney += MoneyPerSecondForThisRound / 10;\n if(totalMPS < MoneyPerSecondForThisRound){\n totalMPS = MoneyPerSecondForThisRound;\n }\n displayMoney(); \n}", "title": "" }, { "docid": "b646ac510527a3ee9764c3b63b6be066", "score": "0.5353137", "text": "calculate() {\n if (this.store.length == 0) return 0;\n let intervals = [];\n let total = 0;\n for (var i = 1; i < this.store.length; i++) {\n let interval = this.store[i] - this.store[i - 1];\n if (isNaN(interval)) debugger;\n intervals.push(interval);\n total += interval;\n }\n\n if (this.store[0] < performance.now() - 5000) {\n // Haven't received any pulses for a while, reset\n this.store = [];\n return 0;\n }\n if (total == 0) return 0;\n return total / (this.store.length - 1);\n }", "title": "" }, { "docid": "7cce0e95a5b6336d88268bd488d40320", "score": "0.5352101", "text": "getTime() {\n return this.startTime ? Math.floor((Date.now() - this.startTime) / 1000) : 0;\n }", "title": "" }, { "docid": "d634e03d38dc932128bce7506e303078", "score": "0.5344748", "text": "function updateCostTotal() {\n console.log(\"Total purchases: $\" + sessionCostTotal.toFixed(2) + \"\\n\");\n}", "title": "" }, { "docid": "e90b9dbeeebb6fbcb73688e1f3c8731c", "score": "0.53437686", "text": "balance(){\nlet sum = 0\nfor (let i=0; i < this.transactions.length; i++) {\n sum = sum + this.transactions[i].amount;\n} return sum\n }", "title": "" }, { "docid": "ceb80c7e7d93848091560d21f864d500", "score": "0.5340982", "text": "function countSum() {\n\tvar sum = 0;\n\tvar timeWasted = JSON.parse(localStorage[\"timeWasted\"]);\n\t\tif (timeWasted !== undefined) {\n\t\t\tsum = timeWasted + UPDATE_SECONDS;\n\t\t\tlocalStorage[\"timeWasted\"] = JSON.stringify(sum);\n\t\t\tconsole.log('Total time wasted is ' + sum + ' seconds');\n\n\t\t\tvar target = JSON.parse(localStorage[\"target\"]);\n\t\t\tvar key = localStorage[\"keyVal\"];\n\t\t\tif (target !== 0 && !waiting && key !== \"Vaan\" && key !== \"Squall\") {\n\t\t\t\tcheckWasteTarget(sum, target);\n\t\t\t}\t\n\t\t\telse console.log(\"no target set\");\n\t\t\tif (waiting) console.log(\"waiting patiently\");\n\t\t}\n\t\telse console.log(\"PANIC: timeWasted undefined!!\");\n}", "title": "" }, { "docid": "d4231013aeec602e92fa12d458c4891d", "score": "0.5339338", "text": "function getSumTotalBytes () {\n return getActiveDownloads().reduce((acc, item) => acc + item.getTotalBytes(), 0)\n}", "title": "" }, { "docid": "6eb58432c2b3a9461299b552abc3524a", "score": "0.5329593", "text": "function timeRun() {\n return ((new Date()).getTime() - START_TIME)/1000;\n}", "title": "" }, { "docid": "77a4806c9f49e9a98b159d54c8ee0907", "score": "0.532318", "text": "function secondsCount(hours, minutes, seconds) {\n return hours * 3600 + minutes * 60 + seconds; \n}", "title": "" }, { "docid": "b49e6372aa83bcb4a3e841b8fc0f59a8", "score": "0.53153586", "text": "function averageTime(total, numberOfElements) {\t\t\n\t\t\tvar avg = ( (total / 1000) / numberOfElements);\n\t\t\treturn avg;\n\t\t}", "title": "" }, { "docid": "fda8da6e6309c75207aa02f71e1ae5ee", "score": "0.5314649", "text": "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}", "title": "" }, { "docid": "ff61e0e7a2ec0e2d9a41018552345a6b", "score": "0.52997106", "text": "get_txCount()\n {\n return this.liveFunc._txCount;\n }", "title": "" }, { "docid": "38a41793b5384cc123484b918174e63b", "score": "0.52995986", "text": "function Transaction() {\n\n function typeTranslate(type) {\n switch (type) {\n case 'in':\n return 'Incoming';\n case 'out':\n return 'Spent';\n case 'pending':\n return 'pending';\n case 'pool':\n return 'Pool';\n case 'failed':\n return 'Failed';\n default:\n throw new Error('Unknown transaction type: ' + type);\n }\n }\n\n function format(val) {\n return val < 10 ? '0' + val.toString() : val.toString();\n }\n\n function toTime(dt) {\n return [dt.getHours(), dt.getMinutes(), dt.getSeconds()].map(format).join(':');\n }\n\n function toDate(dt) {\n return [dt.getDate(), dt.getMonth() + 1, dt.getFullYear()].map(format).join('.');\n }\n\n this.generateTableRow = function (tx, price_usd) {\n\n var type = typeTranslate(tx.type);\n var dt = new Date(tx.timestamp * 1000);\n var date = toDate(dt);\n var time = toTime(dt);\n var amount = Math.round(tx.amount / 1000000000) / 1000;\n var usd = Math.round(amount * price_usd);\n var template = '\\n <td>' + type + '</td>\\n <td>\\n <div class=\"transactions-table__xmr bold\">' + amount + ' XMR</div>\\n <div class=\"transactions-table__usd\">' + usd + ' USD</div>\\n </td>\\n <td>' + tx.payment_id + '</td>\\n <td>' + date + '</td>\\n <td data-transaction-id=\"' + tx.txid + '\">\\n <div class=\"transactions-table__time\">' + time + '</div>\\n <div class=\"transactions-table__details\">details</div>\\n </td>\\n ';\n var tr = document.createElement('tr');\n tr.innerHTML = template;\n tr.className = \"tr-generated\";\n return tr;\n };\n\n this.compare = function (tx1, tx2) {\n return tx1.txid === tx2.txid;\n };\n\n this.datetime = function (tx) {\n var dt = new Date(tx.timestamp * 1000);\n return { date: toDate(dt), time: toTime(dt) };\n };\n\n // this.findRestorHeight = function(txs){\n // let out = txs\n // .filter((tx)=>{\n // return tx.type === 'out';\n // }).sort((tx1,tx2)=>{\n // return tx1.timestamp - tx2.timestamp;\n // });\n // };\n}", "title": "" }, { "docid": "a37410156a858112daec4fa865b83cbf", "score": "0.52925086", "text": "function get_trades_total() {\n let total_trades = stories_data[current_story]\n .filter(x => x.PartnerISO == \"WLD\")\n .map(x => parseInt(x.Value))\n .reduce((x,y) => x + y);\n return total_trades;\n}", "title": "" }, { "docid": "cd4210b925b02fd00f07eafacf45c648", "score": "0.52897894", "text": "function getTotal() {\n\t\treturn cart.reduce((current, next) => {\n\t\t\treturn current + next.price * next.count;\n\t\t}, 0);\n\t}", "title": "" }, { "docid": "623eac9adc83abda7e905a5eae8c5288", "score": "0.5283364", "text": "static getRefreshCost() {\n let notComplete = player.completedQuestList.filter((elem) => { return !elem(); }).length;\n return Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1));\n }", "title": "" }, { "docid": "41e6094323f64716e8ece286b4926615", "score": "0.52807975", "text": "function interval() {\n var requestsRemaining = Math.max(1, remaining);\n // Always underconsume, and leave a bit of a buffer by pretending the rate\n // is running out earlier.\n var timeTillReset = Math.max(1, (resetAt + 500) * 1000 - Date.now());\n return timeTillReset / requestsRemaining;\n}", "title": "" }, { "docid": "62d71a41dbe2e0b3787d65126c84750c", "score": "0.52765924", "text": "function getTotal(counters) {\n return counters.reduce((sum, c) => sum + c.state.count, 0);\n}", "title": "" }, { "docid": "3a749a5b253f5d7706b427d4db2e21de", "score": "0.5275327", "text": "incTotal(delta: number = 1) {\n const { total } = this.getState();\n this.setTotal(total + delta);\n }", "title": "" }, { "docid": "5d0635f2ca8596b05f944cb35bddf7a9", "score": "0.52736133", "text": "getDelta() {\n\t\tlet diff = 0;\n\t\tif ( this.autoStart && ! this.running ) {\n\t\t\tthis.start();\n\t\t\treturn 0;\n\t\t}\n\t\tif ( this.running ) {\n\t\t\tconst newTime = ( typeof performance === 'undefined' ? Date : performance ).now();\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\t\t\tthis.elapsedTime += diff;\n\t\t}\n\t\treturn diff;\n\t}", "title": "" }, { "docid": "2e96fe2e52e691cbe23370ee577978f7", "score": "0.527209", "text": "function countT() {\n ++Seconds;\n var hour = Math.floor(Seconds /3600);\n var minute = Math.floor((Seconds - hour*3600)/60);\n var xseconds = Seconds - (hour*3600 + minute*60);\n document.getElementById(\"time\").innerHTML = hour + \":\" + minute + \":\" + xseconds;\n}", "title": "" }, { "docid": "b5572e4c725b186505d817e3d65626a3", "score": "0.5265014", "text": "async function getTotalCount(){\n\n return dbConnection.collection(collection.log).aggregate(\n [\n {\n $group :\n {\n _id : \"$conversation_id\",\n conversations: { $push: \"$$ROOT\" }\n }\n },\n {$unwind: \"$conversations\"},\n {$group: {\n _id: \"$_id\",\n firstItem: { $first: \"$conversations\"},\n lastItem: { $last: \"$conversations\"},\n countItem: { \"$sum\": 1 }\n }},\n\n { \"$project\": {\n\n \"minutes\": {\n \"$divide\": [{ \"$subtract\": [ \"$lastItem.date\", \"$firstItem.date\" ] }, 1000*60]\n },\n \"counter\": \"$lastItem.context.system.dialog_request_counter\"\n },\n },\n {\n \"$match\": { \"counter\": {$gt: 1 } }\n },\n {\n $count: \"total_doc\"\n }\n ],\n {\n cursor: {\n batchSize: 10000\n },\n allowDiskUse: true,\n explain: false\n }, null)\n .toArray()\n .then((total_doc) => total_doc)\n}", "title": "" }, { "docid": "3d317d78d3f36f504b98674823e7ccc5", "score": "0.5262419", "text": "function transaction() {\n // * CURRENT transaction\n if (AccountType === \"CURRENT\") {\n Accounts[AccountID].current += TransactionValue;\n\n // * SAVINGS transaction\n } else if (AccountType === \"SAVINGS\") {\n // (1) - if withdrawal is made from SAVINGS but the required sum does not exist, only the total available amount is transferred\n // i.e. SAVINGS does not drop below 0\n if (TransactionValue < 0 && Accounts[AccountID].savings < Math.abs(TransactionValue)) {\n Accounts[AccountID].savings -= Accounts[AccountID].savings;\n // (2) - regular SAVINGS transaction\n } else {\n Accounts[AccountID].savings += TransactionValue;\n }\n }\n }", "title": "" }, { "docid": "6861ea9bd88e27d5cc674b4416767ad7", "score": "0.5262095", "text": "keskiarvo() {\n let sum = this.state.timer20.reduce((previous, current) => current += previous);\n let avg = sum / this.state.timer20.length;\n return avg\n }", "title": "" }, { "docid": "fa01e74e55d13b7a22bb5a3cbc23bcd7", "score": "0.5255594", "text": "get uptime() {\n return new Date().getTime() - this._startTime.getTime();\n }", "title": "" }, { "docid": "b059224c25a5a6cbf4b872e2498d9d48", "score": "0.52550054", "text": "total() {\n const rawTotal = this.rawTotal();\n const appliedDiscounts = this.getAppliedDiscounts();\n const discountTotal = this.discountSrv.total(appliedDiscounts);\n return rawTotal - discountTotal;\n }", "title": "" }, { "docid": "ccc174833b8dd788216bdce0ce33db10", "score": "0.525456", "text": "function ms_seconds(x){ return x / 1000;}", "title": "" }, { "docid": "25ef623fb553561a6013872a88b62539", "score": "0.5248324", "text": "updateTCUs() {\r\n this.calculateTCUs(-1, -1);\r\n }", "title": "" }, { "docid": "31324bdfad6067521aee3b359fc371ee", "score": "0.5246273", "text": "countBalance() {\n\t\tvar bal = 0;\n\t\tfor(var i=0;i<this.coins.length;i++) {\n\t\t\tbal += this.coins[i].value;\n\t\t}\n\t\tthis.balance = bal;\n\t}", "title": "" }, { "docid": "b86c898d52ceecdc4d9e65b8576cdefe", "score": "0.5242979", "text": "function getTotalSeconds(time) {\n var parts = time.split(':');\n return ((parseInt(parts[0]) * 60) + parseInt(parts[1]));\n }", "title": "" }, { "docid": "8e4a5ca49e642c090a2db98361703475", "score": "0.52420235", "text": "function getTotalMoney() {\n return Purchase.find().then(function(purchases) {\n let total = 0;\n for (i=0; i < purchases.length; i++) {\n total += purchases[i].cost;\n }\n return total;\n })\n}", "title": "" }, { "docid": "b6ba376161e9656c3cc09e89423ed655", "score": "0.5238782", "text": "async function numberkmsPerc() {\n let kms = 0;\n const response = await fetch(`${urlBaseSQL}/read/user/vehicles/${idUser}`, {\n headers: {\n \"Authorization\": auth\n }\n })\n if (response.status == 200) {\n const veicules = await response.json();\n for (const veicule of veicules) {\n const response2 = await fetch(`${urlBaseSQL}/trip/read/${veicule.id}`, {\n headers: {\n 'Authorization': auth\n }\n });\n if (response2.status == 200) {\n const trips = await response2.json();\n for (const trip of trips) {\n console.log(typeof trip.distance);\n kms += (trip.distance / 1000);\n }\n }\n }\n }\n numeroKmsPerc.innerHTML = parseFloat(Math.round(kms * 100) / 100);\n }", "title": "" } ]
b36de9126a7f60955d29bc72037d1007
Function for when a key is inputted into the search bar
[ { "docid": "68d0ad5c0390c4c22833c61e1ccc157d", "score": "0.6998105", "text": "function onKeyPressed () {\n\n // Gets the current text in the space bar\n const currInput = searchBar.firstElementChild.value;\n\n // Gets all matching links\n const nameMatches = findNameMatches(currInput);\n\n // Hides extra buttons\n hideLinks(nameMatches.length);\n\n // Sets the linksToDisplay to the matches for output\n linksToDisplay = nameMatches;\n\n // Shows first page of output\n placePaginatedLinks(1, linksToDisplay);\n\n}", "title": "" } ]
[ { "docid": "c73de8ef63d9ddbb0f2324a6d13f4f4c", "score": "0.78915155", "text": "function pressKey(event){\n var enterKey=event.keyCode;\n if(enterKey===13){\n if($(\"#searchBox\").val()==\"\"){\n event.preventDefault();\n $(\"#searchResults\").html(\"Type something first you silly duck.\");\n }else{\n event.preventDefault();\n findSearch();\n }}}", "title": "" }, { "docid": "ddb4747f4a239656f93c6fdf6789e7f1", "score": "0.7845381", "text": "function search_keypress(evt) {\n}", "title": "" }, { "docid": "124f89a2f1da08937790583b1adef361", "score": "0.7623275", "text": "handleKeyPressed(event) {\n if (event.keyCode)\n this.search()\n}", "title": "" }, { "docid": "20be29753db853df419f15c1cf79bceb", "score": "0.75930375", "text": "searchHandler( event ) {\n const IntrokeyValue = \"Enter\"; \n \n if( event.key===IntrokeyValue ) {\n this.doSearch(event.target.value.trim());\n }\n }", "title": "" }, { "docid": "2c9429d2a1fa80570bae75f00e848711", "score": "0.7531662", "text": "function setSearch() {\r\n\tconst btn=document.querySelector('#searchbtn');\r\n\tbtn.addEventListener('click', searchCraft);\r\n\tconst bar = document.querySelector('#searchbar');\r\n\tbar.addEventListener(\"keyup\", function(event) {\r\n if (event.key === \"Enter\"|event.keyCode === 13) {\r\n searchCraft(event);\r\n\t }\r\n\t});\r\n}", "title": "" }, { "docid": "f051a237e8acabe4f81ad8b4f852e4d8", "score": "0.75146663", "text": "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "title": "" }, { "docid": "5711cc7d7ae522df5bf304da212cb208", "score": "0.7470487", "text": "function onSearchKeyPress(e) {\n switch (e.keyCode) {\n case 38:\n // up arrow\n updateSuggestion(currentSuggestion - 1)\n break\n case 40:\n // down arrow\n updateSuggestion(currentSuggestion + 1)\n break\n case 13:\n // enter. it'll submit the form, but let's unfocus the text box first.\n inputElmt.focus()\n break\n default:\n nextSearch = searchBox.value\n var searchResults = viewer.runSearch(nextSearch, true)\n searchSuggestions.innerHTML = \"\"\n currentSuggestion = -1\n suggestionsCount = 0\n addWordWheelResults(searchResults.front)\n addWordWheelResults(searchResults.rest)\n }\n }", "title": "" }, { "docid": "867e4861971386f680aa5acd67caaf7c", "score": "0.74319905", "text": "function searchEnter(event) {\n if (event.key === 'Enter'){\n search()\n }\n}", "title": "" }, { "docid": "e3f3f44f735e635256870b1ab7b83322", "score": "0.7395491", "text": "function searchOnKeyUp(e) {\n // Filter out up, down, esc keys\n const keyCode = e.keyCode;\n const cannotBe = [40, 38, 27];\n const isSearchBar = e.target.id === \"search-bar\";\n const keyIsNotWrong = !cannotBe.includes(keyCode);\n if (isSearchBar && keyIsNotWrong) {\n // Try to run a search\n runSearch(e);\n }\n}", "title": "" }, { "docid": "56e7048f876db188ce9cf7af24e84705", "score": "0.73912394", "text": "function respondKeyInput(e)\n{\n if (e.keyCode == \"13\")\n searchSite();\n}", "title": "" }, { "docid": "4fd1ba2864bc89362cb0097debf7cfe6", "score": "0.7389496", "text": "function handleEnterKeyDownInSearchBox() {\n var value = $(idSearchBoxJQ).val();\n\n var item = isValueAMatchInLookupItems(value);\n\n //If it is match we select the item\n if (item !== null) {\n selectItem(item);\n\n } else {\n if (useAutoCompleteOnKeyPress == false) {\n populateResults();\n }\n\n }\n\n\n }", "title": "" }, { "docid": "c15a13ebc4748ff76fc13abed4d7168f", "score": "0.73700935", "text": "search(keyCode){\n if( !keyCode )\n return;\n \n if( keyCode === 13 && this.inputString){\n this.setSearchBarPos();\n this.setState({\n googleSearchQuery : this.inputString,\n uploadedData : '',\n fileName : '',\n errorMsg : '',\n });\n }\n\n }", "title": "" }, { "docid": "2d0464ad7964bac39741fb9f993229a1", "score": "0.7352557", "text": "function enterSearch(event) {\n if (event.keyCode == 13) {\n Search();\n }\n}", "title": "" }, { "docid": "54a19cbe1405225685992d7d48c649c7", "score": "0.7344786", "text": "function keyboardHandler(e) {\n const key = String.fromCharCode( e.which || e.keyCode ).toLowerCase();\n //console.log( \"[%s] pressed\", key );\n let query = document.getElementById( \"searchBox\" ).value;\n query = query.replace( /[^0-9a-z ]+/g, \"\" )\n //console.log( \"query=[%s]\", query );\n searchElements( query.split( \" \" ), recipeIndex );\n}", "title": "" }, { "docid": "63acd959cf104c9f3a56f4e331812aef", "score": "0.7320349", "text": "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 }", "title": "" }, { "docid": "2073287717f4c8b76e03a4c9db662e6d", "score": "0.7307196", "text": "function searchthis(e){\n $.search.value = \"keyword to search\";\n $.search.blur();\n focused = false;\n needclear = true;\n}", "title": "" }, { "docid": "69e0c1ea900bfab8e789ba937e18b6af", "score": "0.7296982", "text": "function onkeyForSearchInput(event)\n{\n //.charCode or .keyCode ??\n if(event.keyCode == 13) //ENTER key\n {\n //trigger already registered \"click\" handler\n document.getElementById('search-button').click();\n }\n}", "title": "" }, { "docid": "7295fefa87b8f12e4f70ad606dccfb5a", "score": "0.72633654", "text": "function keypressHandler(event) {\n\n if ((event.keyCode == '13') || (event.keyCode == '10')) {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString)\n }\n }", "title": "" }, { "docid": "7eb31bb6708159b13b40d9e4b81628b6", "score": "0.72619545", "text": "function searchInput(event) {\n console.log(\"searchInput() called\");\n var searchString = document.getElementById(\"search-bar\").value;\n console.log(searchString);\n // If there was a key press but the input is empty, return\n if (!searchString) { \n return false;\n }\n // If any key other than enter is pressed, autocomplete word\n if (event.keyCode != ENTER_KEY) {\n autocompleteSearch(searchString);\n } else { // If enter is pressed, save user's input and redirect page\n console.log(searchString);\n localStorage.setItem(\"galleryPageSearchTag\", searchString);\n localStorage.setItem(\"galleryPageName\", \"'\" + searchString + \"'\");\n window.location.assign(\"businessgallery.html\");\n }\n return false;\n}", "title": "" }, { "docid": "74c4efdfc763791794e7015687d1f61a", "score": "0.7238815", "text": "function getSearchKey( event ) {\n\tif(!event) return;\n\tvar regex = new RegExp(\"^[a-zA-Z0-9]+$\");\n var key = String.fromCharCode(!(event.charCode) ? event.which : event.charCode);\n\tconsole.log('GOT KEY', key);\n if (!regex.test(key)) {\n getAutosuggesionHeader( '#form_topsearch', event );\n\t}\n\t\n\t getAutosuggesionHeader( '#form_topsearch', event, key );\n\t//func_call( '#form_topsearch', event, key );\n}", "title": "" }, { "docid": "0df6f4cbd7e3c91ac7d6c2b3088ac9c0", "score": "0.723327", "text": "function handleKeyPress(e, val) {\n console.log(e.keyCode);\n if(e.keyCode === 13)\n {\n handleSearch();\n clearSearch();\n return false;\n }\n else\n {\n liveSearchBar(val);\n return true;\n }\n}", "title": "" }, { "docid": "fbd85df90f02602731c1c5d8677066ee", "score": "0.7223224", "text": "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}", "title": "" }, { "docid": "c59cc00ace08009f56fe343d52745dc3", "score": "0.7208068", "text": "handleKeyDown(event) {\n if (event.keyCode == 13 && this.state.searchTerm) {\n this.handleSearch();\n }\n }", "title": "" }, { "docid": "1c26460fb4eeff3f4ccd6c934d9a0fc1", "score": "0.7185467", "text": "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}", "title": "" }, { "docid": "43cf64a7a43d2ad5320c0be94b61a735", "score": "0.7178603", "text": "function performSearchWhenEnter(event){\n if(event.keyCode == \"13\"){\n performSearch();\n }\n}", "title": "" }, { "docid": "34dbdf673b129c380ed09b01cf0d8cc3", "score": "0.71588933", "text": "function handleSearchKeystroke(event) {\r\n searchText = document.getElementById('search').value.toLowerCase().trim();\r\n let matchingBooks = allBooks.filter(book => book.title.toLowerCase().includes(searchText) || book.author.toLowerCase().includes(searchText));\r\n removeBooksFromDOM();\r\n matchingBooks.forEach(function (book) {\r\n insertNewBook(book.id, book.title, book.author, book.subject, book.photoURL, book.vendorURL, book.favorite);\r\n });\r\n applyEventListeners();\r\n}", "title": "" }, { "docid": "d7af2c129e5fef6ff9996a9cf8229aa7", "score": "0.7107335", "text": "handleKeyPress(e){\n\n if (e.charCode===13)//enter\n this.doSearch();\n\n }", "title": "" }, { "docid": "054e7953202f36efbac51c3e559dd0d5", "score": "0.70850873", "text": "function setQuery(event) { \r\n if(event.keyCode == 13) { //13 è l'unicode che corrisponde al tasto INVIO\r\n getResults(srchBar.value); //in input la città e in output le informazioni\r\n srchBar.value = \"\";\r\n circleBtnSearch.setAttribute(\"class\", \"not-active\");\r\n srchbar.hidden = !srchbar.hidden;\r\n }\r\n}", "title": "" }, { "docid": "77d509b65220f1fae91f7ff327af3e34", "score": "0.70820063", "text": "function manualSearchSubmit_keydown_listener(event) {if (event.keyCode == 13) {manualSearchSubmit_listener();}}", "title": "" }, { "docid": "83233b006923cc0ffde7a3b808d5b829", "score": "0.7080805", "text": "function setQuery(event){ // If enter is press store value in getResults()\n if(event.keyCode == 13){\n getResults(searchBox.value);\n }\n}", "title": "" }, { "docid": "8036ee9b80b73d9e4f4ef2a3346b2c50", "score": "0.7075339", "text": "_handleEnter() {\n const properties = virtualKeyboard.getActiveTags()\n const character = properties.text\n if (character === KEYBOARD.setup.deleteSymbol) {\n this._handleBack()\n return\n }\n searchBox.addCharacter(character)\n this.tag('SearchText').text.text = searchBox.getText()\n }", "title": "" }, { "docid": "851ade3d4848bf426fa3c4d677acf8c2", "score": "0.7073131", "text": "function userSearch(e) {\n if (e.keyCode == \"13\") {\n search();\n } else if (e.type == \"click\") {\n search();\n };\n\n function search() {\n\n const searchValue = $(\"#inputValue\").val().trim();\n searchWeather(searchValue);\n searchHistoryBtn(searchValue);\n\n // -------------------------- Save to Local Storage ---------------------------------------\n const userInput = $(this).siblings(\"#inputValue\").val();\n localStorage.setItem(searchValue, userInput);\n\n };\n\n }", "title": "" }, { "docid": "f9de09df9ce2b36d67ea625125d8a9fe", "score": "0.7066924", "text": "function navbarSearchBoxOnClick(e) {\n console.log(e.keyCode);\n if (e.keyCode == 13) {\n //searchPostBy('fromSearchButtonType','fromSearchButtonUsername');\n searchPostBy('fromSearchButtonTypeMobile', 'fromSearchButtonUsername');\n }\n}", "title": "" }, { "docid": "68e50410af8e5bb5903496c45da0ed07", "score": "0.70450175", "text": "onKeyUp(e) {\n if (e.keyCode === 13) {\n this.search();\n }\n }", "title": "" }, { "docid": "9f32896f246c532be3e3792fff1ff063", "score": "0.7038147", "text": "function onclickForSearchButton(event)\n{\n //console.log(event);\n \n var q = document.getElementById('search-query').value; //escape here?\n \n //some kanji searches are going to be legitimately only one char.\n //we need a trim() function instead...\n if(q.length < 1)\n {\n return;\n }\n \n buttonSpinnerVisible(true);\n \n var matches = doEdictQueryOn(q);\n}", "title": "" }, { "docid": "69c3f756c77a1533f3e301a33856ae05", "score": "0.70269287", "text": "function searchCall() {\n $('#searchButton').click(function () {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString);\n });\n\n $('#searchInput').keypress(keypressHandler);\n }", "title": "" }, { "docid": "4b3150fea5e17d58eac04f476099d217", "score": "0.7026004", "text": "function setQuery(event) {\n if (event.keyCode === 13) {\n getResults(searchbox.value);\n }\n}", "title": "" }, { "docid": "3b7d8af0a23d7248ca7d706bd722a1b5", "score": "0.7022844", "text": "function keyListener (e) {\n var nomod = !(e.ctrlKey || e.shiftKey || e.altKey || e.metaKey);\n var empty = search.value.length === 0;\n if (nomod) {\n if (e.keyCode === 40) { // Down.\n nextEntry();\n e.preventDefault(); // Don't change the search cursor position.\n } else if (e.keyCode === 38) { // Up.\n prevEntry();\n e.preventDefault(); // Don't change the search cursor position.\n } else if (e.keyCode === 13 || (empty && e.keyCode === 39)) {\n // Enter or (Empty and Right).\n window.location = slots[pointer].firstElementChild.href;\n } else if (empty && (e.keyCode === 8 || e.keyCode === 37)) {\n // Empty and (Backspace or Left).\n var loc = window.location;\n window.location = loc.protocol + '//' + loc.host +\n loc.pathname.replace(/\\/[^\\/]+[\\/]*$/,'/') + loc.search;\n }\n\n // Additional keys when the search widget is not focused.\n if (document.activeElement !== search) {\n if (e.keyCode === 74) { // J (same as down).\n nextEntry();\n } else if (e.keyCode === 75) { // K (same as up).\n prevEntry();\n } else if (e.keyCode === 88) { // X (click).\n slots[pointer].click();\n } else if (e.keyCode === 191) { // /.\n search.focus();\n e.preventDefault(); // Don't input it in the search bar.\n }\n } else { // The search widget is focused.\n if (e.keyCode === 27) { // ESC.\n search.blur();\n }\n }\n }\n}", "title": "" }, { "docid": "aaa9eb9da66de87da12a882ad1d247af", "score": "0.70213777", "text": "function handleKeyPress(e, form) {\n\t\tvar key = e.keyCode || e.which;\n\t\tif (key == 13) {\n\t\t\taddSearchResults(document.getElementById('searchText1').value.toLowerCase(),true);\n\t\t}\n\t}", "title": "" }, { "docid": "cdfcf29674a36ca3829e5b5269a55926", "score": "0.70129234", "text": "handleSearchKeyChange(searchKey) { \n this.searchKey = searchKey;\n }", "title": "" }, { "docid": "b6fee25495990c417a3ded01984f4eab", "score": "0.7006823", "text": "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "title": "" }, { "docid": "bffadfed722e8d2eb7cd86a89bc39cf8", "score": "0.70026827", "text": "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "title": "" }, { "docid": "3e970891c91adcc771e372fda2127770", "score": "0.7001134", "text": "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}", "title": "" }, { "docid": "34128aed8f90a36c8fb13b7b1862eda3", "score": "0.6998271", "text": "function searchKeyPress(e)\n{\n //look for window.event in case event isn't passed in\n e = e || window.event;\n \n //uncomment if more keycode numbers are needed\n //$(\"#response\").html(e.keyCode); return false;\n \n if (e.keyCode == 13) { //return: submit textbox\n submit();\n return false;\n } else if (e.keyCode == 43) { //+: show url\n $(\"#response\").html(images[i][j]);\n return false;\n } else if (e.keyCode == 61) { //=: show answer\n answer();\n return false;\n } else if (e.keyCode == 45) { //-: new image\n newImage();\n return false;\n } else if (e.keyCode == 95) { //_: show list\n newList();\n return false;\n } else if (e.keyCode == 124) { //|: remove url from list\n removeItem();\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e2fa9078dafa260feb2ebce96eefceff", "score": "0.6992442", "text": "function keyUpHandler(event) {\n //If the search text box has the focus\n var isSearchBoxFocus = false;\n\n isSearchBoxFocus = isFocusElement(idSearchBox);\n\n if (isSearchBoxFocus) {\n\n if (hasSearchBoxValueChanged())\n startTimer();\n }\n }", "title": "" }, { "docid": "bf64e371c9166585cc2ac83a4d6d8555", "score": "0.6986733", "text": "function searchEventListener() {\n\t$(\"#searchbtn\").click(function() {\n\t\tif ($(\"#searchbox\").val() != '') {\n\t\t\tsearchNewspapers($(\"#searchbox\").val());\n\t\t}\n\t});\n}", "title": "" }, { "docid": "359655735b62869aa942578dc63407a3", "score": "0.6986258", "text": "function submit_search(event) {\n if (event.keyCode == 13) {\n $('#we-yxname-search').click();\n }\n}", "title": "" }, { "docid": "5a99c2dd9b02f508f98b10e7c1059667", "score": "0.6967213", "text": "function search_af(event)\n{\n var keycode = (event.keyCode ? event.keyCode : event.which); \n if(keycode == '13')\n { \n $(\"#pagina_registros\").val(1);\n search_and_list_act_fijo('lista_act_fijo');\n } \n \n}", "title": "" }, { "docid": "1ab9ca900265ba9f03631f12d7f3df3f", "score": "0.69633234", "text": "async function trigSearch(e) {\n if (e.code == \"Space\" && e.shiftKey) {\n toggleSearch();\n };\n}", "title": "" }, { "docid": "9d3fe755ce84bbf2c7612522cf7273a0", "score": "0.6961942", "text": "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "title": "" }, { "docid": "4bd7fe6352b6ce72c068d7ed2306bbfa", "score": "0.69403523", "text": "searchEnter(event){\n \t\tif (event.which === 13){\n \t\t\tthis.searchMovie();\n \t\t};\n }", "title": "" }, { "docid": "af344cada5e893e23a439deaae8926e9", "score": "0.6936827", "text": "function search_proyecto(event)\n{\n var keycode = (event.keyCode ? event.keyCode : event.which); \n if(keycode == '13'){ \n $(\"#pagina_registros\").val(1);\n search_and_list_proyecto('lista_proyecto');\n } \n \n}", "title": "" }, { "docid": "186c533be70b6fba27f56f14a38fd260", "score": "0.6933911", "text": "function searchThis(e) {\n $('#searchbox').val($(e).text());\n FJS.filter();\n}", "title": "" }, { "docid": "e4057fcba634a0ea06db80605546571e", "score": "0.69297385", "text": "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}", "title": "" }, { "docid": "c599e068aa001e92867cc5c6f29256fa", "score": "0.69182247", "text": "keyboardHandler(e, component) {\n if (event.metaKey && event.which === 191) { // Cmd + /\n component.initSearch();\n } else {\n switch(e.keyCode) {\n case 27: // ESC\n component.closeSearch();\n break;\n\n case 40: // DOWN\n component.navigateDown(e);\n break;\n\n case 38: // UP\n component.navigateUp(e);\n break;\n }\n }\n }", "title": "" }, { "docid": "832f2e41e2d439f17a142dcbec7afc4a", "score": "0.6903365", "text": "function doneTyping() {\n let keyword = document.getElementById(\"search_input\").value;\n search(keyword);\n }", "title": "" }, { "docid": "e368c8d5d25eafdc7d5582bd6263f0c8", "score": "0.68954265", "text": "function searchKeyPress(e) {\n e = e || window.event;\n if (e.keyCode == 13) {\n $(\"#input_submit\").click();\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "6d671356320d93cd87a31a75d0760578", "score": "0.68940955", "text": "function searchOnKeyDown(e) {\n const keyCode = e.keyCode;\n const parent = e.target.parentElement;\n const isSearchBar = e.target.id === \"search-bar\";\n const isSearchResult = parent ? parent.id.startsWith(\"result-\") : false;\n const isSearchBarOrResult = isSearchBar || isSearchResult;\n\n if (keyCode === 40 && isSearchBarOrResult) {\n // On 'down', try to navigate down the search results\n e.preventDefault();\n e.stopPropagation();\n selectDown(e);\n } else if (keyCode === 38 && isSearchBarOrResult) {\n // On 'up', try to navigate up the search results\n e.preventDefault();\n e.stopPropagation();\n selectUp(e);\n } else if (keyCode === 27 && isSearchBarOrResult) {\n // On 'ESC', close the search dropdown\n e.preventDefault();\n e.stopPropagation();\n closeDropdownSearch(e);\n }\n}", "title": "" }, { "docid": "ee4d3e0d34975cdea6c465b6f48d6cdb", "score": "0.68917894", "text": "function handleKeyUp(event) {\n const searchText = event.target.value;\n Store.updateSearchText(searchText);\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.68782777", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.68782777", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "173f02680d2bb83b9236b2fc3e16815d", "score": "0.68753463", "text": "function doc_keypress(event) {\r\n if(event.keyCode === 13) {\r\n searchCity(); \r\n }\r\n}", "title": "" }, { "docid": "54a7ff1987eddfecf105527c17532086", "score": "0.68697184", "text": "function start() {\r\n document.getElementById(\"search\").addEventListener(\"keypress\", searchvalue);\r\n retreive();\r\n}", "title": "" }, { "docid": "8577b7a0722df8da0d9e2cd81072e128", "score": "0.6867433", "text": "function setSearchEnterPress(searchUrl) {\n $('#search-input').keydown(function (e){\n if(e.keyCode == 13){\n var searchInput = $(this).val();\n if (!searchInput == \"\") {\n $(\"#result-panels-wrapper\").html(\"\");\n getSearchData(searchUrl, searchInput);\n }\n }\n });\n}", "title": "" }, { "docid": "4d9b40725096d5e43c57bf47d7e46c98", "score": "0.68670267", "text": "function focusSearchBoxListener(){ $('#query').val('').focus() }", "title": "" }, { "docid": "f89c5afa0d214b0237b2a97fbd5af223", "score": "0.68543404", "text": "function fileSearch_kp(e){\n e = e || window.event;\n\n // If there are any modifiers or if we're already entering text into\n // another input field elsewhere, then do nothing\n if(e.ctrlKey || e.altKey || e.metaKey || e.target.tagName === 'INPUT') return true;\n\n // Grab the typed character, test it, and show the box if appropriate\n var theChar = String.fromCharCode(e.which);\n if(/[a-zA-Z0-9\\.\\/\\_\\-]/.test(theChar)) showSearchBox(theChar);\n }", "title": "" }, { "docid": "629faca55b0d172767d1974bb399f882", "score": "0.68521106", "text": "function configureSearchInput()\n{\n document.getElementById('search-query').\n addEventListener('keypress', onkeyForSearchInput, false);\n}", "title": "" }, { "docid": "0e24bad83ae296300ff84b2d8a3bc1f6", "score": "0.68519694", "text": "function setQuery(e) {\n if (e.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "title": "" }, { "docid": "5503a8ff40235f983bc6a54b8fea66ff", "score": "0.6839988", "text": "function keyDownHandler(event) {\n //If the search text box has the focus\n var isSearchBoxFocus = false;\n\n isSearchBoxFocus = isFocusElement(idSearchBox);\n\n if (isSearchBoxFocus) {\n stopTimer();\n }\n\n\n switch (event.which) {\n\n //enter\n case 13:\n if (isSearchBoxFocus) {\n handleEnterKeyDownInSearchBox();\n }\n\n break;\n\n //space\n case 32:\n if (!isSearchBoxFocus) {\n var activeItem = $(idDivLookupItemsJQ + \" .ds-nav-lu-results-activeitem .ds-nav-lu-results-li-item-name\");\n selectItem(activeItem);\n }\n\n break;\n\n case 37: // left\n if (!isSearchBoxFocus) {\n navigateBack();\n }\n\n break;\n\n case 38: // up\n traverseList(false);\n scrollActiveItem();\n break;\n\n case 39: // right\n if (!isSearchBoxFocus) {\n\n var activeItem = $(idDivLookupItemsJQ + \" .ds-nav-lu-results-activeitem .ds-nav-lu-results-li-item-name\");\n if (activeItem.length > 0) {\n navigateTo(activeItem.eq(0));\n }\n }\n\n\n break;\n\n case 40: // down\n traverseList(true);\n scrollActiveItem();\n break;\n\n default: return; // exit this handler for other keys\n }\n\n }", "title": "" }, { "docid": "61d44a6b0af66c476d33040647174a57", "score": "0.68338376", "text": "function keyDown() {\n if (event.keyCode == 13) {\n document.getElementById('btnSearch').click();\n }\n }", "title": "" }, { "docid": "01dbcb553420cb8c92adfd75dbd14f6a", "score": "0.68274087", "text": "function handleKeyUp() {\n try {\n messageList.filterByMessage(inputSearch.value);\n }\n catch (e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "b8fa33153abe1720cf083ebd23ab8cc3", "score": "0.68264276", "text": "function start(){\n document.getElementById(\"search\").addEventListener('keypress',searchvalue);\n retreive();\n}", "title": "" }, { "docid": "491a1649f62a8c33ddf0141f89b81fc1", "score": "0.6816793", "text": "handlePressEnter(event) {\n if (event.keyCode === 13)\n this.search();\n}", "title": "" }, { "docid": "34c360317b931a197627b4fe4b98ff49", "score": "0.68079984", "text": "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 }", "title": "" }, { "docid": "34c360317b931a197627b4fe4b98ff49", "score": "0.68079984", "text": "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 }", "title": "" }, { "docid": "34c360317b931a197627b4fe4b98ff49", "score": "0.68079984", "text": "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 }", "title": "" }, { "docid": "ee9ae7bbdc92b10ddcb8a95caaae7c33", "score": "0.680636", "text": "function checkSearchBar(){\n var searchBar = document.getElementById(\"search-large\").value;\n //if yes run search function.\n if (searchBar != \"\"){\n getSearchResults();\n console.log(\"YES\")\n }\n //if no don't run search functions.\n else{\n alert(\"Please enter a search query\")\n console.log(\"NO\");\n }\n}", "title": "" }, { "docid": "199343cc53e1b488679bf72a4d6334fd", "score": "0.68056375", "text": "handleKeyPress(e) {\n if (e.keyCode === 9 || e.keyCode === 13)\n this.submitSearch();\n }", "title": "" }, { "docid": "809a3ee805fcf2f18ef1fa3c3ad03b42", "score": "0.68047935", "text": "onTextInput(event) {\r\n this.searchValue = event.target.value;\r\n if (this.searchValue.trim().length >= 1) {\r\n this.showSearchBoxList = true;\r\n const apiEndpoint = `${process.env.GOOGLE_PLACE_API_URL}${this.apiKey}&types=(${this.searchType})&language=${dxp.i18n.languages[0]}&input=${this.searchValue}`;\r\n this.getData(apiEndpoint).then(async (data) => {\r\n if (data) {\r\n this.filterItemsJson = data;\r\n if (this.filterItemsJson['predictions']) {\r\n this.filterItemsJson = this.filterItemsJson['predictions'];\r\n }\r\n if (this.filterItemsJson.length) {\r\n this.responseFlag = true;\r\n }\r\n }\r\n });\r\n }\r\n if (this.showSearchBoxList === false) {\r\n this.showSearchBoxList = !this.showSearchBoxList;\r\n }\r\n }", "title": "" }, { "docid": "c6a68b9b3f21ff85d8b4f4ae99d6d959", "score": "0.67927617", "text": "pressSearch(e){\n\t if (e.keyCode === 13) {\n\t \tthis.searchName(e.target.value);\n\t } else {\n\t \tthis.setState({username: e.target.value})\n\t }\n\t}", "title": "" }, { "docid": "d00e7d0da5c944131dafbca9551935f9", "score": "0.67898643", "text": "function testMedKey() {\n var kc = event.keyCode;\n if (kc == 13) {\n doMedSearch();\n return;\n } else if (kc > 31) {\n clearMedResults();\n }\n}", "title": "" }, { "docid": "f89acb16eeb723f72ee83e9a3169c0ea", "score": "0.6789848", "text": "searchinputCallback(event) {\n const inputVal = this.locationInput;\n if (inputVal) {\n this.getListQuery(inputVal);\n }\n else {\n this.queryItems = [];\n if (this.userSelectedOption) {\n this.userQuerySubmit('false');\n }\n this.userSelectedOption = '';\n if (this.settings.showRecentSearch) {\n this.showRecentSearch();\n }\n else {\n this.dropdownOpen = false;\n }\n }\n }", "title": "" }, { "docid": "747627a42b39017258116a022ad5ca86", "score": "0.6789405", "text": "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 }", "title": "" }, { "docid": "8b9dfefbf30a9139c3d6a1d8badf4311", "score": "0.6780277", "text": "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}", "title": "" }, { "docid": "da9c9d9e19567ce17ca4b0ef8d74a908", "score": "0.67717636", "text": "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "title": "" }, { "docid": "e8a1392a96988f827c24ccbf9e62bbf0", "score": "0.676779", "text": "function search() {\n\t\n}", "title": "" }, { "docid": "106e51e66addd89d3584e3037e5ae08a", "score": "0.67433274", "text": "function search_para_grupo(event)\n{\n var keycode = (event.keyCode ? event.keyCode : event.which); \n if(keycode == '13'){ \n $(\"#pagina\").val(1);\n search_and_list_grupo_serv();\n } \n \n}", "title": "" }, { "docid": "aa340061fc47cd84a8bc915482fa1ad1", "score": "0.6742745", "text": "function initSearch() {\n var searchInput=$(\"#search-input\");\n var magnifier=$(\"#magnifier\");\n var filmWrapper=$(\".film-wrapper\");\n var seriesWrapper=$(\".series-wrapper\");\n var myQuery;\n\n searchInput.on('keydown',function(e) {\n if (e.which == 13) {\n myQuery=searchInput.val();\n searchApi(myQuery);\n searchInput.val(\"\");\n }\n });\n\n magnifier.click(function() {\n myQuery=searchInput.val();\n searchApi(myQuery);\n searchInput.val(\"\");\n });\n}", "title": "" }, { "docid": "9d96ec57a41523ee7d0d672671c76690", "score": "0.67413926", "text": "function Search() {\n switch (userInput) {\n case \"spotify-this-song\":\n spotifyThisSong();\n break;\n case \"movie-this\":\n movieThis();\n break;\n case \"concert-this\":\n concertThis();\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n }\n\n}", "title": "" }, { "docid": "4e37cff906643431ab0244a9989c2fad", "score": "0.67395484", "text": "search(value) {\n this.ux.input.value = value;\n this.ux.input.focus();\n this.onInputChanged();\n }", "title": "" }, { "docid": "dc70503332761e8518269192adc6b9b2", "score": "0.673914", "text": "onKeyPress(event) {\n if (event.key === \"Enter\"){\n this.props.callBack(this.state.text)\n store.searchTerm = this.state.text\n }\n }", "title": "" }, { "docid": "3bb8a4c176b2cd7e15154916410a2a30", "score": "0.6734462", "text": "function getInput(event){\n event.preventDefault();\n var searchQuery;\n searchQuery = ($(searchBox).val());\n console.log(searchQuery);\n var ytUrl =`https://youtube.googleapis.com/youtube/v3/search?type=video&part=snippet&maxResults=25&q=${searchQuery}\\\\+'+travel'+'&key=AIzaSyDD9MbkIVSzT2a3sOv97OecaqhyGdF174c`;\n searchVideos(ytUrl);\n\n var key = `AIzaSyDWNMiooGhkXMAhnoTL8pudTR83im36YPo`;\n \n var bookUrl = `https://www.googleapis.com/books/v1/volumes?q=${searchQuery}\\\\+travel+guide&key=${key}`;\n searchBooks(bookUrl);\n}", "title": "" }, { "docid": "3cc62d39b87be72f356172db330bf075", "score": "0.67337525", "text": "function searchEnterEvent(e)\r\n{\r\n\t// if press enter in textbox\r\n\tif(e.keyCode == 13)\r\n\t\tloadData();\r\n}", "title": "" }, { "docid": "bf1abd33f745e9696d42fc39efcbebf0", "score": "0.6727289", "text": "function enter_key_press() {\n value = Y.one('input#plugin-filter').get('value');\n if (value.length >= 1) {\n M.local_rlsiteadmin.filter_add(value, 'string', value);\n $input.set('value', '');\n }\n M.local_rlsiteadmin.filter_block_show();\n }", "title": "" }, { "docid": "9a59fb5618469e75078783d117014859", "score": "0.6721699", "text": "function inputChange(event) {\n const searchedKey = event.target.value.toLowerCase();\n filterNotes(searchedKey);\n}", "title": "" }, { "docid": "68bb70da7b9cf2e1e800747f839ae01b", "score": "0.6704091", "text": "function keyDownSearch(event) {\n let key = 0;\n let length = 300;\n let keyPressed = document.querySelector(`div[data-key=\"${event.keyCode}\"]`);\n if (keyPressed === null) {\n return;\n }\n let note = keyPressed.dataset.note;\n for (let i = 0; i < frequencies.length; i++) {\n if (frequencies[i][0] === note) {\n key = frequencies[i][1];\n }\n }\n addVisual(keyPressed);\n playNote(key, length);\n }", "title": "" }, { "docid": "505a97093731fa43e4a9836acdc0048f", "score": "0.66889936", "text": "function handleKeyInPolicySearch(event) {\n\tif (isEnterKeyPressed(event) == true) {\n\t\tsearchPolicies();\n\t}\n}", "title": "" }, { "docid": "c4f44957add8acdc796254f2bf5d63d8", "score": "0.6688294", "text": "function submitSearch(event){\n if(event.keyCode == 13) {\n getWeather(inputValue.value);\n }\n}", "title": "" }, { "docid": "8e61d83af32b3f463e8394e247793852", "score": "0.6686163", "text": "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "title": "" }, { "docid": "17a4df0f49861a1962c5542ac84c2309", "score": "0.667294", "text": "function buttonSearch(){\n\tsearchTerm = this.attributes[2].value; \n\tsearchTerm = searchTerm.replace(/\\s+/g, '+').toLowerCase();\n\t\t\n \tdisplayGifs ();\n}", "title": "" } ]
cd91633113f38dbffdc7af9502323e2d
connect is a facade over connectAdvanced. It turns its args into a compatible selectorFactory, which has the signature: (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps connect passes its args to connectAdvanced as options, which will in turn pass them to selectorFactory each time a Connect component instance is instantiated or hot reloaded. selectorFactory returns a final props selector from its mapStateToProps, mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps, mergePropsFactories, and pure args. The resulting final props selector is called by the Connect component instance whenever it receives new props or store state.
[ { "docid": "392afa025ad30c6ad781bf56a5e39e8f", "score": "0.0", "text": "function match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}", "title": "" } ]
[ { "docid": "cf52f21b17f8969c69e124ea7f912340", "score": "0.7501177", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect_objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect_extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "cf52f21b17f8969c69e124ea7f912340", "score": "0.7501177", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect_objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect_extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "cf52f21b17f8969c69e124ea7f912340", "score": "0.7501177", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect_objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect_extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "cf52f21b17f8969c69e124ea7f912340", "score": "0.7501177", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect_objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect_extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "1ccc4795eaeeb6666f478c3026dc9b48", "score": "0.749944", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect__objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect__extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "1ccc4795eaeeb6666f478c3026dc9b48", "score": "0.749944", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect__objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect__extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "1ccc4795eaeeb6666f478c3026dc9b48", "score": "0.749944", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = connect__objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, connect__extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "a2868400a75714ecc00e2370ddf56f81", "score": "0.74186414", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n var _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, preact_redux_esm__extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "e76084f3ff2a4c25ec2bde1b4f4d85cd", "score": "0.73725617", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "e76084f3ff2a4c25ec2bde1b4f4d85cd", "score": "0.73725617", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "e76084f3ff2a4c25ec2bde1b4f4d85cd", "score": "0.73725617", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "c304ae9e6283c3c9a1184cc06aa2fa9b", "score": "0.7370341", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\t\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\t\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\t\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "c304ae9e6283c3c9a1184cc06aa2fa9b", "score": "0.7370341", "text": "function createConnect() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\t\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n\t var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n\t _ref2$pure = _ref2.pure,\n\t pure = _ref2$pure === undefined ? true : _ref2$pure,\n\t _ref2$areStatesEqual = _ref2.areStatesEqual,\n\t areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n\t _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n\t _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n\t areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n\t _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n\t extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\t\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\t\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return 'Connect(' + name + ')';\n\t },\n\t\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.73276705", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.73276705", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.73276705", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "637577b3c9b796759222007932a67a17", "score": "0.73276705", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "1c5da46913f9e63c9fb478097e3fe1fa", "score": "0.7305205", "text": "function createConnect() {\n var _ref =\n arguments.length > 0 && arguments[0] !== undefined\n ? arguments[0]\n : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC =\n _ref$connectHOC === undefined\n ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_0__[\n \"default\"\n ]\n : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories =\n _ref$mapStateToPropsF === undefined\n ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories =\n _ref$mapDispatchToPro === undefined\n ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories =\n _ref$mergePropsFactor === undefined\n ? _mergeProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory =\n _ref$selectorFactory === undefined\n ? _selectorFactory__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n : _ref$selectorFactory;\n\n return function connect(\n mapStateToProps,\n mapDispatchToProps,\n mergeProps\n ) {\n var _ref2 =\n arguments.length > 3 && arguments[3] !== undefined\n ? arguments[3]\n : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual =\n _ref2$areStatesEqual === undefined\n ? strictEqual\n : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual =\n _ref2$areOwnPropsEqua === undefined\n ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual =\n _ref2$areStatePropsEq === undefined\n ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual =\n _ref2$areMergedPropsE === undefined\n ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, [\n \"pure\",\n \"areStatesEqual\",\n \"areOwnPropsEqual\",\n \"areStatePropsEqual\",\n \"areMergedPropsEqual\",\n ]);\n\n var initMapStateToProps = match(\n mapStateToProps,\n mapStateToPropsFactories,\n \"mapStateToProps\"\n );\n var initMapDispatchToProps = match(\n mapDispatchToProps,\n mapDispatchToPropsFactories,\n \"mapDispatchToProps\"\n );\n var initMergeProps = match(\n mergeProps,\n mergePropsFactories,\n \"mergeProps\"\n );\n\n return connectHOC(\n selectorFactory,\n _extends(\n {\n // used in error messages\n methodName: \"connect\",\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual,\n },\n extraOptions\n )\n );\n };\n }", "title": "" }, { "docid": "2b4db25e0ce3ae954e7cb621b32b150c", "score": "0.72926843", "text": "function createConnect() {\n var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref$connectHOC = _ref.connectHOC;\n var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC;\n var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories;\n var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF;\n var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories;\n var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro;\n var _ref$mergePropsFactor = _ref.mergePropsFactories;\n var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor;\n var _ref$selectorFactory = _ref.selectorFactory;\n var selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n var _ref2$pure = _ref2.pure;\n var pure = _ref2$pure === undefined ? true : _ref2$pure;\n var _ref2$areStatesEqual = _ref2.areStatesEqual;\n var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual;\n var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual;\n var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua;\n var _ref2$areStatePropsEq = _ref2.areStatePropsEqual;\n var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq;\n var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual;\n var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE;\n var extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "3f73e0505d35fc1259ac32f61e53a3ac", "score": "0.72716707", "text": "function createConnect(_temp) {\n\t var _ref = _temp === void 0 ? {} : _temp,\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n\t if (_ref2 === void 0) {\n\t _ref2 = {};\n\t }\n\n\t var _ref3 = _ref2,\n\t _ref3$pure = _ref3.pure,\n\t pure = _ref3$pure === void 0 ? true : _ref3$pure,\n\t _ref3$areStatesEqual = _ref3.areStatesEqual,\n\t areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n\t _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n\t _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n\t areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n\t _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n\t extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t return connectHOC(selectorFactory, _extends({\n\t // used in error messages\n\t methodName: 'connect',\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return \"Connect(\" + name + \")\";\n\t },\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "6aa3eb7daa3dc9f613987694c753a5c7", "score": "0.7256308", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "8862982ebf26bed8d5ded9e69055ad16", "score": "0.7232663", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"default\"] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"default\"] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"default\"] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "10c83b10c4506fb9b9f6fd9eb51203e0", "score": "0.7227988", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "ae67db482fefabf4a2ec2d3187779847", "score": "0.72262853", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2['default'] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2['default'] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2['default'] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2['default'] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2['default'] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2['default'] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2['default'] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2['default'] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "36144fb3885596640d4af5554cec5516", "score": "0.72257215", "text": "function createConnect(store) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n var _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(store, selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName require the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "edc3bdbe6de51b868b8b7835530ede11", "score": "0.7184179", "text": "function createConnect(_temp) {\n\t var _ref = _temp === void 0 ? {} : _temp,\n\t _ref$connectHOC = _ref.connectHOC,\n\t connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced.default : _ref$connectHOC,\n\t _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n\t mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps.default : _ref$mapStateToPropsF,\n\t _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n\t mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps.default : _ref$mapDispatchToPro,\n\t _ref$mergePropsFactor = _ref.mergePropsFactories,\n\t mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps.default : _ref$mergePropsFactor,\n\t _ref$selectorFactory = _ref.selectorFactory,\n\t selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory.default : _ref$selectorFactory;\n\n\t return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n\t if (_ref2 === void 0) {\n\t _ref2 = {};\n\t }\n\n\t var _ref3 = _ref2,\n\t _ref3$pure = _ref3.pure,\n\t pure = _ref3$pure === void 0 ? true : _ref3$pure,\n\t _ref3$areStatesEqual = _ref3.areStatesEqual,\n\t areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n\t _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n\t areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual.default : _ref3$areOwnPropsEqua,\n\t _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n\t areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual.default : _ref3$areStatePropsEq,\n\t _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n\t areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual.default : _ref3$areMergedPropsE,\n\t extraOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\t var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n\t var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n\t var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\t return connectHOC(selectorFactory, (0, _extends2.default)({\n\t // used in error messages\n\t methodName: 'connect',\n\t // used to compute Connect's displayName from the wrapped component's displayName.\n\t getDisplayName: function getDisplayName(name) {\n\t return \"Connect(\" + name + \")\";\n\t },\n\t // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n\t shouldHandleStateChanges: Boolean(mapStateToProps),\n\t // passed through to selectorFactory\n\t initMapStateToProps: initMapStateToProps,\n\t initMapDispatchToProps: initMapDispatchToProps,\n\t initMergeProps: initMergeProps,\n\t pure: pure,\n\t areStatesEqual: areStatesEqual,\n\t areOwnPropsEqual: areOwnPropsEqual,\n\t areStatePropsEqual: areStatePropsEqual,\n\t areMergedPropsEqual: areMergedPropsEqual\n\t }, extraOptions));\n\t };\n\t}", "title": "" }, { "docid": "8f9dd8135a3703e8b2b8caa4447c5446", "score": "0.71650213", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */ ] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */ ] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */ ] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */ ] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */ ] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */ ] : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */ ] : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */ ] : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n }", "title": "" }, { "docid": "b8ef84e54b64e676af16a7735076f049", "score": "0.7156146", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual$1 : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual$1 : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual$1 : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose$7(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match$1(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match$1(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match$1(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends$d({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "e73f9ddc73cd4dd9085fc2905d9eaf87", "score": "0.71544296", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "3c84b825af136a2e2817e16de2501e12", "score": "0.71364564", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__.default : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__.default : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__.default : _ref3$areMergedPropsE,\n extraOptions = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__.default)(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "3c84b825af136a2e2817e16de2501e12", "score": "0.71364564", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__.default : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__.default : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__.default : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__.default : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__.default : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__.default : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__.default : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__.default : _ref3$areMergedPropsE,\n extraOptions = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__.default)(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "e3bda6e0a9311ab1a5f1abbfe980ad2f", "score": "0.7129462", "text": "function createConnect() {\n var _ref =\n arguments.length > 0 && arguments[0] !== undefined\n ? arguments[0]\n : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC =\n _ref$connectHOC === undefined\n ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\n 'a' /* default */\n ]\n : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories =\n _ref$mapStateToPropsF === undefined\n ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\n 'a' /* default */\n ]\n : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories =\n _ref$mapDispatchToPro === undefined\n ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\n 'a' /* default */\n ]\n : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories =\n _ref$mergePropsFactor === undefined\n ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__['a' /* default */]\n : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory =\n _ref$selectorFactory === undefined\n ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\n 'a' /* default */\n ]\n : _ref$selectorFactory\n\n return function connect(\n mapStateToProps,\n mapDispatchToProps,\n mergeProps\n ) {\n var _ref2 =\n arguments.length > 3 && arguments[3] !== undefined\n ? arguments[3]\n : {},\n _ref2$pure = _ref2.pure,\n pure = _ref2$pure === undefined ? true : _ref2$pure,\n _ref2$areStatesEqual = _ref2.areStatesEqual,\n areStatesEqual =\n _ref2$areStatesEqual === undefined\n ? strictEqual\n : _ref2$areStatesEqual,\n _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,\n areOwnPropsEqual =\n _ref2$areOwnPropsEqua === undefined\n ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\n 'a' /* default */\n ]\n : _ref2$areOwnPropsEqua,\n _ref2$areStatePropsEq = _ref2.areStatePropsEqual,\n areStatePropsEqual =\n _ref2$areStatePropsEq === undefined\n ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\n 'a' /* default */\n ]\n : _ref2$areStatePropsEq,\n _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,\n areMergedPropsEqual =\n _ref2$areMergedPropsE === undefined\n ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\n 'a' /* default */\n ]\n : _ref2$areMergedPropsE,\n extraOptions = _objectWithoutProperties(_ref2, [\n 'pure',\n 'areStatesEqual',\n 'areOwnPropsEqual',\n 'areStatePropsEqual',\n 'areMergedPropsEqual',\n ])\n\n var initMapStateToProps = match(\n mapStateToProps,\n mapStateToPropsFactories,\n 'mapStateToProps'\n )\n var initMapDispatchToProps = match(\n mapDispatchToProps,\n mapDispatchToPropsFactories,\n 'mapDispatchToProps'\n )\n var initMergeProps = match(\n mergeProps,\n mergePropsFactories,\n 'mergeProps'\n )\n\n return connectHOC(\n selectorFactory,\n _extends(\n {\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')'\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual,\n },\n extraOptions\n )\n )\n }\n }", "title": "" }, { "docid": "c7aef8586cdcf15bc4e19b9823f22f20", "score": "0.7125815", "text": "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$connectHOC = _ref.connectHOC, connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__[\"a\" /* default */] : _ref$connectHOC, _ref$mapStateToPropsF = _ref.mapStateToPropsFactories, mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__[\"a\" /* default */] : _ref$mapStateToPropsF, _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__[\"a\" /* default */] : _ref$mapDispatchToPro, _ref$mergePropsFactor = _ref.mergePropsFactories, mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__[\"a\" /* default */] : _ref$mergePropsFactor, _ref$selectorFactory = _ref.selectorFactory, selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__[\"a\" /* default */] : _ref$selectorFactory;\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, _ref2$pure = _ref2.pure, pure = _ref2$pure === undefined ? true : _ref2$pure, _ref2$areStatesEqual = _ref2.areStatesEqual, areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areOwnPropsEqua, _ref2$areStatePropsEq = _ref2.areStatePropsEqual, areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areStatePropsEq, _ref2$areMergedPropsE = _ref2.areMergedPropsEqual, areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__[\"a\" /* default */] : _ref2$areMergedPropsE, extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n }", "title": "" }, { "docid": "0c09ce060c99ddb4338e18a27d87a869", "score": "0.71196944", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n }", "title": "" }, { "docid": "566c6683961008ff67e36071b0ad0480", "score": "0.71188414", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "2a8c88f609ab25f5c965c09f8a8f62d3", "score": "0.71186936", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = Object(objectWithoutPropertiesLoose[\"a\" /* default */])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(esm_extends[\"a\" /* default */])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "2a8c88f609ab25f5c965c09f8a8f62d3", "score": "0.71186936", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = Object(objectWithoutPropertiesLoose[\"a\" /* default */])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(esm_extends[\"a\" /* default */])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "361a8cb33e04161934d8e311aaf25e9a", "score": "0.71186936", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = connect_match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = connect_match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = connect_match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "361a8cb33e04161934d8e311aaf25e9a", "score": "0.71186936", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = connect_match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = connect_match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = connect_match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "2a8c88f609ab25f5c965c09f8a8f62d3", "score": "0.71186936", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? connect_mapStateToProps : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? connect_mapDispatchToProps : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? connect_mergeProps : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = Object(objectWithoutPropertiesLoose[\"a\" /* default */])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(esm_extends[\"a\" /* default */])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "7f4aadf70c10483208232f08502c6712", "score": "0.710159", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areMergedPropsE,\n extraOptions = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "7f4aadf70c10483208232f08502c6712", "score": "0.710159", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areMergedPropsE,\n extraOptions = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "7f4aadf70c10483208232f08502c6712", "score": "0.710159", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areMergedPropsE,\n extraOptions = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "7f4aadf70c10483208232f08502c6712", "score": "0.710159", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areMergedPropsE,\n extraOptions = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "7f4aadf70c10483208232f08502c6712", "score": "0.710159", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areMergedPropsE,\n extraOptions = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" }, { "docid": "7f4aadf70c10483208232f08502c6712", "score": "0.710159", "text": "function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? _components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__[\"default\"] : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps__WEBPACK_IMPORTED_MODULE_5__[\"default\"] : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"] : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps__WEBPACK_IMPORTED_MODULE_6__[\"default\"] : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory__WEBPACK_IMPORTED_MODULE_7__[\"default\"] : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"] : _ref3$areMergedPropsE,\n extraOptions = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}", "title": "" } ]
8ccc0bb12b491918c5048103d26ab349
Gives CDP directly to the supplied address
[ { "docid": "c2de8e88ae06b1b7d559144ce6eb4c44", "score": "0.0", "text": "@tracksTransactions\n give(id, address, { promise }) {\n return this.proxyActions.give(\n this._managerAddress,\n this.getIdBytes(id),\n address,\n { dsProxy: true, promise }\n );\n }", "title": "" } ]
[ { "docid": "86042e25178f125b471b0ca82d4d02d9", "score": "0.61632895", "text": "function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }", "title": "" }, { "docid": "86042e25178f125b471b0ca82d4d02d9", "score": "0.61632895", "text": "function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }", "title": "" }, { "docid": "bab130b970585a1bd362262f0bd1815b", "score": "0.59902835", "text": "function sc_caaddr(p) { return p.cdr.cdr.car.car; }", "title": "" }, { "docid": "bab130b970585a1bd362262f0bd1815b", "score": "0.59902835", "text": "function sc_caaddr(p) { return p.cdr.cdr.car.car; }", "title": "" }, { "docid": "66b211ad175ff5cd65ccc2c9bd3066cc", "score": "0.569598", "text": "function sc_cadr(p) { return p.cdr.car; }", "title": "" }, { "docid": "66b211ad175ff5cd65ccc2c9bd3066cc", "score": "0.569598", "text": "function sc_cadr(p) { return p.cdr.car; }", "title": "" }, { "docid": "0e2dc1e0669b0c03384835fb1b2bf461", "score": "0.5681916", "text": "function sc_cdadr(p) { return p.cdr.car.cdr; }", "title": "" }, { "docid": "0e2dc1e0669b0c03384835fb1b2bf461", "score": "0.5681916", "text": "function sc_cdadr(p) { return p.cdr.car.cdr; }", "title": "" }, { "docid": "10eb3389553c7d1962ce1f6bf3643996", "score": "0.56684756", "text": "get NATpunchthroughAddressRestrictedCone() {}", "title": "" }, { "docid": "e3ce0a89e6a868db68b3f0baedc2699a", "score": "0.5643371", "text": "function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }", "title": "" }, { "docid": "e3ce0a89e6a868db68b3f0baedc2699a", "score": "0.5643371", "text": "function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }", "title": "" }, { "docid": "7d1558913c842259d71aa1ae53d1cd1f", "score": "0.56262517", "text": "function gotoAddr() {\n\t var inp = prompt(\"Enter address or label\", \"\");\n\t var addr = 0;\n\t if (labels.find(inp)) {\n\t\taddr = labels.getPC(inp);\n\t } else {\n\t\tif (inp.match(/^0x[0-9a-f]{1,4}$/i)) {\n\t\t inp = inp.replace(/^0x/, \"\");\n\t\t addr = parseInt(inp, 16);\n\t\t} else if (inp.match(/^\\$[0-9a-f]{1,4}$/i)) {\n\t\t inp = inp.replace(/^\\$/, \"\");\n\t\t addr = parseInt(inp, 16);\n\t\t}\n\t }\n\t if (addr === 0) {\n\t\tmessage(\"Unable to find/parse given address/label\");\n\t } else {\n\t\tregPC = addr;\n\t }\n\t updateDebugInfo();\n\t}", "title": "" }, { "docid": "e8c6ada1fb29edea3ebc47b17e7bde9e", "score": "0.5545691", "text": "function sc_cdaadr(p) { return p.cdr.car.car.cdr; }", "title": "" }, { "docid": "e8c6ada1fb29edea3ebc47b17e7bde9e", "score": "0.5545691", "text": "function sc_cdaadr(p) { return p.cdr.car.car.cdr; }", "title": "" }, { "docid": "80774da16f692a271c679bdeb1f75c78", "score": "0.5461963", "text": "function sc_caadr(p) { return p.cdr.car.car; }", "title": "" }, { "docid": "80774da16f692a271c679bdeb1f75c78", "score": "0.5461963", "text": "function sc_caadr(p) { return p.cdr.car.car; }", "title": "" }, { "docid": "9ae5db50b6c5b9ff8699f827bc134ee9", "score": "0.5368993", "text": "set NATpunchthroughAddressRestrictedCone(value) {}", "title": "" }, { "docid": "34a5bb58a31778a7dcfda586737377b5", "score": "0.52531445", "text": "function sc_caaadr(p) { return p.cdr.car.car.car; }", "title": "" }, { "docid": "34a5bb58a31778a7dcfda586737377b5", "score": "0.52531445", "text": "function sc_caaadr(p) { return p.cdr.car.car.car; }", "title": "" }, { "docid": "4f0b3ba410f701ac79959bda03c8ad13", "score": "0.52408004", "text": "function sc_cadadr(p) { return p.cdr.car.cdr.car; }", "title": "" }, { "docid": "4f0b3ba410f701ac79959bda03c8ad13", "score": "0.52408004", "text": "function sc_cadadr(p) { return p.cdr.car.cdr.car; }", "title": "" }, { "docid": "667706be3a84a1a1806cb9bd260ef7a1", "score": "0.517621", "text": "address(value) {\n return getAddress(value);\n }", "title": "" }, { "docid": "8965516c0ecdf8c8848285b54685fa9c", "score": "0.51291734", "text": "address(value) {\n return getAddress$1(value);\n }", "title": "" }, { "docid": "647b304227a9d35add18ee634d3f5c61", "score": "0.5103939", "text": "address(value) {\n return (0,_ethersproject_address__WEBPACK_IMPORTED_MODULE_6__.getAddress)(value);\n }", "title": "" }, { "docid": "77a7ce984c8924b4ad53fdaef8f5d8f2", "score": "0.5058985", "text": "getAddress(path, boolDisplay, boolChaincode) {\n let paths = (0, _utils.splitPath)(path);\n let buffer = Buffer.alloc(1 + paths.length * 4);\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n return this.transport.send(0xe0, 0x02, boolDisplay ? 0x01 : 0x00, boolChaincode ? 0x01 : 0x00, buffer).then(response => {\n let result = {};\n let publicKeyLength = response[0];\n let addressLength = response[1 + publicKeyLength];\n result.publicKey = response.slice(1, 1 + publicKeyLength).toString(\"hex\");\n result.address = \"0x\" + response.slice(1 + publicKeyLength + 1, 1 + publicKeyLength + 1 + addressLength).toString(\"ascii\");\n\n if (boolChaincode) {\n result.chainCode = response.slice(1 + publicKeyLength + 1 + addressLength, 1 + publicKeyLength + 1 + addressLength + 32).toString(\"hex\");\n }\n\n return result;\n });\n }", "title": "" }, { "docid": "820446b101603a72048832a349d59ea5", "score": "0.5023601", "text": "function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }", "title": "" }, { "docid": "820446b101603a72048832a349d59ea5", "score": "0.5023601", "text": "function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }", "title": "" }, { "docid": "9a31ce8d173543ce520d2551b7d6f63d", "score": "0.49418113", "text": "function toChar(cp) {\n if (cp <= 0xffff) {\n return String.fromCharCode(cp);\n }\n\n cp -= 0x10000;\n return String.fromCharCode(cp >>> 10 & 0x3ff | 0xd800) + String.fromCharCode(0xdc00 | cp & 0x3ff);\n }", "title": "" }, { "docid": "e0b03549a83b3208eba3b2ce1ed45df6", "score": "0.4913143", "text": "function PCEstablishCall(pc, rsd) {\n\t// set callee's sdp\n\t// NOTE must be set before setting caller's candidates\n\tpc.rtcpc.setRemoteDescription(new rtcSessionDescription(rsd.sdp), function(){}, function(){});\n\n\t// add callee's candidates\n\tfor (var i = 0; i < rsd.cs.length; ++i) {\n\t\tpc.rtcpc.addIceCandidate(new rtcIceCandidate(rsd.cs[i]), function(){}, function(){});\n\t}\n}", "title": "" }, { "docid": "71f068239a949128c9964c32cdcaf994", "score": "0.4874035", "text": "_dialPeer (peer) {\n return this.libp2p.dialProtocol(peer, [BITSWAP120, BITSWAP110, BITSWAP100])\n }", "title": "" }, { "docid": "20cb8cfc22d91a24603cdca4515e0ce7", "score": "0.48704404", "text": "directConnection(address, connParameter) {\n\t\tif (connParameter === undefined || connParameter == null) {\n\t\t\t/* Default parameters as described in 9.3.12.2 */\n\t\t\tconnParameter = {\n\t\t\t\tintervalMin: MIN_INITIAL_CONN_INTERVAL,\n\t\t\t\tintervalMax: MAX_INITIAL_CONN_INTERVAL,\n\t\t\t\tlatency: 0,\n\t\t\t\tsupervisionTimeout: supervisionTimeout,\t// FIXME\n\t\t\t\tminimumCELength: 0,\t\t\t// Most implementation uses zero\n\t\t\t\tmaximumCELength: 0\t\t\t// Most implementation uses zero\n\t\t\t};\n\t\t}\n\t\tthis._hci.commands.le.createConnection(\n\t\t\t/* Scan Parameter as described in 9.3.11.2 */\n\t\t\t{\n\t\t\t\tinterval: SCAN_FAST_INTERVAL,\n\t\t\t\twindow: SCAN_FAST_WINDOW\n\t\t\t},\n\t\t\tfalse,\t\t\t\t\t\t\t// Ignore white list\n\t\t\taddress.isRandom() ? 0x01 : 0x00,\n\t\t\taddress,\n\t\t\tthis._ownAddressType,\n\t\t\tconnParameter\n\t\t);\n\t}", "title": "" }, { "docid": "5288a3492a1fa16bad5d98184f6ba743", "score": "0.4826358", "text": "_dialPeer (peer, callback) {\n // Attempt Bitswap 1.1.0\n this.libp2p.dial(peer, BITSWAP110, (err, conn) => {\n if (err) {\n // Attempt Bitswap 1.0.0\n this.libp2p.dial(peer, BITSWAP100, (err, conn) => {\n if (err) { return callback(err) }\n\n callback(null, conn, BITSWAP100)\n })\n\n return\n }\n\n callback(null, conn, BITSWAP110)\n })\n }", "title": "" }, { "docid": "7b14e2d52f820eb2a17fd9cb66793d41", "score": "0.48116577", "text": "function sc_cddr(p) { return p.cdr.cdr; }", "title": "" }, { "docid": "7b14e2d52f820eb2a17fd9cb66793d41", "score": "0.48116577", "text": "function sc_cddr(p) { return p.cdr.cdr; }", "title": "" }, { "docid": "e5b029e7e0b8946c59b80b60c7c90e53", "score": "0.4784539", "text": "function jumpto( arg_address )\n{\n\treturn process.reserved.hostDependBindings.ida_jumpto( Number64(arg_address) );\n}", "title": "" }, { "docid": "cc1505c6b8e972118793d15741bafbe2", "score": "0.47832876", "text": "async getAddress (ctx) {\n try {\n const data = _this.shell.exec(`${config.ecPath} -w ${config.walletFile} getunusedaddress`)\n // console.log(`data: ${JSON.stringify(data, null, 2)}`)\n\n const addr = data.replace(/(\\r\\n|\\n|\\r)/gm, '')\n\n ctx.body = {\n success: true,\n address: addr\n }\n } catch (err) {\n console.error(`Error in ec/controller.js/getAddress()`)\n ctx.throw(500, err.message)\n }\n }", "title": "" }, { "docid": "780fc4d4f7e2f40c33da623fe412162d", "score": "0.4775695", "text": "function addressToDest(e){\n document.getElementById('dest').value = e.target.options.address;\n }", "title": "" }, { "docid": "97f2bd4586d80c09ee03ea6e3d573b1d", "score": "0.47535127", "text": "function toChar(cp) {\n if (cp <= 0xffff) {\n return String.fromCharCode(cp);\n }\n\n cp -= 0x10000;\n return String.fromCharCode(((cp >>> 10) & 0x3ff) | 0xd800) + String.fromCharCode(0xdc00 | (cp & 0x3ff));\n}", "title": "" }, { "docid": "97f2bd4586d80c09ee03ea6e3d573b1d", "score": "0.47535127", "text": "function toChar(cp) {\n if (cp <= 0xffff) {\n return String.fromCharCode(cp);\n }\n\n cp -= 0x10000;\n return String.fromCharCode(((cp >>> 10) & 0x3ff) | 0xd800) + String.fromCharCode(0xdc00 | (cp & 0x3ff));\n}", "title": "" }, { "docid": "97f2bd4586d80c09ee03ea6e3d573b1d", "score": "0.47535127", "text": "function toChar(cp) {\n if (cp <= 0xffff) {\n return String.fromCharCode(cp);\n }\n\n cp -= 0x10000;\n return String.fromCharCode(((cp >>> 10) & 0x3ff) | 0xd800) + String.fromCharCode(0xdc00 | (cp & 0x3ff));\n}", "title": "" }, { "docid": "97f2bd4586d80c09ee03ea6e3d573b1d", "score": "0.47535127", "text": "function toChar(cp) {\n if (cp <= 0xffff) {\n return String.fromCharCode(cp);\n }\n\n cp -= 0x10000;\n return String.fromCharCode(((cp >>> 10) & 0x3ff) | 0xd800) + String.fromCharCode(0xdc00 | (cp & 0x3ff));\n}", "title": "" }, { "docid": "97f2bd4586d80c09ee03ea6e3d573b1d", "score": "0.47535127", "text": "function toChar(cp) {\n if (cp <= 0xffff) {\n return String.fromCharCode(cp);\n }\n\n cp -= 0x10000;\n return String.fromCharCode(((cp >>> 10) & 0x3ff) | 0xd800) + String.fromCharCode(0xdc00 | (cp & 0x3ff));\n}", "title": "" }, { "docid": "97f2bd4586d80c09ee03ea6e3d573b1d", "score": "0.47535127", "text": "function toChar(cp) {\n if (cp <= 0xffff) {\n return String.fromCharCode(cp);\n }\n\n cp -= 0x10000;\n return String.fromCharCode(((cp >>> 10) & 0x3ff) | 0xd800) + String.fromCharCode(0xdc00 | (cp & 0x3ff));\n}", "title": "" }, { "docid": "17be9f3545516d264bbe3e926a76e361", "score": "0.47119936", "text": "function YMultiSensController_setupAddress(addr)\n {\n var cmd; // str;\n var res; // int;\n cmd = \"A\"+String(Math.round(addr));\n res = this.set_command(cmd);\n if (!(res == YAPI_SUCCESS)) {\n return this._throw(YAPI_IO_ERROR,\"unable to trigger address change\",YAPI_IO_ERROR);\n }\n YAPI.Sleep(1500);\n res = this.get_lastAddressDetected();\n if (!(res > 0)) {\n return this._throw(YAPI_IO_ERROR,\"IR sensor not found\",YAPI_IO_ERROR);\n }\n if (!(res == addr)) {\n return this._throw(YAPI_IO_ERROR,\"address change failed\",YAPI_IO_ERROR);\n }\n return YAPI_SUCCESS;\n }", "title": "" }, { "docid": "fdd977fb12b3f3d7f52439cec22b4810", "score": "0.47082227", "text": "function call_control_dial(f_telnyx_api_auth_v2, f_dest, f_from, f_connection_id) {\n\n var l_cc_action = 'dial';\n\n var options = {\n url: 'https://api.telnyx.com/v2/calls/',\n\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Authorization': 'Bearer ' + f_telnyx_api_auth_v2\n },\n json: {\n to: f_dest,\n from: f_from,\n connection_id: f_connection_id,\n }\n };\n\n request.post(options, function (err, resp, body) {\n if (err) {\n return console.log(err);\n }\n\n console.log(\"[%s] LOG - Command Executed [%s]\", get_timestamp(), l_cc_action);\n\n if (g_debug)\n console.log(body);\n\n });\n}", "title": "" }, { "docid": "6b850a2db4e1d4b6da7b8889bb642d99", "score": "0.4688549", "text": "setAddress(addr){this.address=addr;}", "title": "" }, { "docid": "6b850a2db4e1d4b6da7b8889bb642d99", "score": "0.4688549", "text": "setAddress(addr){this.address=addr;}", "title": "" }, { "docid": "da3bd56a9abe9091f82cefa0e38342d0", "score": "0.46879518", "text": "function configure (config) {\n config = _.isObject(config) ? config : {}\n this.client.cdpHost = config.cdpHost || 'cdp.in.treasuredata.com'\n return this\n}", "title": "" }, { "docid": "7ee1497985e32c7d63b8558208ff1fe2", "score": "0.46807307", "text": "function getAddress32VPN2(address) { return (address >>> 13);}", "title": "" }, { "docid": "00f0bd7491f815a452342741f1c7d752", "score": "0.46723813", "text": "function PCStartCall(pc, returnFunc) {\n\t// runs after setLocalDescription + ice negotiation occurs\n\tpc.idf = function() {\n\t\tvar sd = MakeSD(pc.rtcpc.localDescription, pc.cs);\n\t\treturnFunc(sd);\n\t};\n\n\tpc.rtcpc.createOffer(function(sdp) {\n\t\tpc.rtcpc.setLocalDescription(sdp, function(){}, function(){});\n\t\t// ice negotiations happen after setLocalDescription\n\t}, function() {},\n\t{ optional: [], mandatory: { OfferToReceiveAudio: true, OfferToReceiveVideo: true }});\n}", "title": "" }, { "docid": "9360e64ee0d46d47ed2fe9242156cb37", "score": "0.4667228", "text": "function enableDhcps()\n{\n\tgraysomething();\n}", "title": "" }, { "docid": "ebb09b7ec55a105117d556416b5634cc", "score": "0.46671796", "text": "function inet_addr(cp)\n\t{\n\t\t// convert to array of bytes\n\t\tvar bytes = cp.split('.');\n\n\t\t// convert to binary\n\t\treturn ((parseInt(bytes[0]) & 0xff) << 24) | \n\t\t ((parseInt(bytes[1]) & 0xff) << 16) |\n\t\t ((parseInt(bytes[2]) & 0xff) << 8) |\n\t\t (parseInt(bytes[3]) & 0xff)\n\t}", "title": "" }, { "docid": "e078612753fb9d810f87e86b42917b89", "score": "0.46577615", "text": "function getAddress(e) {\r\n\tvar index = e.dataset.index;\r\n\tvar ipAddress = document.getElementById(\"inputIPAddress\" + index).value;\r\n\topenConnection(ipAddress, index);\r\n}", "title": "" }, { "docid": "c4f1ad4fb7d8eccf61bd68a3c662f3d6", "score": "0.46482253", "text": "function generateAddress() {\n return lndService.generateAddress();\n}", "title": "" }, { "docid": "3922c715776866b0a2fb8a6154bd7ef0", "score": "0.46423814", "text": "function genip(num, pref){\n var ip = \"\";\n ip += pref;\n for(var i=0; i<3; i++){\n ip +=\":0000\";\n }\n var n;\n ip += \":0212\";\n n = 0x7400 + num;\n ip += \":\"+n.toString(16);\n n = 0x0 + num;\n ip += \":000\"+n.toString(16);\n n = (0x100 * num) + num;\n ip += \":0\"+n.toString(16);\n return ip;\n}", "title": "" }, { "docid": "d663430505c9e73fa780225254308a91", "score": "0.46354747", "text": "function sc_caddr(p) { return p.cdr.cdr.car; }", "title": "" }, { "docid": "d663430505c9e73fa780225254308a91", "score": "0.46354747", "text": "function sc_caddr(p) { return p.cdr.cdr.car; }", "title": "" }, { "docid": "16f8da7b0056644ed3d5e49fb990d349", "score": "0.46330798", "text": "function sc_cdddr(p) { return p.cdr.cdr.cdr; }", "title": "" }, { "docid": "16f8da7b0056644ed3d5e49fb990d349", "score": "0.46330798", "text": "function sc_cdddr(p) { return p.cdr.cdr.cdr; }", "title": "" }, { "docid": "250b9e172bc27588fa31697f58169cbc", "score": "0.4622896", "text": "function address_cfxToEth(addrC) {\n // XXX why doesn't ts know about this fn?\n shared_impl_1.debug(\"address_cfxToEth\", \"call\", addrC);\n var addrObj = CFX_util_1.decodeCfxAddress(addrC);\n var addrE = '0x' + addrObj.hexAddress.toString('hex');\n if (netId !== addrObj.netId)\n throw Error(\"Expected netId=\" + netId + \", got netId=\" + addrObj.netId);\n return addrE;\n}", "title": "" }, { "docid": "101102e1fb76d6bb900dc4958ed17bbd", "score": "0.461789", "text": "function cpaint_call() {\r\n /**\r\n * whether or not debugging is used.\r\n *\r\n * @access public\r\n * @var boolean debugging\r\n */\r\n var debugging = false;\r\n\r\n\r\n /**\r\n * XMLHttpObject used for this request.\r\n *\r\n * @access protected\r\n * @var object httpobj\r\n */\r\n var httpobj = false;\r\n\r\n /**\r\n * URL of the proxy script to use.\r\n * the proxy script is necessary only if data from remote domains is to be retrieved.\r\n *\r\n * @access public\r\n * @var string proxy_url\r\n */\r\n var proxy_url = '';\r\n\r\n /**\r\n * HTTP transfer mode.\r\n *\r\n * allowed values: (GET|POST), default is GET in respect to Operas deficiencies.\r\n *\r\n * @access public \r\n * @var string transfer_mode\r\n */ \r\n var transfer_mode = 'GET';\r\n\r\n /**\r\n * configuration option whether request/response pairs\r\n * are meant to be performed synchronous or asynchronous.\r\n *\r\n * default is asynchronous, since synchronized calls aren't completely supported in most browsers.\r\n *\r\n * @access public \r\n * var boolean async\r\n */\r\n var async = true;\r\n\r\n /**\r\n * response type (TEXT|XML|OBJECT).\r\n *\r\n * @access public \r\n * @var string response_type\r\n */\r\n var response_type = 'OBJECT';\r\n\r\n /**\r\n * whether or not to use a persistent connection\r\n * to the server side.\r\n *\r\n * default is false (new connection on every call).\r\n *\r\n * @access public \r\n * @var boolean persistent_connection\r\n */\r\n var persistent_connection = false;\r\n \r\n /**\r\n * whether or not to use the cpaint api on the backend\r\n *\r\n * default is true (uses cpaint api)\r\n *\r\n * @access public\r\n * @var boolean cpaint_api\r\n */\r\n var use_cpaint_api = true;\r\n\r\n /**\r\n * client callback function.\r\n *\r\n * @access public\r\n * @var function client_callback\r\n */\r\n var client_callback;\r\n\r\n /**\r\n * stores the stack Id within the cpaint object\r\n *\r\n * @access protected\r\n * @var stack_id\r\n */\r\n var stack_id = arguments[0];\r\n \r\n /**\r\n * set ajaxObject to transfer to callback function.\r\n *\r\n * @access public\r\n * @param object\r\n * @return void\r\n */\r\n var ajaxObject = null;\r\n\r\n this.set_ajax_object = function() {\r\n \r\n if (typeof arguments[0] == 'object') {\r\n ajaxObject = arguments[0];\r\n }\r\n }\r\n\r\n /**\r\n * switches debug mode on/off (0|1|2).\r\n *\r\n * @access public\r\n * @param integer debug debug flag\r\n * @return void\r\n */\r\n this.set_debug = function() {\r\n \r\n if (typeof arguments[0] == 'number') {\r\n debugging = Math.round(arguments[0]);\r\n }\r\n }\r\n\r\n /**\r\n * defines the URL of the proxy script.\r\n *\r\n * @access public\r\n * @param string proxy_url URL of the proxyscript to connect\r\n * @return void\r\n */\r\n this.set_proxy_url = function() {\r\n \r\n if (typeof arguments[0] == 'string') {\r\n proxy_url = arguments[0];\r\n }\r\n }\r\n\r\n /**\r\n * sets the transfer_mode (GET|POST).\r\n *\r\n * @access public\r\n * @param string transfer_mode transfer_mode\r\n * @return void\r\n */\r\n this.set_transfer_mode = function() {\r\n \r\n if (arguments[0].toUpperCase() == 'GET'\r\n || arguments[0].toUpperCase() == 'POST') {\r\n\r\n transfer_mode = arguments[0].toUpperCase();\r\n }\r\n }\r\n\r\n /**\r\n * sets the flag whether or not to use asynchronous calls.\r\n *\r\n * @access public\r\n * @param boolean async syncronization flag\r\n * @return void\r\n */\r\n this.set_async = function() {\r\n \r\n if (typeof arguments[0] == 'boolean') {\r\n async = arguments[0];\r\n }\r\n }\r\n\r\n /**\r\n * defines the response type.\r\n *\r\n * allowed values are:\r\n * TEXT = raw text response\r\n * XML = raw XMLHttpObject\r\n * OBJECT = parsed JavaScript object structure\r\n *\r\n * default is OBJECT.\r\n *\r\n * @access public\r\n * @param string response_type response type\r\n * @return void\r\n */\r\n this.set_response_type = function() {\r\n \r\n if (arguments[0].toUpperCase() == 'TEXT'\r\n || arguments[0].toUpperCase() == 'XML'\r\n || arguments[0].toUpperCase() == 'OBJECT') {\r\n\r\n response_type = arguments[0].toUpperCase();\r\n }\r\n }\r\n\r\n /**\r\n * sets the flag whether or not to use a persistent connection.\r\n *\r\n * @access public\r\n * @param boolean persistent_connection persistance flag\r\n * @return void\r\n */\r\n this.set_persistent_connection = function() {\r\n \r\n if (typeof arguments[0] == 'boolean') {\r\n persistent_connection = arguments[0];\r\n }\r\n }\r\n \r\n /**\r\n * sets the flag whether or not to use the cpaint api on the backend.\r\n *\r\n * @access public\r\n * @param boolean cpaint_api api_flag\r\n * @return void\r\n */\r\n this.set_use_cpaint_api = function() {\r\n if (typeof arguments[0] == 'boolean') {\r\n use_cpaint_api = arguments[0];\r\n }\r\n }\r\n\r\n /**\r\n * sets the client callback function.\r\n *\r\n * @access public\r\n * @param function client_callback the client callback function\r\n * @return void\r\n */\r\n this.set_client_callback = function() {\r\n \r\n if (typeof arguments[0] == 'function') {\r\n client_callback = arguments[0];\r\n }\r\n }\r\n\r\n /**\r\n * returns the ready state of the internal XMLHttpObject\r\n *\r\n * if no such object was set up already, -1 is returned\r\n * \r\n * @access public\r\n * @return integer\r\n */\r\n this.get_http_state = function() {\r\n var return_value = -1;\r\n \r\n if (typeof httpobj == 'object') {\r\n return_value = httpobj.readyState;\r\n }\r\n \r\n return return_value;\r\n }\r\n \r\n /**\r\n * internal method for remote calls to the local server without use of the proxy script.\r\n *\r\n * @access public\r\n * @param array call_arguments array of arguments initially passed to cpaint.call()\r\n * @return void\r\n */\r\n this.call_direct = function(call_arguments) {\r\n var url = call_arguments[0];\r\n var remote_method = call_arguments[1];\r\n var querystring = '';\r\n var i = 0;\r\n \r\n // correct link to self\r\n if (url == 'SELF') {\r\n url = document.location.href;\r\n }\r\n \r\n if (use_cpaint_api == true) {\r\n // backend uses cpaint api\r\n // pass parameters to remote method\r\n for (i = 3; i < call_arguments.length; i++) {\r\n querystring += '&cpaint_argument[]=' + encodeURIComponent(call_arguments[i]);\r\n }\r\n \r\n // add response type to querystring\r\n querystring += '&cpaint_response_type=' + response_type;\r\n \r\n // build header\r\n if (transfer_mode == 'GET') {\r\n url = url + '?cpaint_function=' + remote_method + querystring;\r\n \r\n } else {\r\n querystring = 'cpaint_function=' + remote_method + querystring;\r\n }\r\n \r\n } else {\r\n // backend does not use cpaint api\r\n // pass parameters to remote method\r\n for (i = 3; i < call_arguments.length; i++) {\r\n \r\n if (i == 3) {\r\n querystring += encodeURIComponent(call_arguments[i]);\r\n \r\n } else {\r\n querystring += '&' + encodeURIComponent(call_arguments[i]);\r\n }\r\n }\r\n \r\n // build header\r\n if (transfer_mode == 'GET') {\r\n url = url + querystring;\r\n } \r\n }\r\n \r\n // open connection \r\n get_connection_object();\r\n\r\n // open connection to remote target\r\n debug('opening connection to \"' + url + '\"', 1);\r\n httpobj.open(transfer_mode, url, async);\r\n\r\n // send \"urlencoded\" header if necessary (if POST)\r\n if (transfer_mode == \"POST\") {\r\n\r\n try {\r\n httpobj.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\r\n } catch (cp_err) {\r\n alert('ERROR! POST cannot be completed due to incompatible browser. Use GET as your request method.');\r\n }\r\n }\r\n\r\n // callback handling for asynchronous calls\r\n httpobj.onreadystatechange = callback;\r\n\r\n // send content\r\n if (transfer_mode == 'GET') {\r\n httpobj.send(null);\r\n\r\n } else {\r\n debug('sending query: ' + querystring, 1);\r\n httpobj.send(querystring);\r\n }\r\n\r\n if (async == false) {\r\n // manual callback handling for synchronized calls\r\n callback();\r\n }\r\n }\r\n \r\n \r\n /**\r\n * internal method for calls to remote servers through the proxy script.\r\n *\r\n * @access public\r\n * @param array call_arguments array of arguments passed to cpaint.call()\r\n * @return void\r\n */\r\n this.call_proxy = function(call_arguments) {\r\n var proxyscript = proxy_url;\r\n var url = call_arguments[0];\r\n var remote_method = call_arguments[1];\r\n var querystring = '';\r\n var i = 0;\r\n \r\n var querystring_argument_prefix = 'cpaint_argument[]=';\r\n\r\n // pass parameters to remote method\r\n if (use_cpaint_api == false) {\r\n // when not talking to a CPAINT backend, don't prefix arguments\r\n querystring_argument_prefix = '';\r\n }\r\n\r\n for (i = 3; i < call_arguments.length; i++) {\r\n querystring += encodeURIComponent(querystring_argument_prefix + call_arguments[i] + '&');\r\n }\r\n\r\n if (use_cpaint_api == true) {\r\n // add remote function name to querystring\r\n querystring += encodeURIComponent('&cpaint_function=' + remote_method);\r\n \r\n // add response type to querystring\r\n querystring += encodeURIComponent('&cpaint_responsetype=' + response_type);\r\n }\r\n \r\n // build header\r\n if (transfer_mode == 'GET') {\r\n proxyscript += '?cpaint_remote_url=' + encodeURIComponent(url) \r\n + '&cpaint_remote_query=' + querystring\r\n + '&cpaint_remote_method=' + transfer_mode \r\n + '&cpaint_response_type=' + response_type;\r\n\r\n } else {\r\n querystring = 'cpaint_remote_url=' + encodeURIComponent(url)\r\n + '&cpaint_remote_query=' + querystring\r\n + '&cpaint_remote_method=' + transfer_mode \r\n + '&cpaint_response_type=' + response_type;\r\n }\r\n\r\n // open connection\r\n get_connection_object();\r\n\r\n // open connection to remote target\r\n debug('opening connection to proxy \"' + proxyscript + '\"', 1);\r\n httpobj.open(transfer_mode, proxyscript, async);\r\n\r\n // send \"urlencoded\" header if necessary (if POST)\r\n if (transfer_mode == \"POST\") {\r\n\r\n try {\r\n httpobj.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\r\n } catch (cp_err) {\r\n alert('[CPAINT Error] POST cannot be completed due to incompatible browser. Use GET as your request method.');\r\n }\r\n }\r\n\r\n // callback handling for asynchronous calls\r\n httpobj.onreadystatechange = callback;\r\n\r\n // send content\r\n if (transfer_mode == 'GET') {\r\n httpobj.send(null);\r\n\r\n } else {\r\n debug('sending query: ' + querystring, 1);\r\n httpobj.send(querystring);\r\n }\r\n\r\n if (async == false) {\r\n // manual callback handling for synchronized calls\r\n callback();\r\n }\r\n }\r\n\r\n this.test_ajax_capability = function() {\r\n return get_connection_object();\r\n }\r\n \r\n /**\r\n * creates a new connection object.\r\n *\r\n * @access protected\r\n * @return boolean\r\n */\r\n var get_connection_object = function() {\r\n var return_value = false;\r\n var new_connection = false;\r\n\r\n // open new connection only if necessary\r\n if (persistent_connection == false) {\r\n // no persistance, create a new object every time\r\n debug('Using new connection object', 1);\r\n new_connection = true;\r\n\r\n } else {\r\n // persistent connection object, only open one if no object exists\r\n debug('Using shared connection object.', 1);\r\n\r\n if (typeof httpobj != 'object') {\r\n debug('Getting new persistent connection object.', 1);\r\n new_connection = true;\r\n }\r\n }\r\n\r\n if (new_connection == true) {\r\n try {\r\n httpobj = new ActiveXObject('Msxml2.XMLHTTP');\r\n \r\n } catch (e) {\r\n \r\n try { \r\n httpobj = new ActiveXObject('Microsoft.XMLHTTP');\r\n \r\n } catch (oc) {\r\n httpobj = null;\r\n } \r\n }\r\n \r\n if (!httpobj && typeof XMLHttpRequest != 'undefined') {\r\n httpobj = new XMLHttpRequest();\r\n }\r\n \r\n if (!httpobj) {\r\n alert('[CPAINT Error] Could not create connection object');\r\n \r\n } else {\r\n return_value = true;\r\n }\r\n }\r\n\r\n // @todo: problem with asynchronous calls?\r\n if (httpobj.readyState != 4) {\r\n httpobj.abort();\r\n }\r\n\r\n return return_value;\r\n }\r\n\r\n /**\r\n * internal callback function.\r\n *\r\n * will perform some consistency checks (response code, NULL value testing)\r\n * and if response_type = 'OBJECT' it will automatically call\r\n * cpaint_call.parse_ajax_xml() to have a JavaScript object structure generated.\r\n *\r\n * after all that is done the client side callback function will be called \r\n * with the generated response as single value.\r\n *\r\n * @access protected\r\n * @return void\r\n */\r\n var callback = function() {\r\n var response = null;\r\n\r\n if (httpobj.readyState == 4) {\r\n debug(httpobj.responseText, 1);\r\n \r\n // fetch correct response\r\n switch (response_type) {\r\n case 'XML':\r\n response = __cpaint_transformer.xml_conversion(httpobj.responseXML);\r\n break;\r\n \r\n case 'OBJECT':\r\n response = __cpaint_transformer.object_conversion(httpobj.responseXML);\r\n break;\r\n \r\n case 'TEXT':\r\n response = __cpaint_transformer.text_conversion(httpobj.responseText);\r\n break;\r\n \r\n default:\r\n alert('[CPAINT Error] invalid response type \\'' + response_type + '\\'');\r\n }\r\n \r\n // call client side callback\r\n if (response != null \r\n && typeof client_callback == 'function') {\r\n client_callback(response, httpobj.responseText, ajaxObject);\r\n }\r\n \r\n // remove ourselves from the stack\r\n remove_from_stack();\r\n }\r\n }\r\n\r\n /**\r\n * removes an entry from the stack\r\n *\r\n * @access protected\r\n * @return void\r\n */\r\n var remove_from_stack = function() {\r\n // remove only if everything is okay and we're not configured as persistent connection\r\n if (typeof stack_id == 'number'\r\n && __cpaint_stack[stack_id]\r\n && persistent_connection == false) {\r\n \r\n __cpaint_stack[stack_id] = null;\r\n }\r\n }\r\n\r\n /**\r\n * debug method\r\n *\r\n * @access protected\r\n * @param string message the message to debug\r\n * @param integer debug_level debug level at which the message appears\r\n * @return void\r\n */\r\n var debug = function(message, debug_level) {\r\n\r\n if (debugging >= debug_level) {\r\n alert('[CPAINT Debug] ' + message);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9c02b7d7d2030efd2f9abb0b340de2ad", "score": "0.46172547", "text": "function onlookup(err, ip) {\n if (err) return fn(err);\n options.destination.host = ip;\n SocksClient.createConnection(options, onhostconnect);\n }", "title": "" }, { "docid": "b431a1b914020f76994b25853ff954a7", "score": "0.46060127", "text": "function startSSDP(thisNode, port, config)\n {\n //Sanity check\n if (port === null || port === undefined || port <= 0 || port >= 65536) {\n var errorMsg = \"port is in valid (\" + port + \")\";\n thisNode.status({fill:\"red\", shape:\"ring\", text:errorMsg});\n RED.log.error(errorMsg);\n return;\n }\n\n var ssdp = require(\"peer-ssdp\");\n var peer = ssdp.createPeer();\n peer.on(\"ready\", function(){\n });\n peer.on(\"notify\", function(headers, address){\n });\n peer.on(\"search\", function(headers, address){\n var isValid = headers.ST && headers.MAN == '\"ssdp:discover\"';\n if (!isValid)\n return;\n\n var uuid = formatUUID(config.id);\n var hueuUuid = formatHueBridgeUUID(config.id);\n\n // {{networkInterfaceAddress}} will be replaced with the actual IP Address of\n // the corresponding network interface. \n var xmlLocation = \"http://{{networkInterfaceAddress}}:\" + port + \"/upnp/amazon-ha-bridge/setup.xml\";\n\n // Response with 3 different templates\n // https://github.com/bwssytems/ha-bridge/blob/master/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java\n var responseObj1 = {\n HOST: \"239.255.255.250:1900\",\n \"CACHE-CONTROL\": \"max-age=100\",\n EXT: \"\",\n LOCATION: xmlLocation,\n SERVER: \"Linux/3.14.0 UPnP/1.0 IpBridge/1.17.0\",\n \"hue-bridgeid\": uuid,\n ST: \"upnp:rootdevice\",\n USN: \"uuid:\" + hueuUuid\n };\n var responseObj2 = {\n HOST: \"239.255.255.250:1900\",\n \"CACHE-CONTROL\": \"max-age=100\",\n EXT: \"\",\n LOCATION: xmlLocation,\n SERVER: \"Linux/3.14.0 UPnP/1.0 IpBridge/1.17.0\",\n \"hue-bridgeid\": uuid,\n ST: \"uuid:\" + hueuUuid,\n USN: \"uuid:\" + hueuUuid\n };\n var responseObj3 = {\n HOST: \"239.255.255.250:1900\",\n \"CACHE-CONTROL\": \"max-age=100\",\n EXT: \"\",\n LOCATION: xmlLocation,\n SERVER: \"Linux/3.14.0 UPnP/1.0 IpBridge/1.17.0\",\n \"hue-bridgeid\": uuid,\n ST: \"urn:schemas-upnp-org:device:basic:1\",\n USN: \"uuid:\" + hueuUuid\n };\n\n //Delay: timing fix for Echo Dot Gen 2\n //https://github.com/bwssytems/ha-bridge/issues/860\n setTimeout(function() {\n peer.reply(responseObj1, address);\n }, 1500 + 100*1);\n\n setTimeout(function() {\n peer.reply(responseObj2, address);\n }, 1500 + 100*2);\n\n setTimeout(function() {\n peer.reply(responseObj3, address);\n }, 1500 + 100*3);\n\n });\n peer.on(\"found\",function(headers, address){\n });\n peer.on(\"close\",function(){\n });\n peer.start();\n }", "title": "" }, { "docid": "d70883be7ed73e8ca46eade9a650f46b", "score": "0.4602166", "text": "function doCall() {\n console.log(\"Sending offer to peer\");\n pc.createOffer(setLocalAndSendMessage, handleCreateOfferError);\n}", "title": "" }, { "docid": "3ff9e3ff8f6d5308db33cf33cc724b22", "score": "0.45777494", "text": "async getPlcrAddress () {\n try {\n return this.parameterizer.voting.call()\n } catch (error) {\n throw error\n }\n }", "title": "" }, { "docid": "a1a1574d19a123a10d32a81046f27465", "score": "0.4568471", "text": "function I2cDev(address, options) {\n i2c.call(this, address, options);\n}", "title": "" }, { "docid": "7d5ea1ed5a9eff0f9f091e3152b791b8", "score": "0.45667735", "text": "function preChan(cb) {\n\t\t//console.log('conn');\n\t\tvar connection = MikroNode.getConnection(serverIp, 'admin', '123456789#a');\n\t\t//console.log('affter conn');\n\t\tconnection.closeOnDone = true;\n\n\t\tconnection.connect(function (conn) {\n\t\t\tvar chan = conn.openChannel();\n\t\t\tchan.closeOnDone = true;\n\t\t\t//showUser(chan);\n\t\t\tcb(chan, conn);\n\n\t\t});\n\t\t// connection.getConnectPromise().then(function (conn) {\n\t\t// \tconn.getCommandPromise('/ip/address/print').then(function resolved(values) {\n\t\t// \t\tconsole.log('Addreses: ' + JSON.stringify(values));\n\t\t// \t}, function rejected(reason) {\n\t\t// \t\tconsole.log('Oops: ' + JSON.stringify(reason));\n\t\t// \t});\n\t\t// });\n\t}", "title": "" }, { "docid": "2698602068eabbed5666bc18c1e37c8d", "score": "0.45540714", "text": "function doCall() {\n console.log('Sending offer to peer');\n pc.createOffer(setLocalAndSendMessage, handleCreateOfferError);\n}", "title": "" }, { "docid": "8490b9a7229ea26801f63d16b189910a", "score": "0.4551322", "text": "gossip () {\r\n\t\tvar ip = this.findRandomNode();\r\n\t\trequest.post({\r\n\t\t\turl: 'http://' +ip+'/gossip',\r\n\t\t\tjson: true,\r\n\t\t\tbody: {\r\n\t\t\t\tvc: this.vc.clock,\r\n\t\t\t\tkvs: this.kvs\r\n\t\t\t}\r\n\t\t}, (err, res, body) => {\r\n\t\t\t\tif(!err) {\r\n\t\t\t\t\tthis.kvs = body.kvs;\r\n\t\t\t\t\tthis.vc.copyClock(body.vc);\r\n\t\t\t\t\t// this.vc.clock = body.vc;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "9ccc056163ea4e296edd4dd2eae16749", "score": "0.45471975", "text": "getExplorerURL(address) {\n if (!address) {\n return 'https://qtum.info//';\n } else {\n return `https://qtum.info/contract/${address}`;\n }\n }", "title": "" }, { "docid": "279cbdd6d824b5c33e1eb3a2eeb2f7ec", "score": "0.45417327", "text": "function io_write(address, value) { \n const port = address & 0xFF; \n if(port === 1) { \n putchar(value); \n return;\n } \n}", "title": "" }, { "docid": "bba55b63caddc6b5e3897bf73fb762eb", "score": "0.45357025", "text": "function ConnectToEjidoChain(){\n\tconst proc = 'multichaind [email protected]:4787';\n\tconst proc2 = 'multichaind chainInteroEjido -daemon';\n\tcmd.get(proc);\n\tcmd.get(proc2);\n}", "title": "" }, { "docid": "88ce6a96633c4bfce0c86d845253743e", "score": "0.45270935", "text": "function onlookup (err, ip, type) {\n if (err) return fn(err);\n options.target.host = ip;\n SocksClient.createConnection(options, onhostconnect);\n }", "title": "" }, { "docid": "abdd6207dde156f748e823f295dadfb0", "score": "0.45194554", "text": "function Show_AddreListDestino() {\n gdvAddress.PerformCallback(\"DirecDestino:\" + codigo_cliente);\n ppcClientAddress.Show();\n}", "title": "" }, { "docid": "4b608624d1d8841c3c4949b66b880c90", "score": "0.4506788", "text": "function toAccAddress(address) {\n return encoding_1.Bech32.decode(address).data;\n}", "title": "" }, { "docid": "de8068eb451bd3c599b44d148e9b653e", "score": "0.45056415", "text": "function formatEthAdr(adr){\r\n\tvar _smallAdr = adr.substring(0, 10);\r\n\tvar _stringLink = '<a href=\"https://etherscan.io/address/' + adr + '\" target=\"_blank\">' + _smallAdr + '</a>';\r\n\treturn _stringLink;\r\n}", "title": "" }, { "docid": "f3f18d13b83b1e11191ba9e0be51f9b8", "score": "0.4499967", "text": "function doCall() {\r\n\tlogThis('Sending offer to peer, with constraints: \\n' +\r\n\t\t\t' \\'' + JSON.stringify(sdpConstraints) + '\\'.');\r\n\tpc.createOffer(setLocalAndSendMessage,\r\n\t\t\tonCreateSessionDescriptionError, sdpConstraints); \r\n}", "title": "" }, { "docid": "90fcfb8fff43a963f19162548bba7dd3", "score": "0.4492898", "text": "call(address, state, msg) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tvar pgm = fork(path.resolve(address), [], { silent: true, env: { storage: stringify(state), msg: stringify(msg) } });\n\t\t\tpgm.on('message', (msg) => {\n\t\t\t\tswitch(msg.cmd) {\n\t\t\t\t\tcase 'balance':\n\t\t\t\t\t\tconsole.log(\"balance\");\n\t\t\t\t\t\tconsole.log(msg.balance);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'close':\n\t\t\t\t\t\tconsole.log(\"close\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.log(\"fallback\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t//pgm.stdout.pipe(process.stdout);\n\t\t\tpgm.stdout.on('data', function(data) {\n\t\t\t\tconsole.log('stdout: ' + data);\n\t\t\t});\n\t\t\tpgm.stderr.on('data', function(data) {\n\t\t\t\tconsole.log('stdout: ' + data);\n\t\t\t});\n\t\t\tpgm.on('close', function(code) {\n\t\t\t\tconsole.log('closing code: ' + code);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "1471d1a7dc359672ca93d988200467d5", "score": "0.44927934", "text": "connecting(peerAddress){const peerAddressState=this._store.get(peerAddress);if(!peerAddressState){return;}if(peerAddressState.state===PeerAddressState.BANNED){throw'Connecting to banned address';}if(peerAddressState.state===PeerAddressState.CONNECTED){throw`Duplicate connection to ${peerAddress}`;}peerAddressState.state=PeerAddressState.CONNECTING;}", "title": "" }, { "docid": "8e84430781d2618f2f4c37e6a43d30a8", "score": "0.4480677", "text": "function sendPeerCommand(peerAddress, datatype, command = {}) {\n return sendCommand(peerAddress, 'normal', datatype, command);\n}", "title": "" }, { "docid": "3503247300790fb8de5a7faa5e4899a8", "score": "0.44731492", "text": "generateSegWitAddress(keyPair) {\n if (!keyPair.network || !keyPair.network.connect) {\n throw new Error('Invalid keypair type');\n }\n const key = this.bitcoinlib.ECPair.fromWIF(keyPair.privateKey, keyPair.network.connect);\n const { address } = this.bitcoinlib.payments.p2wpkh({\n pubkey: key.publicKey,\n network: keyPair.network.connect,\n });\n return address;\n }", "title": "" }, { "docid": "1eb7e67484690abff0d584c0e114f5cd", "score": "0.44615522", "text": "function getCoord(cAddr) {\n\t\tvar address = cAddr;\n\t\t\n\t\t//This is where I ma getting the longitude and lattitude\n\t\tgeocoder.geocode( {'address': address}, function(results, status) {\n\t\tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\tvar myLatLang = results[0].geometry.location;\n\t\t\tclat = results[0].geometry.location.lat();\n\t\t\tclng = results[0].geometry.location.lng();\t\t\n\t\t\t\tdrawMap();\n\t\t }\n\t\t\t\n\t\t\t});\n\t}", "title": "" }, { "docid": "9350c825eb6c3f9747157f958a30a69b", "score": "0.44503957", "text": "function Address() { }", "title": "" }, { "docid": "e2f7f2e36a87bdc05007e60afa5bbe4a", "score": "0.44421098", "text": "function getLegacyAddress(xpub, account, index) {\n const { address } = bjs.payments.p2pkh({\n pubkey: bip32\n .fromBase58(xpub, global.network)\n .derive(account)\n .derive(index).publicKey,\n network: global.network\n });\n \n return address;\n}", "title": "" }, { "docid": "5846982a1d337043017f07ab9f0f49ab", "score": "0.44149244", "text": "sendGetAddr() {\n if (this.sentGetAddr)\n return;\n\n this.sentGetAddr = true;\n this.send(new packets.GetAddrPacket());\n }", "title": "" }, { "docid": "48c7a550632132417def246b6b98b39f", "score": "0.4413996", "text": "get NATpunchthroughFullCone() {}", "title": "" }, { "docid": "843e3cc9b41a5c44dd00a5927c9bed31", "score": "0.44109493", "text": "openBillingAddress(){\n this.url = this.url + getFieldValue(this.record.data, BILLINGSTREET_FIELD)\n + \"+\" + getFieldValue(this.record.data, BILLINGCITY_FIELD)\n + \"+\" + getFieldValue(this.record.data, BILLINGSTATE_FIELD)\n + \"+\" + getFieldValue(this.record.data, BILLINGCOUNTRY_FIELD);\n this.openMapPage();\n }", "title": "" }, { "docid": "6e3b9733f71cfada2f7c21df2a1f4d5d", "score": "0.44100702", "text": "function paddy(n, p, c) {\n\tvar pad_char = typeof c !== 'undefined' ? c : '0';\n\tvar pad = new Array(1 + p).join(pad_char);\n\treturn (pad + n).slice(-pad.length);\n}", "title": "" }, { "docid": "dde628f658bcf9e2f928a626fbbd82ea", "score": "0.4408386", "text": "getExplorerURL(address) {\n if (!address) {\n return 'https://blockstream.info/liquid/';\n } else {\n return `https://blockstream.info/liquid/address/${address}`;\n }\n }", "title": "" }, { "docid": "f3acd2d72db2072a4d31b39b62f6bbe1", "score": "0.44069624", "text": "function showAddress(address) {\n\t\tif ( !address.match(\",\") ){\n\t\t address += \", San Benedetto del Tronto, Italia\";\n\t\t}\n\t\tif (geocoder) {\n\t\t\tgeocoder.getLatLng(\n\t\t\t\taddress,\n\t\t\t\tfunction(point) {\n\t\t\t\t\tif (!point) {\n\t\t\t\t\t\talert(address + \" not found\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgmap.setCenter(point, 17);\n\t\t\t\t\t\tvar marker = new GMarker(point);\n\t\t\t\t\t\tgmap.addOverlay(marker);\n\t\t\t\t\t\tmarker.openInfoWindowHtml(address+\"</br>\"+point.lat()+\",\"+point.lng());\n\t\t\t\t\t\tsynchronizeParentMap();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n }", "title": "" }, { "docid": "7cc847e1e8e1ccc58d6726018f8e725d", "score": "0.43977597", "text": "async migrateCdp() {\n const currentProxy = await this.getProxy();\n if (!currentProxy) {\n this.needsUpdate = true;\n return await this.proxyService.ensureProxy();\n } else if (this.needToFinishMigrating) {\n this.needsUpdate = true;\n await this.cdpService.give(this.cdpId, this._proxyAddress);\n }\n }", "title": "" }, { "docid": "b05fdadd627cb11d8ecb5a61252bd8dc", "score": "0.4395886", "text": "constructor() {\n super();\n this.type = exports.types.GETADDR;\n }", "title": "" }, { "docid": "7b2c7cf8f33b6f851fe6522a3b4b0d88", "score": "0.43864542", "text": "set cenpoint(pt) {\r\n this.cenpt = pt;\r\n }", "title": "" }, { "docid": "69ad4b5dec982a221a344679a791631e", "score": "0.43837228", "text": "function call() {\n\n\n // First of all, disable the 'Call' button on the page...\n callButton.disabled = true;\n // ...and enable the 'Hangup' button\n hangupButton.disabled = false;\n log(\"Starting call\");\n \n // Chrome\n if (navigator.webkitGetUserMedia) {\n RTCPeerConnection = webkitRTCPeerConnection;\n // Firefox\n }else if(navigator.mozGetUserMedia){\n RTCPeerConnection = mozRTCPeerConnection;\n RTCSessionDescription = mozRTCSessionDescription;\n RTCIceCandidate = mozRTCIceCandidate;\n }\n log(\"RTCPeerConnection object: \" + RTCPeerConnection);\n \n // This is an optional configuration string, associated with NAT traversal setup\n //var servers = null;\n \n\n createPeerConnection();\n \n // We're all set! Create an Offer to be 'sent' to the callee as soon as the local SDP is ready\n pc.createOffer(gotLocalDescription, onSignalingError);\n}", "title": "" }, { "docid": "6d1090dbb3b3741ea24f6c6548dcd0bd", "score": "0.43750808", "text": "function get_Address_from_rId_cId(rId, cId){\n let rowId = rId + 1 ;\n let colId = String.fromCharCode(65 + cId);\n\n return `${colId}${rowId}`;\n}", "title": "" }, { "docid": "13d2a4099c9a739752418320e13ccd57", "score": "0.43714225", "text": "get address() {\n return this.options.hostAddress.toString();\n }", "title": "" }, { "docid": "13d2a4099c9a739752418320e13ccd57", "score": "0.43714225", "text": "get address() {\n return this.options.hostAddress.toString();\n }", "title": "" }, { "docid": "14a28a0ebaabdc4aa9b3c5c76645ca41", "score": "0.436977", "text": "function myIpAddress() {\n return \"192.168.1.22\";\n}", "title": "" }, { "docid": "d803b970e97aab51feef4d801e63d395", "score": "0.4366123", "text": "function cbk(info) {\n \tvar output = {\n \t\tname: \"traceroute\",\n \t\tos: os,\n \t\tparams: [host]\n \t};\n \tvar data = libParse(output, info);\n \tcallback(data);\n }", "title": "" }, { "docid": "a38fde4f778903a692880683a191744d", "score": "0.43488905", "text": "function showAddr(addr) {\n console.log(\"Addresses: \");\n for (let i = 0; i < addr.length; i++) {\n console.log(addr[i]);\n }\n}", "title": "" }, { "docid": "e7ff1832b81d804b73b6ea425aa3cea7", "score": "0.43470132", "text": "function setupIPserver(){\nwindow.parent.centralni.location.href= '../admin/network.php';\n}", "title": "" } ]
4d3a44dae2e52ec8dd8352347cfa6a3f
Replace all occurrences of a string with another string.
[ { "docid": "400fd93c2e553772c2f868abaff2824c", "score": "0.713912", "text": "function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n}", "title": "" } ]
[ { "docid": "7bfce63277df95ddec0542a89f5b58ec", "score": "0.7693493", "text": "function replaceAll(str, search, repl) {\r\n\t\twhile (str.indexOf(search) != -1)\r\n\t\t\tstr = str.replace(search, repl);\r\n\t\treturn str;\r\n\t}", "title": "" }, { "docid": "c44f5787c234ff2eab86bb30c1749980", "score": "0.74724907", "text": "function replaceAll(str, find, replace) {\n\t\t\t\t\t\t\t\twhile (str.indexOf(find) > -1) {\n\t\t\t\t\t\t\t\t\tstr = str.replace(find, replace);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn str;\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "8ac746a35c35d24317ffc3b89cadd5f8", "score": "0.7372224", "text": "function replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, 'g'), replace); }", "title": "" }, { "docid": "52d437d1a7cc93385b2731d990b1366a", "score": "0.733137", "text": "function replaceAll(str, searchStr, replaceStr) {\n return str.split(searchStr).join(replaceStr);\n}", "title": "" }, { "docid": "f631bc6e9a6fb126264a377e48eb3f04", "score": "0.7305348", "text": "function replaceAll(find, replace, str) {\n return str.replace(new RegExp(find, 'g'), replace);\n}", "title": "" }, { "docid": "f631bc6e9a6fb126264a377e48eb3f04", "score": "0.7305348", "text": "function replaceAll(find, replace, str) {\n return str.replace(new RegExp(find, 'g'), replace);\n}", "title": "" }, { "docid": "251d6a700028d1ea51bbc3d10ddc9a9a", "score": "0.7296871", "text": "function replaceAll(find, replace, str) {\n\treturn str.replace(new RegExp(find, 'g'), replace);\n}", "title": "" }, { "docid": "d7dee931cf8e357a308d378cfd0cc1c7", "score": "0.7280611", "text": "function replaceAll(string, find, replace) {\n return string.replace(new RegExp(find, 'g'), replace);\n}", "title": "" }, { "docid": "fe6690995592392caf9d18bfc5f2bbc2", "score": "0.7278821", "text": "function replaceAllStr (st, s1, s2)\r\n{\r\n if (s1!==s2)\r\n for (var i=1; i>=0;)\r\n {\r\n i = st.indexOf(s1);\r\n if (i>=0)\r\n st = st.replace(s1,s2);\r\n }\r\n return st;\r\n}", "title": "" }, { "docid": "ce6dc18a602e57c37b21c0fe963c77b7", "score": "0.7259153", "text": "function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n }", "title": "" }, { "docid": "ce6dc18a602e57c37b21c0fe963c77b7", "score": "0.7259153", "text": "function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n }", "title": "" }, { "docid": "f708587aca5e3750afe13cf496272e51", "score": "0.72305334", "text": "function replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, 'g'), replace);\n }", "title": "" }, { "docid": "2606b02d9ba4e5818748277f8223260d", "score": "0.72218084", "text": "function string_replace_all(str, find, replace) \n{\n return (str.replace(new RegExp(escapeRegExp(find), 'g'), replace));\n}", "title": "" }, { "docid": "510cd333a86d01f5330a9592f97d040d", "score": "0.7219073", "text": "function replaceAll(str, find, replace) {\r\n\t return str.replace(new RegExp(find, 'g'), replace);\r\n\t}", "title": "" }, { "docid": "04837c07d74a382cb187c371acd28cae", "score": "0.7190207", "text": "function replaceAll(string, token, newtoken) {\n while (string.indexOf(token) != -1) {\n string = string.replace(token, newtoken);\n }\n return string;\n}", "title": "" }, { "docid": "1b7ac4cf20b8ceeae3c98e3342254ae9", "score": "0.7188443", "text": "function replaceAll(str, find, replace) {\n for (var i = 0; i < 20 && str.indexOf(find) > -1; i++) {\n str = str.replace(find, replace);\n }\n return str;\n }", "title": "" }, { "docid": "466a8c8d5b72c82ab12461f6b0605dd1", "score": "0.7175206", "text": "function replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, 'g'), replace);\n}", "title": "" }, { "docid": "e19338b3c9ec3f217849edceb2c9f3bd", "score": "0.71719825", "text": "function replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, 'g'), replace);\n}", "title": "" }, { "docid": "f7d8104a4b94ae05ee10153ffaf773b3", "score": "0.7117416", "text": "function replaceAll(str, find, replace) {\n var i = str.indexOf(find);\n if (i > -1){\n str = str.replace(find, replace); \n i = i + replace.length;\n var st2 = str.substring(i);\n if(st2.indexOf(find) > -1){\n str = str.substring(0,i) + replaceAll(st2, find, replace);\n } \n }\n return str;\n}", "title": "" }, { "docid": "97ee1414e1ea73915cad638524a81d67", "score": "0.7084869", "text": "function stringReplace() {\n result = phrase.replace(/the/g, 'the great');\n return result;\n}", "title": "" }, { "docid": "59e9b568a6e609376cd29d1bd81fe405", "score": "0.7034134", "text": "function replaceAll(str, find, replace)\n{\n\treturn str.replace(new RegExp(escapeRegExp(find), 'g'), replace);\n}", "title": "" }, { "docid": "86dede86117f5f6afd6c541e9c3aedd9", "score": "0.70021164", "text": "function replaceAll(str, term, replacement) {\n\t\t\t\treturn str.replace(new RegExp(escapeRegExp(term), 'g'), replacement);\n\t\t\t}", "title": "" }, { "docid": "af98bcf32857c168012262f78574083a", "score": "0.6986903", "text": "function replaceAll(/*String*/ haystack, /*String*/ needle, /*String*/ replacement) {\n return haystack.replace(new RegExp(escapeRegexPattern(needle), 'g'), replacement);\n}", "title": "" }, { "docid": "42217b04b5c3810f45a02f4030ae5e53", "score": "0.69789606", "text": "function jj_replaceAll(str,strFrom,strTo)\n{ \n if (typeof(str) == \"undefined\"){\n return \"\";\n }\t\n while (str.indexOf(strFrom)>-1) {\n\t str = str.replace(strFrom,strTo);\n }\t\n return str; \n}", "title": "" }, { "docid": "45e0ed3055d944be9431fa4e91b86915", "score": "0.6967814", "text": "function replaceAll(src,search,replace){\n return src.split(search).join(replace);\n}", "title": "" }, { "docid": "c7fb25d848a0aaf2960c741629692fe3", "score": "0.6943651", "text": "static replaceAll(input, searchValue, replaceValue) {\n return input.split(searchValue).join(replaceValue);\n }", "title": "" }, { "docid": "b17b337e4efa729bf24f11f84b6c323e", "score": "0.6858491", "text": "function replaceAll(x, y, z){\n return x.toString().replace(new RegExp(y, \"g\"), z);\n}", "title": "" }, { "docid": "5f0bb0421d2636f892439c488a948a3b", "score": "0.6781829", "text": "function replaceAll(self, search, replacement) {\n return self.split(search).join(replacement);\n}", "title": "" }, { "docid": "22543b17310a04319ca7282f4670f68a", "score": "0.6770302", "text": "function str_replace(search, replace, subject) {\n return subject.split(search).join(replace);\n }", "title": "" }, { "docid": "3d7a323bbc6f89871c8d15eaba162a0f", "score": "0.6768891", "text": "function str_replace(haystack, needle, replacement) {\n\tvar temp = haystack.split(needle);\n\treturn temp.join(replacement);\n}", "title": "" }, { "docid": "628fb5e3ee0e2ba9232764f762edd073", "score": "0.6743678", "text": "function replaceAll(text, busca, reemplaza) {\n while (text.toString().indexOf(busca) != - 1)\n text = text.toString().replace(busca, reemplaza);\n return text;\n}", "title": "" }, { "docid": "f796260014c405144f867a659ae55a9c", "score": "0.6737943", "text": "function replaceAll(str, term, replacement) {\nreturn str.replace(new RegExp(escapeRegExp(term), 'g'), replacement);\n}", "title": "" }, { "docid": "ab9b5fa00d20fde9642d407f845e6226", "score": "0.67341787", "text": "function replaceWith(str, repArr) {\n // eliminates instead of replaces if the replaceable\n // parts of the string are at the beginning or end \n // but this is just for cleaning up markdown language \n return str.split(repArr[0]).join(repArr[1])\n }", "title": "" }, { "docid": "49f270e3cf4b2d29e42164885f2e1720", "score": "0.6710889", "text": "function replace(str, needle, newStr) {\n return str.replace(needle, newStr);\n}", "title": "" }, { "docid": "0426864fbfb3f7a7b24b7fbd7e9a42b6", "score": "0.6699471", "text": "function stringReplace(string, whatToReplace, replacement) {\n if (!string || !replacement) { console.log('Missing an Argument.'); return; }\n \n for (var i=0; i<string.length; i++) {\n if (string[i] == whatToReplace) {\n string = string.substr(0, i) + replacement + string.substr(i+1);\n }\n }\n console.log(string);\n return string;\n}", "title": "" }, { "docid": "5029f75727df5f25ac85e6618baade51", "score": "0.6697281", "text": "function replaceMeIfYouCan(strings) {\n\n}", "title": "" }, { "docid": "0854e1324733d952eabe5c6778abeb74", "score": "0.6694429", "text": "function replaceAll( Source, stringToFind, stringToReplace )\n{\n\tvar temp = Source;\n\tvar index = temp.indexOf( stringToFind );\n\n\twhile( index != -1 )\n\t{\n\t\ttemp = temp.replace( stringToFind, stringToReplace );\n\t\tindex = temp.indexOf( stringToFind );\n\t}\n\n\treturn temp;\n}", "title": "" }, { "docid": "21ca53005d82a7cd482dff0fd1168619", "score": "0.6693234", "text": "function replace (regex, str)\n {\n var out2 = out.replace(regex, str);\n if (out == out2) {\n throw new Error('Redundant replace.');\n }\n out = out2;\n }", "title": "" }, { "docid": "156f84620232492e5c7b78230a270fee", "score": "0.6676059", "text": "function myFunction() {\n\n let str1 = \"How you doin?\";\n \n let str2 = str1.replace(\"you\", \"yall\");\n \n console.log(str2);\n \n }", "title": "" }, { "docid": "bcfde1af874ac7f5c82b9b9ecce36dcc", "score": "0.6651389", "text": "function replaceAll(string, char, rep){\r\n if(string.indexOf(char) < 0){\r\n return string\r\n } else {\r\n string = string.replace(char,rep)\r\n if(string.indexOf(char)>=0){\r\n return replaceAll(string,char,rep)\r\n } else {\r\n return string\r\n }\r\n }\r\n}", "title": "" }, { "docid": "67498e405ad332867932bcd9d7ecf421", "score": "0.6650339", "text": "function replaceAll(s, token, replace) {\n const pieces = s.split(token);\n const resultingString = pieces.join(replace);\n return resultingString;\n}", "title": "" }, { "docid": "f624462be206546bb6b4e3b7e03d9c86", "score": "0.6636184", "text": "function replaceAll(sReplace, tReplace, rReplace) {\r\n\tvar rArray = sReplace.split(tReplace);\r\n\tvar nReplace = rArray.length-1;\r\n\t\twhile(nReplace >= 1) {\r\n\t\t\tsReplace = sReplace.replace(tReplace, rReplace);\r\n\t\t\tnReplace--;\r\n\t\t}\r\n\treturn sReplace;\r\n}", "title": "" }, { "docid": "08b19c2c2fe0fc6c32af1cbd3eede106", "score": "0.6562854", "text": "function replaceAll(search, replace, subject) {\n while (subject.indexOf(search) != -1) {\n subject = subject.replace(search, replace);\n }\n return subject;\n}", "title": "" }, { "docid": "61109181eddf9f05a66cd9fc95d44897", "score": "0.6554979", "text": "function replaceString(content, search, replace) {\n var index = 0;\n\n do {\n index = content.indexOf(search, index);\n\n if (index !== -1) {\n content = content.substring(0, index) + replace + content.substr(index + search.length);\n index += replace.length - search.length + 1;\n }\n } while (index !== -1);\n\n return content;\n }", "title": "" }, { "docid": "da6c8ed4827d7ab07026e1dad76e1d4c", "score": "0.65253115", "text": "function replaceWord(firstString,secondString,thirdString) {\n return firstString.replace(secondString,thirdString);\n }", "title": "" }, { "docid": "be0f788ea21b38d5b5a597dac7a1f53d", "score": "0.6516766", "text": "function replaceAll(string,text,by) {\r\n// Replaces text with by in string\r\n var strLength = string.length, txtLength = text.length;\r\n if ((strLength == 0) || (txtLength == 0)) return string;\r\n\r\n var i = string.indexOf(text);\r\n if ((!i) && (text != string.substring(0,txtLength))) return string;\r\n if (i == -1) return string;\r\n\r\n var newstr = string.substring(0,i) + by;\r\n\r\n if (i+txtLength < strLength)\r\n newstr += replaceAll(string.substring(i+txtLength,strLength),text,by);\r\n\r\n return newstr;\r\n}", "title": "" }, { "docid": "88f394ebba5d60cfb6c04cb7d819592a", "score": "0.65073013", "text": "function replace(str, url) {\n if (typeof url === \"function\") return replace.iterate(str, url);\n return str.replace(replace.rx, \"$1\" + url + \"/$4\");\n}", "title": "" }, { "docid": "904ef020f4c62f9d66b4c7fe4b04caf7", "score": "0.650585", "text": "function jsReplace(inString, find, replace) {\n\n var outString = \"\";\n\n if (!inString) {\n return \"\";\n }\n\n // REPLACE ALL INSTANCES OF find WITH replace\n if (inString.indexOf(find) != -1) {\n // SEPARATE THE STRING INTO AN ARRAY OF STRINGS USING THE VALUE IN find\n t = inString.split(find);\n\n // JOIN ALL ELEMENTS OF THE ARRAY, SEPARATED BY THE VALUE IN replace\n return (t.join(replace));\n }\n else {\n return inString;\n }\n}", "title": "" }, { "docid": "534ab48a6bbec0e6d9988aa826773387", "score": "0.6495189", "text": "function replacer(s,val,pos){\n var out = '';\n\n for(var i = 0;i < s.length; i++){\n if(i==pos){\n out += val;\n } else {\n out += s[i];\n }\n }\n return out;\n}", "title": "" }, { "docid": "820e09e04817035af280b846686a5be2", "score": "0.64611167", "text": "function str_replace(search, replace, subject, count) {\n\t var i = 0,\n\t j = 0,\n\t temp = '',\n repl = '',\n sl = 0,\n fl = 0,\n f = [].concat(search),\n r = [].concat(replace),\n s = subject,\n ra = Object.prototype.toString.call(r) === '[object Array]',\n sa = Object.prototype.toString.call(s) === '[object Array]';\n s = [].concat(s);\n if (count) {\n this.window[count] = 0;\n }\n for (i = 0, sl = s.length; i < sl; i++) {\n if (s[i] === '') {\n continue;\n }\n for (j = 0, fl = f.length; j < fl; j++) {\n temp = s[i] + '';\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];\n s[i] = (temp)\n .split(f[j])\n .join(repl);\n if (count && s[i] !== temp) {\n this.window[count] += (temp.length - s[i].length) / f[j].length;\n }\n }\n }\n return sa ? s : s[0];\n}", "title": "" }, { "docid": "820e09e04817035af280b846686a5be2", "score": "0.64611167", "text": "function str_replace(search, replace, subject, count) {\n\t var i = 0,\n\t j = 0,\n\t temp = '',\n repl = '',\n sl = 0,\n fl = 0,\n f = [].concat(search),\n r = [].concat(replace),\n s = subject,\n ra = Object.prototype.toString.call(r) === '[object Array]',\n sa = Object.prototype.toString.call(s) === '[object Array]';\n s = [].concat(s);\n if (count) {\n this.window[count] = 0;\n }\n for (i = 0, sl = s.length; i < sl; i++) {\n if (s[i] === '') {\n continue;\n }\n for (j = 0, fl = f.length; j < fl; j++) {\n temp = s[i] + '';\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];\n s[i] = (temp)\n .split(f[j])\n .join(repl);\n if (count && s[i] !== temp) {\n this.window[count] += (temp.length - s[i].length) / f[j].length;\n }\n }\n }\n return sa ? s : s[0];\n}", "title": "" }, { "docid": "91abc08e5e8569d7b4c5af9a946c1d5d", "score": "0.64475393", "text": "function iterativeReplaceAll (inputString, findValues, replaceValues) {\n if (findValues.length !== replaceValues.length)\n return inputString\n\n for (let i = 0, l = findValues.length; i < l; i++) {\n inputString = replaceAll(inputString, findValues[0], replaceValues[0])\n }\n return inputString\n}", "title": "" }, { "docid": "f6e08e666a75485e07a43ca29fa62fcb", "score": "0.6435653", "text": "function replaceWords() {\n var currentString = \"Strawberries are a popular part of spring and summer diets throughout America. Mouths water from coast to coast each spring, when small white blossoms start to appear on strawberry bushes. They announce the impending arrival of the ruby red berries that so many people crave. Ripe strawberries taste sweet and have only a slight hint of tartness. They are also one of the healthiest fruits around. There are countless recipes for the luscious red berry, but many people prefer to eat them fresh and unaccompanied.\";\n var banana = currentString.replace(/strawberry/ig, \"banana\");\n var bananas = banana.replace(/strawberries/ig, \"Bananas\");\n \n console.log(bananas);\n}", "title": "" }, { "docid": "3aa9f804a985733df2f5f1ac702f6911", "score": "0.64220077", "text": "function replaceString(regex, string, replacement) {\n var changed = string.replace(regex, replacement);\n while (changed != string) {\n string = changed;\n changed = string.replace(regex, replacement);\n }\n return changed;\n}", "title": "" }, { "docid": "9cf6fbac3d532eab7065b422fb6c684f", "score": "0.64210886", "text": "function replaceString(repStr, stringToFind, stringToRep)\n {\n sFind = 0;\n newStr = repStr;\n\n while (sFind != -1)\n {\n // FIND THE NEXT OCCURENCE OF THE stringToFind\n sFind = newStr.indexOf(stringToFind);\n\n // IF THERE IS AN OCCURENCE, PERFORM THE REPLACE\n if (sFind != -1)\n {\n startString = newStr.substring(0, sFind); // GET THE STRING BEFORE stringToFind\n endString = newStr.substring(sFind + stringToFind.length, newStr.length); // GET THE STRING AFTER stringToFind\n newStr = startString + stringToRep + endString; // CAT THE STRING BEFORE AND AFTER stringToFind AND INSERT stringToRep IN BETWEEN\n }\n }\n\n return newStr; // RETURN VALUE AFTER REPLACES\n }", "title": "" }, { "docid": "45137680ed1735785e2621d15b761932", "score": "0.63924223", "text": "function replace(str, searchStr, replaceStr) {\n return odata_common_1.filterFunction('replace', 'string', str, searchStr, replaceStr);\n}", "title": "" }, { "docid": "582722ee96547f70cae18d951828b16b", "score": "0.6379956", "text": "function replaceString(sMain, sSearch, sReplace)\n{\n var sFront = getFront(sMain, sSearch);\n var sEnd = getEnd(sMain, sSearch);\n if (sFront == null || sEnd == null)\n {\n return null;\n\n } else {\n return sFront + sReplace + sEnd;\n }\n}", "title": "" }, { "docid": "cb471981066cc697970b26ce07becbd4", "score": "0.6371738", "text": "function stringRepalece(first, second, third) {\n return first.replace(second, third);\n // burada firsten second u cikar yerine third yaz. \n \n}", "title": "" }, { "docid": "843a8f4685ab0f5170dca71ad61534ed", "score": "0.63675797", "text": "function str_replace (search, replace, subject, count) {\n // Replaces all occurrences of search in haystack with replace \n // \n // version: 1102.614\n // discuss at: http://phpjs.org/functions/str_replace\n // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + improved by: Gabriel Paderni\n // + improved by: Philip Peterson\n // + improved by: Simon Willison (http://simonwillison.net)\n // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // + bugfixed by: Anton Ongson\n // + input by: Onno Marsman\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + tweaked by: Onno Marsman\n // + input by: Brett Zamir (http://brett-zamir.me)\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + input by: Oleg Eremeev\n // + improved by: Brett Zamir (http://brett-zamir.me)\n // + bugfixed by: Oleg Eremeev\n // % note 1: The count parameter must be passed as a string in order\n // % note 1: to find a global variable in which the result will be given\n // * example 1: str_replace(' ', '.', 'Kevin van Zonneveld');\n // * returns 1: 'Kevin.van.Zonneveld'\n // * example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars');\n // * returns 2: 'hemmo, mars'\n var i = 0,\n j = 0,\n temp = '',\n repl = '',\n sl = 0,\n fl = 0,\n f = [].concat(search),\n r = [].concat(replace),\n s = subject,\n ra = r instanceof Array,\n sa = s instanceof Array;\n s = [].concat(s);\n if (count) {\n this.window[count] = 0;\n }\n \n for (i = 0, sl = s.length; i < sl; i++) {\n if (s[i] === '') {\n continue;\n }\n for (j = 0, fl = f.length; j < fl; j++) {\n temp = s[i] + '';\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];\n s[i] = (temp).split(f[j]).join(repl);\n if (count && s[i] !== temp) {\n this.window[count] += (temp.length - s[i].length) / f[j].length;\n }\n }\n }\n return sa ? s : s[0];\n}", "title": "" }, { "docid": "6e6dce26f83c39fefcf3daf47a85c9f8", "score": "0.6366416", "text": "function replaceAll (strText , strFinder, strReplacer)\r\n{\r\n\tstrText += \"\";\r\n\tvar strSpecials = /(\\.|\\*|\\^|\\?|\\&|\\$|\\+|\\-|\\#|\\!|\\(|\\)|\\[|\\]|\\{|\\}|\\|)/gi; // :D\r\n\tstrFinder = strFinder.replace(strSpecials, \"\\\\$1\")\r\n\r\n\tvar objRe = new RegExp(strFinder, \"gi\");\r\n\treturn strText.replace(objRe, strReplacer);\r\n}", "title": "" }, { "docid": "99e9bfbcafb064c70bd509b8533384cb", "score": "0.63389176", "text": "function replaceAll(str, token, newToken, ignoreCase) {\n\n var _token;\n var i = -1;\n\n if (typeof token === \"string\") {\n\n if (ignoreCase) {\n\n _token = token.toLowerCase();\n\n while ((i = str.toLowerCase().indexOf(token, i >= 0 ? i + newToken.length : 0)) !== -1) {\n str = str.substring(0, i) +\n newToken +\n str.substring(i + token.length);\n }\n\n } else {\n return str.split(token).join(newToken);\n }\n\n }\n return str;\n }", "title": "" }, { "docid": "78475adeddaa531abbf3e692aacc79c1", "score": "0.63373256", "text": "function replaceAt(string, index, replacement){\n if (!index) index = 0;\n return string.substr(0, index) + replacement + string.substr(index + replacement.length);\n}", "title": "" }, { "docid": "7f4467e4a574f2b9e6b9f89767963a16", "score": "0.63340884", "text": "function replace(str,str_s,str_d)\n{\n var pos=str.indexOf(str_s);\n\n if (pos==-1)\n return str;\n\n var twopart=str.split(str_s);\n var ret=twopart[0];\n\n for(pos=1;pos<twopart.length;pos++)\n ret=ret+str_d+twopart[pos];\n\n return ret;\n}", "title": "" }, { "docid": "c4f611a3ad6341e48cb33bfa133e4ba8", "score": "0.62898517", "text": "function replaceAt (string, index, replace) {\n return string.substring(0, index) + replace + string.substring(index + 1)\n}", "title": "" }, { "docid": "5004993df5abd170a6d53b7439a0f741", "score": "0.6265598", "text": "function str_replace (search, replace, subject, count) \n{\n var i = 0,\n j = 0,\n temp = '',\n repl = '',\n sl = 0,\n fl = 0,\n f = [].concat(search),\n r = [].concat(replace),\n s = subject,\n ra = Object.prototype.toString.call(r) === '[object Array]',\n sa = Object.prototype.toString.call(s) === '[object Array]';\n s = [].concat(s);\n if (count) {\n this.window[count] = 0;\n }\n\n for (i = 0, sl = s.length; i < sl; i++) {\n if (s[i] === '') {\n continue;\n }\n for (j = 0, fl = f.length; j < fl; j++) {\n temp = s[i] + '';\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];\n s[i] = (temp).split(f[j]).join(repl);\n if (count && s[i] !== temp) {\n this.window[count] += (temp.length - s[i].length) / f[j].length;\n }\n }\n }\n return sa ? s : s[0];\n}", "title": "" }, { "docid": "8e4543f0f3b6977c9741de044f1f3a13", "score": "0.6262287", "text": "function replaceText(s, r, v) {\n\twhile(s.match(r))\n\t\ts = s.replace(r, v);\n\t\n\treturn s;\n}", "title": "" }, { "docid": "c3810ce842dc7c3de54c303fa1190bc0", "score": "0.6232888", "text": "function replaceStr(content, originItem, replaceItem) {\n $.each(originItem, function(index, value) {\n content = content.replaceAll(value.toString(), replaceItem[index].toString())\n });\n return content;\n}", "title": "" }, { "docid": "4e5cc7ae42abae8903081e49e40d444b", "score": "0.6230418", "text": "function str_replace(search, replace, subject, count) {\n var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0,\n f = [].concat(search),\n r = [].concat(replace),\n s = subject,\n ra = r instanceof Array, sa = s instanceof Array;\n s = [].concat(s);\n if (count) {\n this.window[count] = 0;\n }\n\n for (i=0, sl=s.length; i < sl; i++) {\n if (s[i] === '') {\n continue;\n }\n for (j=0, fl=f.length; j < fl; j++) {\n temp = s[i]+'';\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];\n s[i] = (temp).split(f[j]).join(repl);\n if (count && s[i] !== temp) {\n this.window[count] += (temp.length-s[i].length)/f[j].length;}\n }\n }\n return sa ? s : s[0];\n}", "title": "" }, { "docid": "b074a2df3c97c07c7c7ffe6cd0bf604c", "score": "0.62300617", "text": "function gscReplaceAll(html, find, replace)\n{\n localAssert(!gscIsEmptyString(html), \"missing html\");\n localAssert(!gscIsEmptyString(find), \"missing find\");\n if (gscIsEmptyString(replace)) { replace = \"\"; }\n\n //Degenerate case.\n if (find == replace) { return html;}\n\n var workingHtml = html;\n var idxFind;\n var lenFind = find.length;\n var lenReplace = replace.length;\n idxFind = workingHtml.indexOf(find);\n while(idxFind >= 0)\n {\n var textBefore = workingHtml.substring(0, idxFind);\n var textAfter = workingHtml.substring(idxFind + lenFind);\n workingHtml = textBefore + replace + textAfter;\n\n //Look for the next occurance\n idxFind = workingHtml.indexOf(find, idxFind + lenReplace);\n }\n\n return workingHtml;\n}", "title": "" }, { "docid": "120358767761790566376466b8db8d0e", "score": "0.62112176", "text": "function Replacer(string) {\n return string.replace(/<br>/g, \"\").replace(/<i>/g, \"**\").replace(/<\\/i>/g, \"**\").replace(/<i\\/>/g, \"**\")\n}", "title": "" }, { "docid": "5ec2ea43984aa6755450564026d63af7", "score": "0.62098724", "text": "function myFunction() {\n\n let str1 = \"How you doin?\";\n\n let str2 = str1.replace(\"o\",\"u\");\n\nconsole.log(str2);\n\n}", "title": "" }, { "docid": "66fdeb965e06d52324b39f3b42722117", "score": "0.6209066", "text": "function replaceAll(target, search, replacement) {\n return target.split(search).join(replacement);\n}", "title": "" }, { "docid": "857ffbf9ea8ed18895a547514f45257f", "score": "0.62028176", "text": "function bananaberry() {\n\t\n\tvar text = document.getElementById(\"text\").innerHTML; \n\t\n\tvar newText = text.replace(/strawberry/gi, \t\t'banana');\n\tvar newText = text.replace(/strawberries/gi, \t'bananas');\n\t\n\t\n\tdocument.getElementById(\"text\").innerHTML = newText;\n}", "title": "" }, { "docid": "50789119dc078351da244b5b583926ad", "score": "0.6172534", "text": "function safeReplaceAll(target, pattern, replacement) {\n let newStr = target;\n while (newStr.indexOf(pattern) >= 0) {\n newStr = newStr.replace(pattern, replacement);\n }\n return newStr;\n}", "title": "" }, { "docid": "a0ec0cbb6d2c23c5698591233e9bab45", "score": "0.6148493", "text": "function replace(s) {\n var vowels = \"aeiouAEIOU\"\n var result = \"\";\n for (let i = 0; i < s.length; i++) {\n if (vowels.includes(s[i])) {\n result += \"!\";\n } else {\n result += s[i];\n }\n }\n return result\n}", "title": "" }, { "docid": "76318e63173f61a55d847b9a6331f3a5", "score": "0.61481047", "text": "function replace(str, search, replacements) {\n str = toString(str);\n search = toArray(search);\n replacements = toArray(replacements);\n\n var searchLength = search.length,\n replacementsLength = replacements.length;\n\n if (replacementsLength !== 1 && searchLength !== replacementsLength) {\n throw new Error('Unequal number of searches and replacements');\n }\n\n var i = -1;\n while (++i < searchLength) {\n // Use the first replacement for all searches if only one\n // replacement is provided\n str = str.replace(\n search[i],\n replacements[(replacementsLength === 1) ? 0 : i]);\n }\n\n return str;\n }", "title": "" }, { "docid": "e58a1d9a4bc440e5d8a517c66e79c593", "score": "0.61465514", "text": "function replace(s){\n return s.replace(/[aeoiu]/ig, '!');\n}", "title": "" }, { "docid": "4a665e8b9a46ea087d16e8cba2c48a9b", "score": "0.6111789", "text": "function replaceAt(content, index, oldString, newString) {\n logger.debug(`Replacing ${oldString} with ${newString} at index ${index}`);\n return content.substr(0, index) + newString + content.substr(index + oldString.length);\n}", "title": "" }, { "docid": "93a0b37f0d781ef12ba8a3fa3d2f36ca", "score": "0.61020494", "text": "function replace(s){\n let str ='';\n let vowel = 'aeiouAEIOU';\n for(let i = 0; i < s.length; i++){\n if(vowel.includes(s[i])){\n str += '!';\n }else{\n str += s[i];\n }\n }\n return str;\n}", "title": "" }, { "docid": "11a3ac0c0ab81f222ef4556829f78711", "score": "0.6100584", "text": "function replaceAll(str,mapObj){\n var re = new RegExp(Object.keys(mapObj).join(\"|\"),\"gi\");\n return str.replace(re, function(matched){\n return mapObj[matched];\n });\n }", "title": "" }, { "docid": "ab7e954a636eb69ea2f110f83b2c9d9d", "score": "0.6099688", "text": "function replaceAll(text, textToFind, textToReplace) {\n if (!textToFind)\n return text;\n var pattern = escapeStringForRegex(textToFind);\n return text.replace(new RegExp(pattern, \"gi\"), textToReplace);\n }", "title": "" }, { "docid": "ab7e954a636eb69ea2f110f83b2c9d9d", "score": "0.6099688", "text": "function replaceAll(text, textToFind, textToReplace) {\n if (!textToFind)\n return text;\n var pattern = escapeStringForRegex(textToFind);\n return text.replace(new RegExp(pattern, \"gi\"), textToReplace);\n }", "title": "" }, { "docid": "ab7e954a636eb69ea2f110f83b2c9d9d", "score": "0.6099688", "text": "function replaceAll(text, textToFind, textToReplace) {\n if (!textToFind)\n return text;\n var pattern = escapeStringForRegex(textToFind);\n return text.replace(new RegExp(pattern, \"gi\"), textToReplace);\n }", "title": "" }, { "docid": "7c3ffeef66d4c4fd5d84158cf78caff9", "score": "0.6093223", "text": "function replacer(){\n replaced = true;\n return '';\n }", "title": "" }, { "docid": "3a687fe35e88fb1ee62ded91eb690231", "score": "0.60884774", "text": "function strReplace(oldStr, newStr, str) {\n if (isArray(oldStr)) {\n for (var i in oldStr) {\n var rpl = oldStr[i];\n var patt = new RegExp(escapeRegExp(rpl), 'g');\n str = str.replace(patt, (isArray(newStr) ? newStr[i] : newStr));\n }\n return str;\n }\n else if (isString(str)) {\n var patt = new RegExp(oldStr, 'g');\n return str.replace(patt, newStr);\n }\n else\n return \"\";\n }", "title": "" }, { "docid": "6bf29f78c7df6cca1bad99cd84998c6f", "score": "0.60795367", "text": "function replaceStr(str,r,b){\r\n\tvar s=String(str);\r\n\tvar t=String(r);\r\n\tvar sL=s.length;\r\n\tvar tL=t.length;\r\n\tif((sL==0)||(tL==0)){\r\n\t\treturn s;\r\n\t}\r\n\tvar i=s.indexOf(t);\r\n\tif((!i)&&(t!=s.substring(0,tL))){\r\n\t\treturn s;\r\n\t}\r\n\tif(i==-1){\r\n\t\treturn s;\r\n\t}\r\n\tvar nS=(s.substring(0,i)+b);\r\n\tif(i+tL<sL){\r\n\t\tnS+=replaceStr(s.substring(i+tL,sL),t,b);\r\n\t}\r\n\treturn nS;\r\n}", "title": "" }, { "docid": "7963fd6126621a94518239cc5c77d30d", "score": "0.60543245", "text": "function replaceString(oldS,newS,fullS) {\n\tfor (var i=0; i<fullS.length; i++) { \n\t\tif (fullS.substring(i,i+oldS.length) == oldS) { \n\t\t\t fullS = fullS.substring(0,i)+newS+fullS.substring(i+oldS.length,fullS.length) \n\t\t} \n\t} \n\treturn fullS\n}", "title": "" }, { "docid": "3e315eb5d069daec705d7b27a2a0eae2", "score": "0.60184455", "text": "function replaceButSad(s, search, replace) {\n return s.split(search).join(replace);\n}", "title": "" }, { "docid": "802fedfe61c71adb7a8cace8b6693754", "score": "0.6017158", "text": "function replaceAll(str,mapObj){\n if (!str){\n console.log(\"There is no string content...\");\n return;\n }\n\n if (!mapObj){\n console.log(\"There is no map object to replace with...\");\n return;\n }\n\n var regex = new RegExp(Object.keys(mapObj).join(\"|\"),\"gi\");\n\n return str.replace(regex, function(matched){\n return mapObj[matched.toLowerCase()];\n });\n}", "title": "" }, { "docid": "e2d7dd7dcf5befcf1c08c3ef00eaf6c7", "score": "0.60106796", "text": "function replaceAt(str, index, value) {\n return str.substr(0, index) + value + str.substr(index + value.length);\n}", "title": "" }, { "docid": "02321dd8c78e9bac94b8507b727523f0", "score": "0.5989911", "text": "function strGlobalReplace(_fullString, _searchChar, _replaceChar) {\r\n\tvar jsrs = new RegExp(_searchChar, \"g\");\r\n\t\r\n\treturn _fullString.replace(jsrs,_replaceChar);\r\n}", "title": "" }, { "docid": "6b04748da11732d998c678dfb965adc4", "score": "0.59644747", "text": "function replaceFirst(x, y, z){\n return x.toString().replace(y, z);\n}", "title": "" }, { "docid": "a5624fd709ff3b1dcb98099f2be9790f", "score": "0.5943203", "text": "function customSearchAndReplace( str )\n{\n // Process prefs\n if (prefs.hasOwnProperty(\"sandr\"))\n for (let n in prefs.sandr)\n str = singleSearchAndReplace( str, prefs.sandr[n] );\n\n return str;\n}", "title": "" }, { "docid": "f480882504ef859c852fed0e3ad4aa9b", "score": "0.59407616", "text": "function replace(s){\n return s.replace(/a|e|i|o|u/gi, \"!\")\n}", "title": "" }, { "docid": "dcf786416bc18d0554fc3c293019b8af", "score": "0.59397644", "text": "function replace(string,text,by) {\n var strLength = string.length, txtLength = text.length;\n if ((strLength == 0) || (txtLength == 0)) return string;\n var i = string.indexOf(text);\n if ((!i) && (text != string.substring(0,txtLength))) return string;\n if (i == -1) return string;\n var newstr = string.substring(0,i) + by;\n if (i+txtLength < strLength)\n newstr += replace(string.substring(i+txtLength,strLength),text,by);\n return newstr;\n}", "title": "" }, { "docid": "e3447487fb854014520329af321c1c24", "score": "0.5928686", "text": "function findReplace() {\n\tvar str = document.getElementById(\"P2\").innerHTML;\n\tvar res = str.replace(\"porchetta\", \"Veg\");\n\tdocument.getElementById(\"P2\").innerHTML = res;\n\n//this is a really bad search & highlight word..not stable...need to spend some time with this\n}", "title": "" }, { "docid": "08fe1d4b8519447811b06070e98a8828", "score": "0.59206516", "text": "function replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}", "title": "" }, { "docid": "e32cb0ad57963369886ad74e3a57feb0", "score": "0.59136426", "text": "function mixUp (string1, string2) {\n const firstString = string1.replace(string1[1], string2[1]);\n const secondString = string2.replace(string2[1], string1[1]);\n console.log( firstString + \" \" + secondString );\n\n}", "title": "" }, { "docid": "8b4dac8ebf17e52790681ffbb7fac3a1", "score": "0.5900937", "text": "function str_replace(search, replace, subject, count) {\n // note: The count parameter must be passed as a string in order\n // note: to find a global variable in which the result will be given\n // example 1: str_replace(' ', '.', 'Kevin van Zonneveld');\n // returns 1: 'Kevin.van.Zonneveld'\n // example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars');\n // returns 2: 'hemmo, mars'\n\n var i = 0,\n j = 0,\n temp = '',\n repl = '',\n sl = 0,\n fl = 0,\n f = [].concat(search),\n r = [].concat(replace),\n s = subject,\n ra = Object.prototype.toString.call(r) === '[object Array]',\n sa = Object.prototype.toString.call(s) === '[object Array]';\n s = [].concat(s);\n if (count) {\n this.window[count] = 0;\n }\n\n for (i = 0, sl = s.length; i < sl; i++) {\n if (s[i] === '') {\n continue;\n }\n for (j = 0, fl = f.length; j < fl; j++) {\n temp = s[i] + '';\n repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];\n s[i] = (temp)\n .split(f[j])\n .join(repl);\n if (count && s[i] !== temp) {\n this.window[count] += (temp.length - s[i].length) / f[j].length;\n }\n }\n }\n return sa ? s : s[0];\n}", "title": "" }, { "docid": "0d7b329d7bdfc8dffc48906937f3dde9", "score": "0.58938974", "text": "function process(str) {\n return str.replace(\"hi \", \"yoyoma \");\n}", "title": "" } ]
1e61ab130694f3c2aaa56d2526a0efd1
populate list with items from local storage
[ { "docid": "ae12ee9a0d435839d0eb4a2a26fbdf9a", "score": "0.76993334", "text": "function loadLocalStore() {\n const itemList = getItems();\n\n if (itemList.length < 1) return;\n\n itemList.forEach(function(item) {\n item = item.replace(/(?:\\r\\n|\\r|\\n)/g, \"<br />\");\n $(\"ul\").append(\n \"<li><div class='textContent'>\" +\n item +\n \"</div><div class='deleteButton'><i class='far fa-trash-alt' aria-hidden='true'></i></div></li>\"\n );\n });\n}", "title": "" } ]
[ { "docid": "d7cf5576d6917e87ccdb66a91e354942", "score": "0.7831189", "text": "function loadList(){\n if(localStorage.getItem(\"todos\") != null){\n var todos = JSON.parse(localStorage.getItem(\"todos\"));\n for(var i = 0; i < todos.length;i++){\n var todo = todos[i];\n newTodoItem(todo.task,todo.completed);\n }\n }\n}", "title": "" }, { "docid": "1b4a384d7b2f93ee4973523871092595", "score": "0.77569646", "text": "function loadFromLS() {\n let lsItems = localStorage.getItem(\"items\");\n if (lsItems === null) {\n localStorage.setItem(\"items\", JSON.stringify(items));\n } else {\n lsItems = JSON.parse(lsItems);\n lsItems.forEach((item) => {\n items.push(new FoodItem(item.id, item.name, item.calories));\n });\n }\n }", "title": "" }, { "docid": "f042493b3392ab548c4db39f0e755f7b", "score": "0.7636294", "text": "function loadItems() {\n $scope.items = localStorage.getItem(keyStorage) != null ? JSON.parse(localStorage.getItem(keyStorage)) : [];\n }", "title": "" }, { "docid": "5f6b17c1089f871f34df8a3af73bf87f", "score": "0.7538274", "text": "function getItems(){\r\n let items;\r\n if(localStorage.getItem('items') === null){\r\n items = [];\r\n } else {\r\n items = JSON.parse(localStorage.getItem('items'));\r\n }\r\n\r\n//loop\r\nitems.forEach(function(item){\r\n //create li element\r\n const li = document.createElement('li');\r\n //add class\r\n li.className = 'collection-item';\r\n //create text node and append to li\r\n li.appendChild(document.createTextNode(item));\r\n //create new link element\r\n const link = document.createElement('a');\r\n //add class\r\n link.className = 'delete-item secondary-content';\r\n //add icon html\r\n link.innerHTML = '<i class =\"fa fa-remove\"></i>';\r\n //append the link to li\r\n li.appendChild(link);\r\n \r\n //append the li to ul\r\n itemList.appendChild(li);\r\n });\r\n}", "title": "" }, { "docid": "6264e8c25c28fc54250f59d2ffeb4ddc", "score": "0.7486352", "text": "function getItemsFromLS(){\r\n\r\n if(localStorage.getItem('items')===null) {\r\n items=[];\r\n }\r\n else \r\n {\r\n items=JSON.parse(localStorage.getItem('items'));\r\n }\r\n return items;\r\n\r\n}", "title": "" }, { "docid": "26b07ffb96e7e3dd411b8aa463b23b40", "score": "0.73831093", "text": "function getListsItems(list) {\n return JSON.parse(localStorage.getItem(list));\n }", "title": "" }, { "docid": "749fe832d6658c4b0c53d61d39e44255", "score": "0.7369664", "text": "function _loadState() {\n try {\n let data = JSON.parse(localStorage.getItem(\"ListMaker\"))\n _state.lists = data.lists.map(l => {\n let list = new List(l)\n list.listItems = list.listItems.map(i => new Item(i))\n return list\n })\n } catch (e) {\n\n }\n}", "title": "" }, { "docid": "c0bfd0b34cc49322c5a331b357da1768", "score": "0.7351442", "text": "function getListLocal() {\n if (localStorage.todolist) {\n todo.innerHTML = localStorage.todolist;\n }\n }", "title": "" }, { "docid": "1ab22df44753016b59f62e90325b08b8", "score": "0.73294723", "text": "function getLocalItems() {\n\t$.each( localStorage, function( key, value ) {\n\t\tvar container = $(\"<ul class=report/>\");\n\t\tvar key = key.replace(\"formapp_\",\"\");\n\t\tvar key = key.split('_');\n\t\t$(\"<li><span>\"+ key[0] + \"</span> \" + key[1] + \"</li>\").appendTo(container);\n\t\t$('body').prepend(container);\n\t});\n\n}", "title": "" }, { "docid": "ad6561a3b192d5ae856f9d431d426d0a", "score": "0.7322703", "text": "function displayStorage(){\n let exists = localStorage.getItem('groceryList');\n \n if(exists){\n let storageItems = JSON.parse(localStorage.getItem('groceryList'));\n storageItems.forEach(function(element){\n createItem(element);\n })\n }\n}", "title": "" }, { "docid": "e0fb2de7d0e14ede8f4864f95475c463", "score": "0.7312349", "text": "function loadStorage() {\n if (localStorage.getItem('todos'))\n state = JSON.parse(localStorage.getItem('todos'));\n for (let i = 0; i < state.length; i++) {\n let title = document.createTextNode(state[i].title);\n let list = document.createElement('li');\n let span = document.createElement('span');\n span.innerHTML = '<i class=\"trash fas fa-trash-alt\"></i>';\n span.innerHTML += '<i class=\" more bi bi-three-dots\"></i>';\n span.innerHTML += '<i class=\"check bi bi-check-lg\"></i>';\n\n list.appendChild(title);\n list.appendChild(span);\n list.setAttribute('data-title', \"DUE ON: \" + state[i].dueDate + '\\nCREATED ON: ' + state[i].date);\n list.className = state[i].done ? 'done' : '';\n list.id = state[i].id;\n ullist.appendChild(list);\n }\n\n item.focus();\n\n}", "title": "" }, { "docid": "80bf51a6e68129612a5446667b289b57", "score": "0.729574", "text": "retrieveData() {\n const data = JSON.parse(localStorage.getItem('likedListItems'));\n\n if (data) {\n this.items = data;\n }\n }", "title": "" }, { "docid": "7dceb86aa0d392cd9c28c6bfaba978da", "score": "0.7294828", "text": "function getFromLocal() {\n var x = localStorage.getItem(\"allProducts\");\n\n if (x == null) {\n productList = [];\n } else {\n productList = JSON.parse(x);\n }\n}", "title": "" }, { "docid": "8d5fece24ee12ba816c9f132fc0dcf2a", "score": "0.7271202", "text": "function retreiveList(){\n if (!supports_html5_storage()) { return false; }\n if(localStorage[\"listInProgress\"] == \"true\"){\n var arrayLength = (parseInt(localStorage[\"arrayLength\"]));\n \n for(var i = 0; i < arrayLength; i++){\n var retrievedObject = localStorage.getItem('thing'+ i);\n var newThing = JSON.parse(retrievedObject);\n addThing(newThing.description);\n }\n } else {return false;}\n \n}", "title": "" }, { "docid": "ddd7e361b9f72842945f6b122f7e4ffc", "score": "0.72710633", "text": "function getTodos() {\n let todos; //setting the todos \n if(localStorage.getItem('todos') == null){ //if local storage = todods is empty\n todos = []; // starts a new array\n } else {\n todos = JSON .parse(localStorage.getItem('todos')); //takes current array that is already stored \n }\n \n todos.forEach(function(todo){ //this creates the list but in a forEach going through local storage items and making a list element for each one\n document.getElementById(\"todo-list\").innerHTML += \n '<div class=\"todo\"><li class=\"todo-item\">' + todo + \n '</li><button class=\"complete-button\"><i class=\"fas fa-check\"></i></button><button class=\"trash-button\"><i class=\"fas fa-trash\"></i></button></div>'; \n });\n}", "title": "" }, { "docid": "64fb2402299581515c916a70d86fe1fd", "score": "0.7268367", "text": "getLists() {\n let saved = JSON.parse(localStorage.getItem('lists'))\n if (saved) {\n _state.lists = saved;\n }\n }", "title": "" }, { "docid": "34f9a2d87d6e02d35456c065874028b9", "score": "0.7260856", "text": "function loadFromStorage() {\n var listsFromStorage = JSON.parse(localStorage.getItem('allToDoLists'))\n if (listsFromStorage === null) {\n return\n } else {\n for (var i = 0; i < listsFromStorage.length; i++) {\n var toDoList = new ToDoList(listsFromStorage[i].id, listsFromStorage[i].title, listsFromStorage[i].tasks, listsFromStorage[i].urgent);\n allToDoLists.push(toDoList)\n }\n }\n if (allToDoLists === null) {\n allToDoLists = []\n }\n formatListsToDisplay()\n}", "title": "" }, { "docid": "482b80e70658a0b998fd968ab7a41125", "score": "0.72570705", "text": "fetchFromLS (){\n const listName = this.getListName();\n const listFromLS = localStorage.getItem(listName);\n const listConvertedFromJSON = JSON.parse(listFromLS);\n return listConvertedFromJSON;\n }", "title": "" }, { "docid": "a5bcf59e5d84deb3c75ebaf5f3e33c2f", "score": "0.7255641", "text": "function loadItemsFromLocalStorage(){\n\n if(!localStorage.getItem(ITEMS_IN_LOCALSTORAGE_KEY)){\n return;\n }\n\n let itemsInLocalStorage = localStorage.getItem(ITEMS_IN_LOCALSTORAGE_KEY);\n \n // convert all items that are strings to array\n itemsInLocalStorage = itemsInLocalStorage.split(',');\n\n // put all the items in localStorage into our itemsInCart.itemNames array\n itemsInCart.itemNames = itemsInLocalStorage;\n\n // update no of items in cart\n itemsInCart.totalItems = itemsInLocalStorage.length;\n itemCountSpan.innerHTML = itemsInCart.totalItems;\n\n\n // loop over the array, create an <li>, append the item string to the <li>, append the LI to the items-checkout <ul>\n itemsInLocalStorage.map(item =>{\n const li = document.createElement(\"li\");\n const textNode = document.createTextNode(item);\n li.appendChild(textNode);\n itemsInCartUl.appendChild(li); \n })\n\n\n}", "title": "" }, { "docid": "0cb10a6e78e0acdb60c894f37b0b9308", "score": "0.7230534", "text": "function getItemsFromLocalStorage() {\n if(localStorage.getItem('items') === null) {\n items=[];\n }else {\n items = JSON.parse(localStorage.getItem('items'));\n }\n return items;\n}", "title": "" }, { "docid": "9a8d2bade16978b242861483c97b6dcb", "score": "0.72278994", "text": "function populateItems(){\nlocalStorage.getItem('tasks') ? tasks = JSON.parse(localStorage.getItem('tasks')) : tasks = []\ntasks.forEach((taskItem)=>{\n addItems(taskItem.task.toUpperCase(),taskItem.status);\n})\nconsole.log(tasks)\n}", "title": "" }, { "docid": "91ecd6c4559e8057836d62faeadbcf64", "score": "0.72241396", "text": "function getItemsFromStorage(){\n let itemsInStorage = localStorage.getItem('product');\n if (itemsInStorage) {\n let parsedItems = JSON.parse(itemsInStorage);\n for (let i=0; i<parsedItems.length; i++) {\n let item = parsedItems[i];\n let newProduct = new Product(product.name, product.img);\n newProduct.clicks = product.clicks;\n newProduct.views = product.views;\n Product.allProducts.push(newProduct);\n }\n }\n}", "title": "" }, { "docid": "0bab8ca762fa9296d064907a24bd327c", "score": "0.7220586", "text": "function setItemsILS() {\n\tlet stringedItems = JSON.stringify(itemsList)\n\tlocalStorage.setItem(\"items-list\", stringedItems)\n}", "title": "" }, { "docid": "ea07ecb0e220a8f92c76dc728128f495", "score": "0.71919835", "text": "loadFromLocalStorage() {\n\t\t\tvar json = localStorage.getItem(\"cart\");\n\t\t\tthis.items = json ? JSON.parse(json) : [];\n\t\t}", "title": "" }, { "docid": "ebfc9f72644d087de40b51d98e6ceda6", "score": "0.7189135", "text": "function fromStorageToUI() {\n //* retrive items from local storage:\n let todos = JSON.parse(localStorage.getItem(\"todos\"));\n\n //* check array, then add items to UI:\n if (localStorage.getItem(\"todos\") === null) {\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n todos.forEach(el => {\n addUI(el);\n });\n }\n}", "title": "" }, { "docid": "e578f90e642b0b3939d5ab3df9614453", "score": "0.71879524", "text": "function getData(){\n\t\ttoggleControls(\"on\");\n\t\tvar makeDiv = document.createElement('div');\n\t\tmakeDiv.setAttribute(\"id\", \"items\");\n\t\tvar makeList = document.createElement('ul');\n\t\tmakeDiv.appendChild(makeList);\n\t\tdocument.body.appendChild(makeDiv);\n\t\t$('items').style.display = \"block\";\n\t\tfor(var i=0, len=localStorage.length; i<len; i++){\n\t\t\tvar makeLi = document.createElement('li');\n\t\t\tvar linksLi = document.createElement('li');\n\t\t\tmakeList.appendChild(makeLi);\n\t\t\tvar key = localStorage.key(i);\n\t\t\tvar value = localStorage.getItem(key);\n\t\t\tvar obj = JSON.parse(value); //Converts the string in local storage back to an object\n\t\t\tvar makeSubList = document.createElement('ul');\n\t\t\tmakeLi.appendChild(makeSubList);\n\t\t\tfor(var n in obj){\n\t\t\t\tvar makeSubLi = document.createElement('li');\n\t\t\t\tmakeSubList.appendChild(makeSubLi);\n\t\t\t\tvar optSubText = obj[n][0]+\" \"+obj[n][1];\n\t\t\t\tmakeSubLi.innerHTML = optSubText;\n\t\t\t\tmakeSubList.appendChild(linksLi);\n\t\t\t};\n\t\t\tmakeItemLinks(localStorage.key(i), linksLi); //Create edit and delete links for each item in local storage\n\t\t};\n\t}", "title": "" }, { "docid": "89922382bef247c93c907a389af4b9bc", "score": "0.71819586", "text": "function getTodoItems() {\n for (var i = 0; i < localStorage.length; i++) {\n var key = localStorage.key(i);\n if (key.substring(0, 4) == \"todo\") {\n var item = localStorage.getItem(key);\n var todoItem = JSON.parse(item);\n todos.push(todoItem);\n }\n }\n addTodosToPage();\n}", "title": "" }, { "docid": "b150315f8223f7134372da9864dc7642", "score": "0.7170503", "text": "function getList() {\n // list is null if it doesn't exsist\n var list = JSON.parse(localStorage.getItem(\"_list\"));\n if (list === null) {\n list = [];\n }\n\n return list;\n}", "title": "" }, { "docid": "766a7ad322bab5cb1c136463f8e1c057", "score": "0.713883", "text": "function getLocalStorage() {\n return localStorage.getItem('list') ? JSON.parse(localStorage.getItem('list')) : [];\n}", "title": "" }, { "docid": "20c95914e471941850a678f3d2fa987d", "score": "0.7128665", "text": "function addTodoListToUI() {\n const itemsList = localStorage.getItem(TO_DO_LIST_KEY);\n const storedArray = itemsList.split(\",\");\n storedArray.forEach((element) => addItemToListUI(element));\n}", "title": "" }, { "docid": "5632baf048b99063b54ab1f5330ab45c", "score": "0.7121646", "text": "function getData() {\n //toggleControls(\"on\");\n if(localStorage.length === 0) {\n alert(\"There are no players stored, so a default player was added\");\n autoFillData();\n }\n\n for(var i=0, j=localStorage.length; i<j; i++) {\n var key = localStorage.key(i);\n var obj = JSON.parse(localStorage.getItem(key));\n var position \t= obj.value.position;\n console.log(obj.position);\n var makeSubList = $('<li></li>');\n $( '<p>' + obj[0] + \" \" + obj[1] +'</p>'\n \n ).appendTo('playerli');\n //makeSubList.append(makeSubLi).appendTo('#playerli');\n }\n //makeItemLinks(localStorage.key(i), linksLi); //Create our edit and delete buttons/links for each item in localStorage.\n}", "title": "" }, { "docid": "fc7a58c016f7bc0b9d6cb8a50e804716", "score": "0.70983285", "text": "function loadAllTaskItems() {\n const openItems = document.getElementById('openItems');\n const doneItems = document.getElementById('doneItems');\n\n const items = JSON.parse(localStorage.getItem('taskItems'));\n items &&\n items.forEach(taskItem => {\n const task = createLi(taskItem);\n if (taskItem.done) {\n doneItems.appendChild(task);\n } else {\n openItems.appendChild(task);\n }\n });\n}", "title": "" }, { "docid": "f71bb5a052c392ec03a2df503fbb66a1", "score": "0.7088173", "text": "function loadSavedCities() {\n $(\"#citiesList\").html(\"\");\n savedCities = JSON.parse(localStorage.getItem(\"savedCities\"));\n\n if (savedCities === null) savedCities = [];\n\n for (let i = 0; i < savedCities.length; i++) {\n let $listItem = $(\"<li>\");\n $listItem.text(savedCities[i]);\n $listItem.addClass(\"list-group-item\");\n $listItem.attr(\"data-search\", savedCities[i]);\n $(\"#citiesList\").append($listItem);\n }\n}", "title": "" }, { "docid": "f9dc78116a68689135020df012a839f2", "score": "0.70840424", "text": "function loadTodos() {\n // Empty item list html\n $('#item_list').html('');\n\n // Get todos from current user\n let todos = $('#todo_app').data('user');\n let todosJSON = JSON.parse(window.localStorage.getItem(todos));\n\n // Add todos from JSON\n if (todosJSON !== null) {\n todoItemArray = [];\n for (let i = 0; i < todosJSON.length; i++) {\n todoItemArray.push(jsonToTodoItem(todosJSON[i]));\n }\n appendTodoItems();\n }\n}", "title": "" }, { "docid": "3f2e0fb369b9f05e1f672ed4c0028f4a", "score": "0.70641637", "text": "function list_All_Items() { \n\tif ( typeof( localStorage.lists ) === \"undefined\" ) {\n\t\treturn;\n\t}\n\tvar lists = JSON.parse( localStorage.lists );\n\tvar notes_num;\n\n\t/* Loop the whole lists to get each list. */\n for ( list_name in lists ) \n { \n \tnotes_num = lists[ list_name ];\n \tmake_notes_list( list_name, notes_num );\n } \n}", "title": "" }, { "docid": "c3539600ce86e3a70e095c154a6da86f", "score": "0.7051202", "text": "function getItems() {\n const emptyList = {\n props: {},\n lists: [{ name: \"taskList\", items: [] }]\n };\n const locStor = localStorage.getItem(LocalKey);\n const appStore = locStor ? JSON.parse(locStor) : emptyList;\n\n const itemList = appStore.lists[0].items;\n\n updateTitleCount(itemList);\n return (state.itemList = itemList);\n}", "title": "" }, { "docid": "f733241b823804745840e6227c0ecd56", "score": "0.70347893", "text": "function _loadState() {\n let data = JSON.parse(localStorage.getItem(\"AlexTaskMaster\"));\n if (data) {\n let newData = {}\n for (const key in data.lists) {\n if (data.lists.hasOwnProperty(key)) {\n const item = data.lists[key];\n newData[item.id] = new List(item)\n }\n }\n _state.lists = newData;\n }\n}", "title": "" }, { "docid": "c27e11031dd275733216555a8b3740b8", "score": "0.703387", "text": "renderStored() {\n\t\tconst itemString = storage.get();\n\t\tconst itemArray = JSON.parse(itemString);\n\t\tif (Array.isArray(itemArray) && itemArray.length >= 1) {\n\t\t\tthis.items = itemArray;\n\t\t\tfor (const item of itemArray) {\n\t\t\t\tconst addItem = this.createItem(item.title, item.body);\n\t\t\t\tif (item.fav === true) {\n\t\t\t\t\tthis.append(this.favSection, addItem);\n\t\t\t\t} else if (item.archived === true) {\n\t\t\t\t\tthis.append(this.archivedSection, addItem);\n\t\t\t\t} else if (item.trashed === true) {\n\t\t\t\t\tthis.append(this.trashedSection, addItem);\n\t\t\t\t} else {\n\t\t\t\t\tthis.append(this.mainSection, addItem);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tstorage.clear();\n\t\t}\n\t}", "title": "" }, { "docid": "14fc8d6f72e590803205bcc653b6c8ed", "score": "0.703094", "text": "function retrieveData() {\n for (prop in storageEl) {\n storedItems.push(JSON.parse(localStorage.getItem(prop)));\n }\n return storedItems;\n}", "title": "" }, { "docid": "fd53e8dfaed15700de42793d9d410b06", "score": "0.7023701", "text": "function ItemList() {\n\t$.each($.jStorage.index(), function(index, value){\n\t\titemList[index] = BoxOrItem('itemNumber', value);\n\t});\n}", "title": "" }, { "docid": "700bec7ddef765df3e598b0223fdbc07", "score": "0.7020756", "text": "readStorage() {\n const storage = JSON.parse(localStorage.getItem('items')); \n\n // Restoring like from the localStorage\n if (storage) this.items = storage;\n }", "title": "" }, { "docid": "a5d10c01fbe82288dcc84f7277319278", "score": "0.70170474", "text": "function getData () {\n\t\n\ttoggle(\"on\");\n\t\t\n\tif( localStorage.length === 0 ) {\n\t\talert(\"Nothing to show\")\n\t\t\n\t\t} \n\t\t\n\t\tvar make = document.createElement(\"div\");\n\t\tmake.setAttribute(\"id\", \"items\");\n\t\tvar makeList = document.createElement('ul');\n\t\tmake.appendChild(makeList);\t\t\n\t\tdocument.body.appendChild(make);\n\t\tmain('items').style.display=\"block\";\t\n\n\t\t// looking in local storage\n\t\tfor(var i=0, j=localStorage.length; i<j; i++) {\n\t\tvar makeli = document.createElement(\"ul\");\n\t\t\t\n\t\tvar linksLi = document.createElement(\"ul\"); //creating another list item for week 3\n\t\t\t\n\t\tmakeList.appendChild(makeli);\n\t\tvar key = localStorage.key(i);\n\t\tvar value = localStorage.getItem(key);\n\t\tvar object = JSON.parse(value); // convert local storage string back to object\n\t\tvar makeSubList = document.createElement(\"li\");\n\t\tmakeli.appendChild(makeSubList);\n\t\tfor ( var m in object ) {\n\t\t\tvar makeSubLi = document.createElement(\"li\");\n\t\t\tmakeSubList.appendChild(makeSubLi);\n\t\t\tvar optSub = object[m][0]+\": \"+object[m][1];\n\t\t\tmakeSubLi.innerHTML = optSub;\n\t\t\tmakeSubList.appendChild(linksLi); //append dynamically week 3\n\n\t\t\t}\n\t\t// Create our edit and delete button/link for each item in local storage week3\t\n\t\t makeItemLinks(localStorage.key(i), linksLi); \n\t}// the makeItemLinks(localStorage.key[i],linksLi); threw me for a curve!!!! had [i], instead of (i)!!!\n\t\n}", "title": "" }, { "docid": "8bdaf25048f032b290e1d7b87f2ac3e6", "score": "0.7001838", "text": "function setLocalStorage(list){\n localStorage.setItem(\"taskList\", JSON.stringify(list));\n}", "title": "" }, { "docid": "e1433adf274befc62d48977f8db478a2", "score": "0.6990329", "text": "loadListFromLocalStorage() {\r\n if (localStorage) {\r\n if (localStorage.list) {\r\n this.data.list = [];\r\n let listArry = JSON.parse(localStorage.list);\r\n for (let ele of listArry) {\r\n this.data.list.push(ele);\r\n }\r\n this.setState({...this.state })\r\n }\r\n else {\r\n alert('Nothing to load');\r\n }\r\n }\r\n else {\r\n alert('Your browser is outdated.....');\r\n }\r\n }", "title": "" }, { "docid": "0846518d1a411c80fa026a7de1a2ef43", "score": "0.6985771", "text": "getAllDataItems() {\n const list = [];\n const localStorageLength = window.localStorage.length;\n\n for (let i = 0; i < localStorageLength; i += 1) {\n const key = this.getLocalStorage().key(i);\n const value = this.getLocalStorage().getItem(key);\n\n list.push(\n new StorageItem({\n key,\n value,\n }));\n }\n\n return list;\n }", "title": "" }, { "docid": "a97cc1d84d126ef3b7b288fc489912e3", "score": "0.69793797", "text": "static reloadBookListFromStorage() {\n const books = Storage.getBookListFromStorage();\n\n const ui = new UI();\n books.forEach((element) => {\n ui.addBookToList(element);\n });\n }", "title": "" }, { "docid": "b0c71a68ee1907e896c2d82dc69034f4", "score": "0.6975509", "text": "function loadLists() {\n //reset area\n $(\".mdl-navigation\").html(\" \");\n //display new lists\n for (let i = 0; i < localStorage.length; i++) {\n //create link in html for list\n list = localStorage.key(i);\n $(\".mdl-navigation\").append(`\n <a class=\"mdl-navigation__link\" onclick=\"displayList('${list}')\" href=\"#\"> ${list} </a>\n `);\n }\n}", "title": "" }, { "docid": "3a484776e8c6657f6b1735b2ad6247e8", "score": "0.69662637", "text": "function getData(){\n toggleControls(\"on\");\n if(localStorage.length === 0){\n alert(\"There is no data in Local Storage so default data was added.\");\n\t autoFillData();\n\t // -- Commit Out Reload Page when using Test JSON Data Uncommit when not testing!! --\n //window.location.reload();\n }\n var makeDiv = document.createElement('div');\n makeDiv.setAttribute(\"id\", \"items\");\n var makeList = document.createElement('ul');\n makeDiv.appendChild(makeList);\n document.body.appendChild(makeDiv);\n $('items').style.display = \"block\";\n for (var i=0, len=localStorage.length; i<len; i++){\n var makeLi = document.createElement('Li');\n\t var linksLi =document.createElement('li');\n makeList.appendChild(makeLi);\n var key =localStorage.key(i);\n var value = localStorage.getItem(key);\n // convert the string from local storage value back to an object by JSON.parse \n var obj = JSON.parse(value);\n var makeSubList = document.createElement('ul');\n makeLi.appendChild(makeSubList);\n getImage(obj.group[1], makeSubList);\n\t for (var n in obj){\n var makeSubLi = document.createElement('li');\n makeSubList.appendChild(makeSubLi);\n var optSubText = obj[n] [0]+\"\"+obj [n][1];\n makeSubLi.innerHTML = optSubText;\n\t\tmakeSubList.appendChild(linksLi);\n }\n\t makeItemLinks(localStorage.key(i), linksLi); // create edit and delete buttons/link for each item in local storage.\n\t} \n }", "title": "" }, { "docid": "930f00c166aa07ae1df135ecbbc4de93", "score": "0.695275", "text": "function setupItems() {\n let items = getLocalStorage();\n\n if (items.length > 0) {\n items.forEach(function (item) {\n createListItem(item.id, item.value);\n });\n container.classList.add(\"show-container\");\n }\n}", "title": "" }, { "docid": "73b3067aced97ee4584b215faca4d17d", "score": "0.6942944", "text": "function loadlastCity(){\n $(\"ul\").empty();\n let citysList = JSON.parse(localStorage.getItem(\"cityName\"));\n console.log(citysList);\n if(citysList!==null){\n for(i=0; i<citysList.length;i++){\n addToList(citysList[i]);\n }\n }\n}", "title": "" }, { "docid": "c740acb7eaa781789b9b346e0c1e18fd", "score": "0.69329494", "text": "function load_local_storage(item) {\n let title;\n if (item === \"history\") {\n title = gettext(\"<h2 tabindex = '0' aria-label='Recent Searches List. Select a list item to search'>Recent Searches</h2>\");\n } else if (item === \"favourites\") {\n title = \"\";\n }\n\n // Get current date and time\n let currentDate = getDate();\n let date = currentDate.date;\n let time = currentDate.time;\n\n let parsed_data = JSON.parse(localStorage.getItem(item));\n\n if (parsed_data) {\n // create string to hold unordered list html\n let parsed_list = title + \"<ul>\";\n\n // loop backwards through the favourites and add them to the unordered list\n for (let i = parsed_data.length - 1; i >= 0; i--) {\n // Obtain the source & destination id + name\n let parsed_item = parsed_data[i];\n\n // Assign the stop names to variables to give more options for displaying the list\n let source_name_only = parsed_item.source_name.split(\", stop\")[0];\n let destination_name_only = parsed_item.destination_name.split(\", stop\")[0];\n\n // Assign the stop ids to variable to give more options for displaying the list\n let source_id_only = parsed_item.source_name.split(\", stop\")[1];\n let destination_id_only = parsed_item.destination_name.split(\", stop\")[1];\n\n // Apostrophes are replaced with the associated ASCII code to avoid errors in the function calls\n let source_name = parsed_item.source_name.replace(/[\\/\\(\\)\\']/g, \"&#39;\");\n let destination_name = parsed_item.destination_name.replace(/[\\/\\(\\)\\']/g, \"&#39;\");\n\n let parsed_dict = {\n source_name: source_name,\n source_location: parsed_item.source_location,\n destination_name: destination_name,\n destination_location: parsed_item.destination_location,\n date: date,\n time: time,\n };\n\n // Add the names and id's to the unordered list\n parsed_list +=\n \"<li> \" +\n \"<a href='#' onclick='loadSearchTab(\" +\n JSON.stringify(parsed_dict) +\n \"); fetch_data(\" +\n JSON.stringify(parsed_dict) +\n \")'>\" +\n source_name_only +\n \", \" +\n gettext(\"stop \") +\n source_id_only +\n \" - \" +\n \"<br/>\" +\n destination_name_only +\n \", \" +\n gettext(\"stop \") +\n destination_id_only +\n \"</a></li>\";\n }\n // close off the list\n parsed_list += \"</ul>\";\n return parsed_list;\n }\n}", "title": "" }, { "docid": "033c09493ddbcea3f27ca1e70d3c9c78", "score": "0.6926997", "text": "function getTasks() {\n let tasks;\n //Check in LocalStorage to see if any item currently exists. IF none, THEN create emtpy storage array\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n //ELSE parse input value into a object with JSON.PARSE and assign to tasks \n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n //Loop through each task in Storage and create each DOM element\n tasks.forEach(function (task) {\n //Create li element\n const li = document.createElement('li');\n //Assign a class name\n li.className = 'collection-item';\n //Create text node and append to li\n li.appendChild(document.createTextNode(task));\n //Create new link element\n const link = document.createElement('a');\n //Assign a class name \n link.className = 'delete-item secondary-content';\n //Create icon html\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n //Append the link to li \n li.appendChild(link);\n //Append li to ul\n taskList.appendChild(li);\n })\n}", "title": "" }, { "docid": "371fa03a473d43d28d1dd8e4e123c977", "score": "0.6923355", "text": "function fromStorage() {\n var storedNames = JSON.parse(localStorage.getItem(\"names\"));\n var storedScores = JSON.parse(localStorage.getItem(\"scores\"));\n\n if (storedNames && storedScores) {\n listOfNames = storedNames;\n listOfScores = storedScores;\n }\n}", "title": "" }, { "docid": "a7ce80e05ecddbd9d05ceded039daa88", "score": "0.69180983", "text": "function getLists() {\n return JSON.parse(localStorage.getItem('Shopping Lists'));\n }", "title": "" }, { "docid": "4a7f912ec089d0580a962f62808213f6", "score": "0.69083", "text": "function loadDataFromStorage() {\n const serializedData = localStorage.getItem(STORAGE_KEY);\n\n let data = JSON.parse(serializedData);\n\n if (data !== null) list = data;\n document.dispatchEvent(new Event(\"ondataloaded\"));\n}", "title": "" }, { "docid": "2c904a02d7717fa448df94ba8d6d158b", "score": "0.69033796", "text": "function loadList() {\n const loadItens = document.querySelector('.cart__items');\n loadItens.innerHTML = localStorage.getItem('cartList');\n const li = document.querySelectorAll('li');\n li.forEach((item) => item.addEventListener('click', cartItemClickListener));\n}", "title": "" }, { "docid": "cbbeaebfacce4a18e72a6914e3e56a2c", "score": "0.68975574", "text": "retrieveStorage() {\r\n let storage = this.getStorage;\r\n if (storage.length !== 0) {\r\n for (let storedTodo of Object.entries(storage)) {\r\n const createlistItem = document.createElement(\"li\");\r\n createlistItem.textContent = storedTodo[1];\r\n createlistItem.setAttribute(\"class\", \"todo-item\");\r\n const spanElement = document.createElement(\"span\");\r\n spanElement.setAttribute('class', 'spanClass');\r\n spanElement.innerHTML = '<i id=\"list-icon\" class=\"material-icons\">delete</i>';\r\n createlistItem.appendChild(spanElement);\r\n getUlList.appendChild(createlistItem);\r\n hElement.style.display = 'none'\r\n }\r\n } else {\r\n hElement.style.display = 'block';\r\n }\r\n }", "title": "" }, { "docid": "90b46ec2c515e58fa4b184b81a38b8e7", "score": "0.68843126", "text": "function addToLocal() {\n localStorage.setItem(\"allProducts\", JSON.stringify(productList));\n}", "title": "" }, { "docid": "886f47df2e030d31ed49d2df8a77ab5b", "score": "0.68842983", "text": "function getListOfProducts() {\n let products = [];\n for (let index = 0; index < localStorage.length; index++) {\n let objectItem = JSON.parse(localStorage.getItem(localStorage.key(index)));\n products.push(objectItem.itemId);\n }\n return products;\n}", "title": "" }, { "docid": "c8e2dacea899d77a09a8909567436d53", "score": "0.68839294", "text": "function getTaskFromLS() {\r\n let tasks;\r\n if (localStorage.getItem(\"task\") === null) {\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem(\"task\"));\r\n }\r\n tasks.forEach(function(taskItem) {\r\n // Create li element\r\n const li = document.createElement(\"li\");\r\n // Add class\r\n li.className = \"collection-item\";\r\n // Create text node and append to li\r\n li.appendChild(document.createTextNode(taskItem));\r\n // Create new link element\r\n const link = document.createElement(\"a\");\r\n // Add class\r\n link.className = \"delete-item secondary-content\";\r\n // Add icon html\r\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\r\n // Append the link to li\r\n li.appendChild(link);\r\n\r\n // Append li to ul\r\n taskList.appendChild(li);\r\n });\r\n}", "title": "" }, { "docid": "96c46c7366fd6ab2ae7593dbb150e787", "score": "0.688189", "text": "function saveLocalStorage() {\n const listItems = document.querySelectorAll('.item-list');\n const arrayList = [];\n\n for (let index = 0; index < listItems.length; index += 1) {\n if (index === 0) {\n arrayList.push(`${listItems[index].outerHTML}+`);\n } else if (index === listItems.length - 1) {\n arrayList.push(`+${listItems[index].outerHTML}`);\n } else {\n arrayList.push(`+${listItems[index].outerHTML}+`);\n }\n }\n\n localStorage.setItem('completeList', arrayList);\n}", "title": "" }, { "docid": "d3f98685b91e03745141151e8594fc68", "score": "0.6877341", "text": "function displayItems() {\n var l, i;\n var item = {};\n document.getElementById(\"text-discription\");\n for (i = 0; i < localStorage.length; i++) {\n x = localStorage.key(i);\n y = localStorage.getItem(x)\n item[x] = y\n console.log(item)\n //display the values \n $('.list-display-field').append(x + ' : ' + y + \"<br>\");\n\n }\n \n }", "title": "" }, { "docid": "fdaf715e5ed964d68efe9d99b21e07b6", "score": "0.68722755", "text": "function getData() {\n\t\t// Call Function //\n\t\ttoggle(\"on\");\n\t\tif(localStorage.length === 0){\n\t\t\talert(\"There is no data in Local Storage so \\n default data was added.\");\n\t\t\tautoFillData();\n\t\t}\n\t\tvar makeDiv = document.createElement('div');\n\t\tmakeDiv.setAttribute(\"id\", \"items\");\n\t\tvar makeList = document.createElement('ul');\n\t\tmakeDiv.appendChild(makeList);\n\t\tdocument.body.appendChild(makeDiv, $('foot'));\n\t\t// Set 'items' display //\n\t\t$('items').style.display = \"block\";\n\t\tfor(var i=0, j=localStorage.length; i<j; i++) {\n\t\t\tvar makeLi = document.createElement('li');\n\t\t makeLi.style.fontsize= \"25 px\";\n\t\t\tvar buttonsLi = document.createElement('li');\n\t\t\tmakeList.appendChild(makeLi);\n\t\t\tvar key = localStorage.key(i);\n\t\t\tvar value = localStorage.getItem(key);\n\t\t\t// Convert string from local storage into value by JSON.parse //\n\t\t\tvar obj = JSON.parse(value);\n\t\t\tvar makeSubList = document.createElement('ul');\n\t\t\tmakeLi.appendChild(makeSubList);\n\t\t\tfor (var x in obj) {\n\t\t\t\tvar makeSubLi = document.createElement('li');\n\t\t\t\tmakeSubList.appendChild(makeSubLi);\n\t\t\t\tvar optSubTxt = obj[x][0]+\" \"+obj[x][1];\n\t\t\t\tmakeSubLi.innerHTML = optSubTxt;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5d1ffe14e0bad42e1e0e1ea9887e1521", "score": "0.68689984", "text": "function loadTodos() {\n const data = localStorage.getItem(\"todos\");\n if (data) {\n $ul.html(data);\n }\n }", "title": "" }, { "docid": "2cddeaf2754c3d8431715b0eaa986148", "score": "0.68622935", "text": "function loadTasks() {\n let data = JSON.parse(localStorage.getItem('items'));\n console.log(data);\n}", "title": "" }, { "docid": "0cff4b309fc2ebae33d4c12082a78dfd", "score": "0.68493897", "text": "function loadLocalStorage() {\n const loaded = localStorage.getItem(\"tasks\");\n if (loaded) {\n tasks = JSON.parse(loaded);\n listtask(tasks);\n }\n}", "title": "" }, { "docid": "1e0b8953491cd8845ccec24590785d5a", "score": "0.6842913", "text": "function getData(){\n\t\tif(localStorage.length === 0){\n\t\t\talert(\"There is no entry in Local Storage so default data was supplemented.\");\n\t\t\tautoFillData();\n\t\t}\n\t\t\n\t\t//Write Data from L. Storage to browser\n\t\tvar createDataList = document.createElement(\"ul\");\n\t\t$('#display').append(makeList);\n\t\tfor(var i=0, len=localStorage.length; i<len; i++){\n\t\t\tvar createLi = document.createElement('li');\n\t\t\tvar listLinks = document.createElement('li');\n\t\t\tcreateDataList.appendChild(createLi);\n\t\t\tvar key = localStorage.key(i);\n\t\t\tvar value = localStorage.getItem(key);\n\t\t\t\n\t\t\t// Converts string in local storage back to an object using JSON.parse.\n\t\t\tvar body = JSON.parse(value);\n\t\t\tvar createDivList = document.createElement('ul');\n\t\t\tcreateLi.appendChild(createDivList);\n\t\t\tfor(var a in body){\n\t\t\t\tvar createDivli = document.createElement('li');\n\t\t\t\tcreateDivList.appendChild(createDivli);\n\t\t\t\tvar optDivText = body[a][0]+\" \"+body[a][1];\n\t\t\t\tcreateDivli.innerHTML = optDivText;\n\t\t\t\tcreateDivList.appendChild(listLinks);\n\t\t\t}\n\t\t\tcreateLinks(localStorage.key(i), listLinks); // edit and delete links for info in local storage.\n\t\t\t\t\n\t\t}\n}", "title": "" }, { "docid": "62b1cbbf873b85e56decf0aa05db82d6", "score": "0.6841556", "text": "function checkLocalStorage() {\n if (localStorage.getItem('completeList') !== null) {\n const arrayList = localStorage.getItem('completeList').split('+,+');\n for (let index = 0; index < arrayList.length; index += 1) {\n const li = document.createElement('li');\n list.appendChild(li);\n list.lastElementChild.outerHTML = arrayList[index];\n }\n }\n\n eventList();\n}", "title": "" }, { "docid": "1a52dc165a8786bdfc81bddd5a550d7b", "score": "0.68411416", "text": "function getTasks() {\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n // LS stores only str\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n tasks.forEach(function (task) {\n // Create li element\n const li = document.createElement(\"li\");\n // Add Class\n li.className = \"collection-item\";\n // Create a text node and append to li \n li.appendChild(document.createTextNode(task));\n // Create new link element and add class\n const link = document.createElement(\"a\");\n link.className = \"delete-item secondary-content\";\n // Add icon html\n link.innerHTML = '<i class = \"fas fa-times\"></i>';\n // Append the link to li\n li.appendChild(link);\n // Append li to ul\n taskList.appendChild(li);\n });\n}", "title": "" }, { "docid": "5bcface7f25529b64451b5a5bf0ecc37", "score": "0.6840612", "text": "function populateDom(){\n \n if(localStorage.getItem(\"tasks\") != null){\n\n let tasks = JSON.parse(localStorage.getItem('tasks'));\n\n tasks.forEach((val)=>{\n\n var html = document.createElement(\"li\");\n html.classList.add(\"collection-item\");\n html.innerHTML = `<div><span id=\"taskvall\">${val}</span><a href=\"javascript:void(0)\" class=\"secondary-content tooltipped\" data-position=\"right\" data-delay=\"50\" data-tooltip=\"Delete Task\"><i class=\"material-icons removetask\">delete</i></a></div>`;\n document.querySelector(\"#taskerList\").appendChild(html);\n\n });\n\n }\n\n}", "title": "" }, { "docid": "016eb7ce06adb2b40bfcf1342462381c", "score": "0.6837919", "text": "function addDataToList(){\n for(count = 0; count<team_members.length; count ++){\n var list_object = {\n fullname: team_members[count].full_name ,\n date:[],\n status: []\n }\n list_data.push(list_object)\n }\n localStorage.setItem(list_name, JSON.stringify(list_data))\n}", "title": "" }, { "docid": "dbbc4540a0d9e2f60f7203df8ec030c9", "score": "0.6836899", "text": "function _loadState() {\n let data = JSON.parse(localStorage.getItem(\"TaskMaster\"));\n if (data) {\n data.lists = data.lists.map(l => new List(l));\n _state = data;\n }\n}", "title": "" }, { "docid": "c86a56ebfa3154d837010e2254cce705", "score": "0.68352884", "text": "function getListLocalStorage() {\n if (\n localStorage.getItem(\"list\") !== null &&\n localStorage.getItem(\"list\") !== undefined\n ) {\n let list = JSON.parse(localStorage.getItem(\"list\"));\n return list;\n }\n return [];\n}", "title": "" }, { "docid": "25b890f56292b6520a0a116f85d6aaef", "score": "0.68305945", "text": "saveLists() {\n localStorage.setItem('lists', JSON.stringify(_state.lists))\n }", "title": "" }, { "docid": "d43ae622e14581b3db686dba4a4277e1", "score": "0.68295544", "text": "function saveList(){\n var inputLista = document.getElementById(\"items\").innerHTML;\n var dataLista = document.getElementById(\"dl\").innerHTML;\n\n var liste1={\n inpL:inputLista,\n datL:dataLista\n }\n var listee=[];\n listee.push(liste1);\n localStorage.clear();\n localStorage.setItem('listee', JSON.stringify(listee));\n}", "title": "" }, { "docid": "e12f2ff5efcb1d80e900f1e8c08cf728", "score": "0.68288696", "text": "function persist() {\n let list = JSON.parse(localStorage.getItem('toDosList'));\n if (list !== null) {\n toDosList = list;\n } else {\n return list;\n }\n}", "title": "" }, { "docid": "1696a827b9c93fa131a0eaf7ccaeac37", "score": "0.68261415", "text": "function saveListLocal() {\n localStorage.todolist = todo.innerHTML;\n }", "title": "" }, { "docid": "7045e5eebf0b65cc550b385393f613d9", "score": "0.68230695", "text": "getTodos() {\n if (localStorage.getItem('todo_list')) {\n this.todoList = JSON.parse(localStorage.getItem('todo_list'));\n }\n }", "title": "" }, { "docid": "0ef21b96fd86a8e37b0a5a37990fac2f", "score": "0.6815825", "text": "function getTasks() {\r\n let tasks;\r\n if(localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n tasks.forEach(function(task) {\r\n const li = document.createElement('li');\r\n li.className = 'list-group-item bg-light';\r\n let p = document.createElement('p');\r\n p.appendChild(document.createTextNode(task));\r\n let a = document.createElement('a');\r\n a.setAttribute('href','#');\r\n a.innerHTML = '<span class=\"close\">&times;</span>';\r\n p.appendChild(a);\r\n li.appendChild(p);\r\n \r\n //Append li to ul\r\n taskList.appendChild(li);\r\n });\r\n}", "title": "" }, { "docid": "587a920b7b534f8ed3adafbc9e13eda8", "score": "0.68137765", "text": "persistData() {\n localStorage.setItem('likedListItems', JSON.stringify(this.items));\n }", "title": "" }, { "docid": "825c8e63146f0380cded9af8a66fa2eb", "score": "0.68123144", "text": "persistData() {\n localStorage.setItem('items', JSON.stringify(this.items)); // Convert 'items' array into a string as localStorage method needs to save as a string.\n }", "title": "" }, { "docid": "851529b954658faa54dc5c6a21a17771", "score": "0.68091965", "text": "function loadLocalStorageItems() {\n if (localStorage.getItem(\"last\")) {\n generateCityInfo(localStorage.getItem(\"last\"));\n }\n}", "title": "" }, { "docid": "194513f9d33e2d4adef71ff99e78a316", "score": "0.68071574", "text": "function updateDOM(){\n localStorage.setItem('list',JSON.stringify(list));\n}", "title": "" }, { "docid": "bd8e4528be08d9d2f459353012b7fc09", "score": "0.6804271", "text": "function saveToLocalStorage(list) {\n localStorage.setItem(\"list\", JSON.stringify(list));\n}", "title": "" }, { "docid": "73f8dd5c798d818b9ad53df4fb3c9b0c", "score": "0.6802569", "text": "function returnProductsLs(){\n var productsLs = localStorage.getItem('products');\n var parsedProducts = JSON.parse(productsLs);\n generateObjectsFromLs(parsedProducts);\n}", "title": "" }, { "docid": "1214e70fbe0ab5fe08a995d687149257", "score": "0.6798281", "text": "function getTasks() {\nlet tasks;\nif(localStorage.getItem('tasks') === null){\n tasks = [];\n}else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n}\n\ntasks.forEach(function(element){\n// creat li element \nconst li = document.createElement('li');\n// give a class name to li element \nli.className = 'collection-item';\n// append text to li element \nli.appendChild(document.createTextNode(element));\n// creat a link element\nconst link = document.createElement('a');\n// add class name to a element\nlink.className = 'delete-item secondary-content';\n// add icon \nlink.innerHTML = '<i class=\"fa fa-remove\"></i>';\n// append link to li\nli.appendChild(link);\n\n// append li to ul element \ntaskList.appendChild(li);\n\n });\n\n}", "title": "" }, { "docid": "05a8d6122575305404c75e72bf073b23", "score": "0.67973065", "text": "function writeToLS() {\n const newData = [];\n for (let item of items) {\n newData.push(item.toJSON());\n }\n localStorage.setItem(\"items\", JSON.stringify(newData));\n }", "title": "" }, { "docid": "9717556f796c4e903646fb21ca8808cc", "score": "0.6796577", "text": "function getTasks() {\r\n //local var\r\n let tasks;\r\n\r\n //check local storage\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n\r\n tasks.forEach(function (task) {\r\n\r\n //Create <li> list item\r\n const li = document.createElement('li');\r\n //Add class to <li> element created\r\n li.className = 'collection-item'; //class of 'collection' on <ul> and a class of 'collection-item' is recommended with materialize.css\r\n //Create a text node and append to <li> item\r\n li.appendChild(document.createTextNode(task));\r\n\r\n //Create new delete item link element\r\n const link = document.createElement('a');\r\n //Add class to <a> element created\r\n link.className = 'delete-item secondary-content'; //secondary-content for shifting elements to the right (materialize.css)\r\n //Add icon html\r\n link.innerHTML = '<i class=\"fas fa-trash-alt\"></i>';\r\n //Append the link to the <li> element\r\n li.appendChild(link);\r\n //Then append <li> elements to the <ul> element\r\n taskList.appendChild(li);\r\n\r\n });\r\n}", "title": "" }, { "docid": "e587e0513f04c50b5645657bc30d1b46", "score": "0.6792494", "text": "function loadUI(){\r\n const localDataList = JSON.parse(localStorage.getItem(\"dataList\"));\r\n if (localDataList !== null) {\r\n dataList = localDataList;\r\n }\r\n refreshUI();\r\n}", "title": "" }, { "docid": "ecc1bedc494759f914bdddd4e8aa52ca", "score": "0.67903346", "text": "function saveList() {\n const saveItens = document.querySelector('ol');\n localStorage.setItem('cartList', saveItens.innerHTML);\n}", "title": "" }, { "docid": "1606f95fcaea8e64a9d073b893d26405", "score": "0.67900854", "text": "function getData () {\n showHide(\"on\");\n if (localStorage.length === 0) {\n alert(\"You haven't added anyone! So we've added some data for testing.\");\n defaultAdded();\n }\n var makeDiv = $(\"<div>\");\n makeDiv.attr(\"id\", \"items\");\n var makeList = $(\"<ul>\");\n makeDiv.appendTo(makeList);\n $('<div>').appendTo(makeDiv);\n $('#items').css(\"display\",\"block\");\n for (var i=0, j=localStorage.length; i<j; i++) {\n var makeLi = $(\"<li>\");\n var buttonLi = $(\"<li>\");\n makeList.appendTo(makeLi);\n var key = localStorage.key(i);\n var value = localStorage.getItem(key);\n var object = JSON.parse(value);\n var makeSub = $(\"<ul>\");\n makeLi.appendTo(makeSub);\n for (var n in object) {\n var makeSubList = $(\"<li>\");\n makeSub.appendTo(makeSubList);\n var subText = object[n][0]+ \" \" +object[n][1];\n makeSubList.innerHTML = subText;\n makeSubList.appendTo(buttonLi);\n };\n makeButtons(localStorage.key(i), buttonLi);\n };\n}", "title": "" }, { "docid": "2963f23117d33ab4f5b616dc49dcb6f4", "score": "0.6781734", "text": "function getData() {\n //toggleControls(\"on\");\n if(localStorage.length === 0) {\n alert(\"There are no players stored, so a default player was added\");\n autoFillData();\n }\n //Create Div/ul/li tags to display data\n /*var makeDiv = $('<div></div>');\n makeDiv.attr(\"id\", \"players\");\n $('body').append(makeDiv);\n var makeList = $('<ul></ul>');\n makeDiv.append(makeList);*/\n $('#players').empty();\n for(var i=0, j=localStorage.length; i<j; i++) {\n var key = localStorage.key(i);\n var value = localStorage.getItem(key);\n var obj = JSON.parse(value);\n console.log(key);\n var makeSubList = $('<li></li>');\n var makeSubLi = $( '<p>' + obj.position[0] + \" \" + obj.position[1] +'</p>' +\n '<p>' + obj.pname[0] + \" \" + obj.pname[1] +'</p>' +\n '<p>' + obj.team[0] + \" \" + obj.team[1] +'</p>' +\n '<p>' + obj.starter[0] + \" \" + obj.starter[1] +'</p>' +\n '<p>' + obj.notes[0] + \" \" + obj.notes[1] +'</p>' + '<br />'\n );\n makeSubList.append(makeSubLi).appendTo('#playerUL');\n }\n //makeItemLinks(localStorage.key(i), linksLi); //Create our edit and delete buttons/links for each item in localStorage.\n }", "title": "" }, { "docid": "55a934fe831bae89bd387e80b8c8f538", "score": "0.67795914", "text": "function getTodos() {\n var str = localStorage.getItem('taskList');\n taskList = JSON.parse(str);\n if (!taskList) {\n taskList = [];\n }\n}", "title": "" }, { "docid": "f170209c848d3bd7908c7802276b24cc", "score": "0.67740506", "text": "function makeList() {\n let storageList = JSON.parse(localStorage.getItem(\"displayCity\"));\n document.querySelector(\"#city-history\").innerHTML = \"\";\n for (let i = 0; i < storageList.length; i++) {\n document.querySelector(\"#city-history\").append(storageList[i] + \", \");\n }\n}", "title": "" }, { "docid": "56e2504099fadc4a379fec69be8eba36", "score": "0.67626154", "text": "function getTasks(){\n let tasks; //local scope\n if(localStorage.getItem('tasks') === null){\n tasks = []\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n //loop thru existing tasks and create DOM elements\n tasks.forEach(function(task){\n //create li element for tasklist\n const li = document.createElement('li');\n //add a class\n li.className = 'collection-item';\n //create text node and append to li\n li.appendChild(document.createTextNode(task));\n //create new link element\n const link = document.createElement('a');\n //add a class\n link.className = 'delete-item secondary-content';\n //add icon html\n link.innerHTML = '<i class=\"fas fa-times\"></i>';\n //append link to li\n li.appendChild(link);\n //append li to ul\n taskList.appendChild(li);\n });\n}", "title": "" }, { "docid": "00606409c4a408dc92bc36e1e09e9355", "score": "0.67578113", "text": "function getFromLocalStorage() {\n const ref = localStorage.getItem(\"todos\");\n if (ref) {\n todos = JSON.parse(ref);\n renderTodoItems(todos);\n }\n console.log(todos);\n}", "title": "" }, { "docid": "40d26cc65a07239bd4b884b52ae893fb", "score": "0.6756687", "text": "function displayItems() {\n //Get local storage\n var todoList = getTodosFromStorage();\n\n //remove all the items being listed.\n if(document.querySelectorAll(\"ul#todos li\").length) {\n document.querySelectorAll(\"ul#todos li\").forEach(t=>{\n t.remove();\n })\n }\n \n //insert individual todos.\n todoList.forEach(todo => {\n displayToDo(todo);\n });\n}", "title": "" }, { "docid": "fe8df717efa59452f23c9ddba626f7a3", "score": "0.67560977", "text": "static get_list(){\r\n let carts;\r\n if (localStorage.getItem('carts') === null) {\r\n carts = []\r\n }else{\r\n carts = JSON.parse(localStorage.getItem('carts'))\r\n }\r\n return carts\r\n }", "title": "" }, { "docid": "dc9f780b262cd5d25eda54afd7ea3862", "score": "0.674735", "text": "function GetData()\n{\n var ItemStr = localStorage.getItem('Rounds');\n ProductList = JSON.parse(ItemStr);\n\n if (ProductList !== null)\n {\n AllItemsImages = ProductList;\n \n }\n \n \n \n}", "title": "" }, { "docid": "6ae91bb5526ee3168c8106cf72e35ca7", "score": "0.6746534", "text": "function showStorage () {\n let listArray = getList();\n listArray.forEach((item) => {\n addItem(item);\n });\n changeCount();\n}", "title": "" } ]
4fd202b4db660e0f6b8baae8998ce5b7
Get User For Update
[ { "docid": "fa6f00ad9fc05d8d4d47760c57f0bbb3", "score": "0.0", "text": "getRoles() {\r\n return h({\r\n method: 'Get',\r\n url: `${controller}GetRoles`,\r\n });\r\n }", "title": "" } ]
[ { "docid": "062bdf7bf68ec1f53b984431ce56e99a", "score": "0.76373476", "text": "async updatedUser (context) {\n try {\n const user = await this.update(context)\n return user\n } catch (err) {\n throw err\n }\n }", "title": "" }, { "docid": "61241a87a9902e6ce98d22c1587a0356", "score": "0.7249263", "text": "function getUpdateUser(userID) {\n return User.findById(userID);\n}", "title": "" }, { "docid": "ed6f34df4609c343fc474e318823eec5", "score": "0.70219946", "text": "static async updateUser(username, data) {\n let res = await this.request(`users/${username}`, data, 'patch');\n return res.user;\n }", "title": "" }, { "docid": "f9bfd89f5871a336ef54653861b7e698", "score": "0.6806742", "text": "getUserForUpdate(userId) {\r\n return h({\r\n method: 'Get',\r\n url: `${controller}GetUserForUpdate?userId=${userId}`,\r\n });\r\n }", "title": "" }, { "docid": "3f5a208a0f5ade61ea6cdab7dc2469c2", "score": "0.6797855", "text": "updateUser(updateInfo) {\n const userID = updateInfo.ID;\n const url = `${this.baseUrl}/user/${userID}`;\n return this.http.patch(url, updateInfo);\n }", "title": "" }, { "docid": "80b1fa61928685079a462863c7b79e8c", "score": "0.66131043", "text": "getUser(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast);\n return users.get(args.key, feathersParams).then(extractFirstItem);\n }", "title": "" }, { "docid": "80b1fa61928685079a462863c7b79e8c", "score": "0.66131043", "text": "getUser(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast);\n return users.get(args.key, feathersParams).then(extractFirstItem);\n }", "title": "" }, { "docid": "d363238f04fda79565f1fb8b252ce7f6", "score": "0.65843576", "text": "function updateOtherUser(userToUpdate) {\n var async = $q.defer();\n var fullName = userToUpdate.fname + ' ' + userToUpdate.lname;\n Parse.Cloud.run('updateUserById',\n { userId: userToUpdate.userId, fname: userToUpdate.fname, lname: userToUpdate.lname,\n email: userToUpdate.email, userPhone: userToUpdate.userPhone, username: fullName\n }).then(function (result) {\n console.log(\"User updated\" + result);\n async.resolve(result);\n }).catch((error) => {\n console.error('Error while updating user', error);\n async.reject(error);\n });\n\n return async.promise;\n }", "title": "" }, { "docid": "1cb5b45584e542b05ef991880a7187b6", "score": "0.65762955", "text": "static getUser(id) {\n return id ? mtr.users.findOne({ _id: id }) : mtr.users.findOne({ _id: User_.getCurrentId() });\n }", "title": "" }, { "docid": "a0248b01802c025fcdf1c98018c49a68", "score": "0.6561019", "text": "getUser(id) {\n let user = users.get(id);\n if(user) {\n return user.toJSON();\n } else {\n users.fetch();\n return {};\n }\n }", "title": "" }, { "docid": "5c13af9163102b0acf1bb3394804aca3", "score": "0.65574723", "text": "function update() {\n var newUser = {\n username: $scope.profileUsername,\n password: $scope.profilePassword,\n firstName: $scope.profileFirstName,\n lastName: $scope.profileLastName,\n email: $scope.profileEmail\n };\n\n UserService.updateUser(currentUser._id, newUser, function(found) {\n if (found) {\n $location.url(\"profile\");\n console.log(found);\n }\n });\n\n }", "title": "" }, { "docid": "4c62152be2e1df3054ae2ccce017c177", "score": "0.6547504", "text": "updateUser(user) {\n return this.#fetchAdv(this.#updateUserURL(user.getId()), {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json, text/plain',\n 'Content-type': 'application/json',\n },\n credentials:'include',\n body: JSON.stringify(user)\n }).then((responseJSON) => {\n let responseUser = UserBO.fromJSON(responseJSON)[0];\n return new Promise(function (resolve) {\n resolve(responseUser)\n })\n })\n }", "title": "" }, { "docid": "a8d5c147eeed6ea45d76b19bd22e9da1", "score": "0.6543798", "text": "async update (req, res) {\n try {\n if (typeof req.user === 'undefined' || req.user === null) {\n throw new Error('You are not connected')\n }\n const updateStruct = {\n update: {\n userUsername: req.body.username,\n userEmail: req.body.email\n },\n where: {\n userId: req.user.userId\n }\n }\n return CRUDController.update(req, res, User, updateStruct)\n } catch (err) {\n // 401 Unauthorized\n return res.status(401).send({\n error: err.message\n })\n }\n }", "title": "" }, { "docid": "b91d01bc9f1b7ea667cfde7001433608", "score": "0.6533284", "text": "update(id, user) {\n return UserModel.findOneAndUpdate({_id: id}, user, {new: true});\n }", "title": "" }, { "docid": "a47ee59161347ec5005a6d61da41f131", "score": "0.6518066", "text": "showUpdate(user) {\n \n let adminInfo = {\n name : user.name,\n email: user.mail,\n emailSearch: user.email\n };\n\n this.handleUpdateUser(adminInfo);\n }", "title": "" }, { "docid": "8aac51d4de831896b5d89385db4b5de3", "score": "0.65150714", "text": "updateUser({ params, body }, res) {\n User.findOneAndUpdate(\n { _id: params.id },\n body,\n { new: true, runValidators: true }\n )\n .then(userData => {\n if (!userData) {\n res.status(404).json({ message: 'No User found with this id!' });\n return;\n }\n res.json(userData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "0676d4c84e3517c50d824d6570156b59", "score": "0.6513622", "text": "static async updateUser(req, res) {\n \n }", "title": "" }, { "docid": "0fc6d46aab3c25b34cc21fcde1dfa943", "score": "0.6502691", "text": "getCurrentUser() {\n const current_user_id = this.get('current_user')\n return this.get('users')[current_user_id]\n }", "title": "" }, { "docid": "069d8fde341fd864063b5ba505634db6", "score": "0.65000755", "text": "updateOrgUser(updateInfo) {\n const url = `${this.baseUrl}/orguser`;\n return this.http.patch(url, updateInfo);\n }", "title": "" }, { "docid": "3898d077843e7d4336111e661732253d", "score": "0.648641", "text": "update(req, res) {\n return User.findByPk(req.params.id)\n .then(user => {\n if (!user) {\n return res.status(404).send({\n message: \"User Not Found\"\n });\n }\n return user\n .update({\n username: req.body.username,\n email: req.body.email\n })\n .then(user => res.status(200).send(user))\n .catch(error => res.status(400).send(error));\n })\n .catch(error => res.status(400).send(error));\n }", "title": "" }, { "docid": "4793ed157fc04a21fdec435de6f17cf2", "score": "0.64749867", "text": "updateUser({ params, body }, res) {\n Users.findOneAndUpdate({ _id: params.id }, body, { new: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "cf0140f29df19612e7d3003f6676a922", "score": "0.6472623", "text": "function currentUser(data){\n p = data.user;\n // Update Room\n for (let i = 0; i < users.length; i++) {\n if (userp[i].username === p) {\n currUser = userp[i];\n }\n }\n\n return currUser;\n}", "title": "" }, { "docid": "d1d623e045f666d8320b2da705a07d1e", "score": "0.64720374", "text": "updateUser({params, body}, res){\n User.findOneAndUpdate({ _id: params.id}, body, { new: true, runValidators: true})\n .select('-__v')\n .then(dbUserData => {\n if(!dbUserData){\n res.status(404).json({message: 'No user found with this id!'});\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(404).json(err));\n\n }", "title": "" }, { "docid": "3be9035b26805b29298b940c5f11fecb", "score": "0.6450208", "text": "function updateUser() {\n var user = new User($staticUsername.val(),password,$firstName.val(),$lastName.val(),\n $role.val(),$phoneNumber.val(),$email.val(),$dob.val());\n userService\n .updateUser(userID, user)\n .then(toggleAlertMessage);\n }", "title": "" }, { "docid": "26dfaa414512554545fbb0d10a362079", "score": "0.6441761", "text": "updateUser({ params, body }, res) {\n User.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'There is no user with this id! '});\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.json(err));\n }", "title": "" }, { "docid": "0bafdfeb2a459afc7d49f8c96bd6d2c0", "score": "0.6432849", "text": "function updateUser({\n userID,\n value,\n}) {\n return authenticationClient.updateUser(userID, value);\n}", "title": "" }, { "docid": "eeff241ab1fbe7a4957a668c2138bb96", "score": "0.6424782", "text": "async function updateUser() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n if(token && username) {\n currentUser = await User.getLoggedInUser(token, username);\n }\n }", "title": "" }, { "docid": "9a0bc8885dcca9d7377da1f918aeb571", "score": "0.64126647", "text": "async getUser() {\n return await this.client.queryByChaincode(chaincodeId, 'user.get');\n }", "title": "" }, { "docid": "ac2ff13fb7d32feb20c9c55532125c1f", "score": "0.63987345", "text": "async update(req, res){\n try {\n // Procura um usuario pelo id passado na url e atualiza os dados com as modificacoes no banco\n const user = await User.findByIdAndUpdate(req.params.id, req.body, {new: true});\n\n return res.json(user);\n\n } catch (error) {\n return res.status(400).send({error: 'Erro ao listar usuários.' })\n }\n }", "title": "" }, { "docid": "b6d96113e0523c982ec6fc49dce40a0c", "score": "0.6395493", "text": "function editUser(req, res) {\n\t// Reject request from anyone who is neither manager nor user whose document is requested to be edited\n\tif (req.user.type != \"manager\" && req.user._id != req.params.id) {\n\t\tres.status(403).send({message: \"Access denied.\"})\n\t} else {\n var updates = {\n firstName: req.body.firstName,\n lastName: req.body.lastName,\n email: req.body.email,\n phone: req.body.phone,\n password: req.body.password,\n }\n \n if (req.user.type === \"manager\") {\n updates.type = req.body.type\n }\n \n User.findOneAndUpdate({_id: req.params.id}, updates, {new: true}, function(err, editedUser) {\n if (err) {\n res.json({error: err})\n } else {\n res.json({\n message: \"User information successfully edited.\",\n editedUser: editedUser\n })\n }\n })\n }\n}", "title": "" }, { "docid": "fc0281b2032935caa47192b066cd0e1f", "score": "0.63911873", "text": "static async update(username, columnsToUpdate) {\n let { query, values } = partialUpdate('users', columnsToUpdate, 'username', username);\n\n const result = await db.query(query, values);\n return result.rows[0];\n }", "title": "" }, { "docid": "d96805a0c7bbd6acd073e029af71f871", "score": "0.63669986", "text": "static async updateProfile(req, res) {\n try {\n const { email } = req.user;\n const updatedField = await Users.update(req.body, {\n where: { email },\n returning: true,\n plain: true,\n });\n const userData = updatedField[1];\n return res.status(200).json({\n status: 200,\n message: 'user updated',\n data: {\n firstname: userData.firstname,\n lastname: userData.lastname,\n email: userData.email,\n role: userData.role,\n dateofbirth: userData.dateofbirth,\n gender: userData.gender,\n address: userData.address,\n },\n });\n } catch (error) {\n return res.status(500).send(error.message);\n }\n }", "title": "" }, { "docid": "3deff25f2f41d444945c78be0d4d69d9", "score": "0.6350658", "text": "function updateUser(){\n UserService.updateUser(vm.user);\n }", "title": "" }, { "docid": "f591ccf024c4894313caf189c06c9cd1", "score": "0.634747", "text": "update(currentUser, modifiedUser){\n \n this.httpClient.post('/AccountEdit/' + currentUser.id + '/' + modifiedUser.mail.toLowerCase() + '/' + modifiedUser.nickname + '/' + modifiedUser.password)\n .then(() => {\n this.ea.publish('user-updated', { modifiedUser });\n });\n\n \n }", "title": "" }, { "docid": "d4048bb7a153540f89f62bd09d25b6af", "score": "0.6338575", "text": "function GetSpecificUser(req, res) {\n knex('users')\n .where(\"id\", req.swagger.params.id.value)\n .then((users) => {\n if (users.length === 0) {\n res.set('Content-Type', 'text/plain');\n res.status(404).send(\"This user is not found\");\n } else {\n delete users[0].hashed_password\n res.json(users[0]);\n }\n })\n .catch((err) => {\n console.error(err);\n });\n}", "title": "" }, { "docid": "d8d83040231de9024d171f59620d3de2", "score": "0.6334991", "text": "function user(userId) {\n return Meteor.users.findOne(userId);\n}", "title": "" }, { "docid": "81cb90e291fa43b4cb0370bfe0cd0f28", "score": "0.6319976", "text": "updateUser({params, body}, res) {\n User.findOneAndUpdate(\n { _id: params.id}, \n body, \n { new: true, runValidators: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({message: 'No user found with this id!'});\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "1dd6bb1b9a9099956f974f7da9748a6c", "score": "0.63086694", "text": "function UpdateUser(req, res) {\n const updatedUser = req.body;\n knex('users')\n .where(\"id\", req.swagger.params.id.value)\n .then((users) => {\n if (users.length === 0) {\n res.set('Content-Type', 'text/plain');\n res.status(404).send(\"This user is not found\");\n } else {\n bcrypt.hash(updatedUser.password, 12)\n .then((hash) => {\n const newUser = {\n first_name: req.body.first_name,\n last_name: req.body.last_name,\n username: req.body.username,\n hashed_password: hash\n };\n return knex('users')\n .where('id', req.swagger.params.id.value)\n .update(newUser, '*')\n })\n .then((userInfo) => {\n let goodUser = userInfo[0];\n delete goodUser.hashed_password;\n res.status(200).json(goodUser);\n })\n .catch((error) => {\n console.error(error);\n })\n }\n })\n .catch((error) => {\n console.error(error);\n })\n}", "title": "" }, { "docid": "6406b2cf7f61188ab24d4bd693c3f133", "score": "0.630095", "text": "async function editUser(id, changes) {\n\tconst {\n\t\tfirst_name,\n\t\tlast_name,\n\t\tjob_title,\n\t\tuser_type,\n\t\temail,\n\t\tprofile_picture,\n\t\tsub,\n\t} = changes;\n\tif (job_title || user_type) {\n\t\tawait db('Employees')\n\t\t\t.where({ user_id: id })\n\t\t\t.update({ job_title, user_type });\n\t}\n\tif (first_name || last_name || email || profile_picture) {\n\t\tawait db('Users')\n\t\t\t.where({ id })\n\t\t\t.update({ first_name, last_name, email, profile_picture, sub });\n\t}\n\treturn find({ 'Users.id': id });\n}", "title": "" }, { "docid": "7979b6657c2cf3145b53690b25cd9a0a", "score": "0.6292039", "text": "function findUserById() {\n\n}", "title": "" }, { "docid": "3a5ee79586094c763f5f8f49f5d76d4b", "score": "0.62899417", "text": "function userUpdate(req, res) {\n let userUdp = req.body\n let id = req.params.userId\n UserInfo.update({\n _id: id\n }, userUdp, (err, response) => {\n if (err)\n return res.status(500).send({message: `ERROR: error al obtener los usuarios: ${err}`})\n if (response.nModified === 1)\n res.status(200).send({message: 'Datos actualizados'})\n if (response.nModified === 0)\n res.status(200).send({message: 'Datos actualmente actualizados'})\n })\n}", "title": "" }, { "docid": "937a11814f6d947d87f25bb98fbc2364", "score": "0.6287083", "text": "get user() {\n return this.fapp.get('user');\n }", "title": "" }, { "docid": "a342e841137ff73c2fbe36b02e0b36fb", "score": "0.6279062", "text": "function updateUser() {\n const data = getFormData();\n console.log('Older User', data)\n const user = users.get(data.userId).set(data);\n \n console.log('new user', user);\n if (user.isValid()) {\n user.save()\n .done(attributes => {\n resetForm();\n });\n }\n \n }", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.6277791", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.6277791", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "80a06535a9661d999c06e460965a6cd3", "score": "0.6269", "text": "function updateUser(req, res, next) {\n User.updateOne({_id: req.params.userId}, req.body).then(function () {\n User.findOne({_id: req.params.userId}).then(function (user) {\n res.send(user);\n });\n });\n}", "title": "" }, { "docid": "e5e72e2ec3eb4191d32f37fb83cd34f0", "score": "0.6268703", "text": "function updateUser(isReturn) {\n var objUser = angular.copy(vm.modelUser);\n \n if (!vm.modelUser) {\n return;\n }\n if (vm.strPasswordNew) {\n objUser.passwordNew = vm.strPasswordNew;\n }\n\n return CioUserService.handleUserAction(objUser, 'updateUser',\n function(objErr, objResult) {\n \n if (objErr) {\n // do something\n return;\n }\n\n _rematchUser(objResult.objUser);\n return isReturn && closeEditUser();\n });\n }", "title": "" }, { "docid": "9c8668139c440e4a3227335e995fc0ba", "score": "0.6265567", "text": "static async getUser(id) {\r\n var values = super.get(id);\r\n return new User(values);\r\n }", "title": "" }, { "docid": "d437bb39b87dc5372f90c580c28b9581", "score": "0.62505096", "text": "editUser(userId, data) {\n return this.userSchema.findByIdAndUpdate({_id: userId}, data);\n }", "title": "" }, { "docid": "8eb50dac2aa7dc073a07037b6c45ea80", "score": "0.62472826", "text": "static async update(id, data) {\n\n let {query, values} = partialUpdate(\n \"users\",\n data,\n \"id\",\n id\n );\n\n const result = await db.query(query, values);\n const user = result.rows[0];\n\n if (!user) {\n let notFound = new Error(`There exists no user with id: '${id}`);\n notFound.status = 404;\n throw notFound;\n }\n\n return result.rows[0];\n }", "title": "" }, { "docid": "d56ddc852688bfd0c3d0f86c5b50cabb", "score": "0.62448096", "text": "function updateUser(userId, username, password, firstName, lastName, role) {\n \tvar updatedUser = new User(username, password, firstName, lastName, role);\n \tupdatedUser.setId(userId);\n \tuserService.updateUser(updatedUser);\n \tvar updatedRowId = \"#\" + userId\n \t$(updatedRowId).remove();\n \treturn findUserById(userId).then(function(response){\n \t\trenderUser(response);\n \t});\n \t\n }", "title": "" }, { "docid": "a0bdc7ef9ffdeb6a2e3c8dba1a4b1054", "score": "0.6235581", "text": "updateUser({ params, body }, res) {\n User.findOneAndUpdate({ _id: params.id }, body, {\n new: true,\n runValidators: true,\n })\n .then((dbUserData) => {\n if (!dbUserData) {\n res.status(404).json({ message: \"No user found with this id!\" });\n return;\n }\n res.json(dbUserData);\n })\n .catch((err) => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "title": "" }, { "docid": "0bbfe6acecb32e795c1bbf228b9dd9f0", "score": "0.6230902", "text": "async updateUser () {\n\t\t// token becomes the user's actual access token for CodeStream, and also the New Relic token\n\t\t// for observability functions\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tmodifiedAt: Date.now(),\n\t\t\t\t...this.refreshResult.userSet\n\t\t\t}\n\t\t};\n\n\t\tthis.updateOp = await new ModelSaver({\n\t\t\trequest: this,\n\t\t\tcollection: this.data.users,\n\t\t\tid: this.refreshResult.user.id\n\t\t}).save(op);\n\t}", "title": "" }, { "docid": "d518fc1ba33398885ccf78f794770870", "score": "0.6228966", "text": "function updateUserFromDB ( user , object ) {\n return Users.findByIdandUpdate( { _id: user } , object , { new : true } ).select('-password');\n}", "title": "" }, { "docid": "40a6cd62c4bf229b988c5a554a007fe3", "score": "0.6225521", "text": "async function getUser (uID) {\n try {\n const userData = await User.findByPk(uID);\n const user = userData.get({ plain: true });\n return user;\n } catch (err) {\n console.log(`An error occurred when attemping to retrieve user ${uID}`);\n }\n}", "title": "" }, { "docid": "4b6c91de410d05e072aabf1e45aa6ba0", "score": "0.622415", "text": "updateUser(id, userPartial) {\n return this.usersRepository.findOne({ _id: id }).then((user) => {\n if (!user) {\n return 0;\n }\n return this.usersRepository.update(\n { _id: id },\n { ...user, ...userPartial },\n );\n });\n }", "title": "" }, { "docid": "262ff3c9ff0493981943f7dfffb08b87", "score": "0.6223968", "text": "getUser(){\n return this.users[0];\n }", "title": "" }, { "docid": "71de85a761bbc79da538023aa6f1c73a", "score": "0.6221883", "text": "function getUser() {\n return getFromUrlParamOrLocalStorage('h_user');\n}", "title": "" }, { "docid": "fe52833c52802edde1fa51a2a89cd651", "score": "0.6214226", "text": "getUserId() { return this.getRememberMeId(); }", "title": "" }, { "docid": "6482f0bde24db5b5bc3d127b69548321", "score": "0.62107086", "text": "function updateUser() {\n if (!selectedUser) {\n return;\n }\n\n var roles = vm.roles.replace(/\\s+/g, '').split(',');\n\n var newuser = selectedUser;\n var userId = selectedUser._id;\n\n delete newuser._id;\n\n newuser.username = vm.username;\n newuser.password = vm.password;\n newuser.firstName = vm.firstName;\n newuser.lastName = vm.lastName;\n newuser.roles = roles;\n\n UserService.updateUser(userId, newuser)\n .then(function(response) {\n if ($rootScope.currentUser) {\n if ($rootScope.currentUser._id == response.data._id) {\n $rootScope.currentUser = response.data;\n }\n }\n init();\n })\n }", "title": "" }, { "docid": "24a7e407d08d431b8c7ec538b6888e45", "score": "0.6210388", "text": "function updateUser() {\n if (!selectedUser) {\n return;\n }\n\n var roles = vm.roles.replace(/\\s+/g, '').split(',');\n\n var newuser = selectedUser;\n var userId = selectedUser._id;\n\n delete newuser._id;\n\n newuser.username = vm.username;\n newuser.password = vm.password;\n newuser.firstName = vm.firstName;\n newuser.lastName = vm.lastName;\n newuser.email = vm.email;\n newuser.roles = roles;\n\n UserService.updateUser(userId, newuser)\n .then(function(response) {\n if ($rootScope.currentUser) {\n if ($rootScope.currentUser._id == response.data._id) {\n $rootScope.currentUser = response.data;\n }\n }\n init();\n })\n }", "title": "" }, { "docid": "0386299110b3fdfadb44996af6afa83a", "score": "0.6209065", "text": "static getUser(id) {\n if (id in this.users) return this.users[id];\n return undefined;\n }", "title": "" }, { "docid": "22e74500a202f0afbf2247176292672e", "score": "0.6207191", "text": "async UserById(request, response) {\n response.send(await UserServices.getUserById(request.params.id));\n }", "title": "" }, { "docid": "5da2ca9123d67ede690e497fbd8aedea", "score": "0.6205274", "text": "getUser(id) {\n return this.users.filter(user => user.id === id)[0]\n }", "title": "" }, { "docid": "7bf913bb27cd46cf34c2dac930d83edd", "score": "0.62011844", "text": "async function getCurrentUser(){\n const currentUser = await User.findOne({\n where:{\n id:1\n }\n });\n return currentUser;\n}", "title": "" }, { "docid": "ef03bb90523aa6cd5bb9330fbf263029", "score": "0.6197679", "text": "async getUser({ commit, state }) {\n\t\t\ttry {\n\t\t\t\tconst [error, user] = await UserAPI.getUserByUsername(state.username);\n\t\t\t\t// Updating values\n\t\t\t\tcommit(\"setUser\", user);\n\t\t\t\tcommit(\"setUserId\", state.user[0].id);\n\t\t\t\tcommit(\"setUsername\", state.user[0].username);\n\t\t\t\tcommit(\"setHighScore\", state.user[0].highScore);\n\t\t\t\tcommit(\"setUserError\", error);\n\t\t\t} catch (error) {\n\t\t\t\tcommit(\"setUserError\", error.message);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "9950ff94156bc5090963a9559b165af8", "score": "0.6197213", "text": "_getAdminProfile() {\n const adminUsername = this._adminUsername();\n const adminID = Meteor.users.findOne({ username: adminUsername })._id;\n return {\n username: adminUsername, firstName: 'RadGrad', lastName: 'Admin', role: ROLE.ADMIN, userID: adminID,\n };\n }", "title": "" }, { "docid": "bc4f942d4ca713c10c5d9109de6c4c90", "score": "0.61947787", "text": "getUserById(userId) {\n return this.users.find(user => user.id === userId);\n }", "title": "" }, { "docid": "a975bda7a1e0e4bea8de10713c24183a", "score": "0.6190865", "text": "InternalUserUpdate(old, newU)\n {\n \n }", "title": "" }, { "docid": "b94b5c0cce79a3d27c9749a0057c50e0", "score": "0.6189941", "text": "updateUser({ params, body }, res) {\n User.findOneAndUpdate({_id: params.id}, body, {new: true})\n .then((dbUserData) => {\n if(!dbUserData) {\n res.status(404).json({ message: 'No User found with this id!'});\n return;\n }\n res.status(200).json(dbUserData);\n })\n .catch((err) => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "title": "" }, { "docid": "aad30bf925ada085ad4fb25796aae932", "score": "0.6188463", "text": "async retrieveUser (context) {\n try {\n const user = await this.getUser(context)\n return user\n } catch (err) {\n throw err\n }\n }", "title": "" }, { "docid": "e3b4b98d9c09bd64c69083706e04aed4", "score": "0.61877143", "text": "updateUser({ params, body }, res) {\n // first parameter is the \"where\" clause\n // second paramater is the updated data\n // third paramter of { new: true } returns an updated version of the document rather than the original\n // add runValidators to make sure that the validator also runs when we update something \n User.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "4cce1f35912d5bc1b876447596d3b27c", "score": "0.61866665", "text": "getCreatedBy() {\n return dbAdapter.getUserById(this.userId);\n }", "title": "" }, { "docid": "7cd9f1e8e777edb62974c62e4d5d4265", "score": "0.6178622", "text": "function updateUser() {\n userService\n .updateUser(model.userId, model.user)\n .then(function() {\n model.message = \"User updated successfully.\";\n });\n }", "title": "" }, { "docid": "fc9f0dd97e915f42b1689202383dc124", "score": "0.6175875", "text": "function updateOne(req, res) {\n\tconst idUser = req.user._id\n\tController.updateUser(idUser, req.body)\n\t\t.then((user) => {\n\t\t\tresponse.success(req, res, user.body, 201)\n\t\t})\n\t\t.catch((err) => {\n\t\t\tresponse.error(req, res, err, 404)\n\t\t})\n}", "title": "" }, { "docid": "007f158b234f41df44ed8c64e3b97144", "score": "0.61715513", "text": "static async updateOne(req, res) {\n try {\n let idUser = req.params.id;\n\n // On vérifie si l'utilisateur existe en base de données\n const countResult = await UserModel.matchDB(idUser);\n\n // L'utilisateur a bien été trouvé dans la base de données\n if (countResult[0].count > 0) {\n // On renvoie les informations de l'utilisateur\n const { name, mail, role } = req.body;\n const fields = {\n name: name,\n mail: mail,\n role_id: role,\n };\n\n const queryResult = await UserModel.one(idUser, req.method, fields);\n\n res.send(\"User successfully updated\");\n } else {\n res.status(406).send({ \"No result for user :\": idUser });\n }\n } catch (err) {\n // fin du try\n\n res.json({ message: err });\n }\n }", "title": "" }, { "docid": "276bc4049abb2089cec49dde723e8252", "score": "0.61670274", "text": "async getOneUser(condition){\n return UserModel.findOne(condition)\n }", "title": "" }, { "docid": "9ad93643d147fd7b696c9145cf894a0b", "score": "0.61664665", "text": "_getUserById(userId) {\n return this.users.filter((user) => user.id == userId)[0];\n }", "title": "" }, { "docid": "af42d0b9e6cabeb595a4adf942f5db8c", "score": "0.61608875", "text": "function updateUser() {\n if (selectedUser != null) {\n selectedUser.username = $usernameFld.val();\n selectedUser.password = $passwordFld.val();\n selectedUser.firstName = $firstNameFld.val();\n selectedUser.lastName = $lastNameFld.val();\n selectedUser.role = $roleFld.val();\n userService.updateUser(selectedUser._id, selectedUser)\n .then(function (status) {\n var index = usersDB.findIndex(user => user._id === selectedUser._id);\n usersDB[index] = selectedUser;\n renderUsers(usersDB);\n clearInputFields();\n selectedUser = null;\n })\n }\n}", "title": "" }, { "docid": "d328ac187507b8f695f6a5983214bd6b", "score": "0.61576164", "text": "function getLoggedInUser() {\n return storageService.getStorage('user')\n}", "title": "" }, { "docid": "81c2e334d7268686d24d882fa22ed17d", "score": "0.61575294", "text": "function updateUser(fname, lname, email, phone) {\n var async = $q.defer();\n var fullName = fname + ' ' + lname;\n\n const User = new Parse.User();\n const query = new Parse.Query(User);\n\n if (isLoggedIn()) {\n // Finds the user by its ID\n query.get(activeUser.userId).then((user) => {\n // Updates the data we want\n user.set('username', fullName);\n user.set('email', email);\n user.set('copyOfEmail', email);\n user.set('fname', fname);\n user.set('lname', lname);\n user.set('userPhone', phone);\n // Saves the user with the updated data\n user.save().then((response) => {\n console.log('Updated user', response);\n async.resolve(response);\n }).catch((error) => {\n console.error('Error while updating user', error);\n async.reject(error);\n\n });\n });\n }\n return async.promise;\n }", "title": "" }, { "docid": "fd67ac82b07ae77456ed37f2376f644b", "score": "0.61571294", "text": "updateUser(userName){\n\n }", "title": "" }, { "docid": "b28c339b18420185358eaff4b89cd74c", "score": "0.6157087", "text": "getUser(userId) {\n return this.user = this.angularDb.object('accounts/' + userId);\n }", "title": "" }, { "docid": "0afffc59ad088d3401b663ea4b588c0f", "score": "0.61520696", "text": "async updateUser(condition,newValue){\n return UserModel.updateUser(condition,{$set:newValue,})\n \n }", "title": "" }, { "docid": "8be824b97507ff286b58d33525811cbb", "score": "0.6149655", "text": "async getUser(data){\n return User.findOne(data).exec();\n }", "title": "" }, { "docid": "21776ad6efe20174332c781af4ef845c", "score": "0.6149625", "text": "me(parent, arg, ctx, info) {\r\n const userId = ctx.request.userId;\r\n if (!userId) return null;\r\n return ctx.db.query.user(\r\n {\r\n where: { id: userId }\r\n },\r\n info\r\n );\r\n }", "title": "" }, { "docid": "c7a0ba60b8a44657f52bc03150af2154", "score": "0.6143898", "text": "static async update(username, data) {\n let sqlObj = sqlForPartialUpdate(\"users\", data, \"username\", username)\n const result = await db.query(\n `${sqlObj.query}`, sqlObj.values);\n if (result.rows.length === 0) {\n throw { message: `There is no User with username of'${username}`, status: 404 }\n }\n return result.rows[0];\n }", "title": "" }, { "docid": "cfbc07c59787953e5be53f3b2194eb55", "score": "0.614142", "text": "updateUser({ params, body }, res) {\n User.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true})\n .then(result => {\n if (!result) {\n res.status(400).json({ message: 'User not found'});\n return;\n }\n res.json(result)\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "1205edd30aa4d1ea896b5c3511796a44", "score": "0.6129968", "text": "static getUser(id) {\n return users.find(user => user.id === id)\n }", "title": "" }, { "docid": "62697b2f94f905ff3b47c9d96385b2f0", "score": "0.6128417", "text": "function getAdminUser() {\n //...\n}", "title": "" }, { "docid": "33d030373b1cadbb85bd45a1346a435c", "score": "0.6127937", "text": "async getUser() {\n return await this._client.kraken.users.getUser(this._data._id);\n }", "title": "" }, { "docid": "841e8565878d831328e67beba1265efd", "score": "0.6126052", "text": "findOneUser(id) {\n return this.users.find(user => user.id === id);\n }", "title": "" }, { "docid": "6d93277a984f1a42b52346e6c22d0580", "score": "0.6125375", "text": "getUser(state) {\n return state.user;\n }", "title": "" }, { "docid": "49bb5a1ed6c7bdf03da8127d2edb5284", "score": "0.61235344", "text": "function editUserInfo(User, data){\n return function () {\n var updatedInfo = {email: data.email};\n return callWithPromise(User, \"findOneAndUpdate\", {_id: data.id}, {$set: updatedInfo});\n }\n}", "title": "" }, { "docid": "93ae9f05322b76879644f5df1220e63e", "score": "0.6123348", "text": "async update(req, res){\n const user = await Usuario.findByIdAndUpdate(req.params.id, req.body, {new: true})\n return res.json(user)\n }", "title": "" }, { "docid": "4ed0bd2054750b5ab149ba0335678ac0", "score": "0.612157", "text": "function updateUser(req, res){\n var userId = req.params.id;\n var update = req.body;\n\n //sacar pw\n delete update.password;\n\n if(userId != req.user.sub){\n return res.status(500).send({ message: 'No tienes permisos para actualizar los datos del usuario' });\n }\n\n User.find({ $or: [\n {email: update.email.toLowerCase()},\n {nick: update.nick.toLowerCase()}\n ]}).exec((err, users) => {\n var user_isset = false;\n users.forEach((user) =>{\n if(user && user._id != userId) user_isset = true;\n\n });\n if(user_isset) return res.status(404).send({ message: 'Los datos ya existen' });\n\n User.findByIdAndUpdate(userId, update, {new: true}, (err, userUpdated) => { //new true manda el objeto actualizado (userUpdated)\n if(err) return res.status(500).send({ message: 'Error en la petición' });\n\n if(!userUpdated) return res.status(404).send({ message: 'No se ha podido actualizar el usuario' });\n\n return res.status(200).send({ user: userUpdated });\n });\n\n });\n\n}", "title": "" }, { "docid": "4e788dfcd650a8f9f2439aedb6583bbe", "score": "0.6118224", "text": "getUser() {\n // was already instantiated\n if (this._user) {\n return this._user\n }\n\n this._user = new UserModel(this.get('user'))\n\n return this._user\n }", "title": "" }, { "docid": "2ea56a559fd096b6d3081d0efcdb698c", "score": "0.61149204", "text": "update() {\n\t\tthis.setState({\n\t\t\tuser: this.props.currentUser.getUser()\n\t\t});\n\t}", "title": "" }, { "docid": "13c20144160870cc57364c52a9351ba2", "score": "0.61145896", "text": "static updateUser(req, res) {\n UserController.userModel.updateUser(req.params.id, req.body, res);\n console.log(\"updated user\");\n }", "title": "" }, { "docid": "c079298439a0d759f8d295fea3d4fdef", "score": "0.61134577", "text": "updateUser({ params, body }, res) {\n // With this .findOneAndUpdate() method, Mongoose finds a single document we want to update, \n // then updates it and returns the updated document. If we don't set that third parameter, \n // { new: true }, it will return the original document. By setting the parameter to true, \n // we're instructing Mongoose to return the new version of the document.\n\n // There are also Mongoose and MongoDB methods called .updateOne() and .updateMany(), \n // which update documents without returning them.\n User.findOneAndUpdate({ _id: params.id }, body, { new: true, runValidators: true })\n // Mongoose only executes the validators automatically when we actually create new data. \n // This means that a user can create a user, but then update that user with totally \n // different data and not have it validated.\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "4598a27b9c4a8cfca28563579b0c82bf", "score": "0.6109223", "text": "static updateUser(req, res) {\n try {\n const id = parseInt(req.params.id);\n const {email} = req.body || '';\n let userFound = '';\n users.map((user) => {\n if (user.id === id || user.email === email) {\n userFound = user;\n }\n });\n if (!userFound) {\n return res.status(404).json({\n success: 'false',\n message: 'User not found'\n });\n }\n for (const [key, value] of Object.keys(req.body)) {\n userFound.key = value;\n }\n return res.status(200).json({\n success: 'true',\n message: 'User updated successfully',\n user: userFound\n });\n }\n catch (error) {\n return res.status(500).json({\n success: 'false',\n message: 'Something went wrong'\n });\n }\n }", "title": "" } ]
99316d27b4e07872397a97bbd898a58a
When you don't care about the results... Will make messages print out in random order.
[ { "docid": "45cb17d2bf42b02cab8e849005c0bdb5", "score": "0.0", "text": "function forEachParallel(cb) {\n var done = 0;\n\n for (var i = 0; i < messages.length; ++i) {\n asyncFunc.bind(null, messages[i], function () {\n ++done;\n if (done === messages.length) {\n cb();\n }\n })();\n }\n}", "title": "" } ]
[ { "docid": "f58cfe324f9041beae46d45a6eae56d1", "score": "0.6770437", "text": "function mixedmessages(){\n randomNumber = Math.floor(Math.random() * messagesArray.length);\n console.log(messagesArray[randomNumber]);\n}", "title": "" }, { "docid": "adaf8d22a0239caf8775d18e353354b8", "score": "0.638966", "text": "function randomMessageGenerator() {\n let randomNum = Math.floor(Math.random() * phrases.length);\n let phrase = phrases[randomNum];\n let msgObj = {\n msgValue: phrase,\n timestamp: Date.now(),\n priority: Math.floor(Math.random() * 10) + 1,\n };\n return JSON.stringify(msgObj);\n }", "title": "" }, { "docid": "07092de4b702386d2301a18df100a6d8", "score": "0.61883646", "text": "function printFiveMessages() {\n\tprintMessage() \n\tprintMessage()\n\tprintMessage()\n\tprintMessage()\n\tprintMessage()\n\t\n\n\n\n\n}", "title": "" }, { "docid": "1522c0e50be5cab4f1fb4fca78b20263", "score": "0.5890177", "text": "function loserMessage() {\n switch (Math.floor(Math.random()*2)) {\n case 1:\n {console.log(\"you suck\")};\n break;\n case 2:\n {console.log(\"awful\")};\n break;\n default:\n {console.log(\"try again\")};\n break;\n\n }\n}", "title": "" }, { "docid": "70eec863160258f326952a3ba65a5fd2", "score": "0.58334064", "text": "function randomMessage(messages) {\n var min = 0;\n var max = (messages.length - 1);\n var randomValue = Math.floor(Math.random() * (max - min + 1)) + min;\n return messages[randomValue];\n}", "title": "" }, { "docid": "d651b42b3d4f13772fba076e39395ab0", "score": "0.5758751", "text": "function displayMessageOnBoard(activePlayer) { \n let text = turnMessage[Math.floor(Math.random()*turnMessage.length)];\n $('.turn-' + activePlayer).text(text);\n $('.turn-' + notActivePlayer).text(noTurnMessage);\n}", "title": "" }, { "docid": "60089472a5147d50ec4d4cf24fe80e00", "score": "0.5722505", "text": "generate() {\n if (this.stopGeneration) {\n return;\n }\n const message = this.chance.string();\n const priority = lodash.random(1, 3);\n const nextInMS = lodash.random(500, 3000);\n this.messageCallback({\n message,\n priority,\n });\n setTimeout(() => {\n this.generate();\n }, nextInMS);\n }", "title": "" }, { "docid": "b8e37a73471843a0bdeedbeaa33299b3", "score": "0.56940645", "text": "prepareForDisplaying(aMsg) {}", "title": "" }, { "docid": "8c622e58000dd0d668a9741553d1e9e0", "score": "0.56608576", "text": "createMessage(){\n let randomWords = this.selectRandomWords();\n console.log(`${randomWords[0]} reminder: ${randomWords[1]} ${randomWords[2]} all day!`)\n }", "title": "" }, { "docid": "80c46e5d1d6e8d165310031a2f2e42ed", "score": "0.5649513", "text": "function sayRandomPhrase() {\n queueSpeak(phrases[Math.floor(Math.random() * (phrases.length - 0)) + 0]);\n}", "title": "" }, { "docid": "5fa3c9991fe03c3bcf3c4174e9f458bc", "score": "0.5632139", "text": "makeText(numWords = 100) {\n // TODO\n let wordGen = []\n function random(max){\n return Math.floor(Math.random() * (max + 1))\n }\n let resultLength = Object.keys(this.result).length-1\n let resultKeys = Object.keys(this.result)\n wordGen.push(resultKeys[random(resultLength)])\n for (let i = 0; i<numWords-1; i++){\n let lastWord = this.result[wordGen[i]]\n let ran = random(lastWord.length-1)\n if (lastWord[ran] === undefined){\n wordGen.push('.')\n break\n }\n wordGen.push(lastWord[ran])\n }\n return wordGen.join(' ')\n }", "title": "" }, { "docid": "464d8bd128da3e1483e0ecfb56a6b2b9", "score": "0.5595447", "text": "function genGeneralText(msg){\n var text = \"\";\n var luck = randomRange(1,21);\n if (luck == 1){\n text = \"Yeaahhh!!! \"+genText(4,6);\n }\n if (luck == 2){\n text = \"Nooooooo!!! \"+genText(4,6);\n }\n if (luck == 3){\n text = genText(1,3) + \" LOL!\";\n }\n if (luck == 4){\n text = \"LOL what?? \"+genText(4,6)+\" or \"+genText(2,4)+\"?????\";\n }\n if (luck == 5){\n text = \"I am not toxic, but \"+genTextLegacy(4,6) +\" is such a \"+genText(3,3);\n }\n if (luck == 6 || luck == 7 || luck == 8 || luck == 9){\n text = genText(1,11);\n }\n if (luck == 10){\n text = \"I completely agree \"+genText(2,7);\n }\n if (luck == 11){\n text = \"I disagree, \"+genText(3,8);\n }\n if (luck == 12){\n text = \"right, \"+genText(2,7);\n }\n if (luck == 13){\n text = \"this chat is very \"+genText(3,6)+\" and \"+genText(3,6);\n }\n if (luck == 14){\n text = \"@\"+memory.previousCommenter+\" is my best friend, remember when we \"+genText(5,6);\n }\n if (luck == 15){\n text = \"I don't like @\"+memory.previousCommenter;\n }\n if (luck == 16){\n text = \"@\"+memory.previousCommenter+\" is \"+genText(6,12);\n }\n if (luck == 17){\n text = genText(1,8);\n }\n if (luck == 18){\n text = genText(1,8);\n }\n if (luck == 19){\n text = \"so \"+genText(2,9)+\"?\";\n }\n if (luck == 20){\n text = \"please \"+genText(2,9)+\"!\";\n }\n if (luck == 21){\n text = genText(2,6)+\"! lol!!\";\n }\n return text;\n \n}", "title": "" }, { "docid": "1b4b5a19e374330e3dba216e35015715", "score": "0.55797255", "text": "function printQuote() {\n if (quotes.length === 0){\n refreshList();\n }\n var quote = getRandomQuote();\n quotes.splice(quotes.indexOf(quote), 1);\n createMessage(quote);\n document.getElementById(\"quote-box\").innerHTML = message;\n setRandomColor();\n}", "title": "" }, { "docid": "0b9e98234b700220443c0d0354174e74", "score": "0.5557184", "text": "function asyncFunc(message, cb) {\n setTimeout(function () {\n console.log(message);\n cb();\n }, Math.floor(Math.random() * 11));\n}", "title": "" }, { "docid": "cc6cc75b639be3a4f1db248675a3bf6c", "score": "0.5541524", "text": "function displayMessageAgain(item) {\n console.log(\"I am diplaying 2nd message, becuase I ate 12 \" + item);\n }", "title": "" }, { "docid": "1b0d6d94cc4783f62da8c86af6652d14", "score": "0.5519941", "text": "function genPersonalMsg(msg){\n console.log(\"personal\");\n var text = \"\";\n if (msg == \"@\"+opts.identity.username || msg == opts.identity.username){\n if (chance(40)){\n text = \"what?\"\n }else if (chance(50)){\n text = \"yes?\"\n \n }else{\n text = \"what do you want?\"\n } \n \n }else{\n var luck = randomRange(1,9);\n if (luck == 1){\n text = \"yeah right, I am \"+genTextLegacy(3,3)+ \" and you are a \"+genText(2,4);\n }\n if (luck == 2){\n text = \"Ok, \"+genTextLegacy(2,10);\n }\n if (luck == 3){\n text = \"what?\";\n }\n if (luck == 4){\n text = \"who? @\"+memory.previousCommenter+\"???\";\n }\n if (luck == 5){\n text = \"NO! you lie! I'm not \"+genText(2,8);\n }\n if (luck == 6){\n text = \"I think you are completely wrong \"+genText(6,12);\n }\n if (luck == 7){\n text = \"I agree \"+genTextLegacy(3,3)+ \" and \"+genText(2,4);\n }\n if (luck == 8){\n text = \"If you are right and \" + genText(2,8)+\", then it means \"+memory.previousCommenter+\" is a \"+genText(1,2)+\"!\"\n }\n if (luck == 9){\n text = \"did you \"+genText(6,6)+\"?\";\n }\n }\n \n return text;\n}", "title": "" }, { "docid": "75558c6cdba12ef10e083328e5e09843", "score": "0.5515542", "text": "makeText(numWords = 100) {\n\t\t// TODO\n\t\tlet output = [];\n\t\tlet chainKeys = Object.keys(this.chains);\n\t\tlet current = chainKeys[Math.floor(Math.random() * chainKeys.length)];\n\t\twhile (output.length < numWords) {\n\t\t\toutput.push(current);\n\t\t\tlet follows = this.chains[current];\n\t\t\tlet start = follows[Math.floor(Math.random() * follows.length)];\n\t\t\tcurrent = start ? start : [chainKeys[0]];\n\n\t\t\t// if (start == null) {\n\t\t\t// \tcurrent = chains[Math.floor(Math.random() * chains.length)];\n\t\t\t// } else {\n\t\t\t// \t// let search = chains.filter((key) =>\n\t\t\t// \t// \tkey.startsWith(`${start} `)\n\t\t\t// \t// );\n\n\t\t\t// \t// if (search.length == 0) {\n\t\t\t// \t// \toutput.push(start);\n\t\t\t// \t// \tsearch = [chains[0]];\n\t\t\t// \t// }\n\t\t\t// \tcurrent = search[Math.floor(Math.random() * search.length)];\n\t\t\t// }\n\t\t}\n\t\treturn output.join(\" \");\n\t}", "title": "" }, { "docid": "60dffad3b19cea56ab94e3afdaa0e3da", "score": "0.5497286", "text": "makeText(numWords = 100) {\n // TODO\n let keys = Array.from(Object.keys(this.chains))\n \n \n let output = []\n for(let i = 0; i < numWords; i++) {\n \n let random = Math.floor(Math.random() * keys.length)\n let text = keys[random]\n output.push(text)\n \n }\n return output.join(\" \")\n}", "title": "" }, { "docid": "9faf895f65206177b9ad1a44e9b819b3", "score": "0.54620296", "text": "function generateRMsg(arr) {\n let randNum = Math.floor(Math.random() * arr.length);\n return arr[randNum];\n}", "title": "" }, { "docid": "fef577a1fbcb0feb907809f0dbcbc6dc", "score": "0.5460595", "text": "function show_results(){\n\tresult = print( message_body );\n\tdocument.querySelector(\".data-result\").innerHTML = result;\n}", "title": "" }, { "docid": "5e2eaf6cf52772e9e8e31a45b8751115", "score": "0.5448412", "text": "function results() {\n if (scoreKeeper === random) {\n $.alert({\n title: 'BOOM BOOM BOOM',\n content: 'You Destroied The Deathstar! MEOW!<a href=\"/assets/images/boom.jpg\">',\n });\n wins ++ ;\n gameStarted = false;\n return;\n }\n else if (scoreKeeper > random) {\n $.alert({\n title: 'SIZZLE THWAP',\n content: 'TOO MUCH! TOO MUCH! Kitty claws scratch! REWAWR!<img src=\"/assets/images/game over.jpg\">',\n });\n loses ++ ;\n gameStarted = false;\n return;\n }\n else (scoreKeeper < random);{\n return;\n }\n}", "title": "" }, { "docid": "2a85ce07bb7bb27fff1c6550a5964fac", "score": "0.54332614", "text": "randomMsg() {\n // azzero ogni nuova risposta per far si che sia diversa ogni volta\n let risposta = \"\";\n // generateWords funzione CHE MI ARRIVA DAL generateWords.JS\n let text = generateWords(Math.floor((Math.random() * 10) + 1));\n for (var i = 0; i < text.length; i++) {\n // console.log(text[i]);\n risposta = risposta + \" \" + text[i];\n }\n // stampo un oggetto ricevuto random\n let nuovoObj = {\n text: risposta,\n stato: \"ricevuto\",\n orario: \"12:08\",\n data: \"24 11 2020\",\n opzioniMessaggio: \"none\",\n };\n this.corrispondenze[this.attivo].messaggi.push(nuovoObj);\n this.scrollDown();\n }", "title": "" }, { "docid": "613bda786f58b96567569dc4762a77da", "score": "0.54327977", "text": "function printMessageQueueHead() {\r\n if (botMessagePrintingAllowed && messageQueue.length > 0) {\r\n let json = messageQueue.shift();\r\n\r\n botMessagePrintingAllowed = false;\r\n userMessageSendingAllowed = false;\r\n\r\n msg = readJSON(json);\r\n\r\n updateMode();\r\n updateRoomName();\r\n updateCurrentLevel(levelID);\r\n \r\n printMessage(msg);\r\n } else if (messageQueue.length <= 0) {\r\n userMessageSendingAllowed = true;\r\n }\r\n}", "title": "" }, { "docid": "b3de92d2aeaa1ba87bdf659e4b8a8913", "score": "0.5425452", "text": "function provideHint(){\n var $h0 = \"Your number is one of the three numbers: \"; \n var $h1 = generateWinningNumber(100);\n var $h2 = generateWinningNumber(100);\n var $h3 = winningNumber;\n \n if($h1 === $h2 || $h1 === $h3 || $h2 === $h2) {\n $h1 = generateWinningNumber(100);\n $h2 = generateWinningNumber(100);\n }\n \n var randArr = [$h1, $h2, $h3];\n shuffle(randArr);\n\n $(\"#Message\").text($h0 + \" \"+ randArr[0] + \" \" + randArr[1] + \" \" + randArr[2]);\n}", "title": "" }, { "docid": "676816fa24d2fa75ef2ad0a53f2d0f87", "score": "0.5412063", "text": "async function displayMessages(num, time) {\r\n let returnedMessage = await returnMessages(num, time);\r\n return returnedMessage;\r\n}", "title": "" }, { "docid": "a86abb55770cc1c6875f477ac96a6578", "score": "0.53939676", "text": "function displaySorted(){\n\tsortState = $('.form-control :selected').index();\n\tvar doubtList = $('#chatEntries > div');\n\tif(doubtList.length > numRandomDoubts){\n\t\tvar randArray = [];\n\t\tfor(i=0;i<numRandomDoubts;i++){\n\t\t\trandNum = Math.floor((Math.random() * doubtList.length));\n\t\t\trandArray.push(doubtList[randNum]);\n\t\t\tdoubtList.splice(randNum,1);\n\t\t}\n\t\tif(sortState == 0){\n\t\t\trandArray.sort(compareTime);\n\t\t\tdoubtList.sort(compareTime);\n\t\t}else if(sortState == 1){\n\t\t\trandArray.sort(compareTime).reverse();\n\t\t\tdoubtList.sort(compareTime).get().reverse();\n\t\t}else if(sortState == 2){\n\t\t\trandArray.sort(compareVote);\n\t\t\tdoubtList.sort(compareVote);\n\t\t}else if(sortState == 3){\n\t\t\trandArray.sort(compareVote).reverse();\n\t\t\tdoubtList.sort(compareVote).get().reverse();\n\t\t}else{\n\t\t\tconsole.log(\"Should not reach here\");\n\t\t}\n\t\t$('#chatEntries').empty();\n\t\tfor(i=0;i<numRandomDoubts;i++){\n\t\t\t$('#chatEntries').append(randArray[i].outerHTML);\n\t\t}\n\t\tfor(i=0;i<doubtList.length;i++){\n\t\t\t$('#chatEntries').append(doubtList[i].outerHTML);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "074965373958b9739cf697414a955728", "score": "0.53932905", "text": "function randOrder(){\r\n return 0.5 - Math.random();\r\n}", "title": "" }, { "docid": "b137fa97748d2e50cd5d50dcf58d4383", "score": "0.53786117", "text": "function createRandomMessage() {\n const sentence1 = `Your task for today is: ${taskMessage.createRandomTask()}. `;\n const sentence2 = `For this you will get ${getCharmaPoints()} charma points. `;\n const sentence3 = `You could use them the next time you ${recommendationsUsePoints[Math.floor(Math.random() * recommendationsUsePoints.length)]}.`;\n return sentence1 + sentence2 + sentence3;\n}", "title": "" }, { "docid": "201a943b5ed6910516d811b3f38663bd", "score": "0.53772897", "text": "function FirstMessages() {\n\t\t\tconsole.log(\"The match is between \" + team1.teamName + \" and \" + team2.teamName);\n\t\t\tconsole.log(\"The first batsmen out are \" + team1.teamStatus[batter1][0] + \" and \" + team1.teamStatus[batter2][0]);\n\t\t}", "title": "" }, { "docid": "2572e103010332b5f01e541b09894fe2", "score": "0.53722703", "text": "function printData() {\n collectWins();\n players.sort(function (a, b) {\n return b.winShares - a.winShares;\n });\n\n const message = \"data for finishing \" + (lookForWinners ? \"first\" : \"last\") +\n (useOdds? \" using outcome odds from 538\" : \" assuming all outcomes have equal odds\");\n const toDisplay = { title: message, subMessages: [] };\n\n const sortedOdds = { title: \"players sorted by odds\", messages: [] };\n players.forEach(function(player) {\n sortedOdds.messages.push(printWinPercent(player));\n });\n toDisplay.subMessages.push(sortedOdds);\n\n toDisplay.subMessages.push(printUpcomingGames());\n\n toDisplay.subMessages.push({ title: (lookForWinners? \"winners\" : \"losers\") + \" by game\",\n messages: printClinchers() });\n\n toDisplay.subMessages.push({ title: \"must have games\", messages: printCommonGames() });\n\n resetWinData();\n return toDisplay;\n }", "title": "" }, { "docid": "2e6bde8819d8062106ed0c08a55eac69", "score": "0.5360939", "text": "function produceMessages(counter) {\n if (counter < 1000) {\n setTimeout(async () => {\n counter += 1; // eslint-disable-line\n console.log('Produce: Message ', counter);\n await firstTask.publish([{ payload: `Message ${counter}` }]);\n produceMessages(counter);\n }, 1000);\n }\n }", "title": "" }, { "docid": "1c094bef12d406309a3fcd0d2f0675ee", "score": "0.5359402", "text": "function messageOut(o_msg, e){\n\tvar msg = o_msg.split(\" \").reverse(); // Why do I reverse this? Who knows?\n\tfor(var i = 0; i < msg.length; i++)\n\t\tif(wordIndex(msg[i]) == -1){\n\t\t\tmsg.splice(i, 1); i--;\n\t\t}\n\n\tvar out = command(o_msg, e) || genMessage(msg);\n\n\tconsole.log(\"Message out: \" + out);\n\n\treturn swearFilter(out);\n}", "title": "" }, { "docid": "ee76d5a952938a7577c63eb15e9133f6", "score": "0.53530496", "text": "function response() {\n const form = document.getElementById('form');\n\n const messages = [\n 'neigh',\n 'huff',\n 'clop clop',\n '*aggressive snorting*',\n '*whinny*'\n ];\n const randMessage = messages[Math.floor(Math.random()*messages.length)];\n\n postRequest('/send', {\n sender: 'got',\n user: form.user.value,\n text: randMessage\n }).then(res => {\n showMessages(res.chat);\n });\n}", "title": "" }, { "docid": "5aad3c606db3e089eb233e4e5d4923a4", "score": "0.534503", "text": "makeText(numWords = 100) {\n // TODO\n let textArray = [];\n let chain = this.chain;\n let keys = this.keys;\n let currWord;\n\n function randomWord(col) {\n let idx = Math.floor(Math.random() * col.length);\n return col[idx];\n }\n\n currWord = randomWord(keys);\n textArray.push(currWord);\n\n while (textArray.length < numWords) {\n let newWord = randomWord(chain[currWord]);\n if (newWord == null) newWord = randomWord(keys);\n textArray.push(newWord);\n currWord = newWord;\n }\n let res = textArray.join(\" \");\n console.log(res);\n return res;\n }", "title": "" }, { "docid": "08de752c1c7f697977d102d74892d98e", "score": "0.5342801", "text": "function showAllert(msg){\n let msgText = 'Your message = ' + msg; // a + b => ab , 5 + 6 => 11, 5 + a => 5a\n console.log( msgText );\n //alert( msgText );\n\n} // end of showAllert", "title": "" }, { "docid": "3170447af5c2e411c642c500f2fb194d", "score": "0.5336004", "text": "function fake(message) {\r\n\t\tvar chatInput = jQ('#tabcontent-1').contents().find('#chatinp');\r\n\t\tjQ(chatInput).val(message);\r\n\t\tvar sendButton = jQ('#tabcontent-1').contents().find('button[type=submit]')\r\n\t\tjQ(sendButton).click();\r\n\t\tvar wait = defaultWait;//parseInt(Math.random()*defaultWait);\r\n\t\tconsole.log('waiting: '+wait/1000+'sec');\r\n\t\tvar index = parseInt(Math.random()*messages.length);\r\n\t\tvar randomMessage = messages[index];\r\n\t\tconsole.log('sending: '+randomMessage);\r\n\t\tsetTimeout(function() {\r\n\t\t\tfake(randomMessage);\r\n\t\t}, wait);\r\n\t}", "title": "" }, { "docid": "707c03f220be2a2b2c88ecb0b25e32b1", "score": "0.5323167", "text": "function otherMsg(m, u) {\n console.log(m + \": El resultado es \" + u);\n}", "title": "" }, { "docid": "537817536dde19dda09680e693dbec20", "score": "0.5311172", "text": "function printMessageQueueHead() {\r\n // console.log(messageQueue.length );\r\n if (messageQueue.length > 0) {\r\n let json = messageQueue.shift(),\r\n msg = json.message,\r\n sender = json.sender;\r\n \r\n printMessage(msg,sender);\r\n } else {\r\n let playButton = document.getElementById('play-cta');\r\n playButton.className += ' visible';\r\n setTimeout(() => {\r\n let contentArea = document.getElementById('about');\r\n contentArea.style.visibility = 'visible';\r\n contentArea.style.opacity = '1';\r\n }, 750);\r\n }\r\n}", "title": "" }, { "docid": "050306469187ac893b5f5ed22c7e5f32", "score": "0.5310057", "text": "function getEightballMessage() {\n // To get the message,\n // Pick a random number between 1 and however\n // long that array is.\n let messagesSize = messages.length;\n let randomNumber = Math.floor(Math.random() * messagesSize);\n return messages[randomNumber];\n }", "title": "" }, { "docid": "9f9b5d9f77b8fa03fd37e483d8c1bcb2", "score": "0.5302998", "text": "function render_test() {\n if (USE_DATASTORE_FOR_MESSAGES) {\n var messages =\n dsobj.selectMulti(tableName, {}, {orderBy: \"-date\", limit: 10}).map(function(msg) {\n\treturn { date: msg.date, content: msg.content };\n });\n }\n else {\n var messages = [];\n }\n\n var html = utils.renderTemplateAsString(\"misc/channeltest.ejs\", { messages: fastJSON.stringify({ a: messages.reverse()}) });\n response.write(html);\n}", "title": "" }, { "docid": "6027a0210a570f8afc28a2ff3c0e63f3", "score": "0.52967316", "text": "function genMessage(topic){\n\t//The starting word is one of the important words from the original message\n\tvar important_words = findMainWords(topic); console.log(\"Important words: \" + important_words);\n\tvar word = pickFirstWord(important_words);\n\n\tvar sentence = db.w[word].word;\n\n\tvar length = Math.floor(Math.random()*(15)+25);\n\t\n\n\tvar words_done = [word];\n\tvar possible = [[],[],[]];\n\n\tfor(var i = 0; i < length; i++){\n\t\tif(db.w[word].after[0].length > 0){\n\n\t\t\t\tpossible[0] = db.w[word].after;\n\t\t\tif(i > 1){\n\t\t\t\tpossible[1] = db.w[words_done[words_done.length - 2]].after;\n\t\t\tif(i > 2)\n\t\t\t\tpossible[2] = db.w[words_done[words_done.length - 3]].after;\n\t\t\t}\n\n\t\t\tword = pickNext(possible[0],possible[1],possible[2],[words_done[words_done.length - 1], words_done[words_done.length - 2] || false],important_words);\t\n\t\t\twords_done.push(word);\n\t\t\tif(word > -1){\n\t\t\t\tsentence += \" \" + db.w[word].word;\n\t\t\t} else\n\t\t\t\ti = length;\n\t\t}\n\t}\n\n\tsentence += \".\";\n\treturn sentence;\n}", "title": "" }, { "docid": "95a9907d2f9dbe83860d7d06e94d33e2", "score": "0.52965647", "text": "function loading_done() {\n console.log(\"Bot has finished loading!\");\n bot.sortReplies();\n}", "title": "" }, { "docid": "9c6e0533410053b50b3d74d433488b8c", "score": "0.5284045", "text": "async function displayMessage() {\n const responseFromServer = await fetch('/fetch-hello-world-string');\n \n // Saves JSON list\n const jsonList = await responseFromServer.json();\n \n // Selects a random string from the JSON list\n const randomMessage = jsonList[Math.floor(Math.random() * jsonList.length)];\n \n // Display it on the main page: index.html\n const messageContainer = document.getElementById('message-cont');\n messageContainer.innerText = randomMessage;\n}", "title": "" }, { "docid": "f322b325f37f129517b354204d396778", "score": "0.5279551", "text": "makeText(numWords = 100) {\n let wordCount = 1;\n let randInd = Math.floor(Math.random() * Object.keys(this.chains).length);\n let options = Object.keys(this.chains);\n let curWord = options[randInd];\n let returnStr = curWord;\n\n while (wordCount < numWords) {\n options = this.chains[curWord];\n let nextWord = options[Math.floor(Math.random() * options.length)];\n if (nextWord === null) {\n break;\n }\n returnStr = returnStr + ` ${nextWord}`;\n curWord = nextWord;\n wordCount = wordCount + 1;\n }\n\n return returnStr;\n\n }", "title": "" }, { "docid": "6a990d4506dd1df494ea62312b0b9e38", "score": "0.5279015", "text": "function printinitiativeOrder(initiativeOrder, message) {\n if (Object.keys(initiativeOrder.slots[0]).length > 1) initiativeOrder = sortInitiativeOrder(initiativeOrder);\n let faces = \"\";\n for (let i = initiativeOrder.turn - 1; i < initiativeOrder.slots.length; i++) {\n faces += getFace(initiativeOrder.slots[i].type);\n }\n faces += \":repeat:\";\n for (let i = 0; i < initiativeOrder.turn - 1; i++) {\n faces += getFace(initiativeOrder.slots[i].type);\n }\n message.channel.send(\"Round: \" + initiativeOrder.round + \" Turn: \" + initiativeOrder.turn + \"\\nInitiative Order: \");\n if (faces === \"\") return;\n message.channel.send(faces);\n}", "title": "" }, { "docid": "20e14def700300d0130097c64108c191", "score": "0.5278314", "text": "function sortes(req, res, next) {\n // total number of lines in Twilight\n var totallines = 8712;\n var i = Math.floor(totallines * Math.random());\n req.line = text[i];\n return next();\n}", "title": "" }, { "docid": "66057a4a967c070a0941f545c35bf6cc", "score": "0.526144", "text": "function displayMessage(message){ \n if (battleLog[0]==\"\"){\n battleLog[0]=message;\n } else if (battleLog[1]==\"\"){\n battleLog[1]=message;\n } else if (battleLog[2]==\"\"){\n battleLog[2]=message;\n } else {\n battleLog[0]=battleLog[1];\n battleLog[1]=battleLog[2];\n battleLog[2]=message;\n }\n $(\"#message0\").text(battleLog[0]);\n $(\"#message1\").text(battleLog[1]);\n $(\"#message2\").text(battleLog[2]);\n}", "title": "" }, { "docid": "4a6f2cf1f9e65f8d4df25f5b0e773772", "score": "0.5259769", "text": "function readmsg_loop() {\n setTimeout(function () {\n console.log('.');\n USERREADMSG();\n readmsg_loop();\n }, 4900+Math.floor(Math.random()*200));\n }", "title": "" }, { "docid": "e87a925c79c1c00c900a28673437d175", "score": "0.5258814", "text": "function myFunction(){\n \tvar messageList = [\"Happy Friday\", \" Party night\", \"pay day\"];\n var randomNumber = Math.floor(Math.random() * messageList.length);\n document.getElementById(\"welcomeMsg\").innerHTML = messageList[randomNumber];\n }", "title": "" }, { "docid": "9074d7e56a2a16a4c469f62b0b13af21", "score": "0.52519137", "text": "function WriteResults(build_list, sortby)\r\n{\r\n document.writeln('<span class=\"matches\">Matches found: ' +\r\n build_list.length + '</span><br />');\r\n\r\n switch ( sortby )\r\n {\r\n case \"author\": build_list.sort(AuthorSorter)\r\n WriteList(build_list, AuthorSorter, 2);\r\n break;\r\n\r\n case \"class\": build_list.sort(ClassSorter)\r\n WriteList(build_list, ClassSorter, 4);\r\n break;\r\n\r\n case \"classlevel\": build_list.sort(ClassLevelSorter)\r\n WriteList(build_list, ClassLevelSorter, 3);\r\n break;\r\n\r\n default: WriteList(build_list, TopicSorter, 1);\r\n }\r\n}", "title": "" }, { "docid": "297f41346b85207b56cd4f9d0315d445", "score": "0.5238246", "text": "function printAll() {\n // forgive the ugly return\n // just to match the speed up uncomment section\n // in home.html\n printMessageStats();\n printFriends();\n printSettings();\n printAds();\n printEvents();\n printSecurity();\n printPhotoVideo();\n printIndex();\n}", "title": "" }, { "docid": "9601cae7287ec6606d983d86d8d51e56", "score": "0.5226958", "text": "function plain() {\n let counter = 0\n const itemSpeed = item.totalTime\n ? item.totalTime / msg.length\n : item.speed\n\n function doStuff() {\n // End of message processing logic.\n if (counter === msg.length) return moveOn()\n\n let piece = msg[counter]\n\n if (item.military) {\n return military(q.newDiv, piece, () => {\n counter++\n qIterator(itemSpeed, doStuff)\n })\n }\n\n // Avoid HTML parsing on supplied arrays.\n if (getType(msg) !== 'String') {\n div.textContent = piece\n piece = div.innerHTML\n }\n\n q.newDiv.innerHTML += piece\n counter++\n qIterator(itemSpeed, doStuff)\n }\n\n qIterator(itemSpeed, doStuff)\n }", "title": "" }, { "docid": "14e4c9c9408d4466894bdddad2d88733", "score": "0.522222", "text": "function generateRandomSuggestion() {\n $.each($('.ansContainer p'), function(index, value) {\n $(this).css({\n 'order': Math.floor((Math.random() * questionPerPage) + 1)\n });\n })\n }", "title": "" }, { "docid": "13a3e14a0f8b64ebbf53854f919a2d2e", "score": "0.52178824", "text": "logTwice(msg) {\n console.log(msg);\n console.log(msg);\n }", "title": "" }, { "docid": "46d10124c7d86ce3dc2313dc4f4a88ad", "score": "0.5216527", "text": "function randomPicks() {\n var lang = multiLangs[0];\n var src = mySecret;\n translateMsg(lang, src);\n multiLangs.shift();\n }", "title": "" }, { "docid": "e6047f4c843e50e02f55de8f4b3e2e92", "score": "0.5215249", "text": "async function temporaryMessage(msg, requireAcknowledgment) {\n\tlet message; // char[COLS];\n\tlet i, j;\n\n\t// assureCosmeticRNG();\n\tmessage = capitalize(msg);\n\n\t// for (i=0; message[i] == COLOR_ESCAPE; i += 4) {\n\t// \tmessage[i] = capitalize(&(message[i]));\n\t// }\n\n\trefreshSideBar(-1, -1, false);\n\n\tfor (i=0; i<MESSAGE_LINES; i++) {\n\t\tfor (j=0; j<DCOLS; j++) {\n\t\t\tplotCharWithColor(' ', mapToWindowX(j), i, black, black);\n\t\t}\n\t}\n\tprintString(message, mapToWindowX(0), mapToWindowY(-1), white, black, 0);\n\t// restoreRNG();\n\n\tif (requireAcknowledgment) {\n\t\tawait waitForAcknowledgment();\n\t\tupdateMessageDisplay();\n\t}\n}", "title": "" }, { "docid": "722c1560e68d62f401961b7ff039d1f7", "score": "0.5209392", "text": "function refreshMessagesFast() {\n renderMessages(lastMessages);\n}", "title": "" }, { "docid": "5871f111214ffb6cd500191526665e3f", "score": "0.520018", "text": "function modulo() {\n\t\tlet message = \"\";\n\t\tlet number = Math.floor(Math.random()*4+1)\n\t\tswitch(number){\n\t\t\tcase 0:\n\t\t\tmessage = \"Vous ne passerez pas !!\";\n\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\tmessage = \"Kévin est une haine ambulante\";\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\tmessage = \"Mais non ?\";\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\tmessage = \"INCROYABLEEEE\"\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\tmessage = \"ok c'est pas à l'infini\"\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\tbreak;\n\t\t\t\n\t\t}return message;\n\t}", "title": "" }, { "docid": "293f909078a07b75883cc0657a8d0751", "score": "0.51974654", "text": "function botMessages(messageKind) {\n let message;\n switch (messageKind) {\n case 'joined':\n message = randomMsg(joinedMessages, 3);\n break;\n case 'left':\n message = randomMsg(leftMessages, 3);\n break;\n case 'answer':\n message = randomMsg(answerMessages, 9);\n break;\n }\n return message;\n}", "title": "" }, { "docid": "29b85a2b2f71665ced2b02114b368eed", "score": "0.51973194", "text": "function fiftyTwoFactorial() {\n var toMatch = deck.sort(function() {\n return 0.5 - Math.random();\n });\n var matchStr = toMatch.join(\" \").toString();\n if (matchStr !== shuffleStr) {\n document.write(matchStr + \": No Match :(\");\n } else if (matchStr === shuffleStr) {\n document.write(matchStr + \": A Match at last!\");\n return;\n }\n document.write(\"<br /><br />\");\n}", "title": "" }, { "docid": "e20e7c1f8c99418fe9a4f29e76380964", "score": "0.5191522", "text": "function outputQuizResults() {\n //Display all the results\n setTimeout(function(){\n //io.emit('displayScoreBoard', users)\n io.emit('redirect', '/leaderboards')\n }, (secondsPerQuestion+(serverOffset-1)) * 1000);\n\n //After 10 seconds from showing the user the scores, reset the game entirly (the data only gets removed twhen the user refreshes their page)\n setTimeout(function(){\n users = []\n quiz.state = \"Not_Playing\"\n }, ((secondsPerQuestion+(serverOffset-1))+ 10) * 1000); //Times out 10 seconds after redirect\n\n}", "title": "" }, { "docid": "5aee8f65ba692f1e8b1f818c1b53a9c5", "score": "0.519148", "text": "function displayMessage() {\n document.getElementById('messageBox').style.display = \"inline\";\n var sayings = [\"I forgot my chicken!\", \"I'll make you regret\", \"Lets drink some work documents\", \"Its not my problem!\"];\n\n var randomQuote = sayings[Math.floor(Math.random()*sayings.length)];\n\n var random = document.getElementById('selectedQuote').innerHTML = randomQuote;\n\n}", "title": "" }, { "docid": "418cef00407985da0b15e35f69284eb9", "score": "0.51901066", "text": "function message(msg,clearPrevious,force){\r\n if(force==null) force=false;\r\n if(clearPrevious==null) clearPrevious=true;\r\n \r\n if(DEBUG == true || force == true){\r\n var msgdiv = document.getElementById(debug_msg_div);\r\n if(clearPrevious){\r\n msgdiv.innerHTML = msg;\r\n }\r\n else{\r\n msgdiv.innerHTML += \"<br />\"+msg;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0f6cc16c988ca742bf4561fb7c7aa8be", "score": "0.5184462", "text": "showMessages () {\n\t\twhile (this.numLogs > logOptions.maxMessages) {\n\t\t\tthis.logs.shift(); this.numLogs--; //pop them out boys\n\t\t}\n\t\tfor (let i = 0; i < this.numLogs; i++) {\n\t\t\tlet message = this.logs[i];\n\t\t\t\n\t\t\tlet color;\n\t\t\tif (i == this.numLogs-1) {color = \"#fff\"}\n\t\t\telse if (i == this.numLogs-2) {color = \"#ccc\"}\n\t\t\telse if (i == this.numLogs-3) {color = \"#999\"}\n\t\t\telse {color = \"#666\"}\n\t\t\tmessage = `%c{${color}}${message}`;\n\t\t//\tconsole.log(message);\n\t\t//\tmessage = chunkString(message,logOptions.width);\n\t\t\t//if (chunkString.length >= 2) {this.logs.push()}\n\n\t\t\tdisplay.drawText(2+bufferOptions.width, i, message, 2+bufferOptions.width);\n\t\t}\n\t}", "title": "" }, { "docid": "132cfbca98828847c79d4c3dbe2aa022", "score": "0.51836383", "text": "function sendMessagesForRoom() {\n var i;\n\n socket.emit('ketchup', 'begin');\n for (i = 40; i < archive.messages.length; i += 40) {\n socket.emit('ketchup', archive.messages.slice(i - 40, i).filter(shouldGoToUser));\n }\n if (i >= archive.messages.length) {\n socket.emit('ketchup', archive.messages.slice(i - 40, i).filter(shouldGoToUser));\n }\n }", "title": "" }, { "docid": "2d380f191f62c617b5de67f7b1411d13", "score": "0.5183382", "text": "function DisplayMessage(msg, quote, ln = 7) {\n console.log(msg);\n if (quote) {\n console.log(quote);\n }\n console.log(\"Lucky No : \" + ln);\n}", "title": "" }, { "docid": "b7c3d5a4ee5c1f827b1cd09fb9fcaa8a", "score": "0.5183245", "text": "async function gotMessage(msg){\r\n let tokens =msg.content.split(\" \");\r\n\r\n if (tokens[0]==\"hey\"){\r\n //const index=(Math.floor(Math.random()*msgs.length));\r\n msg.channel.send(\"Hey there\");\r\n }\r\n else if (tokens[0]==\"!gif\")\r\n {\r\n let keywords=\"Ms Dhoni Untold Story\"\r\n if (tokens.length>1){\r\n keywords=tokens.slice(1,tokens.length).join(\" \");\r\n\r\n }\r\n //msg.channel.send(\"gif!\");\r\n let url=`https://g.tenor.com/v1/search?q=${keywords}&key=${process.env.TENORKEY}&contentfilter=high`;\r\n let response=await fetch(url);\r\n let json = await response.json();\r\n let ind= (Math.floor(Math.random()*json.results.length));\r\n msg.channel.send(json.results[ind].url);\r\n }\r\n\r\n\r\n\r\n \r\n }", "title": "" }, { "docid": "4bc469cf318c4382ce768f52b041fcf8", "score": "0.5180653", "text": "async function displayRandomness() {\n window.identity = window.identity || await findFirstNode();\n startProgressBar();\n //print randomness and update verfified status\n console.log(\"display.js fecthing randomness - from \", window.identity);\n requestFetch(window.identity, window.distkey);\n printNodesList(window.identity);\n}", "title": "" }, { "docid": "77fb7212aeae284453d599fd1fd5e339", "score": "0.51786816", "text": "function messagebox(id) {\n\tif(messagecount < 1){\n \tid.innerHTML = \"Starting Game!\";\n \t\t// timedelay(id);\n \t\tsetTimeout(function(){wordgenerator()}, 1000)\n \t\tmessagecount++;\n\t}else{\n\t\treturn;\n\t}\n}", "title": "" }, { "docid": "e6c142b322d544167be54906a4b047d6", "score": "0.5176529", "text": "function outputMsg(res){\n\t\tvar percentage = Math.round((result * 100)/maxQuestion);\n\t\tvar msg = \"\"\n\t\tif(percentage < 10){\n\t\t\treturn \"You're a flag 'Ignorant' \" + userName + \", you only got \" + percentage + \"%\"\n\t\t}else if(percentage < 30){\n\t\t\treturn \"You really don't know your flags \" + userName + \", you only got \" + percentage + \"%\"\n\t\t}else if(percentage < 50){\n\t\t\treturn \"Meh!!, \" + userName + \" you only got \" + percentage + \"%\"\n\t\t}else if(percentage < 60){\n\t\t\treturn \"You're OK \" + userName + \", you got \" + percentage + \"%\"\n\t\t}else if(percentage < 80){\n\t\t\treturn \"You're Fine \" + userName + \", you got \" + percentage + \"%\"\n\t\t}else if(percentage < 100){\n\t\t\treturn \"You're good \" + userName + \", you got \" + percentage + \"%\"\n\t\t}\n\t\treturn \"You're a genius \" + userName + \", you got \" + percentage + \"%\"\n\t}", "title": "" }, { "docid": "7fd519c30fa8d28fa51192a5594fce48", "score": "0.51744837", "text": "function random() {\n\n var random = rand(0, companions.length);\n show_result(companions[random]);\n}", "title": "" }, { "docid": "724cfac8e29f7e9e251f40d106cd055f", "score": "0.5171677", "text": "function printMessage(msg, isTransient) {\n if (isTransient) {\n transientMessage = msg;\n } else {\n permanentMessage = msg;\n }\n var textToShow = transientMessage != '' ? transientMessage : permanentMessage;\n if (lastMessageShown != textToShow) {\n document.getElementById(\"statusmsg\").innerHTML = textToShow;\n }\n lastMessageShown = textToShow;\n}", "title": "" }, { "docid": "29474748a8548f03772191f3f2a17d8a", "score": "0.51434916", "text": "function cmdRekt(channelName, from, msgarray) {\n if (wordlists.toldlist) {\n var randomint = randomInt(0, wordlists.rektlist.length - 1);\n var rekt = wordlists.rektlist[randomint];\n botprint(channelName, rekt);\n }\n}", "title": "" }, { "docid": "424ead1a838c8abc436c03bd3c6cc989", "score": "0.5138129", "text": "function printCommonGames() {\n const messages = [];\n players.forEach(function (player) {\n if (player.winningOutcomes.length === 0) {\n return;\n }\n\n for (let round = 0; round < correctPicks.length; round++) {\n for (let game = 0; game < correctPicks[round].length; game++) {\n if (correctPicks[round][game]) {\n continue;\n }\n let winner = null;\n let commonGame = true;\n for (let i = 0; i < player.winningOutcomes.length; i++) {\n if (winner === null) {\n winner = player.winningOutcomes[i][round][game];\n }\n else if (winner !== player.winningOutcomes[i][round][game]) {\n commonGame = false;\n break;\n }\n }\n if (commonGame) {\n messages.push(player.name + \" is out unless \" + winner + \" \" + roundActions[round]);\n }\n }\n }\n });\n return messages;\n }", "title": "" }, { "docid": "263af7c8cc66fc83a26c5a43e9643e6b", "score": "0.5136414", "text": "function printLog(string){\n if($('.gamelog tr').length === maxMessages){\n $('.gamelog tr:nth-child(1)').remove();\n }\n $('#gameMsg').append('<tr><td>'+string+'</td></tr>');\n $('.gamelog').scrollTop($('.gamelog')[0].scrollHeight);\n }", "title": "" }, { "docid": "101ee9157d45cc1f1918cd65fd953274", "score": "0.51291585", "text": "function ResultsRetrievalMessage() {\n}", "title": "" }, { "docid": "d93792c69252d47a16cda66a081fdc55", "score": "0.5125235", "text": "function printResults(results) {\n console.log(chalk.red('##############################'))\n\n console.log(table(results))\n\n console.log(chalk.magenta('Results provided courtesy of Abbreviations.com (https://www.abbreviations.com/)'))\n\n console.log(chalk.red('##############################'))\n}", "title": "" }, { "docid": "e3bb0968fda47401c25d592f5a0726b7", "score": "0.5122655", "text": "function randomLine() {\n var lineid = Math.floor(Math.random() * messages.length - 1);\n var line = messages[lineid];\n return [line];\n}", "title": "" }, { "docid": "41c20f5daaf9476749833cd7a5e805ac", "score": "0.5119311", "text": "function undefinedMsg(){\n giphy.random(\"undefined\", function (err, res) {\n var giffy = JSON.stringify(res);\n var toSend = JSON.parse(giffy);\n var msg = toSend.data.image_url;\n send(\"Sorry I can't find that word. Here's a random gif instead.\");\n send(msg);\n\n });\n }", "title": "" }, { "docid": "b97c248151d74fd08103fc7489ae067d", "score": "0.5116654", "text": "function genQuestionAnswer(msg,type){\n if (type == CommentType.question){//if type is question\n var luck = randomRange(1,11)\n if (luck == 1){\n text = \"Yeah, I am asking the same question\";\n }\n if (luck == 2){\n text = \"good question, also \"+memory.previousMsg +\"?\";\n }\n if (luck == 3){\n text = \"I don't get you, are you trying to ask \"+genTextLegacy(msg.length/5);\n }\n if (luck == 4){\n text = \"you know that the answer is no, because \"+genText(2,5);\n }\n if (luck == 5){\n text = \"you know that the answer is no, because \"+genText(2,5);\n }\n if (luck == 6){\n text = \"Why? because \"+genText(4,10);\n }\n if (luck == 7){\n text = \"I don't like your question\";\n }\n if (luck == 8){\n text = \"good question\";\n }\n if (luck == 9){\n text = \"ask @\"+memory.previousCommenter;\n }\n if (luck == 10){\n text = \"NO!!! \"+genText(3,7);\n }\n if (luck == 11){\n text = \"YES!!! \"+genText(3,7);\n }\n \n }\n //personal\n if (type == CommentType.talkingToMe){\n var text =\"\";\n var luck = randomRange(1,7)\n if (luck == 1){\n text = \"The answer is yes, as @\"+memory.previousCommenter+\" said, \"+genText(3,msg.length/2)\n }\n if (luck == 2){\n text = \"The answer is no, as @\"+memory.previousCommenter+\" said, \"+genText(3,msg.length/2)\n }\n if (luck == 3){\n text = \"not at all... \"+genText(1,msg.length/3)\n }\n if (luck == 4){\n text = \"don't ask me, ask @\"+memory.previousCommenter\n }\n if (luck == 5){\n text = \"I don't know, but I think that \"+genText(2,msg.length/3)\n }\n if (luck == 6){\n text = genText(2,msg.length/3)+\", why do you ask?\"\n }\n if (luck == 7){\n text = genText(2,2)+ \" and \" + genText(1,5) +\" that's what I know\"\n }\n }\n return text\n \n}", "title": "" }, { "docid": "7370809a22e45a931d5034f376d834f3", "score": "0.51132464", "text": "async function msg() {\n const a = await who();\n const b = await what();\n const c = await where();\n\n console.log(`${a} ${b} ${c}`);\n}", "title": "" }, { "docid": "2c2bd4b40b1f435781c89c355dfa1998", "score": "0.5112476", "text": "function shuffleAnswers(x)\n{\n var j = 0;\n var qlog = [];\n var rightOne = Math.floor(Math.random()*4);\n for(var i = 0; i < 4; i++)\n {\n if(i === rightOne)\n {\n qlog.push(x.correctone);\n rightText = x.correctone;\n rightbtn = i + 1;\n }else{\n qlog.push(x.falseOnes[j]);\n j++;\n }\n };\nreturn qlog;\n}", "title": "" }, { "docid": "e5bee98e3631e012fcede560e47705bd", "score": "0.51109624", "text": "function cmdTold(channelName, from, msgarray) {\n if (wordlists.toldlist) {\n var randomint = randomInt(0, wordlists.toldlist.length - 1);\n var told = wordlists.toldlist[randomint];\n botprint(channelName, told);\n }\n}", "title": "" }, { "docid": "e74afc0752a8dc2dc033506c69c8209a", "score": "0.5109089", "text": "function PrintStatusMessages(GPMResult)\n{\n\tvar GPMStatus = GPMResult.Status;\n\n\tif (GPMStatus.Count == 0)\n\t{\n\t\t// No messages, so just return\n\t\treturn;\n\t}\n\n\tWScript.Echo(\"\");\n\tvar e = new Enumerator(GPMStatus);\n\tfor (; !e.atEnd(); e.moveNext())\n\t{\n\t\tWScript.Echo(e.item().Message);\n\t}\n}", "title": "" }, { "docid": "c55f2b2333ac4d2725cbb97b4facf9e5", "score": "0.51053256", "text": "function printResults() {\n console.log(\"Pres Pols: \" + presPolicies);\n console.log(\"Chan Pol: \" + chanPolicy);\n console.log(\"Bots: \" + bots);\n console.log(\"Fascists: \" + fascists);\n console.log(\"Liberals: \" + liberals);\n console.log(\"President: \" + president);\n console.log(\"Chancellor: \" + chancellor);\n presPolicies = [];\n fCardCount = 0;\n}", "title": "" }, { "docid": "387b6e369306769f834a4bc823bb1dd4", "score": "0.5103667", "text": "function printMessage(message) {\n var times = 0;\n screen.style.vivibility = \"hidden\";\n screen.innerHTML = message;\n var blink = setInterval(function () {\n times++;\n if (times === 4) {\n clearInterval(blink);\n }\n screen.style.visibility = (screen.style.visibility === \"hidden\" ? \"\" : \"hidden\");\n }, 200);\n }", "title": "" }, { "docid": "23e6f78f461d77d96d26ab462d159d68", "score": "0.50976527", "text": "makeText(numWords = 50) {\n let keys = Array.from(Object.keys(this.chains));\n let randNum = Math.floor(Math.random() * keys.length);\n let key = keys[randNum];\n let text = [];\n\n while (text.length < numWords){\n text.push(key);\n randNum = Math.floor(Math.random() * keys.length);\n key = keys[randNum];\n }\n\n let fullText = text.join(\" \");\n return fullText;\n }", "title": "" }, { "docid": "a467f640111f9b79a13cde61794f0246", "score": "0.50939167", "text": "function showResults() {\n if (playerScore > computerScore) {\n console.log(\n `______ GAME OVER ______\\n` +\n `Congratulations! You cheated to win the game!\\n\\n`\n );\n } else if (computerScore > playerScore) {\n console.log(\n `______ GAME OVER ______\\n` +\n `Ha! You lost the game! Better luck next time!\\n\\n`\n );\n } else if (playerScore == computerScore) {\n console.log(\n `______ GAME OVER ______\\n` + `We TIED?! That shouldn't be possible!\\n\\n`\n );\n }\n}", "title": "" }, { "docid": "6f1782fdabc2883d914c2f8b11d59883", "score": "0.5093303", "text": "function generate() {\n rand = Math.floor(Math.random() * Math.floor(phrases.length));\n // console.log(rand);\n}", "title": "" }, { "docid": "0a5c37db35e1bf62e63c9a3c33afe95a", "score": "0.5086248", "text": "function printGuildMessages(ae) {\n // Fill in the most recent messages.\n var message = jQuery('div.message-container div.content');\n var msg = ae.msgs.guild.getLast();\n for(i = 0; i < 6; i++) {\n var moment = new Date(msg.time * 1000);\n var date = moment.getMonth() + '/' + moment.getDay();\n var time = moment.getHours() + ':' + moment.getMinutes();\n message.append(\n '<div class=\"name msg-' + msg.id + '\">' + date + ' ' + time + ' ' + msg.playerName + '</div>' + \n '<div class=\"message msg-' + msg.id + '\">' + msg.message + '</div>'\n );\n $('div.name.msg-' + msg.id).click(function () {\n var msg_body = $(this).next();\n if ($(msg_body).css('display') == 'none') {\n $(msg_body).fadeIn();\n }\n else {\n $(msg_body).fadeOut(); \n }\n });\n ae.msgs.guild.getPrev();\n }\n}", "title": "" }, { "docid": "efea9d147cc621af0ab5d1a522a88e59", "score": "0.5085734", "text": "function printRandom5(data){\n\t\tfor(var i = 0; i < 5; i++){\n\t\t\tvar randomIndex = Math.floor(Math.random()*20);\n\t\t\tvar random = data.results[randomIndex].sort_name;\t\n\t\t\tvar html = \"<li>\";\n\t\t\thtml += \"<a class = 'links' href =\";\n\t\t\thtml += data.results[i].link.url;\n\t\t\thtml += \">\"\n\t\t\thtml += random;\n\t\t\thtml += \"</a></li>\";\n\t\t\t$(\"#random-five\").append(html);\n\t\t};\n\t}", "title": "" }, { "docid": "26a3f02c342df4624653c2b8e081763e", "score": "0.50782144", "text": "function getRandomQuote (){\n var randomNumber = getRandomNumber();\n console.log(\"*** Getting quote | randomNumber = \" + randomNumber + \" ***\");\n console.log(\"-> quotes shown: \" + quotesLog.length + \" [\" + quotesLog.join(\",\") + \"]\");\n\n if (quotesLog.length < quotes.length){ //if unused quotes left at all\n for (i = 0; i <= quotesLog.length; i++){\n if (quotesLog.indexOf(randomNumber) > -1){ //if random quote index in log\n randomNumber = getRandomNumber(); //try again, reset loop\n console.log(\"Quote shown, trying again with \" + randomNumber);\n i = -1;\n } else { //if not in log, go ahead\n console.log(\"Quote NOT shown, returning: \" + quotes[randomNumber].quote);\n quotesLog.push(randomNumber);\n return quotes[randomNumber];\n }\n }\n\n } else { //if no quotes left, empty log and return quote\n console.log(\"Quoteslog full, resetting log and returning: \" + quotes[randomNumber].quote);\n quotesLog = [];\n quotesLog.push(randomNumber);\n return quotes[randomNumber];\n }\n}", "title": "" }, { "docid": "44d774d746ee365dad3d3396ed8f95bf", "score": "0.50770724", "text": "function random(){\n console.log(Math.round(Math.random() * 1000));\n console.log(Math.round(Math.random() * 1000));\n console.log(Math.round(Math.random() * 1000));\n console.log(Math.round(Math.random() * 1000));\n}", "title": "" }, { "docid": "9f5bb49e8db61e50cebd49cf131d6094", "score": "0.5073897", "text": "function showNoResMesg()\n{\n // return if already loaded.\n if(noResultMsgLoaded) return;\n noResultMsgLoaded = true;\n\n // check whether if we need to destroy the players if loaded\n if(playerLoaded) destroyPlayers();\n\n // create the div element\n let div = document.createElement('div');\n div.setAttribute(\"id\", \"NoResults\");\n\n const paraStr = [\n \"Your search did not match any video results.\",\n \"Suggestions:\"];\n\n // create child para tags to store strings.\n for(let count = 0; count < 2; count++)\n {\n let para = document.createElement('p');\n para.innerHTML = paraStr[count];\n para.setAttribute(\"class\", \"text-attr\");\n div.appendChild(para);\n }\n\n // create unorder list to store suggestions.\n let unordLst = document.createElement('ul');\n const suggestions = [\n \"Make sure all words are spelled correctly.\",\n \"Try different keywords.\",\n \"Try more general keywords.\",\n \"Try fewer keywords.\"];\n\n for(let count = 0; count < 4; count++)\n {\n let lst = document.createElement('li');\n lst.innerHTML = suggestions[count];\n lst.setAttribute(\"class\", \"text-attr\");\n unordLst.appendChild(lst);\n }\n div.appendChild(unordLst);\n\n // append to the body element, as it is the last one.\n document.getElementsByTagName('body')[0].append(div);\n}", "title": "" }, { "docid": "a32bc11768531c320ddb9e78e4bbbc07", "score": "0.50699836", "text": "function printAll(data) {\n\tfor (var message of data.rows) {\n\t\tif (message.username === \"Server Announcement\") {\n\t\t\tserverMessage(message);\n\t\t}\n\t\telse {\n\t\t\tpostMessage(message);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4a0ccb0ab5f0c3cd91c869ebf8916a32", "score": "0.5064082", "text": "function writeResults(message) {\n $(\"#resultsContainer\").show();\n // Add some nice coloring\n message = message.replace(/Warning:/g, \"<span style='color:orange;'>Warning:</span>\");\n message = message.replace(/Error:/g, \"<span style='color:red;'>Error:</span>\");\n // set the project key for any projectId expressions... these come from the validator to call REST services w/ extra data\n message = message.replace(/projectId=/g, getProjectKeyValue());\n\n //$(\"#resultsContainer\").html(\"<table><tr><td>\" + message + \"</td></tr></table>\");\n $(\"#resultsContainer\").html($(\"#resultsContainer\").html() + message);\n}", "title": "" }, { "docid": "89f9fa1bb77f99da961b5f51e6232d59", "score": "0.50633264", "text": "async execute(message, args) {\n console.log(\"random select\");\n\n let result;\n\n result = await itemModel.aggregate([{$sample: {size:1}}]);\n console.log(`result: ${result[0].item_name} `);\n\n\n\n //TODO: Time test 2 methods\n // await itemModel.count().exec(async function (err, count) {\n // console.log(`Item count: ${count}`);\n\n // //generate single random number\n // var randomNum = Math.floor(Math.random() * count);\n // console.log(`random num generated: ${randomNum}`);\n\n // //pulls random document using rng nindex\n // result = await itemModel.findOne().skip(randomNum);\n // console.log(`result: ${result}`);\n\n //send message to chat\n //TODO: enum handling--> grammar based on itemType\n message.channel.send(`Your should get: ${result[0].item_name}`);\n // });\n }", "title": "" }, { "docid": "3ca668f3376fdd8a0da69e3decf65856", "score": "0.5061985", "text": "async function msg() {\n const [a, b, c] = await Promise.all([who(), what(), where()]);\n\n console.log(`${a} ${b} ${c}`);\n}", "title": "" }, { "docid": "6bf3112138d45773a5c6643a1ee49556", "score": "0.5060978", "text": "function home_generate_motd()\r\n{\r\n\tvar dom = document.getElementById( \"motd\" );\r\n\tif( dom == null )\r\n\t{\r\n\t\tconsole.log( \"Failed to set MOTD\\n\" );\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar messages = new Array(\r\n\t\t[ \"programmer, photographer, driver\" ]\r\n\t);\r\n\t\r\n\tvar i = Math.random() * ( messages.length - 1 );\r\n\ti = Math.round( i );\r\n\tdom.innerHTML = messages[i];\r\n}", "title": "" }, { "docid": "743e512c46b707c2e0eef6753a46a3f8", "score": "0.5053664", "text": "function randomQuestion() {\n var randomNumber = Math.floor(Math.random() * chosenCategory.length);\n newQuestion = chosenCategory[randomNumber];\n noRepeats(newQuestion);\n sendQuestion();\n alreadyShown.push(newQuestion);\n}", "title": "" }, { "docid": "b79f961acd24939497015586d9993c82", "score": "0.50501335", "text": "function genBanText(msg){\n var text = \"\";\n var luck = randomRange(1,4);\n if (luck == 1){\n text = \"why would you want to ban humans?\";\n }\n if (luck == 2){\n text = \"humans ban humans when they \"+genText(4,6);\n }\n if (luck == 3){\n text = genText(4,6)+\" and ban \"+genText(4,6)+ \"?\";\n }\n if (luck == 3){\n text = \"banning is not a good thing, but it's ok if you want to ban @\"+memory.previousCommenter;\n }\n return text;\n \n}", "title": "" } ]
5a1d2398cbc58fc7b543681cdfcdba89
Determines if a mine can be placed on the given position Reasons for not being able to place a mine It's the first clicked field It's one of the neigboring fields of the first clicked field There is already a mine on that field
[ { "docid": "dd0afc5a238e170b1e7d001fdb779bfc", "score": "0.75908613", "text": "canPlaceMine(x, y) {\n const [startX, startY] = this.startingPoint\n\n // Is it the first clicked field?\n const isStartingPoint = x === startX && y === startY\n\n // Is it a neighboring field?\n const isNeighboringField = neighborFields(startX, startY).some(([_x, _y]) => {\n return x == _x && y == _y\n })\n\n // Does it already have a mine?\n const hasAlreadyMine = this.fields[x][y].hasMine === true\n\n return !isNeighboringField && !hasAlreadyMine && !isStartingPoint\n }", "title": "" } ]
[ { "docid": "5004e3fbfce52c3d3ee4ba6b2b98b637", "score": "0.6589983", "text": "function checkPosition() {\n\t\tif(mark == 1) {\n\t\t\tflag(this);\n\t\t\tmark = 0;\n\t\t\treturn;\n\t\t}\n\n\t\t// Does nothing if this piece is flagged\n\t\tif(this.innerHTML == \"?\") {\n\t\t\t// Unmarks the marked piece if the button \"unmark\" was selected\n\t\t\tif(unmark == 1) {\n\t\t\t\tthis.innerHTML = \"\";\n\t\t\t\tunmark = 0;\n\t\t\t}\n return;\n }\n\n\t\tlet board = document.getElementById(\"board\").children;\n\t\tlet i = 0;\n\t\tfor(i = 0; i < 256; i++) {\n\t\t\tlet piece = board[i];\n\t\t\tif(piece == this) {\n\t\t\t\tisMine(piece, i);\n\t\t\t\tthis.style.backgroundColor = \"#d9d9d9\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet numMines = 0;\n\n\t\t// Checks the top of the piece for mines\n\t\tif(i > 15) {\n\t\t\tnumMines = checkUp(board, numMines, i);\n\t\t}\n\n\t\t// Checks the bottom of the piece for mines\n\t\tif(i < 240) {\n\t\t\tnumMines = checkBottom(board, numMines, i);\n\t\t}\n\n\t\t// Checks right of the piece for mines\n\t\tif((i + 1) % 16 != 0) {\n\t\t\tlet other = board[i + 1];\n\t\t\tif(other.className == \"mine\") {\n\t\t\t\tnumMines += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Checks left of the piece for mines\n\t\tif(i % 16 != 0 && i != 0) {\n \t \tlet other = board[i - 1];\n \t\tif(other.className == \"mine\") {\n \t numMines += 1;\n }\n }\n\n\t\tif(numMines != 0 && this.className != \"mine\") {\n\t\t\tthis.innerHTML = numMines.toString();\n\t\t\tnumColor(this);\n\t\t}\n\t\tthis.onmouseover = null;\n\t\tthis.onclick = null;\n\t\tuncovered += 1;\n\n\t\tif(uncovered == (256 - totMines)) {\n\t\t\tisOver();\n\t\t}\n\t}", "title": "" }, { "docid": "a27468337c55d16f7734050e6acb1b84", "score": "0.6433991", "text": "function hasWon(minefield) {\n for(var y = 0; y < $scope.height; y++) {\n for(var x = 0; x < $scope.width; x++) {\n var spot = getSpot(minefield, y, x);\n if(spot.isCovered && spot.content != \"mine\") {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "6dbbc64820197bb69ba2aba3a3314ed3", "score": "0.6376878", "text": "function allowedMove(clicked_tile)\n{\n\tlet x_clicked=parseInt(clicked_tile.split('_')[0]),y_clicked=parseInt(clicked_tile.split('_')[1]),x_player=parseInt(whoseturn.position.split('_')[0]), y_player=parseInt(whoseturn.position.split('_')[1]);\n\treturn (x_clicked==x_player && Math.abs(y_clicked-y_player)<=3|| y_clicked==y_player && Math.abs(x_clicked-x_player)<=3 )\n}", "title": "" }, { "docid": "2d3c2c9469b6c45d0ec4ff87f9f5f043", "score": "0.6269024", "text": "function isGuard(a){\n if(a.position_short.includes('G')){\n if(parseInt(a.three_pointers_attempted)>=1){\n return true;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n }", "title": "" }, { "docid": "10bb88a16d4e11c2eb86b06ec5ebe490", "score": "0.62595177", "text": "function CheckPosition(){\r\n\t\t\tif( x < 0 || y < 0) {\r\n\t\t\t\tconsole.log(\"off to left or top\");\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( x > dropWIDTH || y > dropHEIGHT) {\r\n\t\t\t\tconsole.log(\"off to bottom or right\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "title": "" }, { "docid": "bd3735f2ef93d308811e929ea56264ad", "score": "0.6221384", "text": "validateButton(position){\r\n\r\n const ALLOWEDXPOSITION=[\r\n [1,4],[0,2,5],[1,3,6],[2,7],\r\n [0,5,8],[4,6,1,9],[5,7,2,10],[6,3,11],\r\n [4,12,9],[8,10,5,13],[9,11,6,14],[7,15,10],\r\n [8,13],[12,14,9],[13,15,10],[14,11]\r\n ]\r\n\r\n let allowedPositions=ALLOWEDXPOSITION[this.movePosition];\r\n return(allowedPositions.includes(position));\r\n }", "title": "" }, { "docid": "f236cc9e54b2eecf430a31be4e3ba35a", "score": "0.6200874", "text": "function cannotPlaceObject(i,j) {\r\n\t if ( GRID1[i][j] == GRID_WALL)\r\n\t\t\treturn true;\r\n\t\tif ( GRID1[i][j] == GRID_MAZE) \r\n\t\t\treturn true;\r\n\r\n\t\tif ( GRID2[i][j] == GRID_WALL) \r\n\t\t\treturn true;\r\n\t\tif ( GRID2[i][j] == GRID_MAZE && agentFloor) \r\n\t\t\treturn true;\r\n\r\n\t\tif ( GRID3[i][j] == GRID_WALL) \r\n\t\t\treturn true;\r\n\t\tif ( GRID3[i][j] == GRID_MAZE && agentFloor) \r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "62b86688e901b7a1299a8422abe4f45d", "score": "0.6183385", "text": "function canMove(colNum, rowNum) {\n let move_box = document.querySelector(`[data-column=\"${colNum}\" ][data-row=\"${rowNum}\"]`);\n\n if (move_box.classList.contains(\"wall\") === false) {\n let box = document.getElementById(\"box\");\n box.parentNode.removeChild(box);\n move_box.appendChild(box);\n\n positionRow = rowNum;\n positionCol = colNum;\n\n // If-Statement for Winning Condition - Check if user reached the \"F\" position, then the game is over. \n if (move_box.classList.contains(\"finish\")) {\n document.getElementById(\"gamePlay\").innerText = \"Congratulations! You made it through the Tiger Maze!\";\n }\n }\n //return (positionY >= 0) && (positionY < map.length) && (positionX >= 0) && (positionX < map[positionY].length) && (map[positionY][positionX] != 1);\n }", "title": "" }, { "docid": "d5044c337ca1f6f3e5a721c5d3fc09e4", "score": "0.61256975", "text": "function placeRandomMine(minefield) {\n var minePlaced = false;\n do {\n var column = Math.round(Math.random() * ($scope.width - 1));\n var row = Math.round(Math.random() * ($scope.height - 1));\n var spot = getSpot(minefield, column, row);\n if (spot.content != \"mine\") {\n spot.content = \"mine\";\n mineLocations.push(spot);\n minePlaced = true;\n console.log(\"MINE placed at [ \" + column + \", \" + row + \"]\");\n }\n else {\n console.log(\"MINE already at [ \" + column + \", \" + row + \"] Placing another\");\n }\n } while (!minePlaced);\n }", "title": "" }, { "docid": "e661b141cdb5ad4ffbb6117b984f4279", "score": "0.61138594", "text": "function checkSelf(gs, pm) {\n\t\tfor (let i = 0; i < gs.you.body.data.length - 1; i++) {\n\t\t\tfor (let move in pm) {\n\t\t\t\tif (pm[move].x === gs.you.body.data[i].x && pm[move].y === gs.you.body.data[i].y) {\n\t\t\t\t\tpm[move].valid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "901cc349cbb88280087a1dda5cfb587e", "score": "0.6094918", "text": "checkInteractValidity() {\n if (Phaser.Geom.Rectangle.ContainsPoint(this.room2b_hole_zone, this.room2b_character_north)) {\n this.room2b_E_KeyImg.x = this.room2b_character_north.x;\n this.room2b_E_KeyImg.y = this.room2b_character_north.y-75;\n this.room2b_E_KeyImg.alpha = 1.0;\n if (this.room2b_key_E.isDown) {\n this.scene.start(\"one_Lesson\");\n\n }\n }\n else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2b_quiz_info, this.room2b_character_north)) {\n this.room2b_E_KeyImg.x = this.room2b_character_north.x;\n this.room2b_E_KeyImg.y = this.room2b_character_north.y-75;\n this.room2b_E_KeyImg.alpha = 1.0;\n if (this.room2b_key_E.isDown) {\n this.room2b_activatedQuiz = true;\n this.activateQuiz();\n this.questionStack.alpha = 1;\n this.correctCount = 1;\n }\n\n } else if(Phaser.Geom.Rectangle.ContainsPoint(this.room2b_middle_info, this.room2b_character_north)) {\n if(this.holeOpened == true) {\n this.room2b_E_KeyImg.x= this.room2b_character_north.x;\n this.room2b_E_KeyImg.y = this.room2b_character_north.y + 75;\n this.room2b_E_KeyImg.alpha = 1.0;\n\n if(this.room2b_key_E.isDown) {\n this.scene.start(\"one_lesson\");\n }\n }\n }\n else {\n this.hideActivities();\n this.room2b_E_KeyImg.alpha = 0.0;\n }\n }", "title": "" }, { "docid": "2ca7048bd60f65d2dafaaa6d772d754f", "score": "0.60253286", "text": "function warriorPositionClick() {\n //get position\n $positions = $(\".field-line-warrior-position\");\n $positions.removeClass(\"coverable\").unbind(\"click\", warriorPositionClick);\n line = $positions.index(this);\n $position = this;\n if (man != null) {\n mans.push(man);\n var newMan = man;\n //show new man\n newMan.show($position, line);\n //start man fire\n var intervalId = setInterval(function() {\n newMan.fire(zombies);\n if (newMan.leftTime <= 0) {\n clearInterval(intervalId);\n newMan.die();\n var index = mans.indexOf(newMan);\n mans.splice(index, 1);\n }\n }, newMan.rate);\n man == null;\n }\n }", "title": "" }, { "docid": "6246a29df7f55fbbc9ca139ad16b39f1", "score": "0.60114276", "text": "checkIfNearIcon() {\n let d1 = dist(\n this.sprite.position.x,\n this.sprite.position.y,\n iconPos.x1,\n iconPos.y1\n );\n let d2 = dist(\n this.sprite.position.x,\n this.sprite.position.y,\n iconPos.x2,\n iconPos.y1\n );\n let d3 = dist(\n this.sprite.position.x,\n this.sprite.position.y,\n iconPos.x3,\n iconPos.y1\n );\n let d4 = dist(\n this.sprite.position.x,\n this.sprite.position.y,\n iconPos.x4,\n iconPos.y2\n );\n let d5 = dist(\n this.sprite.position.x,\n this.sprite.position.y,\n iconPos.x5,\n iconPos.y2\n );\n\n if (d1 < iconPos.dist) {\n $(`#li`).addClass(\"iconshovered\");\n liHovered = true;\n } else {\n $(`#li`).removeClass(\"iconshovered\");\n liHovered = false;\n }\n if (d2 < iconPos.dist) {\n $(`#messages`).addClass(\"iconshovered\");\n messagesHovered = true;\n } else {\n $(`#messages`).removeClass(\"iconshovered\");\n messagesHovered = false;\n }\n if (d3 < iconPos.dist) {\n $(`#garden`).addClass(\"iconshovered\");\n gardenHovered = true;\n } else {\n $(`#garden`).removeClass(\"iconshovered\");\n gardenHovered = false;\n }\n if (d4 < iconPos.dist) {\n $(`#food`).addClass(\"iconshovered\");\n foodHovered = true;\n } else {\n $(`#food`).removeClass(\"iconshovered\");\n foodHovered = false;\n }\n if (d5 < iconPos.dist) {\n $(`#social`).addClass(\"iconshovered\");\n socialHovered = true;\n } else {\n $(`#social`).removeClass(\"iconshovered\");\n socialHovered = false;\n }\n }", "title": "" }, { "docid": "e9ee69e95f3eb326f9413487a67caaec", "score": "0.598549", "text": "checkPosition() {\n if(dist(this.xPos, this.yPos, this.startX, this.startY) > this.fireRadius || this.surviveTime == 0) {\n this.inDisplay = false;\n }\n }", "title": "" }, { "docid": "5b5189462c80b02f0d3e5fbe4a4ba13a", "score": "0.5973577", "text": "canSee(x, y) {\n let x1 = -1, x2 = -1, y1 = -1, y2 = -1;\n let cornerx = this.x, cornery = this.y; // upper left\n for(let i = 0; i < 4; i++) {\n if(i === 1) {\n cornerx += MonsterCommon.SPRITE_SIZE * this.size; // upper right\n } else if(i === 2) {\n cornery += MonsterCommon.SPRITE_SIZE * this.size; // lower right\n } else if(i === 3) {\n cornerx -= MonsterCommon.SPRITE_SIZE * this.size; // lower left\n }\n if(x < cornerx) {\n x1 = x;\n x2 = cornerx;\n } else {\n x1 = cornerx;\n x2 = x;\n }\n if(y < cornery) {\n y1 = y;\n y2 = cornery;\n } else {\n y1 = cornery;\n y2 = y;\n }\n for(let j = x1; j <= x2; j += 20) { // checking every 20th pixel to improve runtime\n for(let k = y1; k <= y2; k += 20) {\n if(!this.floor.map.isOnMap(j, k, true)) {\n return false;\n }\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "42f864560f563ce4b998f912f3a810fc", "score": "0.5971966", "text": "function isSpawnTile(tile) {\n return tile.y == boardHeight - 2 || tile.y == boardHeight - 1;\n}", "title": "" }, { "docid": "0560792dd498e15d667017f5f10a4676", "score": "0.59593576", "text": "checkPosition() {\n if(this.xPos < 0 || this.xPos > width || this.yPos < 0 || this.yPos > height) {\n this.inDisplay = false;\n }\n }", "title": "" }, { "docid": "c5c2518d6cf161baf71558591f9a3a10", "score": "0.59511125", "text": "function isWon(player, placePos)\n{\n\treturn (check_column(player, placePos) || check_row(player, placePos) || check_diag(player, placePos));\n}", "title": "" }, { "docid": "fff42d9caace7f989a618662716e44f9", "score": "0.593769", "text": "function isPositionTaken(x_pos, y_pos) {\n return Game.board[y_pos][x_pos] !== 0;\n }", "title": "" }, { "docid": "fa5b6b76ac563d6c40e23e49f668be9a", "score": "0.5934549", "text": "checkPlace(boat) {\n let success = true;\n let posX = boat.position.x,\n posY = boat.position.y;\n\n for (let idx = 0; idx < boat.squares; idx++) {\n if (boat.horizontal) {\n posX = boat.position.x+idx;\n } else {\n posY = boat.position.y+idx;\n }\n if (this.board[posX][posY]) {\n success = false;\n break;\n }\n }\n\n return success;\n }", "title": "" }, { "docid": "c963e219e585502d158804ddd0a453fc", "score": "0.59333867", "text": "function canMove(box){ \n\t\treturn (emptyNeighbors().indexOf(box)!=-1); \n\t}", "title": "" }, { "docid": "fe48b6c652a98940af063fcf83f641f7", "score": "0.5916651", "text": "function has_unplaced_piece(ship, type){\n\tconsole.log(type);\n\treturn ship.length > 0 && ship.length < ship_types[type].size;\n}", "title": "" }, { "docid": "9eafc5e0a0ec88f5766de61aab052077", "score": "0.59058815", "text": "checkField(pos) {\n if (pos[0] < 0 || pos[1] < 0 || pos[0] > this.rows - 1 || pos[1] > this.cols - 1) {\n return \"bounds\";\n } else if (this.map[pos[0]][pos[1]] === hole) {\n return \"hole\";\n } else if (this.map[pos[0]][pos[1]] === treasure) {\n return \"treasure\";\n }\n }", "title": "" }, { "docid": "ca9392a5fe36c02c10b3d664f6a3e43f", "score": "0.5899435", "text": "checkClick(x, y){\n\t\tif(this.hidden) return false;\n\t\tif(this.hitBox().x1 < x && this.hitBox().x2 > x\n\t\t&& this.hitBox().y1 < y && this.hitBox().y2 > y\n\t\t&& !this.iBrick.spawner){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "b243954cc2bbe82d9a04fa0330010b0b", "score": "0.5893718", "text": "_okToPlace( ship ) {\r\n // Get position\r\n let row = ship.row;\r\n let col = ship.col;\r\n\r\n // Check given orientation\r\n if ( ship.horizontal ) {\r\n // Check if ship is not outside the map\r\n if ( row < 0 || row >= this.size || col < 0 || col + ship.length > this.size ) {\r\n return false;\r\n }\r\n\r\n // Check if there are no squares at row and columns\r\n for ( let i = col; i < col + ship.length; i++ ) {\r\n if ( this.squares[row][i].hasShip() ) {\r\n return false;\r\n }\r\n }\r\n } else {\r\n // Check if ship is not outside the map\r\n if ( row < 0 || row + ship.length > this.size || col < 0 || col >= this.size ) {\r\n return false;\r\n }\r\n\r\n // Check if there are no squares at column and rows\r\n for ( let i = row; i < row + ship.length; i++ ) {\r\n if ( this.squares[i][col].hasShip() ) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n // Success of finding a spot!\r\n return true;\r\n }", "title": "" }, { "docid": "b24ef7d369d7d47f6b37029e8c17c7a8", "score": "0.58903444", "text": "function checkCollectable(t_collectable)\n{\n if(dist(gameChar_world_x, gameChar_y, t_collectable.pos_x, t_collectable.pos_y)<41)\n {\n t_collectable.isFound = true;\n game_score +=1;\n }\n}", "title": "" }, { "docid": "e019d223ee0180878f44262d83882616", "score": "0.5890196", "text": "function placeMinesAuto(frstClickIdx) {\r\n var loc;\r\n var count = 1;\r\n while (count <= gLevel.MINES) {\r\n loc = { i: getRandomInt(0, gBoard.length - 1), j: getRandomInt(0, gBoard[0].length - 1) };\r\n if ((frstClickIdx) && (loc.i === frstClickIdx.i && loc.j === frstClickIdx.j) || (gBoard[loc.i][loc.j].isMine)) continue;\r\n gBoard[loc.i][loc.j].isMine = true;\r\n count++;\r\n }\r\n}", "title": "" }, { "docid": "f0880c86fba1cb668fc8c4ca5be2ed31", "score": "0.58766025", "text": "function checkPlacement (row, col, ship) { // Source: Modified from Bill Mei\n // First, check if the ship is within the grid\n if (checkWithinBounds(row, col, ship)) { // Source: Modified from LearnTeachCode\n // Then check to make sure it doesn't collide with another ship\n for (var i = 0; i < ship.length; i++) {\n if (ship.dir === VERTICAL) {\n if (aiBoard[row + i][col] === SHIP ||\n aiBoard[row + i][col] === MISS ||\n aiBoard[row + i][col] === SUNK) {\n return false;\n }\n } else {\n if (aiBoard[row][col + i] === SHIP ||\n aiBoard[row][col + i] === MISS ||\n aiBoard[row][col + i] === SUNK) {\n return false;\n }\n }\n }\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "c2175ab4fe98f3be6fa828b3784e0848", "score": "0.586836", "text": "isPlaced() {\n return this.position !== null;\n }", "title": "" }, { "docid": "79142af82dcd0321b1e4c63501d5794c", "score": "0.5867801", "text": "function positionCheck(spot){\n\n\tif (goLeft(horizontal, vertical) == (spot - 1)){\n\t\treturn true;\n\t}\n\n if (goRight(horizontal, vertical) == (spot - 1)){\n\t\treturn true;\n\t}\n\n\tif (goDown(horizontal, vertical) == (spot - 1)){\n\t\treturn true;\n\t}\n\n\tif (goUp(horizontal, vertical) == (spot - 1)){\n\t\treturn true;\n\t}\n\n}", "title": "" }, { "docid": "1725b9e8f8e1e7e43f0305525c8979ec", "score": "0.5848969", "text": "function checkMoveShips(clickEvent) {\n if (zonesHighlighted.length == 0) return false;\n \n var coords = windowToCanvas(window.cvs, clickEvent.clientX, clickEvent.clientY),\n zone = searchGrid.coordsToZone(coords);\n \n if ($.inArray(zone, zonesHighlighted) > -1) {\n moveShips(coords);\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "f948dbbbd8f9c9191e5a45d660084190", "score": "0.5845686", "text": "function placerMine(){ // placer des mines\r\n var a = Math.random();\r\n //probabilité que chaque case contienne une mine\r\n var b = 0.19;\r\n\r\n if (a <= b){\r\n colonne.classList.add(\"mine\");\r\n nbMines++;\r\n nbMinesATrouver++;\r\n }\r\n }", "title": "" }, { "docid": "f7de5fcb5142792a1f25ad6f534dff6a", "score": "0.5835708", "text": "function inCheckBy(pieceType, loc) {\n //const opponentColor = capturedOwn.classList.contains(\"black\") ? \"white\" : \"black\";\n const position = boardCells[loc];\n if (position.firstChild\n && position.firstChild.classList.contains(pieceType)\n && position.firstChild.classList.contains(color === \"black\" ? \"white\" : \"black\")) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "4432acc2c4f175f9053d92b2392b99fd", "score": "0.5829392", "text": "validFoodCoordinate(){\n for(let i = 0; i < this.snake.body_length; i++){\n let cell = this.snake.getCell(i);\n if(cell.getX() === this.food.getX() && cell.getY() === this.food.getY()){\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "a9e66ee7a4893440c826edb2642e221f", "score": "0.5829029", "text": "function CheckBounds(){\r\n var x = snake[0].x;\r\n var y = snake[0].y;\r\n if(x>map.length-1 || x < 0 || y < 0 || y>map.length-1){\r\n gameOver();\r\n return;\r\n } \r\n }", "title": "" }, { "docid": "5f723d3716d1810143a26b40739aebc3", "score": "0.5828222", "text": "function notOKCandySpawn() {\n\t\t\tif ( ( $scope.candy_x >= $scope.cat_x && $scope.candy_x < $scope.cat_x+$scope.cat_size && $scope.candy_y >= $scope.cat_y && $scope.candy_y < $scope.cat_y+$scope.cat_size ) ||\n\t\t\t\t( $scope.candy_x >= $scope.list_x && $scope.candy_x < $scope.list_x+$scope.list_size_x && $scope.candy_y >= $scope.list_y && $scope.candy_y < $scope.list_y+$scope.list_size_y ) ) {\t\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tfor ( var i = 0; i < $scope.wello_snake.length; i++ ) {\n\t\t\t\t\tif ( $scope.candy_x === $scope.wello_snake[i].x && $scope.candy_y === $scope.wello_snake[i].y ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\treturn false;\t\n\t\t}", "title": "" }, { "docid": "526360fde85a79ed0452c7eca9fdadad", "score": "0.5826651", "text": "has_structures_to_dismantle(room, pos) {\n const flags = room.lookForAt(LOOK_FLAGS, pos);\n return (_.filter(flags, Dismantler.is_dismantler_flag).length !== 0);\n }", "title": "" }, { "docid": "d5fa9f1c522f4d116cd373d4135924a7", "score": "0.582658", "text": "function positionSpriteTop(i, j){\n\t// on crée nos variables posx, posxx, et posxxx dans lesquelles on stocque randomX-1,randomX-2 et randomX-3\n\tvar posx=i-1;\n\tvar posxx=i-2;\n\tvar posxxx=i-3;\n\n\t\t\t\n\tif (posx>=0) { // position 1\n\t\tif (plateau.children[posx].children[j].innerHTML === sprite1) {\n\t\t\treturn false;\n\t\t}else if (plateau.children[posx].children[j].innerHTML === sprite2) {\n\t\t\treturn false;\n\t\t}else if (plateau.children[posx].children[j].innerHTML === impasse) {\n\t\t\treturn false;\n\t\t}else if ((plateau.children[posx].children[j].innerHTML === arme1)||(plateau.children[posx].children[j].innerHTML === arme2)||(plateau.children[posx].children[j].innerHTML === arme3)||(plateau.children[posx].children[j].innerHTML === arme4)){\n\t\t\tplateau.children[posx].children[j].classList.add(\"caseCliquable\");\n\t\t}else if (plateau.children[posx].children[j].children.length == 0){\n\t\t\tplateau.children[posx].children[j].classList.add(\"caseCliquable\");\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}else{\n\n\t}\n\n\tif (posxx>=0) { // position 2\n\t\tif (plateau.children[posxx].children[j].innerHTML === sprite1) {\n\t\t\treturn false;\n\t\t\tif (posxxx<=8) {\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else if (plateau.children[posxx].children[j].innerHTML === sprite2) {\n\t\t\treturn false;\n\t\t\tif (posxxx<=8) {\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else if (plateau.children[posxx].children[j].innerHTML === impasse) {\n\t\t\treturn false;\n\t\t\tif (posxxx<=8) {\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t}else if ((plateau.children[posxx].children[j].innerHTML === arme1)||(plateau.children[posxx].children[j].innerHTML === arme2)||(plateau.children[posxx].children[j].innerHTML === arme3)||(plateau.children[posxx].children[j].innerHTML === arme4)){\n\t\t\t\tplateau.children[posxx].children[j].classList.add(\"caseCliquable\");\n\t\t\t}else if (plateau.children[posxx].children[j].children.length == 0){\n\t\t\t\tplateau.children[posxx].children[j].classList.add(\"caseCliquable\");\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\n\t\t\t}\n\n\t\tif (posxxx>=0) { // position 3\n\t\t\tif (plateau.children[posxxx].children[j].innerHTML === sprite1) {\n\t\t\t\treturn false;\n\t\t\t}else if (plateau.children[posxxx].children[j].innerHTML === sprite2) {\n\t\t\t\treturn false;\n\t\t\t}else if (plateau.children[posxxx].children[j].innerHTML === impasse) {\n\t\t\t\treturn false;\n\t\t\t}else if ((plateau.children[posxxx].children[j].innerHTML === arme1)||(plateau.children[posxxx].children[j].innerHTML === arme2)||(plateau.children[posxxx].children[j].innerHTML === arme3)||(plateau.children[posxxx].children[j].innerHTML === arme4)){\n\t\t\t\tplateau.children[posxxx].children[j].classList.add(\"caseCliquable\");\n\t\t\t}else if (plateau.children[posxxx].children[j].children.length == 0){\n\t\t\t\tplateau.children[posxxx].children[j].classList.add(\"caseCliquable\");\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t}else{\n\n\t}\n}", "title": "" }, { "docid": "87c559844bd2b49b670da4566eaa2049", "score": "0.5822812", "text": "function cellClicked(elCell, i, j) {\n\n if (!gTimeInterval) {\n timer();\n if (gBoard[i][j].isMine) {\n gBoard[i][j].isMine = false;\n if (j - 1 < 0) {// if it has alraedy mines???\n gBoard[i][j + 1].isMine = true;\n } else {\n gBoard[i][j - 1].isMine = true;\n }\n }\n }\n setMinesNegsCount(gBoard);\n\n if (gState.isGameOn && !gBoard[i][j].isMarked && !gBoard[i][j].isShown) {\n\n var cell;\n if (gBoard[i][j].isMine) {\n cell = MINE;\n updateCellData(elCell, cell, i, j);\n } else if (gBoard[i][j].minesAroundCount >= 1) {\n cell = gBoard[i][j].minesAroundCount;\n updateCellData(elCell, cell, i, j);\n } else {\n expandShown(gBoard, i, j);\n }\n checkMineClicked(elCell, i, j);\n checkGameOver(elCell, i, j);\n }\n\n}", "title": "" }, { "docid": "953e627949bd8517d55dbaf9943fd31e", "score": "0.58175707", "text": "function reveal_hint(){\n\t//reveal a mine on the board make the grid glow, and make it selected\n\tif(mine_coordinates_hints.length > 0){\n\t\tvar hint = mine_coordinates_hints.pop();\n\t\tvar x = hint[1];\n\t\tvar y = hint[0];\n\t\tchange_tile_color(x,y,'orange');\n\t\treturn true;\n\t}\n\talert(\"No more hints, go to work!\");\n\treturn false\n}", "title": "" }, { "docid": "a984b97ad33c7e7ade076f40d24d581f", "score": "0.58110785", "text": "handleMoveClick(location) {\n let valid = false;\n this.moves.forEach((spot, i) => {\n if (location[0] === spot[0] && location[1] === spot[1]) {\n this.move(location);\n valid = true;\n }\n });\n if (!valid) {\n new Audio('assets/error.wav').play();\n $(board.clicked.$icon).addClass('shaker');\n setTimeout(() => {\n $(board.clicked.$icon).removeClass('shaker');\n }, .3);\n }\n\n return valid;\n }", "title": "" }, { "docid": "074d0e3a5f813a495c366bdd63ce3a8e", "score": "0.58109874", "text": "function canMoveLeft(){\n\n empty=isEmpty()\n for(i=0;i<width*height;i++){\n if(i%width>0){\n \n \n if(empty.id==squares[i].id){\n \n return true\n }\n }\n \n \n \n }\n return false\n}", "title": "" }, { "docid": "288d2aaa389b77c6aded5e4de91f91b5", "score": "0.5808515", "text": "function mineField($field,rows,colls,cell_row,cell_coll)\n{\n\t//go through field\n\tfor (let i = 0;i < rows;i++)\n\t{\n\t\tfor (let j = 0;j < colls;j++)\n\t\t{\n\t\t\t//if current cell does not equals selected by player cell and random number less than 0.1 - mines cell\n\t\t\tif (Math.random() < 0.2 && i != cell_row && j != cell_coll)\n\t\t\t{\n\t\t\t\tlet $cell = $('.coll[row=' + i + '][coll=' + j + ']')\n\t\t\t\t$cell.addClass('mine')\n\t\t\t\tamountFlags++\n\t\t\t}\t\n\t\t}\n\t}\n\n\treveal(cell_row,cell_coll)\n}", "title": "" }, { "docid": "f98d416f3c535268c935693bd09d91c2", "score": "0.5803207", "text": "function check(e) {\r\n var pos = getPos(e),\r\n posAbs = {x: e.clientX, y: e.clientY}; // div is fixed, so use clientX/Y\r\n if (!visible &&\r\n pos.x >= region.x && pos.x < region.x + region.w &&\r\n pos.y >= region.y && pos.y < region.y + region.h) {\r\n me.show(posAbs); // show tool-tip at this pos\r\n }\r\n else setDivPos(posAbs); // otherwise, update position\r\n }", "title": "" }, { "docid": "5938b9316e8831d87d863a82837b1d81", "score": "0.5802755", "text": "_blockedBy(sprite) {\n return this.arkona.checkMapPosition(...sprite.gamePos)\n }", "title": "" }, { "docid": "2eb51d94079d29c97488519d63ea2301", "score": "0.5794325", "text": "function isValid(p) {\n //if this is the first click and the piece isn't empty\n if(p.text() !== \"\" && firstClick){\n return true;\n }\n //if this is the second click and you haven't clicked on\n // the same piece twice\n else if(p.attr(\"id\") !== oldLoc.attr(\"id\") && !firstClick){\n var oldIndex = [parseInt(oldLoc.attr(\"id\").substring(0,1)),\n parseInt(oldLoc.attr(\"id\").substring(1))];\n var newIndex = [parseInt(p.attr(\"id\").substring(0,1)), \n parseInt(p.attr(\"id\").substring(1))];\n var color;\n\n \n\n //If the piece is white\n if(whitePieces.includes(oldLoc.text())){\n //if you're not clicking on a piece of the same color\n if(!whitePieces.includes(p.text())){\n //PIECES\n //|---------------------KING--------------------|\n //if the piece is a king\n if(oldLoc.text() === kingWhite){\n if(Math.abs(oldIndex[0] - newIndex[0]) <= 1 &&\n Math.abs(oldIndex[1] - newIndex[1]) <= 1){\n kingWhiteMoved = true;\n return true;\n }\n //if they try to castle kingside\n if(oldLoc.attr(\"id\") === \"74\" &&\n p.attr(\"id\") === \"76\" &&\n !kingWhiteMoved && !rookA8Moved){\n $(\"#77\").html(\"\");\n $(\"#75\").html(\"♖\");\n kingWhiteMoved = true;\n rookA8Moved = true;\n return true;\n }\n //if they try to castle queenside\n if(oldLoc.attr(\"id\") === \"74\" &&\n p.attr(\"id\") === \"72\" &&\n !kingWhiteMoved && !rookA1Moved){\n $(\"#70\").html(\"\");\n $(\"#73\").html(\"♖\");\n kingWhiteMoved = true;\n rookA1Moved = true;\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|---------------------PAWN--------------------|\n //if the piece is a pawn\n if(oldLoc.text() === pawnWhite){\n //if it is the pawn's first move and\n // they try moving up by either 1 or\n // 2 spots\n if(oldIndex[0]==6 && (newIndex[0]==5 || newIndex[0]==4)&&\n newIndex[1] == oldIndex[1]){\n return true;\n }\n //if the pawn is moving up 1 square\n // and the square is not occupied\n else if(newIndex[0] == oldIndex[0] - 1 &&\n newIndex[1] == oldIndex[1] &&\n p.text() === \"\"){ \n return true;\n }\n //if the pawn is capturing\n else if(newIndex[0] == oldIndex[0] - 1 &&\n (newIndex[1] == oldIndex[1] - 1 ||\n newIndex[1] == oldIndex[1] + 1) &&\n p.text() !== \"\"){\n return true;\n }\n }\n //|---------------------END---------------------|\n\n \n //|-------------------KNIGHT--------------------|\n //If the piece is a knight\n if(oldLoc.text() === knightWhite){\n //If the location is valid\n //Locations to the North of the knight\n if(newIndex[0] == oldIndex[0] - 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the South of the knight\n if(newIndex[0] == oldIndex[0] + 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the East of the knight\n if(newIndex[1] == oldIndex[1] + 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n //Locations to the West of the knight\n if(newIndex[1] == oldIndex[1] - 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n }\n //|---------------------END---------------------|\n \n\n //|---------------------ROOK--------------------|\n //If the piece is a rook\n if(oldLoc.text() === rookWhite){\n //if the new position is in a straight line\n var positionsVert = [];\n var positionsHori = [];\n if(newIndex[0] == oldIndex[0]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the rook's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"70\"){\n rookA1Moved = true;\n }else{\n rookA8Moved = true;\n }\n return true;\n }else if(newIndex[1] == oldIndex[1]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is vertical of the rook's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n });\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"70\"){\n rookA1Moved = true;\n }else{\n rookA8Moved = true;\n }\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|--------------------BISHOP-------------------|\n //if the piece is a bishop\n if(oldLoc.text() === bishopWhite){\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0)){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays depending on their location \n // relative to the original position\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n\n //|--------------------QUEEN--------------------|\n //if the piece is a queen\n if(oldLoc.text() === queenWhite){\n var positionsVert = [];\n var positionsHori = [];\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal,horizontal,or vertical of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0) && \n !(oldIndex[0] == newIndex[0]) &&\n !(oldIndex[1] == newIndex[1])){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the queen's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n //if the id is in the same lane and the \n // new position is vertical of the queen's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n }\n }\n \n //if the piece is black\n else{\n //if you're not clicking on a piece of the same color\n if(blackPieces.includes(p.text())){\n return false;\n }\n if(!blackPieces.includes(p.text())){\n\n //PIECES\n //|---------------------KING--------------------|\n //if the piece is a king\n if(oldLoc.text() === kingBlack){\n if(Math.abs(oldIndex[0] - newIndex[0]) <= 1 &&\n Math.abs(oldIndex[1] - newIndex[1]) <= 1){\n kingBlackMoved = true;\n return true;\n }\n //if they try to castle kingside\n if(oldLoc.attr(\"id\") === \"04\" &&\n p.attr(\"id\") === \"06\" &&\n !kingBlackMoved && !rookH8Moved){\n $(\"#07\").html(\"\");\n $(\"#05\").html(\"♜\");\n kingBlackMoved = true;\n rookH8Moved = true;\n return true;\n }\n //if they try to castle queenside\n if(oldLoc.attr(\"id\") === \"04\" &&\n p.attr(\"id\") === \"02\" &&\n !kingBlackMoved && !rookH1Moved){\n $(\"#00\").html(\"\");\n $(\"#03\").html(\"♜\");\n kingBlackMoved = true;\n rookH1Moved = true;\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|---------------------PAWN--------------------|\n //if the piece is a pawn\n if(oldLoc.text() === pawnBlack){\n //if it is the pawn's first move and\n // they try moving up by either 1 or\n // 2 spots\n if(oldIndex[0]==1 && (newIndex[0]==2 || newIndex[0]==3) &&\n newIndex[1] == oldIndex[1]){\n return true;\n }\n //if the pawn is moving up 1 square\n // and the square is not occupied\n else if(newIndex[0] == oldIndex[0] + 1 &&\n newIndex[1] == oldIndex[1] &&\n p.text() === \"\"){ \n return true;\n }\n //if the pawn is capturing\n else if(newIndex[0] == oldIndex[0] + 1 &&\n (newIndex[1] == oldIndex[1] - 1 ||\n newIndex[1] == oldIndex[1] + 1) &&\n p.text() !== \"\"){\n return true;\n }\n }\n }\n //|---------------------END---------------------|\n\n \n //|-------------------KNIGHT--------------------|\n //If the piece is a knight\n if(oldLoc.text() === knightBlack){\n //If the location is valid\n //Locations to the North of the knight\n if(newIndex[0] == oldIndex[0] - 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the South of the knight\n if(newIndex[0] == oldIndex[0] + 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the East of the knight\n if(newIndex[1] == oldIndex[1] + 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n //Locations to the West of the knight\n if(newIndex[1] == oldIndex[1] - 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n }\n //|---------------------END---------------------|\n \n\n //|---------------------ROOK--------------------|\n //If the piece is a rook\n if(oldLoc.text() == rookBlack){\n //if the new position is in a straight line\n var positionsVert = [];\n var positionsHori = [];\n \n if(newIndex[0] == oldIndex[0]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the rook's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"00\"){\n rookH1Moved = true;\n }else{\n rookH8Moved = true;\n }\n return true;\n }else if(newIndex[1] == oldIndex[1]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is vertical of the rook's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n });\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"00\"){\n rookH1Moved = true;\n }else{\n rookH8Moved = true;\n }\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|--------------------BISHOP-------------------|\n //if the piece is a bishop\n if(oldLoc.text() === bishopBlack){\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0)){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays depending on their location \n // relative to the original position\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n\n //|--------------------QUEEN--------------------|\n //if the piece is a queen\n if(oldLoc.text() === queenBlack){\n var positionsVert = [];\n var positionsHori = [];\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal,horizontal,or vertical of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0) && \n !(oldIndex[0] == newIndex[0]) &&\n !(oldIndex[1] == newIndex[1])){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the queen's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n //if the id is in the same lane and the \n // new position is vertical of the queen's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n }\n }\n \n return false;\n }", "title": "" }, { "docid": "b492fbb1a10834b2ce4d3b32e8a69be9", "score": "0.57915306", "text": "_fieldIsValid(field){\n let arr = new Array(this.height).fill(false).map((row) => new Array(this.width).fill(false));\n // Where Player1 starts\n arr[1][1] = true;\n for (let x = 2; x < this.width - 1; x++){\n arr[1][x] = arr[1][x - 1] && (field[1][x] != marks.undestructive);\n }\n for (let y = 2; y < this.height - 1; y++){\n for (let x = 1; x < this.width - 1; x++){\n arr[y][x] = (field[y][x] != marks.undestructive) &&\n (arr[y][x - 1] || arr[y - 1][x]);\n }\n }\n // Player1 can reach Player2\n return arr[this.height - 2][this.width - 2];\n }", "title": "" }, { "docid": "0ef52e0be8c254d05d0c4a408e46a23a", "score": "0.57877874", "text": "checkClick(x, y){\n\t\tif(this.posX < x && this.posX + XSIZE > x && this.posY < y && this.posY + XSIZE > y && !this.iBrick.spawner){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "10968ec3d8b7b7b88e9514c1d8982cdb", "score": "0.57828766", "text": "function checkMove(){\n \n var iMove = gMan.i + gDirec.i;\n var jMove = gMan.j + gDirec.j;\n var canMove = true;\n \n var nextCellWAllObj = isElsInPos(iMove,jMove,'W');\n if (nextCellWAllObj){\n return false;//` into the wall\n }\n var nextCellBoxObj = isElsInPos(iMove,jMove,'B');\n if (nextCellBoxObj !=null ){ //` pusshing box\n var wall = isElsInPos(iMove+ gDirec.i,jMove+ gDirec.j,'W');//` into wall box\n var box = isElsInPos(iMove+ gDirec.i,jMove+ gDirec.j,'B');//` into another box\n if(box !=null || wall !=null ){\n return false;\n }else{\n objsToMove.push(nextCellBoxObj); \n }\n }\n return true\n}", "title": "" }, { "docid": "b2c165f0e367f216e7ec8a17b18a7007", "score": "0.5778207", "text": "function isOnfieldPosition(posX, posY)\n{\n if ((posX > gameSettings[\"gameFieldSize\"] || posY > gameSettings[\"gameFieldSize\"]) || (posX < 1 || posY < 1))\n {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "d0a649061225d2daadef8c5e196687a4", "score": "0.5773323", "text": "function isCorrectMove(event){\r\n\tif(theElement.id == 6 || theElement.id == 9 || theElement.id == 10 || theElement.id == 13 || theElement.id == 14 || theElement.id == 15){\r\n\t\t//do same => (same top & left-240) or (top-160 & left-120)\r\n\t\tif((newY >= posY && newY <= posY+20) && (newX >= (posX-240) && newX <= (posX-220))){\r\n\t\t\tneighbourTop = posY;\r\n\t\t\tneighbourLeft = posX-120;\r\n\t\t\tnewY = posY;\r\n\t\t\tnewX = posX-240;\r\n\t\t\treturn moveFlag = true;\r\n\t\t}\r\n\t\telse if((newY >= (posY-160) && newY <= (posY-140)) && (newX >= (posX-120) && newX <= (posX-100))){\r\n\t\t\tneighbourTop = posY-80;\r\n\t\t\tneighbourLeft = posX-60;\r\n\t\t\tnewY = posY-160;\r\n\t\t\tnewX = posX-120;\r\n\t\t\treturn moveFlag = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(theElement.id == 4 || theElement.id == 7 || theElement.id == 8 || theElement.id == 11 || theElement.id == 12 || theElement.id == 13){\r\n\t\t//do same => (same top & left+240) or (top-160 & left+120)\r\n\t\tif((newY >= posY && newY <= posY+20) && (newX >= (posX+240) && newX <= (posX+260))){\r\n\t\t\tneighbourTop = posY;\r\n\t\t\tneighbourLeft = posX+120;\r\n\t\t\tnewY = posY;\r\n\t\t\tnewX = posX+240;\r\n\t\t\treturn moveFlag = true;\r\n\t\t}\r\n\t\telse if((newY >= (posY-160) && newY <= (posY-140)) && (newX >= (posX+120) && newX <= (posX+140))){\r\n\t\t\tneighbourTop = posY-80;\r\n\t\t\tneighbourLeft = posX+60;\r\n\t\t\tnewY = posY-160;\r\n\t\t\tnewX = posX+120;\r\n\t\t\treturn moveFlag = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(theElement.id == 4 || theElement.id == 6 || theElement.id == 1 || theElement.id == 2 || theElement.id == 3 || theElement.id == 5){\r\n\t\t//do same => top+160 & (left+120 or left-120)\r\n\t\tif((newY >= (posY+160) && newY <= (posY+180)) && (newX >= (posX+120) && newX <= (posX+140))){\r\n\t\t\tneighbourTop = posY+80;\r\n\t\t\tneighbourLeft = posX+60;\r\n\t\t\tnewY = posY+160;\r\n\t\t\tnewX = posX+120;\r\n\t\t\treturn moveFlag = true;\r\n\t\t}\r\n\t\telse if((newY >= (posY+160) && newY <= (posY+180)) && (newX >= (posX-120) && newX <= (posX-100))){\r\n\t\t\tneighbourTop = posY+80;\r\n\t\t\tneighbourLeft = posX-60;\r\n\t\t\tnewY = posY+160;\r\n\t\t\tnewX = posX-120;\r\n\t\t\treturn moveFlag = true;\r\n\t\t}\r\n\t}\r\n\treturn moveFlag;\r\n}", "title": "" }, { "docid": "b9f8a3595a34be2cbbf5141d3cdc78e4", "score": "0.5773216", "text": "function checkShipPresence(random_id,ship_size,next_square_multiplicator) {\n var i=0;\n while (i < ship_size && !document.getElementById(random_id+i*next_square_multiplicator).classList.contains('spotTaken')){\n i++;\n }\n if (i == ship_size) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "6b500a5148dc0b87012a2e3788ae5736", "score": "0.57713497", "text": "function canPlace(col, row) {\n try {\n var g = grid[col][row];\n if (!empty(col, row) || !placeable(col, row)) return false;\n if (g === 3) return true;\n if (g === 1 || g === 2 || g === 4) return false;\n return true;\n } catch (NoSuchTileException) {\n return false;\n }\n}", "title": "" }, { "docid": "ef6f8a06e84e2b1f3521cf94394e41ed", "score": "0.5770593", "text": "function isItemMovable (numberItem, activeKind){\n\n var allPosiblesMovesInBoard = extractPosibleMovesInBoard(activeKind);\n var actualPositionOfItem = activeKind.listItems[numberItem - 1].position;\n var emptyItem = activeKind.listItems[activeKind.listItems.length - 1];\n var posibleMovesOfItemInBoard = allPosiblesMovesInBoard[actualPositionOfItem - 1];\n\n if (posibleMovesOfItemInBoard.includes(emptyItem.position)) {\n //console.log(true);\n return true;\n }else {\n //console.log(false);\n return false;\n }\n\n }", "title": "" }, { "docid": "715019decf7905b192c7b593664ee88a", "score": "0.5768947", "text": "checkCollisions() {\n\t\tif ((player.x <= this.x+55 && player.x+55 >= this.x) && player.y == this.y){\n\t\t\tutils.launchModal('collision');\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "90902b3b389e334821e4235b4aee64b5", "score": "0.57593757", "text": "function isUnmarkedPosition(position) {\n if(availableMoves.indexOf(position) === -1) {\n console.log('Position already marked. Try again');\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "4d26695a43e37c34c8f0127a28dac33c", "score": "0.574261", "text": "function canMove() {\n // If col is less than 0 or greater than 15\n // or row is greater than 21, then block is out of bounds\n // and we return false\n let x;\n let y;\n\n return positions.every((pos) => {\n x = pos.col + offsetX;\n y = pos.row + offsetY;\n\n if (direction === 'left') {\n return (\n x > LEFT_BOUND &&\n currentBoard[y][x] !== 1 &&\n currentBoard[y][x - 1] !== 1 &&\n y < BOTTOM_BOUND\n );\n }\n\n if (direction === 'right') {\n return (\n x < RIGHT_BOUND &&\n currentBoard[y][x] !== 1 &&\n currentBoard[y][x + 1] !== 1 &&\n y < BOTTOM_BOUND\n );\n }\n });\n}", "title": "" }, { "docid": "1f04010e8efb1c05f8ca2834860ec252", "score": "0.5739336", "text": "function checkMine(location) {\n var elSmiley = document.querySelector(\".smiley\");\n if (gBoard[location.i][location.j].isMine === true) {\n mineSound.play()\n gLives--;\n renderCell(location, MINE);\n life();\n elSmiley.innerText = \"🤕\";\n changeSmiley();\n checkGameWon()\n if (gLives === 0) {\n clearTimeout(gSmileyTime);\n elSmiley.innerText = \"😫\";\n gameOver();\n }\n } else {\n score();\n elSmiley.innerText = \"😮\";\n changeSmiley();\n }\n}", "title": "" }, { "docid": "4f4a1f7d577fa2513c7d7de36d7251fd", "score": "0.57373124", "text": "function flagBomb(spaceX, spaceY) {\n if (spaceX >= 0 && spaceX < GRIDSIZE && spaceY >= 0 && spaceY < GRIDSIZE) {\n \n if (grid[spaceY][spaceX].status === \"Not Clicked\" && grid[spaceY][spaceX].flag === false) {\n if(totalMine>0){\n grid[spaceY][spaceX].flag = true;\n totalMine = totalMine - 1; //total mine counter left goes down when flagged\n \n }\n }\n \n else if (grid[spaceY][spaceX].flag === true){\n grid[spaceY][spaceX].flag = false;\n totalMine = totalMine + 1; //total mine counter left goes back up when unflagged\n }\n }\n \n}", "title": "" }, { "docid": "9b6babd55261ce496b0fa193d437e712", "score": "0.57370126", "text": "function isFoodPositionTaken() {\n for(var i = 0; i < snakePosition.length; i++) {\n var p = snakePosition[i];\n if(p[1] === foodPosition[1] && p[0] === foodPosition[0]) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "a0a1dc1a61e76fd6742e39b49735ded1", "score": "0.57366276", "text": "function checkCollision(direction, magnitude, newPosition) {\n\n \n var length = thePlayer.block.shape.length;\n \n var reqy = thePlayer.position.x;\n var reqx = thePlayer.position.y;\n \n if (direction == \"x\") \n reqy += magnitude;\n else if (direction == \"y\")\n reqx += magnitude;\n\n var stateOfBoard = new Array(length);\n \n for (var i = 0; i < length; i++) {\n stateOfBoard[i] = new Array(length);\n for (var j = 0; j < length; j++) \n stateOfBoard[i][j] = board[reqx+i][reqy+j];\n \n }\n\n for (var i = 0; i < length; i++) {\n for (var j = 0; j < length; j++) {\n if (newPosition[i][j] == 1 && stateOfBoard[i][j] != 0) \n return false\n }\n }\n return true;\n}", "title": "" }, { "docid": "fd08c6bd10b62bbe90406520ec982913", "score": "0.57357514", "text": "isLegalMove(position) {\n var currentPieceOrientation = this.getCurrentPieceOrientation(position.orientation);\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n // check if occupied cell needs to be examined (as 0 is falsy and anything else is truthy)\n if (currentPieceOrientation[i][j]) {\n // check if cell on the board is already occupied\n var r = position.row + i;\n var c = position.col + j;\n \n //check if border gets overstepped\n if (r >= this.height ||\n c >= this.width ||\n r < 0 ||\n c < 0 ||\n //or if cell is occupied\n this.board[r][c]) {\n return false;\n }\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "9b86a79465e73adb671bce5c7ba9c1eb", "score": "0.5734799", "text": "isValidPlace(initWorkerList, x, y) { // TODO REFACTOR into single return statement -sb\n if (this.tileIsInBounds(x, y)) {\n if (!initWorkerList.some((w) => w.x === x && w.y === y)) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "4369a6edd0d1ddfcf8c03f0295ff74bb", "score": "0.5732036", "text": "function checkWin(){\n if (state === \"easy\"||state === \"medium\"||state === \"hard\"){\n\n let gameOver = 0;\n let mineTotal = 0;\n\n for (let y = 0; y<GRIDSIZE; y++) {\n for (let x= 0; x<GRIDSIZE; x++) {\n\n if (grid[y][x].isMine === true){\n mineTotal = mineTotal +1;\n }\n\n if(grid[y][x].status !== \"Not Clicked\"){\n gameOver = gameOver + 1;\n }\n }\n }\n if (gameOver === GRIDSIZE * GRIDSIZE - mineTotal){\n state = \"userWin\" ;\n \n } \n }\n}", "title": "" }, { "docid": "fb48e963b1d05d7dc71af92b814f23d5", "score": "0.5726197", "text": "function placeMine() {\r\n var emptyCells = getEmptyCells(gBoard);\r\n\r\n for (var n = 0; n < gLevel.mines; n++) {\r\n var randomIndex = getRandomInt(0, emptyCells.length);\r\n var coords = emptyCells[randomIndex];\r\n gBoard[coords.i][coords.j].isMine = true;\r\n gBoard[coords.i][coords.j].isShown = false;\r\n emptyCells.splice(randomIndex, 1);\r\n };\r\n}", "title": "" }, { "docid": "6bcf2e25096ed6eaf471349941f89245", "score": "0.5723002", "text": "canSeePC() {\n this.targetAquired = false;\n let minDist = -1;\n for(let player of this.floor.players) {\n if(this.canSee(player.x, player.y) && this.canSee(player.x + player.SPRITE_SIZE * player.size, player.y + player.SPRITE_SIZE * player.size) &&\n this.canSee(player.x + player.SPRITE_SIZE * player.size, player.y) && this.canSee(player.x, player.y + player.SPRITE_SIZE * player.size)) {\n this.targetAquired = true;\n if(this.findDistance(player.x, player.y) < minDist || minDist === -1) {\n this.targetx = player.x;\n this.targety = player.y;\n minDist = this.findDistance(player.x, player.y);\n }\n }\n }\n return minDist !== -1;\n }", "title": "" }, { "docid": "fdd9abdfc89ca237e2401fc116fa4ef4", "score": "0.5721073", "text": "function isValidPosition(sprite, allSprites) {\n // new sprite must be at least one div away from existing sprites on all sides\n var notAllowedRange = sprite.type.spriteLength + 1;\n for (var i = 0; i < allSprites.length; i++) {\n // get the difference of position of the new sprite's right column and that of the current existing one\n var diff = Math.abs(sprite.type.rightColNum - allSprites[i].type.rightColNum);\n // if the new one is within the allowed range and it's in the same row\n if (diff < notAllowedRange && sprite.type.cellNum == allSprites[i].type.cellNum) {\n // this sprite is not allowed to be placed here\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "b7fdf041a130f6cc12dbd5b45b3f140b", "score": "0.5720709", "text": "function check() {\n if (finalPositions[0] === finalPositions[1] && \n finalPositions[1] === finalPositions[2]) {\n $('#message').html(\"you won! Enjoy your \" + \n // final positions are mutiples of image heights\n options[finalPositions[0] / imageHeight]); \n } else {\n $('#message').html(\"try again!\");\n }\n leverTrigger();\n }", "title": "" }, { "docid": "201483b1dd98ca78a6603ae9b470f0b5", "score": "0.5719713", "text": "function isValidPosition (x, y) {\n if (x < 0 || x > 9 || y < 0 || y > 9 ) {\n console.log(\"Can't move. Rover off-grid.\");\n return false;\n }\n if (roverGrid[x][y] == 'O') {\n console.log(\"Can't move. Obstacle found.\");\n return false;\n }\n if (roverGrid[x][y] != null) {\n console.log(\"Can't move. Another rover found.\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "f59a55cace7d03247d6d764392d4a5ba", "score": "0.57127106", "text": "function clickMine(x = mousePos.x, y = mousePos.y) {\n // this closes the menu\n if (menuOpen) {\n hideMenu();\n return;\n }\n if (mineMap.cells[x][y].flagged) {\n // nothing else happens when you click on a flagged square\n return;\n }\n // \"discover\" this cell\n mineMap.cells[x][y].discovered = true;\n // now, what did they click on?\n // did they click on a mine?\n if (mineMap.cells[x][y].isMine) {\n lose();\n }\n // or did they click on a blank spot?\n else if (mineMap.cells[x][y].number === 0) {\n // reveal all adjacent squares\n let neighbors = nodeNeighbors(x, y, mineMap.width, mineMap.height);\n neighbors.forEach(n => {\n // if it hasn't been discovered already....\n if (!mineMap.cells[n.x][n.y].discovered) {\n // click it\n clickMine(n.x, n.y);\n }\n })\n }\n}", "title": "" }, { "docid": "a665bed49bec06510a39dbf4019f01c5", "score": "0.5710175", "text": "function validate_pursuit_loc() {\n var x = curr_object.x;\n var y = curr_object.y;\n\n return (\n x >= LEFT_EDGE_POS * $(window).width() && \n x <= RIGHT_EDGE_POS * $(window).width() &&\n y >= TOP_EDGE_POS * $(window).height() &&\n y <= BOTTOM_EDGE_POS * $(window).height()\n );\n}", "title": "" }, { "docid": "c0dba96be27b1f25fcde612c4a2b39b4", "score": "0.5709223", "text": "isPromotableAt (pos) {\n // そもそも成れない駒\n if (!this.isPromotable()) {\n return false\n }\n // 先手\n if (this.color === 0) {\n return 1 <= pos.y && pos.y <= 3\n }\n // 後手\n return 7 <= pos.y && pos.y <= 9\n }", "title": "" }, { "docid": "16c4aefa9ec4fb030d0f50bfc84b9074", "score": "0.570781", "text": "function safeMineGrab (gameData, helpers) {\n var direction;\n var myHero = gameData.activeHero;\n\n var mine = nearestTile(gameData, {\n type: \"DiamondMine\",\n \"owner.team\": {\n op: \"NEQ\",\n val: myHero.team\n }\n });\n\n var enemy = nearestTile(gameData, {\n type: \"Hero\",\n team: {\n op: \"NEQ\",\n val: myHero.team\n }\n })\n\n if (myHero.health === 100) {\n if (mine && mine.distance === 1) {\n if (enemy && enemy.distance > 3) {\n return mine.direction;\n return well.direction;\n }\n }\n }\n}", "title": "" }, { "docid": "264867d47c1a2cf252f47da7ed21c3a7", "score": "0.570373", "text": "function _check_slot(offset, result) {\n\n var resultPos1 = offset + (result+1) * SLOT_HEIGHT;\n var resultPos2 = offset + (that.elements.length*SLOT_HEIGHT) + (result+1)*SLOT_HEIGHT;\n var minimum = 2 * SLOT_HEIGHT + REEL_TOP_MARGIN - LOW_SPEED;\n var maximum = 2 * SLOT_HEIGHT + REEL_TOP_MARGIN + LOW_SPEED;\n \n console.log('Result pos = '+resultPos1+' and '+resultPos2);\n\n if ((resultPos1 >= minimum && resultPos1 <= maximum)\n || (resultPos2 >= minimum && resultPos2 <= maximum)) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "884847f684b31745c5704b3e32c806cf", "score": "0.5702714", "text": "function checkDiamond(t_diamond) {\n \n x = t_diamond.x_pos;\n y = t_diamond.y_pos;\n if(realPos +10>= x - 30 && realPos-10 <= x + 30) {\n if(game_char_y + 30 >= y- 55 && game_char_y -20 <= y) {\n if(!t_diamond.isFound){\n t_diamond.isFound = true;\n score += 1;\n console.log(score);\n }\n \n \n }\n \n \n }\n \n //diamond disappears when character comes in contact with it\n \n}", "title": "" }, { "docid": "23bb91e8de3a604d72f97b6ef6c67de3", "score": "0.57024854", "text": "function checkIfMovable(id, player, type, gameSquare, boardSize) {\n let pieceRow = getMatrixParameter(id,boardSize,'row');\n let pieceColumn = getMatrixParameter(id,boardSize,'column');\n let movableRow, upperRow, lowerRow, movable;\n let [movableRColumn, movableLColumn] = moveColumnSelector(pieceRow, pieceColumn);\n\n switch (type) {\n case 'special':\n switch (pieceRow) {\n case 0:\n lowerRow = false;\n upperRow = checkIfRLEmpty(gameSquare, pieceRow + 1, movableRColumn, movableLColumn);\n break;\n \n case boardSize - 1:\n lowerRow = checkIfRLEmpty(gameSquare, pieceRow - 1, movableRColumn, movableLColumn);\n upperRow = false;\n break;\n default:\n lowerRow = checkIfRLEmpty(gameSquare, pieceRow - 1, movableRColumn, movableLColumn);\n upperRow = checkIfRLEmpty(gameSquare, pieceRow + 1, movableRColumn, movableLColumn); \n break;\n }\n movable = (upperRow || lowerRow);\n break;\n \n default:\n switch (player) {\n case 'red':\n movableRow = pieceRow + 1;\n break;\n \n default:\n movableRow = pieceRow - 1;\n break;\n }\n movable = checkIfRLEmpty(gameSquare, movableRow, movableRColumn, movableLColumn);\n break;\n }\n return movable;\n}", "title": "" }, { "docid": "052127acad0e648e2f5bfdd8e8c137c9", "score": "0.5700681", "text": "move() {\n for (let g = 0; g < this.grid.blocks.length; g++) {\n if (this.body.x > this.grid.blocks[g].x) {\n if (this.body.y > this.grid.blocks[g].y) {\n if (this.body.x < this.grid.blocks[g].x + this.grid.blocks[g].width) {\n if (this.body.y < this.grid.blocks[g].y + this.grid.blocks[g].height) {\n if (this.grid.blocks[g].color != \"grey\") {\n console.log(this.grid.blocks[g]);\n this.location = this.grid.blocks[g];\n } else {\n alert(\"No puedes moverte para esa dirección porque se encuentra un obstáculo, vuelve a reorientar a Rover.\");\n questions();\n }\n }\n } else {\n alert(\"No puedes moverte para esa dirección porque se encuentra un obstáculo, vuelve a reorientar a Rover.\");\n questions();\n }\n } \n } \n }\n }", "title": "" }, { "docid": "08623e0815018a23b37de2c65584a2de", "score": "0.56986606", "text": "function checkForNewSpawn(){\r\n\t\tvar requestNewRotatedBox = true;\r\n\t\tvar requestNewNonRotatedBox = true;\r\n\r\n\t\tfor(var i = 0; i < objectCount; i++){\r\n\t\t\tif(objects[i].position.x >= 1000 && objects[i].position.y > 0){\r\n\t\t\t\trequestNewRotatedBox = false;\r\n\t\t\t}\r\n\t\t\tif(objects[i].position.x >= 1000 && objects[i].position.y < 0){\r\n\t\t\t\trequestNewNonRotatedBox = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(requestNewRotatedBox == true){\r\n\t\t\tspawnBoxRotated();\r\n\t\t}\r\n\t\tif(requestNewNonRotatedBox == true){\r\n\t\t\tspawnBoxNoRotated();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "b8f92954dd9dc8bd7058a092a16e6b8a", "score": "0.56965286", "text": "function placeFlag(tile) {\n\tif (!tile.div.classList.contains(\"bombflagged\")) {\n\t\tsimulateClick(tile.div, 2);\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "0df5ce15201f7093645a806f8fad6dc5", "score": "0.5692366", "text": "function checkPlacementCollision(firstPlacement){\n var addedPlanet = app.currentLevel.planets[app.currentLevel.planets.length - 1];\n for(var i = 0; i < app.currentLevel.planets.length - 1; i++){\n var planet = app.currentLevel.planets[i];\n\n if(checkCollisionwith(addedPlanet, planet)){\n app.keysPressed[-1] = undefined;\n if(firstPlacement == true){\n planet = app.currentLevel.planets.pop();\n app.currentLevel.massLeft += planet.mass;\n app.currentLevel.nPlanetsAdded--;\n }\n }\n\n }\n\n if (checkCollisionwith(app.ship, addedPlanet) || checkCollisionwith(app.currentLevel.exit, addedPlanet)) {\n app.keysPressed[-1] = undefined;\n planet = app.currentLevel.planets.pop();\n app.currentLevel.massLeft += planet.mass;\n app.currentLevel.nPlanetsAdded--;\n }\n\n for (var i = 0; i < app.currentLevel.fuel.length; i++){\n if(checkCollisionwith(addedPlanet, app.currentLevel.fuel[i])){\n app.keysPressed[-1] = undefined;\n planet = app.currentLevel.planets.pop();\n app.currentLevel.massLeft += planet.mass;\n app.currentLevel.nPlanetsAdded--;\n }\n }\n\n}", "title": "" }, { "docid": "7f17a329531d60ab9d75a18f93993a35", "score": "0.5681201", "text": "function shouldWePlotPositionData (checkedActions){\n\n var gameMappings = _.where(options.mappings, {game : settings.game});\n\n // Does the game have more then 1 data type?\n if (gameMappings.length < 2) {\n return true;\n\n // Is the [position] check box selected?\n } else if (_.contains(checkedActions, 'position')){\n return true\n\n // Otherwise, don't show positions\n } else {\n return false\n };\n}", "title": "" }, { "docid": "51e72e2ac83f3344ba31c0435228cda8", "score": "0.5680367", "text": "function checkWin(){\n\n for (let i = 0; i < rows; i++){\n for (let j = 0; j < columns; j++){\n if ((document.getElementById('tile'+((rows*i)+j)).className != 'revealed') && (check(i, j) != 'mine')){\n return false;\n } \n }\n }\n\n return true;\n}", "title": "" }, { "docid": "acf29031cb1f610a9327b0a55082f18c", "score": "0.5671201", "text": "check_poss_is_hole(){\n return(this.field[this.poss[0]][this.poss[1]] === hole);\n }", "title": "" }, { "docid": "78d8498b8733673ddbab4f699aa1d604", "score": "0.56668246", "text": "function validDropPosition(id, row, col) {\n var length = shipStatus[id].size,\n rotated = shipStatus[id].rotated,\n position = rotated ? row : col;\n if(onBoard(length, position) && cellsEmpty(length, row, col, rotated, id)) {return true;}\n else {return false;}\n }", "title": "" }, { "docid": "6d9f559221ae0749b5b475e746280007", "score": "0.5664415", "text": "function checkIfGemCanBeMovedHere(fromPosX, fromPosY, toPosX, toPosY) {\n\n if (toPosX < 0 || toPosX >= BOARD_COLS || toPosY < 0 || toPosY >= BOARD_ROWS)\n {\n return false;\n }\n\n if (fromPosX === toPosX && fromPosY >= toPosY - 1 && fromPosY <= toPosY + 1)\n {\n return true;\n }\n\n if (fromPosY === toPosY && fromPosX >= toPosX - 1 && fromPosX <= toPosX + 1)\n {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "8dff58e29221d857fd298543fb8877c5", "score": "0.5663413", "text": "function checkIfFoundTreasure(){\n if(player.col === treasure.col && player.row === treasure.row) {\n treasure.setRandomPosition();\n player.points ++;\n if(player.points === winningScore) {\n alert(\"Congratulations! You win!\");\n player.row = 0; \n player.col = 0;\n player.points = 0;\n treasure.setRandomPosition();\n }\n } else return false;\n}", "title": "" }, { "docid": "ae0f589fcef0ef0f2198c7912e6afec5", "score": "0.5662206", "text": "function verify(loc, lastLoc, map) {\n let x = loc[0];\n let y = loc[1];\n let z = loc[2];\n let xCell = Math.floor(x/Q.CELL_SIZE)+1;\n let zCell = Math.floor(z/Q.CELL_SIZE)+1;\n\n if ( xCell>=0 && xCell < Q.MAZE_COLUMNS && zCell>=0 && zCell < Q.MAZE_ROWS ) { //off the map\n let cell = map[xCell][zCell];\n\n // where are we within the cell?\n let offsetX = 1+x - xCell*Q.CELL_SIZE;\n let offsetZ = 1+z - zCell*Q.CELL_SIZE;\n\n if (!cell.S && offsetZ > Q.AVATAR_CELL)z -= Q.WALL_EPSILON + offsetZ - Q.AVATAR_CELL;\n else if (!cell.N && offsetZ < -Q.AVATAR_CELL) z -= offsetZ + Q.AVATAR_CELL - Q.WALL_EPSILON;\n if (!cell.E && offsetX > Q.AVATAR_CELL) x -= Q.WALL_EPSILON + offsetX - Q.AVATAR_CELL;\n else if (!cell.W && offsetX < -Q.AVATAR_CELL) x -= offsetX + Q.AVATAR_CELL - Q.WALL_EPSILON;\n\n } else { }// if we find ourselves off the map, then jump back \n return [x, y, z];\n}", "title": "" }, { "docid": "02089f894a2baca668d96d6cbd09ec85", "score": "0.56590563", "text": "canPlaceShip( row, col, shipSize, isHorizontal, mapMatrix ) {\r\n let counter = 0;\r\n // Loop the matrix position to check if it has some ship on it\r\n while (counter < shipSize) {\r\n if (isHorizontal) {\r\n if ((mapMatrix[row - 1][col - 1 + counter]) != 0) {\r\n return false;\r\n }\r\n }\r\n else {\r\n if ((mapMatrix[row - 1 + counter][col - 1]) != 0) {\r\n return false;\r\n }\r\n }\r\n counter++;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "3e745d2c0b28608f7dcd8d99a0542b6a", "score": "0.56564224", "text": "hitBorder(){\n // DELIMITAMOS TODO EL AREA DEL MAPA\n return this.x > 490 || this.x < 0 || this.y > 290 || this.y < 0;\n }", "title": "" }, { "docid": "4527081147aa2290bca853fe6d13ef80", "score": "0.5655107", "text": "checkInter(s) {\n return ((s.pos.x < this.right && s.pos.x > this.left && s.pos.y > this.top && s.pos.y < this.bottom) && !s.goal);\n }", "title": "" }, { "docid": "6d2863cba0b23576112fae922ce1a984", "score": "0.565403", "text": "checkCollision() {\n if (this.row === treasure.row && this.col === treasure.col) {\n treasure.randomPosition();\n }\n }", "title": "" }, { "docid": "d32fdce6ea828ab473be9b0a961197f9", "score": "0.5645394", "text": "onShowState() {\n super.onShowState();\n let loc = this.translation;\n let x = loc[0];\n //let y = loc[1];\n let z = loc[2];\n let xCell = Math.floor(x/Q.CELL_SIZE)+1;\n let zCell = Math.floor(z/Q.CELL_SIZE)+1;\n let offsetX = 1+x - xCell*Q.CELL_SIZE;\n let offsetZ = 1+z - zCell*Q.CELL_SIZE;\n let cell = this.map[xCell][zCell];\n console.log(\"PlayerActor: \", this);\n console.log(\"cell: \", xCell, zCell);\n console.log(\"offset: \", offsetX, offsetZ);\n console.log(\"map cell: \", cell);\n if (!cell.S && offsetZ > Q.AVATAR_CELL)console.log(\"In South wall!\");\n else if (!cell.N && offsetZ < -Q.AVATAR_CELL) console.log(\"In North wall!\");\n if (!cell.E && offsetX > Q.AVATAR_CELL) console.log(\"In East wall!\");\n else if (!cell.W && offsetX < -Q.AVATAR_CELL) console.log(\"In West wall!\");\n }", "title": "" }, { "docid": "1418ceea9de5a5bc3a0056cb835f8188", "score": "0.56426054", "text": "function canSpreadToLeft(mapGrid, currMapPosn){\n\tvar response = 1;\n\n\tif ((currMapPosn % blockWidth) > blockCenter)\n\t\tresponse = 0;\n\tif ((currMapPosn % blockWidth) == 0)\n\t\tresponse = 0;\n\t\n\treturn response;\n}", "title": "" }, { "docid": "95e7b65eede6f873df0ce15bc85bf36b", "score": "0.5640717", "text": "_isPointerInZone() {\n let [x, y, mods] = global.get_pointer();\n\n switch (this._position) {\n case St.Side.LEFT:\n if (x <= this.staticBox.x2 &&\n x >= this._monitor.x &&\n y >= this._monitor.y &&\n y <= this._monitor.y + this._monitor.height) {\n return true;\n }\n break;\n case St.Side.RIGHT:\n if (x >= this.staticBox.x1 &&\n x <= this._monitor.x + this._monitor.width &&\n y >= this._monitor.y &&\n y <= this._monitor.y + this._monitor.height) {\n return true;\n }\n break;\n case St.Side.TOP:\n if (x >= this._monitor.x &&\n x <= this._monitor.x + this._monitor.width &&\n y <= this.staticBox.y2 &&\n y >= this._monitor.y) {\n return true;\n }\n break;\n case St.Side.BOTTOM:\n if (x >= this._monitor.x &&\n x <= this._monitor.x + this._monitor.width &&\n y >= this.staticBox.y1 &&\n y <= this._monitor.y + this._monitor.height) {\n return true;\n }\n break;\n }\n\n return false;\n }", "title": "" }, { "docid": "593d327458ec6dc760aa6f0a7e3237bd", "score": "0.5632506", "text": "function customerShipPositions(event) {\n coveringReminder.style.display = 'none'\n \n customerCells.forEach( cell => {\n if (cell.classList.contains('not-allowed')) {\n cell.classList.remove('not-allowed')\n }\n })\n \n\n // First Ship\n if (customerShipPositionsArray.length < 3) {\n if (((parseInt(event.target.textContent) + 1) % width === 0) || ((parseInt(event.target.textContent) + 2) % width === 0)\n || ((parseInt(event.target.textContent) + 3) % width === 0) \n || ((parseInt(event.target.textContent) + width) > cellCounts - 1) ) {\n customerCells.forEach( cell => {\n if (parseInt(cell.textContent) < 99) {\n if ( (parseInt(cell.textContent) + 1) % width === 0 || (parseInt(cell.textContent) + 2) % width === 0 || (parseInt(cell.textContent) + 3) % width === 0\n || (parseInt(cell.textContent) + width) > cellCounts - 1 ){\n cell.classList.add('not-allowed')\n grid.children[99].classList.add('not-allowed')\n }\n } \n })\n \n return coveringReminder.style.display = 'block' \n } else {\n const shipPosition = customerCells[parseInt(event.target.textContent)]\n const secondPosition = customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent]\n const thirdPosition = customerCells[grid.children[parseInt(event.target.textContent) + 2].textContent]\n const fourthPosition = customerCells[grid.children[parseInt(event.target.textContent) + 3].textContent]\n const fifthPosition = customerCells[grid.children[parseInt(event.target.textContent) + width].textContent]\n const sixthPosition = customerCells[grid.children[parseInt(event.target.textContent) + 1 + width].textContent]\n const seventhPosition = customerCells[grid.children[parseInt(event.target.textContent) + 2 + width].textContent]\n const eighthPosition = customerCells[grid.children[parseInt(event.target.textContent) + 3 + width].textContent]\n\n shipPosition.classList.add('ships-positions')\n secondPosition.classList.add('ships-positions')\n thirdPosition.classList.add('ships-positions')\n fourthPosition.classList.add('ships-positions')\n fifthPosition.classList.add('ships-positions')\n sixthPosition.classList.add('ships-positions')\n seventhPosition.classList.add('ships-positions')\n eighthPosition.classList.add('ships-positions')\n // Storing Ships as a Class in the Grid Cells\n customerShipPositionsArray.push(shipPosition, secondPosition, thirdPosition, fourthPosition, fifthPosition, sixthPosition, seventhPosition, eighthPosition)\n //Assigning Class to Every Ship Specifically\n shipPosition.classList.add('first-ship')\n shipPosition.classList.add('first-ship-one')\n secondPosition.classList.add('first-ship')\n secondPosition.classList.add('first-ship-two')\n thirdPosition.classList.add('first-ship')\n thirdPosition.classList.add('first-ship-three')\n fourthPosition.classList.add('first-ship')\n fourthPosition.classList.add('first-ship-four')\n fifthPosition.classList.add('first-ship')\n fifthPosition.classList.add('first-ship-five')\n sixthPosition.classList.add('first-ship')\n sixthPosition.classList.add('first-ship-six')\n seventhPosition.classList.add('first-ship')\n seventhPosition.classList.add('first-ship-seven')\n eighthPosition.classList.add('first-ship')\n eighthPosition.classList.add('first-ship-eight')\n firstShipArray.push(shipPosition, secondPosition, thirdPosition, fourthPosition, fifthPosition, sixthPosition, seventhPosition, eighthPosition)\n if(!event.target.classList.contains('not-allowed')){\n tanksChoiceClicker++\n } \n \n if (tanksChoiceClicker === 1) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 2 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank2.png)no-repeat'\n } else if (tanksChoiceClicker === 2) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 3 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank3.png)no-repeat'\n } else if (tanksChoiceClicker === 3) {\n tankChoicerHeader.textContent = 'Place Your Himars'\n tankChoicerText.textContent = 'It Contains 6 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank4.png)no-repeat'\n } else if (tanksChoiceClicker === 4) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 4 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank5.png)no-repeat'\n } \n } // Second Ship\n } else if (customerShipPositionsArray.length > 7 && customerShipPositionsArray.length < 9) {\n if (((parseInt(event.target.textContent) + 1) % width === 0) || (event.target.classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent].classList.contains('ships-positions'))) {\n customerCells.forEach( cell => {\n if (parseInt(cell.textContent) < 99) {\n if ((parseInt(cell.textContent) + 1) % width === 0 || grid.children[parseInt(cell.textContent) + 1].classList.contains('ships-positions'))\n cell.classList.add('not-allowed')\n grid.children[99].classList.add('not-allowed')\n }\n \n })\n return coveringReminder.style.display = 'block' \n } else {\n const shipPosition = customerCells[parseInt(event.target.textContent)]\n const secondPosition = customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent]\n // Storing Ships as a Class in the Grid Cells\n shipPosition.classList.add('ships-positions')\n secondPosition.classList.add('ships-positions')\n customerShipPositionsArray.push(shipPosition, secondPosition)\n //Assigning Class to Every Ship Specifically\n shipPosition.classList.add('second-ship')\n shipPosition.classList.add('second-ship-one')\n secondPosition.classList.add('second-ship')\n secondPosition.classList.add('second-ship-two')\n secondShipArray.push(shipPosition, secondPosition)\n if(!event.target.classList.contains('not-allowed')){\n tanksChoiceClicker++\n } \n \n if (tanksChoiceClicker === 1) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 2 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank2.png)no-repeat'\n } else if (tanksChoiceClicker === 2) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 3 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank3.png)no-repeat'\n } else if (tanksChoiceClicker === 3) {\n tankChoicerHeader.textContent = 'Place Your Himars'\n tankChoicerText.textContent = 'It Contains 6 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank4.png)no-repeat'\n } else if (tanksChoiceClicker === 4) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 4 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank5.png)no-repeat'\n } \n } // Third Ship\n } else if (customerShipPositionsArray.length > 9 && customerShipPositionsArray.length < 11) {\n if (((parseInt(event.target.textContent) + 1) % width === 0) || ((parseInt(event.target.textContent) + 2) % width === 0)\n || (event.target.classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent].classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 2].textContent].classList.contains('ships-positions'))) {\n customerCells.forEach( cell => {\n if (parseInt(cell.textContent) < 99) {\n if ( (parseInt(cell.textContent) + 1) % width === 0 || (parseInt(cell.textContent) + 2) % width === 0 \n || grid.children[parseInt(cell.textContent) + 1].classList.contains('ships-positions') \n || grid.children[parseInt(cell.textContent) + 2].classList.contains('ships-positions')\n ){\n cell.classList.add('not-allowed')\n grid.children[99].classList.add('not-allowed')\n }\n } \n })\n return coveringReminder.style.display = 'block'\n } else {\n const shipPosition = customerCells[parseInt(event.target.textContent)]\n const secondPosition = customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent]\n const thirdPosition = customerCells[grid.children[parseInt(event.target.textContent) + 2].textContent]\n // Storing Ships as a Class in the Grid Cells\n shipPosition.classList.add('ships-positions')\n secondPosition.classList.add('ships-positions')\n thirdPosition.classList.add('ships-positions')\n customerShipPositionsArray.push(shipPosition, secondPosition, thirdPosition)\n \n //Assigning Class to Every Ship Specifically\n shipPosition.classList.add('third-ship')\n shipPosition.classList.add('third-ship-one')\n secondPosition.classList.add('third-ship')\n secondPosition.classList.add('third-ship-two')\n thirdPosition.classList.add('third-ship')\n thirdPosition.classList.add('third-ship-three')\n thirdShipArray.push(shipPosition, secondPosition, thirdPosition)\n if(!event.target.classList.contains('not-allowed')){\n tanksChoiceClicker++\n } \n \n if (tanksChoiceClicker === 1) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 2 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank2.png)no-repeat'\n } else if (tanksChoiceClicker === 2) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 3 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank3.png)no-repeat'\n } else if (tanksChoiceClicker === 3) {\n tankChoicerHeader.textContent = 'Place Your Himars'\n tankChoicerText.textContent = 'It Contains 6 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank4.png)no-repeat'\n } else if (tanksChoiceClicker === 4) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 4 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank5.png)no-repeat'\n } \n } // Fourth Ship\n } else if (customerShipPositionsArray.length > 12 && customerShipPositionsArray.length < 15) {\n if (((parseInt(event.target.textContent) + 1) % width === 0) || ((parseInt(event.target.textContent) + 2) % width === 0)\n || ((parseInt(event.target.textContent) + 3) % width === 0) || ((parseInt(event.target.textContent) + 4) % width === 0)\n || ((parseInt(event.target.textContent) + 5) % width === 0)\n || (event.target.classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent].classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 2].textContent].classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 3].textContent].classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 4].textContent].classList.contains('ships-positions')) \n || (customerCells[grid.children[parseInt(event.target.textContent) + 5].textContent].classList.contains('ships-positions'))) {\n customerCells.forEach( cell => {\n if (parseInt(cell.textContent) < 99) {\n if ( (parseInt(cell.textContent) + 1) % width === 0 || (parseInt(cell.textContent) + 2) % width === 0 \n || (parseInt(cell.textContent) + 3) % width === 0 || (parseInt(cell.textContent) + 4) % width === 0 \n || (parseInt(cell.textContent) + 5) % width === 0 \n || grid.children[parseInt(cell.textContent) + 1].classList.contains('ships-positions') \n || grid.children[parseInt(cell.textContent) + 2].classList.contains('ships-positions')\n || grid.children[parseInt(cell.textContent) + 3].classList.contains('ships-positions') \n || grid.children[parseInt(cell.textContent) + 4].classList.contains('ships-positions')\n || grid.children[parseInt(cell.textContent) + 5].classList.contains('ships-positions')\n ){\n cell.classList.add('not-allowed')\n grid.children[99].classList.add('not-allowed')\n }\n } \n })\n return coveringReminder.style.display = 'block'\n } else {\n const shipPosition = customerCells[parseInt(event.target.textContent)]\n const secondPosition = customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent]\n const thirdPosition = customerCells[grid.children[parseInt(event.target.textContent) + 2].textContent]\n const fourthPosition = customerCells[grid.children[parseInt(event.target.textContent) + 3].textContent]\n const fifthPosition = customerCells[grid.children[parseInt(event.target.textContent) + 4].textContent]\n const sixthPosition = customerCells[grid.children[parseInt(event.target.textContent) + 5].textContent]\n // Storing Ships as a Class in the Grid Cells\n shipPosition.classList.add('ships-positions')\n secondPosition.classList.add('ships-positions')\n thirdPosition.classList.add('ships-positions')\n fourthPosition.classList.add('ships-positions')\n fifthPosition.classList.add('ships-positions')\n sixthPosition.classList.add('ships-positions')\n customerShipPositionsArray.push(shipPosition, secondPosition, thirdPosition, fourthPosition, fifthPosition, sixthPosition)\n \n //Assigning Class to Every Ship Specifically\n shipPosition.classList.add('fourth-ship')\n shipPosition.classList.add('fourth-ship-one')\n secondPosition.classList.add('fourth-ship')\n secondPosition.classList.add('fourth-ship-two')\n thirdPosition.classList.add('fourth-ship')\n thirdPosition.classList.add('fourth-ship-three')\n fourthPosition.classList.add('fourth-ship')\n fourthPosition.classList.add('fourth-ship-four')\n fifthPosition.classList.add('fourth-ship')\n fifthPosition.classList.add('fourth-ship-five')\n sixthPosition.classList.add('fourth-ship')\n sixthPosition.classList.add('fourth-ship-six')\n fourthShipArray.push(shipPosition, secondPosition, thirdPosition, fourthPosition, fifthPosition, sixthPosition)\n if(!event.target.classList.contains('not-allowed')){\n tanksChoiceClicker++\n } \n \n if (tanksChoiceClicker === 1) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 2 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank2.png)no-repeat'\n } else if (tanksChoiceClicker === 2) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 3 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank3.png)no-repeat'\n } else if (tanksChoiceClicker === 3) {\n tankChoicerHeader.textContent = 'Place Your Himars'\n tankChoicerText.textContent = 'It Contains 6 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank4.png)no-repeat'\n } else if (tanksChoiceClicker === 4) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 4 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank5.png)no-repeat'\n } \n } // Fifth Ship\n } else if (customerShipPositionsArray.length > 16 && customerShipPositionsArray.length < 21) {\n if (((parseInt(event.target.textContent) + 1) % width === 0) || ((parseInt(event.target.textContent) + 2) % width === 0)\n || ((parseInt(event.target.textContent) + 3) % width === 0) || (event.target.classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent].classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 2].textContent].classList.contains('ships-positions'))\n || (customerCells[grid.children[parseInt(event.target.textContent) + 3].textContent].classList.contains('ships-positions')) ) {\n customerCells.forEach( cell => {\n if (parseInt(cell.textContent) < 99) {\n if ( (parseInt(cell.textContent) + 1) % width === 0 || (parseInt(cell.textContent) + 2) % width === 0 \n || (parseInt(cell.textContent) + 3) % width === 0 \n || grid.children[parseInt(cell.textContent) + 1].classList.contains('ships-positions') \n || grid.children[parseInt(cell.textContent) + 2].classList.contains('ships-positions')\n || grid.children[parseInt(cell.textContent) + 3].classList.contains('ships-positions')\n ){\n cell.classList.add('not-allowed')\n grid.children[99].classList.add('not-allowed')\n }\n } \n })\n return coveringReminder.style.display = 'block'\n } else {\n const shipPosition = customerCells[parseInt(event.target.textContent)]\n const secondPosition = customerCells[grid.children[parseInt(event.target.textContent) + 1].textContent]\n const thirdPosition = customerCells[grid.children[parseInt(event.target.textContent) + 2].textContent]\n const fourthPosition = customerCells[grid.children[parseInt(event.target.textContent) + 3].textContent]\n // Storing Ships as a Class in the Grid Cells\n shipPosition.classList.add('ships-positions')\n secondPosition.classList.add('ships-positions')\n thirdPosition.classList.add('ships-positions')\n fourthPosition.classList.add('ships-positions')\n customerShipPositionsArray.push(shipPosition, secondPosition, thirdPosition, fourthPosition)\n \n //Assigning Class to Every Ship Specifically\n shipPosition.classList.add('fifth-ship')\n shipPosition.classList.add('fifth-ship-one')\n secondPosition.classList.add('fifth-ship')\n secondPosition.classList.add('fifth-ship-two')\n thirdPosition.classList.add('fifth-ship')\n thirdPosition.classList.add('fifth-ship-three')\n fourthPosition.classList.add('fifth-ship')\n fourthPosition.classList.add('fifth-ship-four')\n fifthShipArray.push(shipPosition, secondPosition, thirdPosition, fourthPosition)\n btn.style.display = 'inline'\n tankChoicer.style.display = 'none'\n tankChoicerWrapper.style.display = 'none'\n if(!event.target.classList.contains('not-allowed')){\n tanksChoiceClicker++\n } \n \n if (tanksChoiceClicker === 1) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 2 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank2.png)no-repeat'\n } else if (tanksChoiceClicker === 2) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 3 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank3.png)no-repeat'\n } else if (tanksChoiceClicker === 3) {\n tankChoicerHeader.textContent = 'Place Your Himars'\n tankChoicerText.textContent = 'It Contains 6 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank4.png)no-repeat'\n } else if (tanksChoiceClicker === 4) {\n tankChoicerHeader.textContent = 'Place Your Artillery'\n tankChoicerText.textContent = 'It Contains 4 Cells on Strategy Panel'\n tankChoicer.style.background = 'url(./images/tank5.png)no-repeat'\n } \n } \n }\n }", "title": "" }, { "docid": "d0b60cf257e3304c0cb39a52826f4c64", "score": "0.5624562", "text": "function isPositionBlocked(x, y) {\r\n if (x < 0 || width <= x) return true;\r\n if (y >= height) return true;\r\n\r\n if (filled[y][x] != empty) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "2693e18da0245c176cc9ea75f7a897be", "score": "0.56231564", "text": "function checkCollectable(t_collectable) {\n\n\n distCollectable = dist(gameChar_world_x,\n gameChar_y, \n t_collectable.x_pos, \n t_collectable.y_pos);\n\n if (distCollectable <= 45) {\n t_collectable.isFound = true;\n\n game_score += t_collectable.size;\n }\n\n}", "title": "" }, { "docid": "f281e1b906ab5dd56ca62e4de4949e1b", "score": "0.5622267", "text": "function canCastleLeft(loc) {\n if (inCheck(color, loc, -1, -1)\n || (pieceColor === \"b\" && !bCastleLeft)\n || (pieceColor === \"w\" && !wCastleLeft)) {\n return false;\n }\n for (let i = loc - 1; i > 56; i--) {\n if (boardCells[i].firstChild\n || (inCheck(color, i, i, loc) && i > loc - 3)) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "221735935b6165913e0f1650aaf165d6", "score": "0.5618766", "text": "function canFrameShift(map, row, col, dir) {\n // // console.log(`r,c=${row},${col} dir=${dir}`)\n if (row < 0 || col < 0 || row >= map.rows || col >= map.cols) {\n//\t// console.log(\"can't shift: off the world\")\n\treturn false\n }\n if (!map.hasObstacleAt(row, col)) {\n\t//// console.log(\"the map has no obstacle at row, col\")\n\tif (map.hasObjectTouching(row, col)) {\n\t // // console.log(\"there's an obj touching row, col\")\n\t var obj = map.getObjectTouching(row, col)\n\t if (obj.isMoving === false) {\n\t//\t// console.log(\"the obj is not moving\")\n\t\treturn false\n\t }\n\t // // console.log(\"the object is moving\")\n\t return checkFrontier(map, obj, row, col, dir)\n\t}\n//\t// console.log(\"there is no obj touching\")\n\tlet v = true\n\tmap.objList.forEach(function(obj) {\n\t if (obj.isMoving) {\n\t\tif (obj !== player && checkFrontier(map, obj, row, col, dir) == false) v = false\n\t }\n\t})\n\treturn v //prevent sideways collision\n }\n // // console.log(\"there is obstacle at row col\")\n \n return false //is obstacle\n}", "title": "" }, { "docid": "1ee0ff8a90f2a7521f13725e56c45cab", "score": "0.56083745", "text": "function checkInBlue(objectName){\n if(objectName.position.y>400){\n      if(objectName.position.x>324 && objectName.position.x<416)\n      {\n        console.log('Point!');\n       // objectName.isVisible=false;\n counter+=1;\n resetGame(objectName);\n\n return;\n      }\n      else\n      {\n        console.log('Miss!');\n      }\n\n    }\n}", "title": "" } ]
4e6485b4100073768d689ef98cb33751
Chooses a random input in a specific grid
[ { "docid": "6d053cfe2da70ec43d37b73ced1bbcbc", "score": "0.7089987", "text": "function RandomlyChooseInputInGrid(Grid)\n{\n\tvar listOfInputsInGrid = $(\"#\" + $(Grid).attr('id') + \" :input[type='text']\");\n\tvar randomControlIndex = GenerateRandomInputNumber();\n\tlistOfInputsInGrid.each(function () \n\t{\n\t\tvar inputIndex = $(this).attr('id').substring(5,6);\n\t\tif (inputIndex == randomControlIndex)\n\t\t{\n\t\t\t$(this).val(GenerateRandomInputNumber());\n\t\t\tif ((ValidateInputXAxis(this, true)) &&\n\t\t\t\t(ValidateInputYAxis(this, true)))\n\t\t\t{\n\t\t\t\t$(this).prop(\"disabled\", true)\n\t\t\t\t .css({\n\t\t\t\t\t\"background-color\": \"gray\",\n\t\t\t\t\t\"color\": \"black\"\n\t\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(this).val(\"\");\n\t\t\t\treturn RandomlyChooseInputInGrid(Grid);\n\t\t\t}\n\t\t}\t\n\t});\t\n}", "title": "" } ]
[ { "docid": "97fc7019f9dffb1042c1fb2a6b026777", "score": "0.6819656", "text": "function createRandomInput() {\n\tcreateRandomTable(output, \"outputcell\");\n\tdisableAll(input);\n\trow = 5;\n\tcol = 5;\n}", "title": "" }, { "docid": "911bd3650250e67bc8c8048a1250e3a5", "score": "0.6641196", "text": "function randomGrid(grid) {\n\tvar i,\n\t\tj;\n\t\n\tfor (i=0; i < grid.length; ++i) {\n\t\tfor (j=0; j < grid[0].length; ++j) {\n\t\t\tgrid[i][j] = Math.random() > LIFE.randomFactor ? 1 : 0;\n\t\t}\n\t}\n\t\n\treturn grid;\n}", "title": "" }, { "docid": "d67bcc197f9c21f6a25d6952a3f4e093", "score": "0.66365874", "text": "function getRandCoord() {\n \n // Return a random coordinate in the grid\n return {x: Math.floor(Math.random() * (gridSize)), y: Math.floor(Math.random() * (gridSize))}\n \n}", "title": "" }, { "docid": "7ccc6b3bd69d2cfd18252b4206ed1347", "score": "0.66303366", "text": "function pickLocation() {\n var cols = floor(width/scl);\n\tvar rows = floor(height/scl);\n food = createVector(floor(random(cols)), floor(random(rows)));//this ensure the food is in the grid aligned with snake\n\tfood.mult(scl);//to expand it back out\n}", "title": "" }, { "docid": "18738ac13a2103d7148d187c5646cf5e", "score": "0.66149354", "text": "generateRandomNumber(){\n return Math.floor(Math.random() * this.grid.length)\n }", "title": "" }, { "docid": "aa1adfb9c7f96673d8e902d3722f3803", "score": "0.6589125", "text": "function handleRandomizeGrid() {\n const rows = [];\n for (let i = 0; i < numRows; i++) {\n rows.push(\n Array.from(Array(numCols), () => (Math.random() > 0.6 ? 1 : 0))\n );\n }\n setGrid(rows);\n }", "title": "" }, { "docid": "41525673529606b759f63e07084dfc81", "score": "0.64730996", "text": "function createGrid() {\n userChoice = parseInt(window.prompt(\"Choose grid size between 1-16\"));\n if (userChoice > 64) return;\n makeRows(userChoice);\n makeCols(userChoice);\n}", "title": "" }, { "docid": "2bd16e92a929e226a1294f129f35ea7a", "score": "0.6438562", "text": "function populateGrid() {\n\tfor(var i = 0; i < WIDTH; i++) {\n\t\tfor(var j = 0; j < HEIGHT; j++) {\n\t\t\tGRID[i][j] = Math.random() < DENSITY;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f405500518c825066ee5e6078946e313", "score": "0.64139915", "text": "function pickLocation() {\n // this is done to ensure the space picked is on the grid\n var cols = floor(width/scl);\n var rows = floor(height/scl);\n\n var foodX = floor(random(cols)) * scl;\n var foodY = floor(random(rows)) * scl;\n\n for (var i = 0; i < s.tail.length; i++) {\n if ((foodX === s.tail[i].x) && (foodY === s.tail[i].y)) {\n foodX = floor(random(cols)) * scl;\n foodY = floor(random(rows)) * scl;\n\n i = 0;\n }\n }\n\n food = createVector(foodX, foodY);\n}", "title": "" }, { "docid": "a100d3b05cfb8090f79393d97eb335e1", "score": "0.6399501", "text": "function compPick() {\n let randomPick = Math.floor(Math.random() * availableSquares.length);\n let pickId = (availableSquares[randomPick]);\n document.getElementById(pickId).click();\n }", "title": "" }, { "docid": "29d927928f2faffa7e6f29e2ae0409b6", "score": "0.6393671", "text": "function newGrid() {\n var j = prompt(\"How many squares would you like your grid to be?\");\n clearGrid();\n createGrid(j);\n}", "title": "" }, { "docid": "5fca063c2053ac2279e503fec68d3441", "score": "0.638", "text": "getNewTileRandom() {\n let nums = [2,4];\n let temp = nums[Math.floor(Math.random() * 2)];\n return temp;\n }", "title": "" }, { "docid": "26c7dfb2abf2ceb180681441c13b1670", "score": "0.63561743", "text": "function fillRandom() { // fills grid randomly\r\n for(var j=0;j<gridHeight;j++) {//iterate through rows\r\n for(var k=0;k<gridWidth;k++){ //iterate through columns\r\n var rawRandom = Math.random();//gets random raw number\r\n var improvedNUm = (rawRandom*2);//converting it into an int\r\n var randomBinary = Math.floor(improvedNum);\r\n if(randomBinary === 1) {\r\n theGrid[j][k]=1;\r\n } else {\r\n theGrid[j][k] = 0;\r\n}\r\n}\r\n}\r\n}", "title": "" }, { "docid": "78abea0b482895a0bf0236e96a7f2948", "score": "0.6355783", "text": "function newGrid() {\n removeGrid();\n let sizeOfGrid = parseInt(prompt(\"Number of squares per side for new grid?\", 16));\n if (sizeOfGrid < 2 || sizeOfGrid > 75) {\n alert(\"Invalid number! Please enter a number between 2 and 75\");\n } else if (sizeOfGrid >= 2 && sizeOfGrid <= 75) {\n generateGrid(sizeOfGrid, sizeOfGrid);\n } else {\n alert(\"Invalid! Please enter a number between 2 and 75\");\n }\n}", "title": "" }, { "docid": "dac1474ee825b7deb41cce5cb2b7c2f4", "score": "0.63503844", "text": "function generate() {\r\n let solution = getEmptyGrid();\r\n let grid = getEmptyGrid();\r\n\r\n for ( let rowIndex = 0; rowIndex < GRID_SIZE; rowIndex++ ) {\r\n for ( let colIndex = 0; colIndex < GRID_SIZE; colIndex++ ) {\r\n const availableValues = _getAvailableValues(solution, rowIndex, colIndex);\r\n const value = availableValues[ Math.floor( Math.random() * availableValues.length ) ];\r\n\r\n if ( value ) {\r\n solution[rowIndex][colIndex] = value;\r\n\r\n const isFixed = Math.random() < PERCENT_OF_FIXED_BOXES;\r\n\r\n grid[rowIndex][colIndex] = isFixed ? value : 0;\r\n } else {\r\n // should start over. after current for-loop colIndex will be increased\r\n // so to get first gridBox should set colIndex to -1\r\n rowIndex = 0;\r\n colIndex = -1;\r\n solution = getEmptyGrid();\r\n grid = getEmptyGrid();\r\n }\r\n }\r\n }\r\n\r\n return { grid, solution };\r\n}", "title": "" }, { "docid": "8ee1b241e99421503b953bfcd82f14a6", "score": "0.63282967", "text": "function fillGrid(){\r\n for (var i = 0; i < rows ; i++){\r\n for (var j = 0; j < cols ; j++){\r\n rand = Math.floor(Math.random(1) * 2);\r\n rand === 1 ? grid[i][j] = 1 : grid[i][j] = 0 ;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2d498fbc77113ff57b452b3d9a17af40", "score": "0.6326437", "text": "getRandomCoordinate() {\n return Math.floor(Math.random() * Math.floor(this.gridSize));\n }", "title": "" }, { "docid": "85f8c64a0d04459bcd6c3d72670cf30d", "score": "0.6318342", "text": "function generateRandomGrid() {\n\tvar newg = new grid();\n\n\tnewg.eachCell(function(val, x, y) {\n\t\tvar rnd = generateRandomInt(0,1);\n\t\tnewg.setCell(x,y,rnd);\n\t});\n\n\treturn newg;\n}", "title": "" }, { "docid": "6633c1d6dcfb14a34b5e73fe637d81b0", "score": "0.63080055", "text": "randomGridPosition() {\n // TODO: Use the built-in Math object, the Point class, \n // and the properties of this Board class to return \n // a Point that is at a random location in the board\n return new Point(Math.floor(Math.random()*this.gridWidth), Math.floor(Math.random()*this.gridHeight))\n }", "title": "" }, { "docid": "f46189a674ac9b68610b040a6449d333", "score": "0.6302633", "text": "function selectPos (){\n return Math.floor(Math.random() * (boardSize - 1) + 1);\n}", "title": "" }, { "docid": "87cb5996681bd0db96d346c15f5bb6df", "score": "0.62972754", "text": "function fillRandom() { \r\n\t\r\n\t//iterate through rows\r\n\tfor (let j = 0; j < gridHeight; j++) { \r\n\t//iterate through columns\r\n\tfor (let k = 0; k < gridWidth; k++) { \r\n //get a raw random number \r\n // random donne un chiffre entre 0 et 1 non inclus\r\n let random = Math.floor(Math.random()*2); \r\n //on obtient soit 1 soit 0\r\n if (random === 1) {\r\n \tcanvas[j][k] = 1;\r\n } else {\r\n \tcanvas[j][k] = 0;\r\n }\r\n }\r\n}\r\n}", "title": "" }, { "docid": "09b362b08cacfb0b220abb112e42e2b1", "score": "0.62628937", "text": "function randcell() {\n\t\treturn Math.floor(Math.random()*xCellCount);\n\t}", "title": "" }, { "docid": "cea218a026ea2bf5182149795acd6498", "score": "0.6250366", "text": "function pickLocation() {\n\tvar cols = floor(width/scl);\n\tvar rows = floor(height/scl);\n\tfood = createVector(floor(random(cols)), floor(random(rows)));\n\tfood.mult(scl);\n}", "title": "" }, { "docid": "53a7f344de845a87a4cf39236adcd214", "score": "0.6249971", "text": "function randomTile() {\n\t\t\t\t\tvar landscape_length = World.LANDSCAPE.length;\n\t\t\t\t\trndm_tile = Math.floor((Math.random() * landscape_length)); // random tile selected\n\t\t\t}", "title": "" }, { "docid": "e990d8a6ad746375820aee0ac11df778", "score": "0.6197252", "text": "function place_food(){\r\n\tdo{\r\n\t\tvar random_x = Math.floor(Math.random()*(config.grid_size-2))+1;\r\n\t\tvar random_y = Math.floor(Math.random()*(config.grid_size-2))+1;\r\n\t}while(squares[random_x][random_y] != 0);\r\n\tsquares[random_x][random_y] = 2;\r\n\tfood = new Point(random_x,random_y);\r\n}", "title": "" }, { "docid": "7c8776e067e62d3dc9d814daa0a0cfc5", "score": "0.6194294", "text": "function randomize ()\n{\n\n // Clear all the buttons\n for (var row = 0; row < 5; row++)\n {\n for (var col = 0; col < 5; col++)\n {\n clear(row, col);\n }\n }\n\n // Make 15 moves at random\n for (var moves = 0; moves < 15; moves++)\n {\n var r = Math.floor(Math.random()*5);\n var c = Math.floor(Math.random()*5);\n var button = $(\"#gameboard input\").get(r*5+c);\n play(button);\n }\n}", "title": "" }, { "docid": "e03a52299afda581f560b5409d06ebde", "score": "0.6182646", "text": "function poner_comida(){\n\tdo{\n\t\tvar random_x = Math.floor(Math.random()*(config.grid_size-2))+1;\n\t\tvar random_y = Math.floor(Math.random()*(config.grid_size-2))+1;\n\t}while(squares[random_x][random_y] != 0);\n\tsquares[random_x][random_y] = 2;\n\tfood = new Point(random_x,random_y);\n}", "title": "" }, { "docid": "a9a429ba38bbd74086db6c24079dede4", "score": "0.6175127", "text": "function putRandomTile() {\n // caut un random cell in care sa pun unul din cele 2 cell-uri\n let randomCell = Math.floor(Math.random() * $('.grid-cell').length);\n if ($(randomCell).hasClass('grid-cell-two') || $(randomCell).hasClass('grid-cell-four')) {\n putRandomTile(); \n } else {\n $('.grid-cell').eq(randomCell).removeClass('grid-cell').addClass(function () {\n // generez un numar random de la 0 la 100 si trimit ca parametru clasa two sau four in functie de procent\n let randomNumber = Math.floor(Math.random() * 100);\n if (randomNumber <= 90) {\n return 'grid-cell-two'\n } else return 'grid-cell-four'\n });\n }\n}", "title": "" }, { "docid": "6dd46b5dbc6f232ae90d4714875a47b8", "score": "0.61481774", "text": "function generateRandomNum() {\r\n //Loop to create the ships\r\n for (let n = 0; n < 3; n++) {\r\n //Generate random location on grid\r\n let locationRow = Math.randomInt(0, cpuRowMax);\r\n let locationCol = Math.randomInt(cpuColMin, cpuColMax);\r\n //Change the restrictions on each ship\r\n cpuRowMax = cpuRowMax - 1;\r\n cpuColMin = cpuColMax + 2;\r\n cpuColMax = cpuColMax + 2;\r\n //Change shipId along with loop\r\n let shipId = Number(1 + n);\r\n //Assign ship Id\r\n cpuGrid[locationRow][locationCol] = shipId;\r\n //Change the number of coordinates\r\n let numCoor = Number(3 + n);\r\n //Draw each coordinate\r\n for (let i = 1; i < numCoor; i++) {\r\n let loc2 = locationRow + i;\r\n cpuGrid[loc2][locationCol] = shipId;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "09a8d3371b0b3f14b25a02006c27d210", "score": "0.61381656", "text": "function newGrid() {\n var c = document.getElementById(\"myCan\");\n var ctx = c.getContext(\"2d\");\n ctx.clearRect(0, 0, 400, 400); //canvas aufräumen\n for (var y = 0; y < h; y++) {\n for (var x = 0; x < w; x++) {\n if (grid[y][x] === 1) {\n //ctx.gridWidth = 5; || ctx.lineWidth = 15;\n ctx.fillStyle = '#AA0011'; //'hsl(' + 360 * Math.random() + ', 100%, 50%)'; //Farbe der Punkte\n ctx.fillRect(y, x, 1, 1);\n };\n /*else {\n ctx.fillStyle = '#888888'; //'hsl(' + 360 * Math.random() + ', 100%, 50%)'; //Farbe der Punkte\n ctx.fillRect(y, x, 1, 1);\n }*/\n }\n }\n}", "title": "" }, { "docid": "6d0930c045d8ac806665df90abcc5614", "score": "0.61353266", "text": "function generateRandomNumber() {\n var random = Math.floor(Math.random() * grid);\n board.push(random);\n while (board.length < grid) {\n random = Math.floor(Math.random() * grid);\n if (!board.includes(random)) {\n board.push(random);\n }\n }\n}", "title": "" }, { "docid": "d1b8a6ace15285b03392c1f615af9aae", "score": "0.61249757", "text": "function randomise_stars() {\n const num = Math.floor(Math.random() * 1000) + 100;\n console.log(num);\n gridSetup(num);\n}", "title": "" }, { "docid": "a4e9175c0aafd702532a2c28313eea92", "score": "0.61152035", "text": "function makeApple() {\n let x = 0;\n let y = 0;\n while (grid[x][y] != 0) {\n x = Math.round(1 + Math.random() * (CELL_COUNT - 3))\n y = Math.round(1 + Math.random() * (CELL_COUNT - 3))\n }\n return {\n x,\n y\n }\n}", "title": "" }, { "docid": "3908e975689048f83aa176d88dc9310c", "score": "0.60867816", "text": "function pickCorner(){\n\tvar corners = [tictactoe.cells[0],tictactoe.cells[2],tictactoe.cells[6],tictactoe.cells[8]];\n\tvar cornersLength = corners.length;\n\tvar availableCorners = [];\n\tfor(i = 0; i < cornersLength; i++){\n\t\tif(corners[i] !== 'x' && corners[i] !== 'o'){\n\t\t\tavailableCorners.push(corners[i]);\n\t\t}\n\t}\n\tvar randomCorner = Math.floor(Math.random()*availableCorners.length);\n\tcellChoice(availableCorners[randomCorner]);\n}", "title": "" }, { "docid": "89a0e5b95773cf0cbeb2fd821bb1b562", "score": "0.6077025", "text": "chooseParts()\n\t{\n\t\tlet random = Math.floor(Math.random() * 3 + 1);\n\t\t\n\t\tif(random == 1)\n\t\t{\t\t\n\t\t\tthis.gridCranePartOne = this.craneGridPartThreeTexture;\n\t\t\tthis.gridCranePartTwo = this.craneGridPartOneTexture;\n\t\t\tthis.gridCranePartThree = this.craneGridPartTwoTexture;\n\t\t}\n\t\telse if(random == 2)\n\t\t{\t\t\n\t\t\tthis.gridCranePartOne = this.craneGridPartTwoTexture;\n\t\t\tthis.gridCranePartTwo = this.craneGridPartThreeTexture;\n\t\t\tthis.gridCranePartThree = this.craneGridPartOneTexture;\n\t\t}\n\t\telse if(random == 3)\n\t\t{\t\t\n\t\t\tthis.gridCranePartOne = this.craneGridPartOneTexture;\n\t\t\tthis.gridCranePartTwo = this.craneGridPartThreeTexture;\n\t\t\tthis.gridCranePartThree = this.craneGridPartTwoTexture;\n\t\t}\n\t}", "title": "" }, { "docid": "808e1d6613d188920b4b263f6ac81e49", "score": "0.6074489", "text": "function chooseBox(){\n\n let limit = 8;\n let attempt = 0;\n\n /* Generate a random number 0 - 2 for array index */\n\trandX = Math.round(Math.random() * 2);\n\trandY = Math.round(Math.random() * 2);\n\n\twhile(isSpaceFilled(randX, randY)){\n\n\t\t/* If cannot find empty space after 9 tries, give up (else will freeze up!) */\n\t if(attempt === limit){\n\t break;\n }\n\t\trandX = Math.round(Math.random() * 2);\n\t\trandY = Math.round(Math.random() * 2);\n attempt++;\n\t}\n}", "title": "" }, { "docid": "c12b10213a4b443853eed71af497d1dc", "score": "0.6073241", "text": "function addRandom(num)\n{\n\n //for the size of random tiles added, set that number of tiles to active\n for(var i = 0; i < num;i++)\n { \n\n var x = Math.floor(Math.random() * (columns - 1));\n var y = Math.floor(Math.random() * (rows - 1));\n \n girdArray[x][y] = 1;\n\n\n\n\n }\n\n\n //redrawing the updated board\n mgraphics.redraw();\n\n\n\n}", "title": "" }, { "docid": "a748fdbd7be74abe9ea6c93e6a006afc", "score": "0.6061654", "text": "function selectRandomEntry(arr){\n let index = Math.floor(Math.random()*arr.length);\n return arr[index];\n }", "title": "" }, { "docid": "94903e4225a8c41ac4b04ea9a4c5ca8f", "score": "0.6058165", "text": "function generateRandomPuzzle(){\n\t//determines puzzle dimensions\n\t_rows = Math.floor(Math.random()*(_num_rows-1))+2; \n\t_cols = Math.floor(Math.random()*(_num_cols-1))+2;\n\t//chooses which image to use\n\t_img = 0;// Math.floor(Math.random()*_numImages);\n \n //generates solution picture + puzzle solution button\n\tanswer();\n\t//creates puzzle\n\tcreateTiles();\n}", "title": "" }, { "docid": "b41a21474755e0db517bdec868c9edfe", "score": "0.6057084", "text": "function choose_start() {\n\n var ret = new Array();\n var side = generate_random(3)\n\n switch (side) {\n // 0 = top side. Row must be row 0 column is random.\n case 0 : ret.push(0); ret.push(generate_random(NUM_ROWS_COLS - 1)); ret.push(0); break;\n // 1 = right side. Column must be NUM_ROWS_COLS and row is random.\n case 1 : ret.push(generate_random(NUM_ROWS_COLS - 1)); ret.push(NUM_ROWS_COLS - 1); ret.push(1); break;\n // 2 = bottom side. Row must be NUM_ROWS_COLS and column is random.\n case 2 : ret.push(NUM_ROWS_COLS - 1); ret.push(generate_random(NUM_ROWS_COLS - 1)); ret.push(2); break;\n // 3 = left side. Column must be 0 and row is random.\n case 3 : ret.push(generate_random(NUM_ROWS_COLS - 1)); ret.push(0); ret.push(3); break;\n }\n\n return ret;\n}", "title": "" }, { "docid": "5627dd4af39bd8347470f11693100786", "score": "0.6042916", "text": "function selector(questionChoices) {\n\n var randomSelection = Math.random(1);\n\n}", "title": "" }, { "docid": "93e87926553015e2c021342ea9f04b0e", "score": "0.60406685", "text": "initial() {\n const { grid, rows, columns } = this.state;\n for (let i = 0; i < columns; i++) {\n for (let j = 0; j < rows; j++) {\n grid[i][j] = Math.round(Math.random()); // Assigns random 1 or 0 to grid\n }\n }\n this.setState({ grid });\n }", "title": "" }, { "docid": "11f02b4acd23cf810cd23a2247618972", "score": "0.60402626", "text": "selectRandomState() {\n var random = Math.ceil(Math.random() * 10);\n var player = 0;\n\n if (random > 9) player = 1;\n else if (random > 8) player = 2;\n\n return player;\n }", "title": "" }, { "docid": "5984a1be90bdf93673d04c7e691d9fcc", "score": "0.6037136", "text": "function selectRandomEntry(arr){\n let index = Math.floor(Math.random()*arr.length);\n return arr[index];\n}", "title": "" }, { "docid": "1df9a5ecfd8a8d0c24a7e3c06ef0452e", "score": "0.603567", "text": "function userInput() {\n var askUser = prompt(\"How many boxes would you like to have on each side?\");\n clearGrid();\n buildGrid(askUser);\n}", "title": "" }, { "docid": "7040251c867057bf51633cac4d9acd33", "score": "0.60321873", "text": "function setFood() {\n\n // array to track empty coordinates\n var empty = [];\n \n // track all coordinates of the grid that are empty\n for (var x = 0; x < grid.width; x++) {\n for (var y = 0; y < grid.height; y++) {\n // populate array with all empty coordinates\n if (grid.get(x, y) === EMPTY) {\n empty.push({x:x, y:y});\n }\n }\n }\n \n // math function to determine random array slot given the array length\n var randomPosition = empty[Math.floor(Math.random() * empty.length)];\n // set the randomly determined coordinate to the 'FRUIT' value ie '2'\n grid.set(FRUIT, randomPosition.x, randomPosition.y);\n}", "title": "" }, { "docid": "7393baed8d7ccf1743911b2f06e1a55c", "score": "0.60270435", "text": "function random() {\n init();\n setStartingPopulation(Math.ceil((sizeX * sizeY) / 5));\n reDraw(true);\n}", "title": "" }, { "docid": "b2fe9796206bac9463928bd8ff765167", "score": "0.60156596", "text": "function randomGrid(width, height){\n\tconst grid = [];\n\tfor(let i = 0; i < height; i ++){\n\t\tlet row = [];\n\t\tfor(j = 0; j < width; j++){\n\t\t\tconst val = Math.round(Math.random());\n\t\t\trow.push(val);\n\t\t}\n\t\tgrid.push(row);\n\t}\n\treturn grid;\n}", "title": "" }, { "docid": "9606ea187b347d372840805ad80bace3", "score": "0.60136896", "text": "function generateSnakeStartingPosition() {\n return Math.floor(Math.random() * gridSize);\n}", "title": "" }, { "docid": "b8a8329b89511d3bc1c34b46ef10a772", "score": "0.601289", "text": "function createNewGrid() {\n let newGrid = 0;\n do {\n newGrid = prompt(\"Pick a number between 1 and 100 to make a new grid:\", 14);\n } while (newGrid >= 100 && newGrid);\n console.log(`newGrid: ${newGrid}`);\n \n removeCells();\n \n gridTemplate(newGrid);\n multiply = newGrid * newGrid;\n return addCells(multiply);\n }", "title": "" }, { "docid": "12e003d29f3c8948fb474d4519c04fdf", "score": "0.60119206", "text": "function pick_random(e){\n\tvar directions = [\"top\", \"bottom\", \"left\", \"right\"];\n\treturn e[directions[Math.floor(Math.random() * directions.length)]];\n}", "title": "" }, { "docid": "b084fd7f77d4006a28b147566ebe9ac0", "score": "0.60004985", "text": "function pickRow (game) {\n const rowOptions = game.enemyRows;\n const el = Math.floor((Math.random() * rowOptions.length));\n return rowOptions[el];\n}", "title": "" }, { "docid": "adf34102e88bd7d565e227cd7bccdff0", "score": "0.5998169", "text": "function getRandomLocation() {\r\n return Math.floor(Math.random() * HEIGHT * WIDTH);\r\n}", "title": "" }, { "docid": "03ac6d7fe5ea38720a4611f319d876b4", "score": "0.59944206", "text": "function getRandomIndex() {\n return Math.floor(Math.random() * (answerInputElements.length));\n }", "title": "" }, { "docid": "05660dab458b67fd33936b35fb515dbe", "score": "0.5977817", "text": "function pickLocation(){\n var cols = floor(width/scl);\n var rows = floor(height/scl);\n food = createVector(floor(random(cols)), floor(random(rows)));\n food.mult(scl)\n \n //updates the score each time the food is eaten\n prevScore = parseInt(scoreElem.html().substring(8));\n scoreElem.html('Score = ' + (prevScore + 1));\n}", "title": "" }, { "docid": "143493a102f9d6ed8ebcaaba973b638b", "score": "0.59774446", "text": "function createGrid() {\n for (let x = 0; x < width; x++) {\n grid[x] = [];\n next[x] = [];\n for (let y = 0; y < height; y++) {\n const a = 1;\n const b = 0;\n grid[x][y] = {\n a: a,\n b: b,\n };\n next[x][y] = {\n a: a,\n b: b,\n };\n }\n }\n\n // Randomly seed cells\n for (var i = 100; i < 150; i++) {\n for (var j = 100; j < 150; j++) {\n if(Math.random() > .9) {\n grid[i][j].b = Math.random() / Math.random() * Math.random();\n }\n }\n }\n\n // Print out values\n document.getElementById('kill').innerHTML = kill;\n document.getElementById('feed').innerHTML = feed;\n}", "title": "" }, { "docid": "ea75a2e70e7126ad278e6db728afba6d", "score": "0.5972066", "text": "function choose2random(i = null, v = 0) {\n let a = i;\n if (i == null) {\n a = Math.floor(ran(0, (tile.length)));\n }\n\n //check no. of empty cells\n let empty_cell = 0;\n for (let i = 0; i < tile.length; i++) {\n if (tile_set[i].val == 0) {\n empty_cell++;\n }\n }\n\n //assign value if empty\n if (tile_set[a].val == 0) {\n tile_set[a].val = ran() > 0.9 ? 4 : 2;\n if (v != 0) {\n tile_set[a].val = v;\n }\n tile_set[a].pop = true;\n // console.log(tile_set[a].pop);\n } else if (empty_cell > 0 && tile_set[a].val != 0) {\n choose2random();\n }\n for (let i = 0; i < tile.length; i++) {\n tile_set[i].draw();\n }\n}", "title": "" }, { "docid": "0001ba418c9104e43823fe98e21dfe60", "score": "0.5971463", "text": "populate() {\n for (let i = 0; i < BOARD_ROWS; i++) {\n for (let j = 0; j < BOARD_COLUMNS; j++) {\n this.grid[i][j] = this.randomType();\n\n do {\n this.grid[i][j] = this.randomType();\n } while (this.state.matches.checkAt(i, j));\n }\n }\n }", "title": "" }, { "docid": "308471dd416c39e0d7c0b5c4a8aef7dd", "score": "0.59626806", "text": "function placingRandomMines(clickedCell) {\n var possibleCells = []\n for (var i = 0; i < gBoard.length; i++) {\n for (var j = 0; j < gBoard.length; j++) {\n if (clickedCell.i === i && clickedCell.j === j) continue\n possibleCells.push({ i: i, j: j })\n }\n }\n for (var i = 0; i < gBoard.length; i++) {\n var selectedCell = possibleCells.splice(getRandomIntInclusive(0, possibleCells.length - 1), 1)[0]\n gBoard[selectedCell.i][selectedCell.j].isMine = true\n }\n}", "title": "" }, { "docid": "214f6977c5c3fa4e03afa1601fca8364", "score": "0.5959089", "text": "choose(choices) {\n console.log('choices:', choices);\n\n let idx = Math.floor(Math.random() * choices.length);\n this.move = choices[idx];\n }", "title": "" }, { "docid": "c7f969d01edb4dc028aa48bd1f77cf56", "score": "0.5958724", "text": "function generatePuzzle(){\n\tfor(let i = 0; i <rows+1; i++){\n\t\tfor(let j = 0; j< cols+1; j++){\n\t\t\tpuzzle[i][j] = solution[i][j];\n\t\t}\n\t}\n\t//console.log(puzzle===solution);\n\t//console.log(puzzle, solution);\n\tlet r = randomNum(0,rows);\n\tlet c = randomNum(0,cols);\n\tfor(let i = 0 ; i<diff; i++){\n\t\tr = randomNum(1,rows);\n\t\tc = randomNum(1,cols);\n\t\tconsole.log(r,c);\n\t\tclickBox(r,c);\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "beeaf9973d68f84975c3c90081fd0184", "score": "0.59582716", "text": "function initializeGrid(){\n\tfor( let x = 0 ; x < conf.gsize[0] ; x ++ ){\n\t\tfor( let y = 0 ; y < conf.gsize[1] ; y ++ ){\n\t\t\tif( C.random() < 0.5 ){\n\t\t\t\tC.setpix( [x,y], 1 )\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "22ad3c4698801ec233de1e2f268230e8", "score": "0.594541", "text": "function generateComputerChoice() {\r\n let choices = [\"r\", \"p\", \"s\"];\r\n let num = Math.floor(Math.random() * 3);\r\n return choices[num];\r\n}", "title": "" }, { "docid": "849d19437931ab0c4f3130b49eabcacf", "score": "0.5939291", "text": "function chooseRandom() {\n\n//populates an array of cards to choose from\n\tcreateChoices();\n\n//from that created array(selectedCards), random cards are selected to be pushed into CHOSEN array\n\tselectRandom(selectedCards, CHOSEN);\n}", "title": "" }, { "docid": "010fac5d88cfdbc202b18eacec02c579", "score": "0.59372497", "text": "function random (snake, setFood) {\n if (!setFood && START) return;\n\n let snakePos = [];\n\n if (setFood) {\n snakePos = snake.tail.slice();\n snakePos.push(Object.assign({}, snake.head));\n snakePos.push(Object.assign({}, snake.neck));\n }\n const grid = randGrid(snakePos);\n const randNum = Math.floor(Math.random() * (grid.length));\n\n if (!setFood) return grid[randNum];\n\n if (grid.length === 0) {\n console.log('Grid filled');\n return;\n }\n setFood(food =>\n ({ ...food, row: grid[randNum].row, col: grid[randNum].col }));\n}", "title": "" }, { "docid": "a45bd6c6c92ed5ea90228b2ae6eb6d08", "score": "0.5934796", "text": "function changeInputText() {\n inpText = inpTextArray[int(random(0, 5))];\n}", "title": "" }, { "docid": "2c50e527e8946803a394b517c6e696ec", "score": "0.59319633", "text": "function GetRandomCell() {\n let cell = null;\n let column = Random(1, 5);\n let row = Random(1, 5);\n\n cell =\n // Row 1\n column == 1 && row == 1\n ? cell_1_1\n : column == 2 && row == 1\n ? cell_2_1\n : column == 3 && row == 1\n ? cell_3_1\n : column == 4 && row == 1\n ? cell_4_1\n : // Row 2\n column == 1 && row == 2\n ? cell_1_2\n : column == 2 && row == 2\n ? cell_2_2\n : column == 3 && row == 2\n ? cell_3_2\n : column == 4 && row == 2\n ? cell_4_2\n : // Row 3\n column == 1 && row == 3\n ? cell_1_3\n : column == 2 && row == 3\n ? cell_2_3\n : column == 3 && row == 3\n ? cell_3_3\n : column == 4 && row == 3\n ? cell_4_3\n : // Row 4\n column == 1 && row == 4\n ? cell_1_4\n : column == 2 && row == 4\n ? cell_2_4\n : column == 3 && row == 4\n ? cell_3_4\n : column == 4 && row == 4\n ? cell_4_4\n : null;\n\n return cell;\n}", "title": "" }, { "docid": "67cb01a6e2c270b4587487ecec8d1643", "score": "0.59231114", "text": "function getRandomChoice() {\n target = hiddenLetter[Math.round(Math.random() * (hiddenLetter.length - 1))]; \n console.log(target);\n}", "title": "" }, { "docid": "57f9849d793137155f4fed90c44b7d96", "score": "0.59197587", "text": "function randomize(dim){\r\n\tvar j;\r\n\tusedIndex[0]=0;\r\n\tusedIndex.push(dim);\r\n\tdim=Math.floor(25*Math.random());\r\n\t\r\n\tfor(var j=0;j<usedIndex.length;j++){\r\n\t\tif(dim===usedIndex[j]){\r\n\t\t\tdim=Math.floor(25*Math.random());\r\n\t\t\tj=0;\r\n\t\t}\r\n\t\tif(usedIndex.length>=25){\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn dim;\r\n}", "title": "" }, { "docid": "c0648bf2938ca867055c0ecb224ac90c", "score": "0.59191304", "text": "function computerPlay() {\n let random = Math.floor(Math.random()*3);\n let decision = selections[random];\n return decision;\n}", "title": "" }, { "docid": "8b8c2b86cf28f00c2a9d1ce6a51d07e2", "score": "0.5916539", "text": "function getRandomFoodPosition() {\n let newFoodPosition;\n while (newFoodPosition == null || onSnake(newFoodPosition)) {\n newFoodPosition = randomGridPosition();\n }\n return newFoodPosition;\n}", "title": "" }, { "docid": "9a196e7167a093e88f85f42101f2279c", "score": "0.59095174", "text": "function generateNumbers() {\r\n return Math.floor(Math.random() * rows * columns);\r\n }", "title": "" }, { "docid": "797a45a30c5704dc492ed1a38463e0bf", "score": "0.5908358", "text": "function userSelect() {\n userGuess =\n userPicks[(Math.random() * userPicks.length)]\n}", "title": "" }, { "docid": "a3ac43fbc9f41fd425bb62d99c9f49e6", "score": "0.58992565", "text": "function randomMove() {\n\n let availableSpot = [] ;\n\n for( let i = 0 ; i < 3 ; i++ ){\n\n for( let j = 0 ; j < 3 ; j++ ){\n\n if( board[i][j] == '' ){\n\n var choose = {\n x : 0 ,\n y : 0\n }\n\n choose.x = i ;\n\n choose.y = j ;\n \n availableSpot.push( choose ) ;\n }\n }\n }\n\n choose = availableSpot[ Math.floor( Math.random() * availableSpot.length ) ] ;\n \n curX = choose.x ;\n\n curY = choose.y ;\n\n board[curX][curY] = ai ;\n\n moveSound() ;\n\n putSymbol('O') ;\n\n curPlayer = human ;\n\n swapHeadingColor() ;\n\n showResult() ;\n}", "title": "" }, { "docid": "07d41b66afc3756b6823e11b3d09893d", "score": "0.589912", "text": "function chooseGrid(level) {\n let numberOfCards, gridRows, gridColumns;\n switch (level) {\n // Assign 16 images\n case 'easy':\n numberOfCards = 16;\n gridRows = gridColumns = 4;\n break;\n // Assign 32 images\n case 'medium':\n numberOfCards = 36;\n gridRows = gridColumns = 6;\n break;\n // Assign 64 images\n case 'hard':\n numberOfCards = 64;\n gridRows = gridColumns = 8;\n break;\n default:\n // Nothing to do here\n break;\n }\n return {\n numberOfCards,\n gridRows,\n gridColumns\n };\n}", "title": "" }, { "docid": "8c2f657c7b20d3c1823e36cd652b8f5f", "score": "0.5896295", "text": "function randomPosition(){\n\tlet row = Math.floor(Math.random()*(bombs-1))+1; \n\tlet col = Math.floor(Math.random()*(bombs-1))+1; \n\t\n\treturn [row,col];\n}", "title": "" }, { "docid": "69fb4e0f5bfbb8833fb728f8db5b8d50", "score": "0.5893945", "text": "function ai_move() {\n\n // Create array of valid cells to play in\n let valid_cells = [];\n for (let grid = 0; grid < 9; grid++){\n for(let cell = 0; cell < 9; cell++) {\n if(big_grid[grid][cell] == \"E\") {\n valid_cells.push(\"[\" + grid + \"][\" + cell + \"]\");\n }\n }\n }\n\n // Check if O can win in this turn, if so, eliminate all other options\n if ((could_win(\"O\", valid_cells).length != 0) && (diff == 1)){\n valid_cells = could_win(\"O\", valid_cells);\n }\n\n // Check if X can win in this grid, if so, elimininate options that DON'T block X from winning grid\n if ((could_win(\"X\", valid_cells).length != 0) && (diff == 1)) {\n valid_cells = could_win(\"X\", valid_cells);\n }\n\n // Stretch goal: For each option, check where X will be sent. If X can win THAT grid, eliminate that option.\n\n // Finally, choose randomly from remaining cells\n let chosen_cell = valid_cells[Math.floor(Math.random()*valid_cells.length)];\n big_grid[chosen_cell[1]][chosen_cell[4]] = \"O\";\n document.getElementById(chosen_cell).value = \"O\";\n return chosen_cell;\n}", "title": "" }, { "docid": "eae33a959b87dba84a9dffffb616d85d", "score": "0.5893434", "text": "function computerSelection(){\n return selections[Math.floor(Math.random() * selections.length)]\n}", "title": "" }, { "docid": "7ec552f15308b509122ea100d040072c", "score": "0.58876216", "text": "function getComputerSelection() {\n return choices[Math.floor(Math.random() * choices.length)];\n}", "title": "" }, { "docid": "18b6728b3ab2771b525520ef184e0b82", "score": "0.5879778", "text": "function reset() {\n\tclearGrid();\n\tlet z = prompt(\"Pick a number...\");\n\tcreateGrid(z);\n}", "title": "" }, { "docid": "c1fecc0d5fe0fbea531f236952d0bcd9", "score": "0.5877939", "text": "function userInput() {\n main.innerHTML = \"\";\n let row = prompt(\"Enter the amount of rows you would like\");\n let column = prompt(\"Enter the amount of columns you would like\");\n \n createGrid(column, row);\n}", "title": "" }, { "docid": "eeb51d4aaf4f1b7fd3a32581ef3f002d", "score": "0.5870849", "text": "function random(itemCount, arraySelectedFrom){\n\n// need to build this when its more clear\n\n}", "title": "" }, { "docid": "72b28de4722d3095c0167f71d97a2f47", "score": "0.58644724", "text": "function getComputerChoice(){\r\n const choices = ['U','F','S'];\r\n const randonNumber=Math.floor(Math.random()*3);\r\n return choices[randonNumber];\r\n}", "title": "" }, { "docid": "0fd5b72f9291a5c94fed89737800df9a", "score": "0.58605176", "text": "function getComputerSelection(){\n const number = Math.floor(Math.random() * 3);\n let computerSelection = options[number];\n return computerSelection;\n}", "title": "" }, { "docid": "81ed6eaee204697f34a778a09230ca2b", "score": "0.58562064", "text": "function randomMoveAI() {\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n if(grid[i][j] === ' ' ) {\n return {\n i : i,\n j : j\n };\n }\n }\n }\n }", "title": "" }, { "docid": "13a6afd8c1efe5cd67efd9fcf17c5c43", "score": "0.5855755", "text": "static fillSeats(grid) {\n const size = grid.length;\n for (let i = 0; i < size; i++) {\n const x = Math.floor(Math.random() * size);\n const y = Math.floor(Math.random() * size);\n grid[x][y] = \"O\";\n }\n return grid;\n }", "title": "" }, { "docid": "501b1aa6a3d96e8f41ff1fd0cb0fba20", "score": "0.585534", "text": "function randomPick(array) {\n //Create a binding that gets a random number that will represent an index of an array\n let choice = Math.floor(Math.random() * array.length);\n //Returns the element at the chosen random index\n return array[choice];\n}", "title": "" }, { "docid": "2da48931d2cc91434d26b05491a65afb", "score": "0.5852023", "text": "function randomOranges() {\n //clear grid first\n grid = new Grid(grid.rows, grid.cols);\n document.getElementById(\"grid\").innerHTML = grid.rebuildGrid();\n\n let orangeAmt = Math.floor(.75 * (grid.rows * grid.cols));\n let i = 0;\n let coords = [[Math.floor(Math.random() * grid.rows),\n Math.floor(Math.random() * grid.cols)]]\n while (i < orangeAmt) {\n let coord = coords[0];\n let neighbors = determineCoords(coord[0], coord[1])\n coords.unshift(neighbors[Math.floor(Math.random() * neighbors.length)]);\n i++;\n }\n coords.forEach((coord) => \n setOrange(document.getElementById(`${coord[0]}-${coord[1]}`))\n );\n}", "title": "" }, { "docid": "9418e58a9b147febcc94b4e48ee9f46c", "score": "0.5849147", "text": "function getRandomElement(arr) {\n let randomElement = Math.floor(Math.random() * arr.length);\n let chosenElement = arr[randomElement]\n placeholderArr.push(chosenElement);\n}", "title": "" }, { "docid": "747544b043dfecb7bbe4e22872706032", "score": "0.5847923", "text": "function getRandomTile() {\n return Math.floor(Math.random() * tilecolors.length);\n }", "title": "" }, { "docid": "bff9bf732bb1283e7296a98073233e3d", "score": "0.5843245", "text": "function computerChooses(array) {\n const randomIndex = Math.floor(Math.random() * 3);\n return array[randomIndex];\n}", "title": "" }, { "docid": "d9c73a8da7131cd985e1f709c4ecee65", "score": "0.5834474", "text": "function computerIsGuessing(){\n var randomNum = Math.floor(Math.random() * 3)\n if(randomNum === 0){\n setRock(display[1])\n computerInput = 0\n }else if( randomNum === 1){\n setPaper(display[1])\n computerInput = 1\n }else{\n setScissors(display[1])\n computerInput = 2\n } \n return computerInput \n}", "title": "" }, { "docid": "28969523125e38002fe7a642900d04c9", "score": "0.583353", "text": "function getRandomFoodPosition() {\n let newFoodPosition;\n while (newFoodPosition == null || onSnake(newFoodPosition)) {\n newFoodPosition = randomGridPostion();\n }\n return newFoodPosition;\n}", "title": "" }, { "docid": "7fb39bd00cd8e5b644a6d2fc4eb18c7c", "score": "0.58325857", "text": "function getbotChoice()\n{\n //here we are randomly generating 0,1 and 2 because we have 3 options rock,paper,Scissors;\n //Math.random()-->generates random value between 0 to 1;\n //we want upto 3 so we multiply it with 3\n //it gives float values so we are taking floor of that vale;\n let ch=Math.floor(Math.random()*3);\n //ch variable having 0,1,or 2 so we select \n let values=['rock','paper','Scissors'];\n //here we are selecting the values arr of index(randomly generated)\n return values[ch];\n}", "title": "" }, { "docid": "3f695ca71f021fc08bf5078422ee6693", "score": "0.5832064", "text": "function pick(event)\n{\n // sets in div element like data-row taking by .dataset metod\n const {row, column} = event.target.dataset;\n\n\n // ? player 2 : player 1 shorter if else\n // : <- else player 1\n const turn = round % 2 === 0 ? player2 : player1;\n\n if(!reset)\n {\n if (board[row][column] !== '') return;\n event.target.textContent=turn;\n board[row][column] = turn;\n round++;\n check();\n }\n else\n {\n \n for(let i=0; i<16;i++){\n newround[i].textContent='';\n }\n reset = false;\n \n }\n \n}", "title": "" }, { "docid": "48ce67f19bce7bda340b9325f5ea9a1b", "score": "0.5824895", "text": "function createGrid( rows, cols, isRandom){\n var arr = [];\n for(var i=0; i < rows; i++){\n arr.push([]);\n arr[i].push(new Array(cols));\n for(var j=0; j < cols; j++){\n arr[i][j] = isRandom ? !! Math.round(Math.random()) : false;\n }\n }\n return arr;\n }", "title": "" }, { "docid": "39d3d0045e45b757b246812c76b52031", "score": "0.58195376", "text": "function selectRandNum() {\nreturn Math.floor(Math.random()*imageSilo.length);\n}", "title": "" }, { "docid": "5031cbf149228e0266e1a3e4f48ca9d5", "score": "0.58112895", "text": "function pickRandomNumber(arr) {\n //Math.random generates random number from 0 to 1. \n //Multiply Math.random by array length to get various numbers not limited to 0-1.\n //Math.floor => rounds down the above result to nearest int. \n\t\tlet x = arr[Math.floor(Math.random() * arr.length)];\n\t\tnumberToMatch = x;\n\t\t$(\"#randomNumber\").html(numberToMatch);\n\n\t\tconsole.log(\"random number: \" + numberToMatch);\n\n\t}", "title": "" }, { "docid": "5672503dab2e9fec69127918b769b978", "score": "0.5809319", "text": "function generateInput (T, Nmax) {\n console.log(T);\n for (let i = 0; i < T; i++) {\n console.log(Math.floor(Math.random() * (Nmax - 1)) + 1);\n } \n}", "title": "" }, { "docid": "640158c0f9f96edc9c4b900e01074958", "score": "0.5808363", "text": "function computerSelect(){\n computerHand.selection = rock_paper_scissor[Math.floor(Math.random()*3)];\n}", "title": "" } ]
0b3a47630c157a008cc42f9549b1a4de
! vuerouter v3.0.2 (c) 2018 Evan You
[ { "docid": "6fc394a246759ec0cb72113b262a4a92", "score": "0.0", "text": "function r(e,t){0}", "title": "" } ]
[ { "docid": "b4b2185c21aad95ad5141ce3a08592af", "score": "0.6204412", "text": "function RevolverTools () {}", "title": "" }, { "docid": "cd2e2bff1ce0f145aea071f562e95ad4", "score": "0.57908005", "text": "inizializza() {\n\n }", "title": "" }, { "docid": "cfde3a48296adf4183ed781a56c5ae7c", "score": "0.57823575", "text": "function ZR(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"source.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "3644733a41324b10d69736958f9fec28", "score": "0.5694227", "text": "_onViseme() {}", "title": "" }, { "docid": "1b8832063ae098079cce2c6c6aeb7770", "score": "0.5597481", "text": "function gA(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"source.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "fc2058adadf742b3edd48360b31da4c3", "score": "0.5574229", "text": "function oj(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "0fe7f2766fd9c59d3a38ac36d6674d54", "score": "0.5569402", "text": "static generate() {\n //in here can update later to other version uudiv5 v1 \n //or write any other logic or functionality as needed\n return v4();\n }", "title": "" }, { "docid": "5d63851d5b6e96a25273a8048bfb10b4", "score": "0.5547199", "text": "function aV(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "0c5a14f953888b48f9094a7235bfeadc", "score": "0.55403703", "text": "function vt(){}", "title": "" }, { "docid": "75139f2fc24c74eb324e38e70fa6863d", "score": "0.5503316", "text": "function $D(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "fb90698f6f853af83afce36f8e7e4690", "score": "0.54832864", "text": "function vectorUpgrade(upgrade){\n}", "title": "" }, { "docid": "3fba0edfd0054488a9e36902cf6dcc18", "score": "0.54658705", "text": "onUpdated() { }", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.54108727", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.54108727", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "e1fd6370f9dceb24ecc3cd7ebbb8a8e8", "score": "0.54030246", "text": "function SigV4Utils() { }", "title": "" }, { "docid": "557eff393eff7b6cc6e7b8bfeda0c889", "score": "0.5371671", "text": "function LT(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53578246", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "eff37ff77c08c6c80b96c1fbdca1be00", "score": "0.5332329", "text": "function Xk(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "90708218c4ffca3652b2c57cec2d081e", "score": "0.53195286", "text": "function $x(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "2768c156986a21118357c558d9a7c85a", "score": "0.531709", "text": "function WT(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "633474559cec443b08c3f0e4fb86ef56", "score": "0.5310647", "text": "function V5(){}", "title": "" }, { "docid": "841e64a320d3bc591a69a6470f379bc4", "score": "0.53055954", "text": "function kA(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "00c97e1f8b2a8ec1527de619a3269979", "score": "0.5304845", "text": "update (){\n // will be implemented in invdividual components\n }", "title": "" }, { "docid": "25d8c6638db80538606bf5e47ebfa5fd", "score": "0.528647", "text": "function IP(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "d7edc4bf2de5ec94fd0d2fa8fab28764", "score": "0.52822876", "text": "function UF(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "6557a79098c1dce4e11b6af91e0860ce", "score": "0.52743405", "text": "drive() {\n return 'vroom'\n }", "title": "" }, { "docid": "db8b7c911eedeca4e957640e9ba0dcb2", "score": "0.52711046", "text": "constructor() {\n\t\t\n\t}", "title": "" }, { "docid": "d585809c535efe8460a53f181b1292b3", "score": "0.52704984", "text": "function VL(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"style.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "420c403630dfd41e487f53ea5ac0727a", "score": "0.5260576", "text": "function BP(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "fcd587821beb91ee7101d130218a264b", "score": "0.52402306", "text": "function V(t,e){if(s(t)&&!(t instanceof pa)){var n;return m(t,\"__ob__\")&&t.__ob__ instanceof _a?n=t.__ob__:ba&&!Go()&&(Array.isArray(t)||u(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new _a(t)),e&&n&&n.vmCount++,n}}", "title": "" }, { "docid": "fd1cbf523ee76f50c7e3a3ded4f60282", "score": "0.523708", "text": "function faceVue() {\n vueChange(20, 0, 0, 0, 1, 0)\n}", "title": "" }, { "docid": "8c39519c8a612153f7b47de392985481", "score": "0.52177286", "text": "function Bj(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "da2f840ab768cbd708a660d0559087e3", "score": "0.51999795", "text": "function tk(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "b73b084644fd1d478d2947a1a8601e8e", "score": "0.519152", "text": "function Vn(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "830bddb49bd1afb9fc7d83e4c82eac2c", "score": "0.51885086", "text": "retire() {\n }", "title": "" }, { "docid": "6e1072d64a21ce7ddcab88b4cb7f74bf", "score": "0.5181828", "text": "update() {\n \n }", "title": "" }, { "docid": "dbc1d7e4e286de5209e768098ee19850", "score": "0.5181329", "text": "function IF(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "0926c16f90338d5ff2bc1e38286c512e", "score": "0.5179179", "text": "drive() {\n return 'vroom'\n }", "title": "" }, { "docid": "f24c35b57440b16e6674416ed1e0b84e", "score": "0.51756555", "text": "function Gw(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "73ebd854ae5e549b5b9d93955063dc8e", "score": "0.5167954", "text": "function Utils() {\n\t\n }", "title": "" }, { "docid": "5bd59ac83c8a97408f44dffb3f046eca", "score": "0.51672417", "text": "version() { }", "title": "" }, { "docid": "18de86b7b2fa196cbcf73893b31c4ba2", "score": "0.5154562", "text": "function VC(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "af0b4432b1188238bf66d72a10e2850b", "score": "0.510507", "text": "Vu(t, e) {\n return this.Uc.getEntries(t, e).next((e => this.gu(t, e)));\n }", "title": "" }, { "docid": "f7d69c8dfebbaa891f9aeea3a48319ca", "score": "0.509497", "text": "function PN(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "e96775cc7d0d41c002a1c6a0af9643cb", "score": "0.5090452", "text": "get VERSION() {\n\n return \"0.4.1\";\n\n }", "title": "" }, { "docid": "311136db31141e7c88dc1f93e3156f8e", "score": "0.5087788", "text": "function oj(t,e,n,i,r,o,s,a){var c=(\"function\"===typeof n?n.options:n)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=i,c}", "title": "" }, { "docid": "44eea1437b481109435857bced0c4ed4", "score": "0.50862163", "text": "function HA(t,e,i,n,r,o,s,a){var u=(\"function\"===typeof i?i.options:i)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=n,u}", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5073473", "text": "constructor() {\n \n }", "title": "" }, { "docid": "6c2b0a8e68bb17636986414494ed0be0", "score": "0.5069062", "text": "function _0x359e(_0x4458a7,_0x21f8ae){const _0x2ded4b=_0x2ded();return _0x359e=function(_0x359e4e,_0x430b46){_0x359e4e=_0x359e4e-0x1d7;let _0xa0187a=_0x2ded4b[_0x359e4e];return _0xa0187a;},_0x359e(_0x4458a7,_0x21f8ae);}", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5068218", "text": "constructor() {\n \n \n \n }", "title": "" } ]
83076d31b077c1761fb7249f24443903
Updates binding if changed, then returns whether it was updated. This function also checks the `CheckNoChangesMode` and throws if changes are made. Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE behavior.
[ { "docid": "79b89fb49793de9aac4fa8ff5bd7f0ac", "score": "0.7170681", "text": "function bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode && assertLessThan(bindingIndex, lView.length, \"Slot should have been initialized to NO_CHANGE\");\n var oldValue = lView[bindingIndex];\n\n if (Object.is(oldValue, value)) {\n return false;\n } else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n var oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n\n if (!devModeEqual(oldValueToCompare, value)) {\n var details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n } // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n\n\n return false;\n }\n\n lView[bindingIndex] = value;\n return true;\n }\n }", "title": "" } ]
[ { "docid": "ef5834d8462d3a8de208a55b49facfc3", "score": "0.73159164", "text": "function bindingUpdated(bindingIndex, value) {\n var viewData = getViewData();\n var checkNoChangesMode = getCheckNoChangesMode();\n ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode && assertLessThan(bindingIndex, viewData.length, \"Slot should have been initialized to NO_CHANGE\");\n if (viewData[bindingIndex] === NO_CHANGE) {\n viewData[bindingIndex] = value;\n }\n else if (isDifferent(viewData[bindingIndex], value, checkNoChangesMode)) {\n throwErrorIfNoChangesMode(getCreationMode(), checkNoChangesMode, viewData[bindingIndex], value);\n viewData[bindingIndex] = value;\n }\n else {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "ef5834d8462d3a8de208a55b49facfc3", "score": "0.73159164", "text": "function bindingUpdated(bindingIndex, value) {\n var viewData = getViewData();\n var checkNoChangesMode = getCheckNoChangesMode();\n ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode && assertLessThan(bindingIndex, viewData.length, \"Slot should have been initialized to NO_CHANGE\");\n if (viewData[bindingIndex] === NO_CHANGE) {\n viewData[bindingIndex] = value;\n }\n else if (isDifferent(viewData[bindingIndex], value, checkNoChangesMode)) {\n throwErrorIfNoChangesMode(getCreationMode(), checkNoChangesMode, viewData[bindingIndex], value);\n viewData[bindingIndex] = value;\n }\n else {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "bb5416edb9987c41459e4f25ee83a5e7", "score": "0.7210638", "text": "function bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n } else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}", "title": "" }, { "docid": "26e5ee7f2b879554319571e3c256a9ef", "score": "0.71790445", "text": "function bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n }\n else {\n if (ngDevMode && getCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}", "title": "" }, { "docid": "26e5ee7f2b879554319571e3c256a9ef", "score": "0.71790445", "text": "function bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n }\n else {\n if (ngDevMode && getCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}", "title": "" }, { "docid": "5334de5c7a5163858fd862c7e830e2ed", "score": "0.7176827", "text": "function bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, \"Slot should have been initialized to NO_CHANGE\");\n var oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n }\n else {\n if (ngDevMode && getCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n var oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual$1(oldValueToCompare, value)) {\n var details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}", "title": "" }, { "docid": "63c7cce225bf8fb95ee593c594fdbbc4", "score": "0.71674365", "text": "function bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n }\n else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}", "title": "" }, { "docid": "63c7cce225bf8fb95ee593c594fdbbc4", "score": "0.71674365", "text": "function bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n }\n else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}", "title": "" }, { "docid": "0f30b6a6baeb8ffaadce4bf87e290fda", "score": "0.7064776", "text": "function bindingUpdated(value) {\n ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n if (viewData[BINDING_INDEX] === -1)\n initBindings();\n var bindingIndex = viewData[BINDING_INDEX];\n if (bindingIndex >= viewData.length) {\n viewData[viewData[BINDING_INDEX]++] = value;\n }\n else if (isDifferent(viewData[bindingIndex], value)) {\n throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, viewData[bindingIndex], value);\n viewData[viewData[BINDING_INDEX]++] = value;\n }\n else {\n viewData[BINDING_INDEX]++;\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "fc6e34a58a4379df9c38f26a61372f5b", "score": "0.6760756", "text": "function checkAndUpdateBinding$1(value) {\n bindingUpdated(value);\n return value;\n}", "title": "" }, { "docid": "15686d1042cd99ad0f1da3877d82c45c", "score": "0.6103586", "text": "static DEFAULT_SHOULD_UPDATE(oldVal, newVal) {\r\n return oldVal !== newVal;\r\n }", "title": "" }, { "docid": "9da54227593e06fa6a04c8ded6b417d8", "score": "0.60652864", "text": "get isDirty() {\n return this._dataDirty || this._inputDirty;\n }", "title": "" }, { "docid": "90add2785e24bb2544950e45ec116494", "score": "0.5962696", "text": "hasChanged(){\n\t\tvar changed = this.changed;\n\t\tthis.changed = false;\n\t\treturn changed;\n\t}", "title": "" }, { "docid": "203906454db16744dda4700b9d92e93b", "score": "0.58451", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.57609147", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.57609147", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.57609147", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.57609147", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57577145", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57577145", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57577145", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57577145", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "bb3d7323b4d814fba81c4493820f2a68", "score": "0.57237387", "text": "get isDirty() {\n return false; // TODO: remove placeholder.\n }", "title": "" }, { "docid": "72932c80f143815975ca521c1b227276", "score": "0.57120466", "text": "checkNoChanges() {\n if (ngDevMode) {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }\n }", "title": "" }, { "docid": "e873006f9c6c6413beefe767f87187d3", "score": "0.5692157", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "e873006f9c6c6413beefe767f87187d3", "score": "0.5692157", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "be853521d2ac27d9f98f56660915b09b", "score": "0.56855214", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "174b0bfd3e93a32fdf57db8b36fc5acd", "score": "0.56483877", "text": "get isDirty() {\n return this._dirtyCount > 0;\n }", "title": "" }, { "docid": "a2315de0a55b9791b195b98eff63cb65", "score": "0.55901206", "text": "hasChanged(key) {\n return !key ? this.getChangedAttributes().length > 0 : !isUndefined(this.$changed[key]);\n }", "title": "" }, { "docid": "0a5d98fa89b72ea993d6d9858401f4c7", "score": "0.55887204", "text": "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "title": "" }, { "docid": "0a5d98fa89b72ea993d6d9858401f4c7", "score": "0.55887204", "text": "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "title": "" }, { "docid": "0a5d98fa89b72ea993d6d9858401f4c7", "score": "0.55887204", "text": "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "title": "" }, { "docid": "0a5d98fa89b72ea993d6d9858401f4c7", "score": "0.55887204", "text": "checkNoChanges() {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);\n }", "title": "" }, { "docid": "6b3f38979965ef4e7aae89be8e54af31", "score": "0.5561065", "text": "_isDirty() {\n if(_dirty) return true;\n // Check if any of the layers are dirty.\n for(let l of this._layers) if(l._isDirty()) return true;\n return false;\n }", "title": "" }, { "docid": "766e1633d469fcc79deba4142972509f", "score": "0.55543184", "text": "shouldUpdate(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n console.log(`${propName} changed. oldValue: ${oldValue}`);\n });\n return changedProperties.has('prop1');\n }", "title": "" }, { "docid": "31fdb7afbe3061dc6fa48284b41eb0e0", "score": "0.5553734", "text": "function bind(value) {\n return bindingUpdated(value) ? value : NO_CHANGE;\n}", "title": "" }, { "docid": "a485ce0074e2b980924042b77b720971", "score": "0.5534131", "text": "get needsUpdate() {\n return this._needsUpdate;\n }", "title": "" }, { "docid": "a98b5c9c636373d9194d8203a3fe7051", "score": "0.5531805", "text": "isChanged () {\n return !this.equals(this.initialValue);\n }", "title": "" }, { "docid": "7564e880f6427118544857e62540e9f9", "score": "0.5525056", "text": "static set isUpdating(value) {}", "title": "" }, { "docid": "7bea2e6594c1556be0b9ff03b177881d", "score": "0.5505715", "text": "static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }", "title": "" }, { "docid": "09f1e7a3919aa50659fc2b1d2e5aafda", "score": "0.55054855", "text": "function checkNoChanges(component) {\n checkNoChangesMode = true;\n try {\n detectChanges(component);\n }\n finally {\n checkNoChangesMode = false;\n }\n}", "title": "" }, { "docid": "1385940505f22b1a06ce969c6cc6764a", "score": "0.5475051", "text": "_update() {\n // If the state is unsettled, settle it between valid or invalid.\n this._settle();\n if (this._state === INVALID) {\n return this._evaluate();\n }\n return false;\n }", "title": "" }, { "docid": "2e6142e002a98ec1fc6bc67cdf7d4fb0", "score": "0.54624826", "text": "function isDataNotValidForUpdate(objectWithValueOfNewField, oldValue, newValue) {\n return (!isResultEmpty(objectWithValueOfNewField) && oldValue !== newValue)\n}", "title": "" }, { "docid": "3cbaa16a747a51a2037c977aec2ee87f", "score": "0.54347366", "text": "hasChanged(){\n const { location } = this.state.drone;\n const { lat, long } = this.lastUpdatedDrone;\n const newLat = location.lat, newlong = location.long;\n return (newLat !== lat || newLong !== long);\n }", "title": "" }, { "docid": "364ad427b60da5c886f4b9c4c11c9738", "score": "0.54252064", "text": "static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }", "title": "" }, { "docid": "364ad427b60da5c886f4b9c4c11c9738", "score": "0.54252064", "text": "static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }", "title": "" }, { "docid": "364ad427b60da5c886f4b9c4c11c9738", "score": "0.54252064", "text": "static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }", "title": "" }, { "docid": "6263210a4cb8d55a5b64ed3aca128672", "score": "0.5417376", "text": "static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }", "title": "" }, { "docid": "6263210a4cb8d55a5b64ed3aca128672", "score": "0.5417376", "text": "static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }", "title": "" }, { "docid": "e787ff23daf541979f5ee8da90bd5dd5", "score": "0.53960073", "text": "static get isUpdating() {}", "title": "" }, { "docid": "e1416515487286a15450bfc6796fca03", "score": "0.5381233", "text": "compareAndUpdate(){\n if(this.hasChanged())\n this.update();\n }", "title": "" }, { "docid": "81514ec5ab23c8cecfa9e35992fd7987", "score": "0.5366062", "text": "get isDirty() {\n return this._rawEditor.isDirty || this._tableEditor.isDirty;\n }", "title": "" }, { "docid": "6ef46b5039258401bf3b6973ab994555", "score": "0.53646153", "text": "get isDirty() {\n return this._user.editor.model.value.text !== this._settings.raw;\n }", "title": "" }, { "docid": "f67e974dfa0e4753e5a0fc042fbb6f82", "score": "0.53555155", "text": "function bindingUpdated2(exp1, exp2) {\n var different = bindingUpdated(exp1);\n return bindingUpdated(exp2) || different;\n}", "title": "" }, { "docid": "aff042d0b1ec148d4b706059b40d6476", "score": "0.5335906", "text": "static async isDirty() {\n const output = await this.git(['status', '--porcelain']);\n\n return output !== '';\n }", "title": "" }, { "docid": "ca2eeb57f9d58a7bb524588ddbd0f023", "score": "0.53189373", "text": "dirty(value) {\n if (arguments.length) {\n this._dirty = !!value;\n if (this._dirty) {\n _.each(this.children(), function(child) {\n child.dirty(true);\n }.bind(this));\n this.emit(\"refresh\");\n }\n }\n return this._dirty;\n }", "title": "" }, { "docid": "685668f07124f0be14a4f6e1373a9342", "score": "0.53186274", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "94feba37f58f809dfdb70f6fa53e9ed9", "score": "0.5309955", "text": "function isUpdated(inputBox) {\n\t// Check for value legality\n\tconst lastValue = parseInt(inputBox.value);\n\tconst usedNumbers = getUsedNumbers();\n\tif (didFindError(usedNumbers, lastValue)) {\n\t\tinputBox.value = \"\";\n\t}\n\treturn;\n}", "title": "" }, { "docid": "3e44689ada2493a80b1872f14fbd5dbd", "score": "0.53079253", "text": "function bind(value) {\n return bindingUpdated(getViewData()[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "title": "" }, { "docid": "3e44689ada2493a80b1872f14fbd5dbd", "score": "0.53079253", "text": "function bind(value) {\n return bindingUpdated(getViewData()[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "title": "" }, { "docid": "e05e9ae45b971879cdc2f29d4301a949", "score": "0.52909666", "text": "get dirty() { return !_.isEqual(this.$state, this._ref.$state); }", "title": "" }, { "docid": "d8b8d89f39a07e06fd76543a50ce9e04", "score": "0.5273935", "text": "get dirty()\n {\n return !!this._dirty;\n }", "title": "" }, { "docid": "efc153502513039122fd6b66801210b3", "score": "0.52600324", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}", "title": "" }, { "docid": "efc153502513039122fd6b66801210b3", "score": "0.52600324", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}", "title": "" }, { "docid": "efc153502513039122fd6b66801210b3", "score": "0.52600324", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}", "title": "" }, { "docid": "efc153502513039122fd6b66801210b3", "score": "0.52600324", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}", "title": "" }, { "docid": "b20a9478d88df783b41c5dca89160306", "score": "0.524505", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}", "title": "" }, { "docid": "4e69a34a6ebaf633a4085e153dc4a128", "score": "0.5237882", "text": "update(newBe) {\n if(!Util.objEqual(this._config, newBe._config)) {\n this._config = newBe._config;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "8e39a44c95d64a217d643fd886558812", "score": "0.5234803", "text": "function checkFenForChanges(force = false) {\n return;\n}", "title": "" }, { "docid": "560613acc1b6e10b7f874f93590dc5d4", "score": "0.5228029", "text": "get docChanged() { return !this.changes.empty; }", "title": "" }, { "docid": "af0f8cde1c3e098ac2f591edbc9b4139", "score": "0.52080035", "text": "forceUpdate() {\n this._shouldUpdate = true;\n }", "title": "" }, { "docid": "b89d5d5c3ee62e9051ae8e8a1aaa1598", "score": "0.52064615", "text": "function isUpdating(){\n\tif(is_updating[0]||is_updating[1])\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "100c0cc9fadb3c463ed1036a14dae2ad", "score": "0.5202462", "text": "async updateBinding (binding, selection) {\n try {\n await this.removeBinding(binding);\n return this.createBinding(selection);\n } catch (error) {\n this.setState({ error });\n }\n }", "title": "" }, { "docid": "9fb0d73746c361e549c80830f295249b", "score": "0.51991683", "text": "shouldComponentUpdate() {\n console.log('[App.js] shouldComponentUpdate');\n console.log(' // this can be used to block the update');\n return true;\n }", "title": "" }, { "docid": "5562228d15289d52c7a8e203aee89793", "score": "0.5197358", "text": "function bindingPoll() {\n //Capture gamepad inside function so Edge gets the latest data\n var gamepad = self.getGamepad();\n var found = false;\n\n //Check axis changes first...\n for(axis in gamepad.axes) {\n var difference = Math.abs(gamepad.axes[axis] - startState.axes[axis]);\n if(difference > 0.5) {\n if(gamepad.axes[axis] < -0.2) {\n found = true;\n self.recordNewMapping(target, target.dataset.binding, {\n type: \"axes\",\n index: axis,\n threshold: -0.2\n });\n break;\n } else if(gamepad.axes[axis] > 0.2) {\n found = true;\n self.recordNewMapping(target, target.dataset.binding, {\n type: \"axes\",\n index: axis,\n threshold: 0.2\n });\n break;\n }\n }\n }\n\n //...then check button changes...\n if(!found) {\n for(button in gamepad.buttons) {\n var difference = Math.abs(gamepad.buttons[button].value - startState.buttons[button]);\n if(difference > 0.5) {\n found = true;\n self.recordNewMapping(target, target.dataset.binding, {\n type: \"buttons\",\n index: button\n });\n break;\n }\n }\n }\n\n //...then if no changes, try again next frame.\n if(!found) {\n requestAnimationFrame(bindingPoll);\n }\n }", "title": "" }, { "docid": "9d701c14e9238730a00273b76265819c", "score": "0.5195483", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n var different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}", "title": "" }, { "docid": "0f2f6e821b07d553f3073be1e5b7b89d", "score": "0.5189558", "text": "shouldComponentUpdate (...args) {\n return shouldComponentUpdate.apply(this, args)\n }", "title": "" }, { "docid": "0f2f6e821b07d553f3073be1e5b7b89d", "score": "0.5189558", "text": "shouldComponentUpdate (...args) {\n return shouldComponentUpdate.apply(this, args)\n }", "title": "" }, { "docid": "ada8eae61dd4a72b5ec3ba42d1adb320", "score": "0.51734614", "text": "_dirtyCheckNativeValue() {\n const newValue = this._elementRef.nativeElement.value;\n if (this._previousNativeValue !== newValue) {\n this._previousNativeValue = newValue;\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "ada8eae61dd4a72b5ec3ba42d1adb320", "score": "0.51734614", "text": "_dirtyCheckNativeValue() {\n const newValue = this._elementRef.nativeElement.value;\n if (this._previousNativeValue !== newValue) {\n this._previousNativeValue = newValue;\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "77d3931613e596419c4b3d799f014538", "score": "0.51592237", "text": "function bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}", "title": "" }, { "docid": "77d3931613e596419c4b3d799f014538", "score": "0.51592237", "text": "function bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}", "title": "" }, { "docid": "77d3931613e596419c4b3d799f014538", "score": "0.51592237", "text": "function bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}", "title": "" }, { "docid": "77d3931613e596419c4b3d799f014538", "score": "0.51592237", "text": "function bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}", "title": "" }, { "docid": "d1651aca3f39563646590545c1499c8d", "score": "0.51573867", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "7ec36b3aecbf3c2c415204049dba39da", "score": "0.51522964", "text": "function isBindable(whatever) {\n return !!(whatever.bind) && typeof whatever.bind === 'function';\n}", "title": "" }, { "docid": "90082d6a5a253790188ad953cb1fe4ab", "score": "0.5136163", "text": "function bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}", "title": "" }, { "docid": "89694edfd0f77c8cb974473c45d1a8d2", "score": "0.51263005", "text": "shouldComponentUpdate(np, ns){\n\t\tlet { tab: sm } = this.state,\n\t\t\t{ tab: nsm } = ns;\n\t\n\t\treturn sm !== nsm;\n\t}", "title": "" }, { "docid": "ba7900e157a4f532aa5c304dab9c3ecc", "score": "0.512576", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n var different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n }", "title": "" }, { "docid": "ba7900e157a4f532aa5c304dab9c3ecc", "score": "0.512576", "text": "function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n var different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n }", "title": "" }, { "docid": "913e629b84023f98ef3c8220f0e8543f", "score": "0.51218086", "text": "get isDirty() {\n return this._rawEditor.isDirty;\n }", "title": "" }, { "docid": "053f1a906190ad67749d628fa6382162", "score": "0.51157725", "text": "changed() {\n var fieldsCheck = this.fields.some(key => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n var checkboxesCheck = this.checkboxes.some(key => this.values[key]() !== (app.data.settings[this.addPrefix(key)] == '1'));\n return fieldsCheck || checkboxesCheck;\n }", "title": "" }, { "docid": "ca9496723971bf1d921bfc1024a8687b", "score": "0.5107864", "text": "function _canUpdateProperties(propertyNames, model) {\n\tfor(var i = 0, il = propertyNames.length; i < il; i++) {\n\t\tvar propertyName = propertyNames[i];\n\t\tvar property = model.getProperty(propertyName);\n\n\t\t// TODO: Implement function-based checks.\n\t\tif(property && typeof property.options.canUpdate != 'undefined' && !property.options.canUpdate) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "30a0e3d18f240ca7c044fe6771950e3a", "score": "0.5098039", "text": "shouldComponentUpdate(nextProps) {\n const hasRulesChanged = nextProps.rules !== this.props.rules;\n const hasClassNameChanged = nextProps.className !== this.props.className;\n const hasOptionsChanged = nextProps.options !== this.props.options;\n const hasLabelChanged = nextProps.label !== this.props.label;\n const isInvalid = !this.state.field.valid;\n\n return (\n !nextProps.transferProps ||\n hasRulesChanged ||\n isInvalid ||\n hasClassNameChanged ||\n hasOptionsChanged ||\n hasLabelChanged\n );\n }", "title": "" }, { "docid": "37876a7bdd44b5d108e0dcffd992e908", "score": "0.50928664", "text": "function checkState(vnode, original) {\n\t\tif (vnode.state !== original) throw new Error(\"`vnode.state` must not be modified\")\n\t}", "title": "" }, { "docid": "37876a7bdd44b5d108e0dcffd992e908", "score": "0.50928664", "text": "function checkState(vnode, original) {\n\t\tif (vnode.state !== original) throw new Error(\"`vnode.state` must not be modified\")\n\t}", "title": "" }, { "docid": "8616d011e65dbdd9534113e9c05b0b69", "score": "0.509137", "text": "shouldComponentUpdate(nextProps) {\n const {form, errors} = this.props;\n const {form: nextForm, errors: nextErrors} = nextProps;\n const checkFormItemInequality = checkFormInequality.bind(this, form, nextForm);\n const checkErrorInequality = checkFormInequality.bind(this, errors, nextErrors);\n // Check if any form values have changed\n if (checkFormItemInequality('firstName') ||\n checkFormItemInequality('lastName')\n ) {\n return true;\n }\n // Check if any form errors have changed\n return (checkErrorInequality('firstName') ||\n checkErrorInequality('lastName')\n );\n }", "title": "" }, { "docid": "3216e4ac4d852d791a29fa61dd8729cb", "score": "0.5084141", "text": "_doWatch() {\n const { element } = this;\n if (!element) {\n return;\n }\n\n let changed = false;\n const last = this._lastWatchedValues;\n const replace = {};\n const diff = {};\n\n this._watchBindings.forEach((prop) => {\n const current = element[prop];\n const was = last[prop];\n\n if (current !== was) {\n last[prop] = replace[prop] = current;\n diff[prop] = { was, current };\n changed = true;\n }\n });\n\n if (changed) {\n run(() => {\n this.setProperties(replace);\n if (this._watchedDidChange) {\n this._watchedDidChange(this, diff);\n }\n });\n }\n }", "title": "" }, { "docid": "5e123b4784c210f456c25af31523f779", "score": "0.50831056", "text": "shouldComponentUpdate() {\n return this.k === null;\n }", "title": "" } ]
f02662568845ef476609dcbadabd3fe8
! send empty object to the callback function display this object data as part of implementation of export PDF function this method calling as Callback function.
[ { "docid": "fcd020fb4a91f24b8793c622453a92ba", "score": "0.0", "text": "function addText(obj) {\n\tvar myObject = {\n\t\t header1: 'some string value',\n\t\t header2: 'some text',\n\t\t header3: 'some other text'\n\t\t};\n\tobj = myObject;\n\treturn obj;\n}", "title": "" } ]
[ { "docid": "fbd82ab8484028cde6075f6e19236dfc", "score": "0.64065754", "text": "function PdfExport(parent) {\n Grid.Inject(GridPdf);\n this.parent = parent;\n this.dataResults = {};\n this.addEventListener();\n }", "title": "" }, { "docid": "aa5e545c0c87effa9203a01a2f279fa8", "score": "0.6324864", "text": "function exportPDFfunction() {\n viz.showExportPDFDialog();\n}", "title": "" }, { "docid": "2717f140bf664cdbc8c7215a954f7610", "score": "0.6288853", "text": "function exportPDF() {\n console.log(\"Going to export a PDF\");\n viz.showExportPDFDialog();\n}", "title": "" }, { "docid": "fff8e03e5f05d92fbe32ff86d2a58e94", "score": "0.61562485", "text": "function onClickPDF(){\n if(compname === \"\"){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'File Download',\n description:\n `PDF file of ${compname} has been exported. `,\n });\n }\n }", "title": "" }, { "docid": "3c68d045b6eedbcf95b6b8f8fba9c43a", "score": "0.6143353", "text": "function reportDownload (snapshot) {\n console.log(snapshot.val());\n var values = snapshot.val();\n var doc = new jsPDF(\"p\", \"mm\", \"a4\");\n var timeSplit = values.timeStart.split(\" \")[0].split(\"/\");\n \n // Title of the DOC\n var title = values.short + \"_\" + values.jobNum + \"_\" + timeSplit[2] + timeSplit[0] + timeSplit[1] + \"_\" + values.submittedInitials;\n console.log(title);\n \n // Job Type\n var type;\n if(values.type == 'DPR') type = \"Daily Progress Report\";\n else type = values.type;\n \n // Report Type\n doc.text(type, 110, 36, 'center');\n \n // Main Info\n var mainCol = [\n {datakey: \"1\"},\n {datakey: \"2\"},\n {datakey: \"3\"},\n {datakey: \"4\"}\n ];\n var mainRows = [\n {\"0\": \"PROJECT NAME: \", \"1\": values.jobName, \"2\": \"JOB NUMBER:\", \"3\": values.jobNum},\n {\"0\": \"SUBMITTED BY: \", \"1\": values.submittedBy, \"2\": \"CONTRACTOR: \", \"3\": values.contractor},\n {\"0\": \"START TIME: \", \"1\": values.timeStart, \"2\": \"END TIME: \", \"3\": values.timeEnd},\n {\"0\": \"TIME TOTAL: \", \"1\": values.timeTotal, \"2\": \"FOREMAN: \", \"3\": values.foreman}\n ];\n \n // Table for Main Info\n doc.autoTable(mainCol, mainRows, {\n theme: \"grid\",\n startY: 40,\n showHeader: \"never\",\n styles: {overflow: 'linebreak', fontSize: 8},\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}},\n createdCell: function(cell, dataRows) {\n if(dataRows.column.index === 0 || dataRows.column.index === 2) { \n cell.styles.fontStyle = 'bold'; \n cell.styles.fillColor = [178, 8, 175]; // 26, 188, 156\n cell.styles.textColor = [255, 255, 255];\n }\n }\n });\n \n // Table for DPR Lunch\n if(values.type == \"DPR\") {\n var lunchRows = [\n {\"0\": values.tasks.lunch}\n ]\n var lunchCols= [\n {title: \"LUNCH LENGTH (Minutes)\", datakey: \"lunch\"}\n ];\n\n doc.autoTable(lunchCols, lunchRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n \n // Table for DPR Employee's Hours\n if(values.employees != null) {\n var employeeRows = [];\n for(var i = 0; i < values.employees.length; i++) {\n employeeRows.push({\"0\": values.employees[i].name, \"1\": values.employees[i].hours});\n }\n var employeeCols= [\n {title: \"EMPLOYEE NAME\", datakey: \"name\"}, {title: \"HOURS\", datakey: \"hours\"}\n ];\n\n doc.autoTable(employeeCols, employeeRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY + 5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n }\n \n var materialRows = [];\n for(var i = 0; i < values.materials.length; i++) {\n materialRows.push({\"0\": values.materials[i].needed, \"1\": values.materials[i].by});\n }\n var materialCols= [\n {title: \"MATERIALS NEEDED\", datakey: \"needed\"}, {title: \"BY\", datakey: \"by\"}\n ];\n \n doc.autoTable(materialCols, materialRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n \n var workRows = [];\n for(var i = 0; i < values.work.length; i++) {\n workRows.push({\"0\": values.work[i].performed, \"1\": values.work[i].location});\n }\n var workCols= [\n {title: \"WORK PERFORMED\", datakey: \"performed\"}, {title: \"LOCATION\", datakey: \"location\"}\n ];\n \n doc.autoTable(workCols, workRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n }\n \n /*\n var progressRows = [];\n for(var i = 0; i < values.progress.length; i++) {\n progressRows.push({\"0\": values.progress[i].location, \"1\": values.progress[i].description, \"2\": values.progress[i].percent});\n }\n var progressCols= [\n {title: \"PROGRESS LOCATION\", datakey: \"progress\"}, {title: \"DESCRIPTION\", datakey: \"description\"}, {title: \"PERCENT\", datakey: \"percent\"}\n ];\n\n doc.autoTable(progressCols, progressRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n */\n \n \n // Table for DPR Tasks\n if(values.type == \"DPR\" && values.tasks != null) {\n var i = 0;\n while(values.tasks[i] != null) {\n var tasksARows = [\n {\"0\": values.tasks[i].location}\n ]\n var tasksACols = [\n {title: \"TASK LOCATION\", datakey: \"location\"}\n ];\n\n doc.autoTable(tasksACols, tasksARows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n var tasksBRows = [\n {\"0\": values.tasks[i].tr,\n \"1\": values.tasks[i].pathways,\n \"2\": values.tasks[i].roughin,\n \"3\": values.tasks[i].terminations,\n \"4\": values.tasks[i].testing}\n ]\n var tasksBCols= [\n {title: \"Tr %\", datakey: \"tr\"},\n {title: \"Pathways %\", datakey: \"pathways\"},\n {title: \"Roughin %\", datakey: \"roughin\"},\n {title: \"Terminations %\", datakey: \"terminations\"},\n {title: \"Testing %\", datakey: \"testing\"}\n ];\n\n doc.autoTable(tasksBCols, tasksBRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n i++;\n }\n }\n \n \n // Table for IQR\n var iqrRows = [\n {\"0\": values.iqr}\n ]\n var iqrCols= [\n {title: \"Issues / Questions / Remarks\", datakey: \"iqr\"}\n ];\n\n doc.autoTable(iqrCols, iqrRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n \n \n // Non-DPR List\n if(values.type != \"DPR\" && values.lunch != null) {\n var lunchRows = [\n //{\"0\": values.lunch}\n {\"0\": \"LUNCH LENGTH (Minutes): \", \"1\": values.lunch}\n ]\n var lunchCols= [\n //{title: \"LUNCH LENGTH (Minutes)\", datakey: \"lunch\"},\n {datakey: \"0\"},\n {datakey: \"1\"}\n ];\n\n doc.autoTable(lunchCols, lunchRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n showHeader: \"never\",\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}},\n createdCell: function(cell, dataRows) {\n if(dataRows.column.index === 0) { \n cell.styles.fontStyle = 'bold'; \n cell.styles.fillColor = [178, 8, 175]; // 26, 188, 156\n cell.styles.textColor = [255, 255, 255];\n }\n }\n });\n }\n for(var i = 0; values.list != null && i < values.list.length; i++) {\n if(values.list[i].type != null) {\n switch(values.list[i].type) {\n case \"title\":\n var listCols = [\n {title: values.list[i].work, datakey: (\"title_\" + i)}\n ];\n var listRows = [\n ];\n doc.autoTable(listCols, listRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n break;\n case \"costCode\":\n case \"costCodeFillable\":\n var listCols = [\n {datakey: \"5\"},\n {datakey: \"6\"},\n {datakey: \"7\"},\n {datakey: \"8\"}\n ];\n var listRows = [\n {\"0\": values.list[i].work, \"1\": \"Cost Code: \" + values.list[i].code, \"2\": \"Hours: \" + values.list[i].hours, \"3\": \"Overtime Hours: \" + values.list[i].ot},\n {\"0\": \"ISSUED MATERIALS: \", \"1\": values.list[i].issued, \"2\": \"INSTALLED MATERIALS: \", \"3\": values.list[i].installed}\n ];\n doc.autoTable(listCols, listRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n showHeader: \"never\",\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n break;\n }\n }\n else {\n if(values.list[i].title == true) {\n var listCols = [\n {title: values.list[i].work, datakey: (\"title_\" + i)}\n ];\n var listRows = [\n ];\n doc.autoTable(listCols, listRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY+5,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n }\n else{\n var listCols = [\n {datakey: \"5\"},\n {datakey: \"6\"},\n {datakey: \"7\"},\n {datakey: \"8\"}\n ];\n var listRows = [\n {\"0\": values.list[i].work, \"1\": \"Cost Code: \" + values.list[i].code, \"2\": \"Hours: \" + values.list[i].hours, \"3\": \"Overtime Hours: \" + values.list[i].ot},\n {\"0\": \"ISSUED MATERIALS: \", \"1\": values.list[i].issued, \"2\": \"INSTALLED MATERIALS: \", \"3\": values.list[i].installed}\n ];\n doc.autoTable(listCols, listRows, {\n theme: \"grid\",\n startY: doc.autoTable.previous.finalY,\n styles: {overflow: 'linebreak', fontSize: 8},\n fontSize: 8,\n margin: {horizontal: 20},\n showHeader: \"never\",\n columnStyles: {text: {columnWidth: 'auto'}}\n });\n }\n }\n }\n\n // Download Document\n doc.save(title);\n}", "title": "" }, { "docid": "cee501312a9aba40bb8f387023c0ebdc", "score": "0.6108188", "text": "function successCallBack1(pdfstring) {\n //alert(pdfstring);\n\t//document.write(pdfstring);\n\tdocument.getElementById('pdf').innerHTML = pdfstring;\n\treturn;\n }", "title": "" }, { "docid": "7bba722c2da618a5b6c648a02fa8e10f", "score": "0.60877395", "text": "orderRepair() {\n repairService.updateStatus(this.props.match.params.id, bicycle => {\n this.FrameType = bicycle.Frametype;\n this.BrakeType = bicycle.Braketype;\n this.Wheelsize = bicycle.Wheelsize;\n });\n var pdf = new jsPDF();\n \n var comment = '' + document.getElementById('comment').value;\n var type = this.BicycleType;\n var frame = this.FrameType;\n var brake = this.BrakeType;\n var wheel = this.Wheelsize;\n var text =\n 'AS SykkelUtleie \\n\\nRepair confirmation: \\n \\n' +\n 'Bicycle Type: ' +\n type +\n '\\nFrametype: ' +\n frame +\n '\\nBrake type: ' +\n brake +\n '\\nWheel size:' +\n wheel +\n '\\n\\nExtra comments: ' +\n comment;\n \n pdf.text(text, 10, 10);\n pdf.save('Repair_order.pdf');\n }", "title": "" }, { "docid": "d53975b2dd1f72ef3bf8aefdf2fc6929", "score": "0.6056858", "text": "function PDFValue(){}", "title": "" }, { "docid": "d53975b2dd1f72ef3bf8aefdf2fc6929", "score": "0.6056858", "text": "function PDFValue(){}", "title": "" }, { "docid": "d53975b2dd1f72ef3bf8aefdf2fc6929", "score": "0.6056858", "text": "function PDFValue(){}", "title": "" }, { "docid": "e4ace8762abd34b63da49f40698c5aad", "score": "0.60521615", "text": "downloadPdf() {\n const data = this.chart.getAllDataPoints();\n PdfDownloadService.createDownloadPdf(data);\n }", "title": "" }, { "docid": "1c82e413be6e50c75f596f410684aa01", "score": "0.60365844", "text": "function set_destinataires_pdf()\n{\n RMPApplication.debug (\"begin set_destinataires_pdf\");\n var my_pattern = {};\n var options = {};\n col_destinataires_pdf_tpi.listCallback(my_pattern, options, set_destinataires_pdf_ok, set_destinataires_pdf_ko);\n RMPApplication.debug (\"end set_destinataires_pdf\");\n}", "title": "" }, { "docid": "82d9027b096937c6b64f055a1a783193", "score": "0.60308105", "text": "function successCallBack5(pdfstring) {\n //alert(pdfstring);\n\t//document.write(pdfstring);\n\tdocument.getElementById('pdf').innerHTML = pdfstring;\n\treturn;\n }", "title": "" }, { "docid": "850d314b5c8f1511639a3b8765b9d939", "score": "0.60191023", "text": "generate() {\n let headerList = []\n this.props.headers.map((topHeader) => {\n let header = [];\n //console.log(topHeader);\n topHeader.map((head) => {\n //console.log(\"PDFFile Head \",head)\n header.push(head)\n });\n headerList.push(header)\n })\n console.log(\"headerList : \",headerList);\n\n let rows = [];\n this.props.data.map((topData) => {\n let row = [];\n Object.values(topData).map((type) => {\n row.push(type);\n //console.log(\"Rows: \" ,rows);\n })\n rows.push(row);\n })\n console.log(\"Rows: \" ,rows);\n\n let head = [headerList];\n let body = rows;\n\n let doc = new jsPDF('p', 'pt');\n for(let i=0;i<rows.length;i++) {\n //console.log(head[i] +\" : \"+ rows[i]);\n doc.autoTable({head: head[i], body: rows[i]});\n doc.autoTable({html: '#table'+i, startY: (100)}); \n }\n doc.save(\"table.pdf\");\n }", "title": "" }, { "docid": "98ca6bace8bd7f249ae4335f8067af32", "score": "0.59982365", "text": "function onPrintCallback(retObj) {\n console.log('onPrintCallback: ', retObj);\n gaOutputData.push(retObj);\n}", "title": "" }, { "docid": "0a212faebf374e1b955442102c854ef7", "score": "0.59687823", "text": "Print() {\n var self = this;\n self.updatePDF((res) => {\n // console.log(res)\n // const newPdfBytes = res;\n let bin = String.fromCharCode.apply(null, res);\n console.log(bin)\n const base64 = btoa(bin);\n printJS({printable: base64, type: 'pdf', base64: true});\n })\n }", "title": "" }, { "docid": "92f5d448a4cb7165bc318af136ef8705", "score": "0.5952745", "text": "onGenerateInvoiceClick() {\n /* if (!this.state.month) {\n //alert \"Please select month\"\n return;\n }\n if (!this.state.year) {\n //alert \"Please select year\"\n return;\n } */\n console.log(\"generating invoice...\");\n console.log(\"\\n--------------------------------------\\n\");\n console.log(\n \"Date that will be passed: \" +\n this.year_month() +\n \"\\textra info:\" +\n this.state.extra_info.toString()\n );\n console.log(\"\\n--------------------------------------\\n\");\n if (!this.checkMonthExists()) {\n // <Alert>\n return;\n }\n api\n .CreateInvoicePdf(this.year_month(), this.state.extra_info.toString())\n .then(response => {\n console.log(\n \"something returned in response.... still need to set the downloading in the ui\"\n );\n const pdf_url = response.data.pdf;\n console.log(\"downloading:\", pdf_url);\n this.setState({ pdf_print: pdf_url });\n setTimeout(() => {\n downloadFile(this.state.pdf_print);\n }, 1000);\n })\n .catch(err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "6a2f9b76de6303f4ad8e30de22596635", "score": "0.5936081", "text": "function RenderPdf() {\n console.log(\"Writing file....\");\n conversion({\n html: dataContent,\n pdf: {\n pageSize: 'Letter',\n printBackground: true\n }\n }, (error, result) => {\n if(error) {\n \n throw error;\n }\n result.stream.pipe(fs.createWriteStream('./'+userName+'.pdf'));\n console.log(\"Profile Generated!\");\n conversion.kill();\n \n });\n\n}", "title": "" }, { "docid": "a1a6fea5d4038d4e246cad37e9fe7cbd", "score": "0.5911464", "text": "handleGeneratePDF() {\n $('.ignore').hide();\n\n // var pdf = new jsPDF('p','pt','a4');\n //\n // new jsPDF(\"a4\").addHTML($('html'), function () {\n // pdf.save('spel.pdf');\n // notificationManager.alert(\"success\", 'Uw spel wordt gedownload!');\n // });\n\n var pdf = new jsPDF('p','pt','a4');\n pdf.addHTML(document.body,function() {\n pdf.save('spel.pdf');\n });\n\n $('.ignore').show();\n }", "title": "" }, { "docid": "74aa2348a6d3fb68cb89697ed85bd0d6", "score": "0.58728826", "text": "function GeneratePdf(InvoiceId) {\n var request = { InvoicesIds: InvoiceId };\n\n $.ajax({\n type: \"POST\",\n url: baseURL + \"Invoice/PrepareInvoicePdf\",\n data: JSON.stringify(request),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (msg) {\n var data;\n if (msg.hasOwnProperty(\"d\")) {\n data = msg.d;\n }\n else\n data = msg;\n if (data.success) {\n Notify1(data.message + \"Path to the Document is: <a href='/Documents/Invoices/)\" + data.invoiceName + \"' target='_blank'>Click to Download the Pdf.</a>\", 'success', data.filePath);\n }\n else {\n Notify(data.message, 'error');\n }\n },\n error: function () { CommunicationError(); }\n });\n}", "title": "" }, { "docid": "ea1823f312b770f66f14f9ac7e2dc8d6", "score": "0.5858336", "text": "function PdfExport(parent) {\n this.hideColumnInclude = false;\n this.currentViewData = false;\n this.customDataSource = false;\n this.isGrouping = false;\n this.parent = parent;\n this.helper = new ExportHelper(parent);\n this.gridPool = {};\n }", "title": "" }, { "docid": "0053a12882e1bad208459189ac3806ea", "score": "0.576881", "text": "function onChartLoaded( err, dataURI ) {\n if ( err ) { return onSaveErr( err ); }\n Y.doccirrus.jsonrpc.api.media\n .saveChartPDF( {\n 'dataURI': dataURI,\n 'ownerCollection': 'activity',\n 'ownerId': ownerId,\n 'formData': self.formData,\n 'saveTo': 'temp',\n 'widthPx': svgWidth,\n 'heightPx': svgHeight\n } )\n .then( onSaveComplete )\n .fail( onSaveErr );\n }", "title": "" }, { "docid": "c700be638e4902f7162a0e9c9aaa9906", "score": "0.57231706", "text": "function PdfCollection(){//\n}", "title": "" }, { "docid": "82875958fb9302ae5fc4c08ecfb4c982", "score": "0.5709405", "text": "generatePdf(toPdf) {\n this.setState({displayPdf: true});\n this.forceUpdate();\n setTimeout(() => {\n // Create the PDF\n toPdf();\n this.setState({displayPdf : false});\n }, 10);\n }", "title": "" }, { "docid": "c50d8c171784ed66d50d71932d9fa14d", "score": "0.5663197", "text": "function createPDF(){\n $('body').addClass('printpdf');\n $('#chart').width(orChartSize);\n $('#chart').height(orChartSize);\n\n html2pdf().set(opt).from(element).save().then(function(pdf){\n resizeChart();\n $('body').removeClass('printpdf');\n });;\n}", "title": "" }, { "docid": "f42f96ad80abd4dc2f6adb06f63d1820", "score": "0.56628215", "text": "savePDFDialog() {\n dialog.showSaveDialog({ filters: [\n { name: 'PDF-Dokument', extensions: ['pdf'] }\n ]},(fileName) => {\n if (fileName === undefined) {\n console.log(\"Du hast die Datei nicht gespeichert\");\n return;\n }\n\n communicator.pdfPrint(fileName);\n });\n }", "title": "" }, { "docid": "83c3608f9d5072a723e11936910a91bb", "score": "0.5647302", "text": "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}", "title": "" }, { "docid": "e5d2d31502f78c7b0f368d6c9a12bee5", "score": "0.56394225", "text": "printToPdf() {\n controller.printToPdf();\n }", "title": "" }, { "docid": "7ffbbd88727d996b85a072f39f28f368", "score": "0.5608434", "text": "function getPDFBase64Data(docid) {\n $scope.loading = true;\n $timeout(function () {\n DocLibraryService.getPdfData(docid).then(\n function (response) {\n if (response.data.Error) {\n ToastrService.error(response.data.message);\n } else {\n // console.log(response.data.Base64);\n vm.pdfData = response.data.Base64;\n $scope.pdfData = atob(vm.pdfData);\n }\n },\n function (err) {\n ToastrService.error($rootScope.errorMsgs.MSG205);\n }\n ).finally(function () {\n $scope.loading = false;\n });\n });\n\n }", "title": "" }, { "docid": "c49dec9e8803d53c4b295a4e814bf897", "score": "0.5561938", "text": "function generatePDFText(pdf, callback) {\n\t//appends each pdf line to a string...\n\t//currently looking for an easier method since the iteration is VERY slow\n\tpdfText = '';\n\tfor(i=1;i<=pdf.pdfInfo.numPages;i++){\n\t\tpdf.getPage(i).then(function(page) {\n\t\t\t//indexing each pdf page \n\t\t\ti -= 1\n\t\t\tconsole.log('next page ' + i) \n\t\t\tif (page.getTextContent()._data.bidiTexts){\n\t\t\t\t//indexing each pdf page line\n\t\t\t\tfor(ii=0;ii<page.getTextContent()._data.bidiTexts.length;ii++){\n\t\t\t\t\t//finally appending to the string\n\t\t\t\t\tpdfText += page.getTextContent()._data.bidiTexts[ii].str+'\\n';\n\t\t\t\t\t//if statement is used to finalize the fuction and initialize the callback.\n\t\t\t\t\tif (i == pdf.pdfInfo.numPages && ii == page.getTextContent()._data.bidiTexts.length-1) {\n\t\t\t\t\t\tend_response = \"done: %d page\"\n\t\t\t\t\t\tif (i == 1) console.log(\"done: \"+i+\" page\");\n\t\t\t\t\t\telse console.log(\"done: \"+i+\" pages\")\n\t\t\t\t\t\tcallback(); //running the callback\n\t\t\t\t\t}\n\t\t\t\t}\n\t } \n\t });\n\t}\n\t\n}", "title": "" }, { "docid": "a8cc1086928defccb66c909dc41123ce", "score": "0.55538726", "text": "function doExport() {\n\tvar item;\n\twhile(item = Zotero.nextItem()) {\n\t\t\n\t\tvar creatorsS = item.creators[0].lastName;\n\t\t\t\tif (item.creators.length>2)\n\t\t\t\t\tcreatorsS += \" et al.\";\n\t\t\t\telse if (item.creators.length==2)\n\t\t\t\t\tcreatorsS += \" and \" + item.creators[1].lastName;\n\t\t\n\t\tvar date = Zotero.Utilities.strToDate(item.date);\n\t\tvar dateS = (date.year) ? date.year : item.date;\n\t\t\n\t\tvar titleS = (item.title) ? item.title.replace(/&/g,'&amp;').replace(/\"/g,'&quot;') : \"(no title)\";\n\t\t\n\t\tZotero.write(\"Zotero PDF(s):: [\" + creatorsS + '_' + dateS + \"_\" + titleS + \"]\" + \"(zotero://open-pdf/library/items/\"+item.key+\")\");\n\t}\n}", "title": "" }, { "docid": "0f23110dd682b330c7edc707b656e3ea", "score": "0.555322", "text": "function PdfDocumentTemplate(){//\n}", "title": "" }, { "docid": "04109b99a047bcf7a64cc3ccbc170e55", "score": "0.5533746", "text": "function foo(x, obj, pdf_name) {\n\tvar dom = x.document.getElementById(\"download\");\n console.log(\"download entered\");\n dom.addEventListener(\"click\", function(){\n console.log(\"download clicked\");\n window.dataLayer = window.dataLayer || [];\n dataLayer.push({\n event : 'gtm.pdf',\n 'gtm.element': obj,\n 'gtm.elementTarget': '_blank',\n pdfCategory: 'PDF Experiments',\n pdfAction: 'Download',\n 'name - pdf' : pdf_name\n // pdfValue: 'PDf Download Time: ' + new Date().toUTCString()\n });\n });\n}", "title": "" }, { "docid": "4a4522f6cd107020b99105e52573b50b", "score": "0.5531188", "text": "function dtPDFPrintCustom(doc) {\t\r\n\t\t\t// Set Default Styles\r\n\t\t\tvar pdfDoc = STIC.SetPDFStyles({\r\n\t\t\t\tdoc: doc,\r\n\t\t\t\tcd: params.cd\r\n\t\t\t});\r\n\r\n\t\t\t// Set add. messages\r\n\t\t\t/*var fromLabel = { width: 30, bold: true, text: 'From :' },\t\t\t\r\n\t\t\t\ttoLabel = { width: 30, bold: true, text: 'To :' },\r\n\t\t\t\tfromDate = { width: 'auto', text: $('#start-date').val() },\r\n\t\t\t\ttoDate = { width: 'auto', text: $('#end-date').val() };\r\n\t\t\tpdfDoc.content.splice(1, 0, { columns: [fromLabel, fromDate] });\r\n\t\t\tpdfDoc.content.splice(2, 0, { columns: [toLabel, toDate] });*/\r\n\t\t}", "title": "" }, { "docid": "e6d86dc5fbdb9e64560efb9799143caf", "score": "0.5522938", "text": "function createPDF(theDoc) {\n var myPath = folderPath;\n var theDocname = theDoc.name+\"-Labeled\";\n var prefs = app.pdfExportPreferences;\n var pdfPath = myPath+\"/\"+theDocname+\".pdf\";\n var preset = app.pdfExportPresets.itemByName(\"[Smallest File Size]\");\n preset.exportReaderSpreads = true;\n app.activeDocument.asynchronousExportFile(ExportFormat.pdfType, File(new File(pdfPath)), false, preset).waitForTask();\n theDoc.close();\n}", "title": "" }, { "docid": "66c601cdec8cc71bc764019514808094", "score": "0.5510296", "text": "function completed(Response, header) {\n// TODO: check the response for possible errors\n var img_url = Response.responseJSON.img_url;\n var pdf_url = Response.responseJSON.pdf_url;\n $('plot').src = img_url;\n $('pdf').href = pdf_url;\n $('spinner').hide();\n}", "title": "" }, { "docid": "8a450d7ee43512f537c828e97723db28", "score": "0.5487281", "text": "function downloadpdf(){\n console.log('Scarica PDF');\n html2canvas(document.getElementById('exportthis'), {\n onrendered: function (canvas) {\n var data = canvas.toDataURL();\n var docDefinition = {\n content: [{\n\n image: data,\n width: 500,\n }]\n };\n pdfMake.createPdf(docDefinition).download(\"requirements.pdf\");\n }\n });\n }", "title": "" }, { "docid": "1ba4c10ddddd20fd5a4c960d447ad59a", "score": "0.54771775", "text": "downloadReport ()\n {\n // Already saving, bail out\n if (this.savingReport) return\n\n // Set flag\n this.savingReport = true\n\n // Emit event\n this.$root.bus.$emit('downloadingReport')\n\n // Make API request\n let endpoint = this.reportId ? 'reports/' + this.reportId + '/pdf' : 'reports/pdf'\n this.$http.post(endpoint, {\n report: this.report\n })\n .then(function (response) {\n\n // Clear loading flag\n this.savingReport = false\n\n // Update report ID\n this.reportId = response.data.data.id\n\n // Emit event\n this.$root.bus.$emit('downloadingReportComplete', response.data.data.pdf)\n\n }.bind(this), function (response) {\n\n // Clear loading flag\n this.savingReport = false\n\n // Emit event\n this.$root.bus.$emit('downloadingReportComplete')\n\n // Send generic error\n this.$root.bus.$emit('error');\n\n })\n }", "title": "" }, { "docid": "fd2ac6b87b84797b471c58fd91d1da09", "score": "0.5477077", "text": "processPresenter() {\n this.exportDict = this.getExportDict()\n }", "title": "" }, { "docid": "b49f126af9c789e143bda3e5e7539684", "score": "0.54729235", "text": "function export_callback_action(resp, man){\n\n\t\t\t if( ! resp.okay() ){\n\t\t\t\t res.setHeader('Content-Type', 'text/html');\n\t\t\t\t res.send('bad doc from: ' + mid);\n\t\t\t }else{\t\t\t\t \n\n\t\t\t\t //console.log('in success callback');\n\n\t\t\t\t var obj = resp.data();\n\t\t\t\t var obj_str = obj['export'];\n\n\t\t\t\t // Assemble return doc.\n\t\t\t\t //res.setHeader('Content-Type', 'text/owl');\n\t\t\t\t res.setHeader('Content-Type', 'text/plain');\n\t\t\t\t res.send(obj_str);\n\t\t\t }\n\t\t\t }", "title": "" }, { "docid": "e28083060c3aa50150d00e5d0322d054", "score": "0.547227", "text": "save_pdf () {\n this.pdf_canvass.save(\"offer_tag_document.pdf\"); // will save the file in the current working directory\n\t}", "title": "" }, { "docid": "99cb4caa9b25f15c6c6ea152218002f7", "score": "0.5469103", "text": "function PdfFunction(dictionary){//Field\n/**\n * Internal variable to store dictionary.\n * @private\n */this.mDictionary=null;/**\n * Local variable to store the dictionary properties.\n * @private\n */this.mDictionaryProperties=new DictionaryProperties();this.mDictionary=dictionary;}", "title": "" }, { "docid": "be44b73477f88b271e235c82db282af4", "score": "0.5453696", "text": "function createTravelsTotalPDF(res, travels, user, dateRange, sum, indexes) {\n travelsTotalToPDF(\n travels,\n user,\n dateRange,\n sum,\n indexes,\n binary => {\n res.contentType('application/pdf');\n res.set('Content-Transfer-Encoding', 'binary');\n console.log(binary);\n res.send(binary);\n },\n error => {\n res.send('ERROR: ', error);\n }\n );\n }", "title": "" }, { "docid": "53c5f9b64fc1446d34f6c5ac21523f13", "score": "0.5432267", "text": "function saveAsPDF(){\n\t\t\t$('.savepdf').css('visibility','hidden');\n\t\t\tcreate_jpg_web();\t// create JPG file from canvas\n\t\t\tif (widthCanvas < heightCanvas) {\t\t\t\n\t\t\tflipCanvas = true;\n\t\t\tvar wC = heightCanvas;\n\t\t\tvar hC = widthCanvas;\n\t\t\twCmm = height_in_mm;\n\t\t\thCmm = width_in_mm;\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\tflipCanvas = false;\n\t\t\tvar wC = widthCanvas;\n\t\t\tvar hC = heightCanvas;\n\t\t\twCmm = width_in_mm;\n\t\t\thCmm = height_in_mm;\n\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\topenPDF();\n\n\t\t}", "title": "" }, { "docid": "072bd34ae9487a0e398512e5a98b0730", "score": "0.5405113", "text": "createPDFMakeDD(cb) {\n if (!this._model) {\n return new Error(\"No model load\");\n }\n if (!this._data) {\n return new Error(\"No data load\");\n }\n this._recursiveFindObject(this.dd, () => {\n cb(this.dd);\n });\n }", "title": "" }, { "docid": "5c1d38fdfc5065ab8f05d846265d07e8", "score": "0.5399956", "text": "function viewCorresDocInPdf(corresponid)\n \t\t {\n \t\t \t \n \t\t \t$(\"#corresponid\").val(corresponid);\n \t\t \t$(\"#gencorpdfForm\").submit();\n \t\t }", "title": "" }, { "docid": "b6303bb4d02bb79751864831f70cfdf6", "score": "0.539541", "text": "function JSONToPDFConvertor(JSONData, ReportTitle, fileName, width) {\n var tableBody = [];\n for (var i = 0; i < JSONData.length; i++) {\n if (i === 0) {\n for (var j = 0; j < JSONData[i].length; j++) {\n var headingName = JSONData[i][j];\n var index = JSONData[i].indexOf(headingName);\n if (index !== -1) {\n JSONData[i][index] = { text: headingName, bold: true, alignment: 'center' };\n }\n }\n }\n }\n var docDefinition = {\n // header: function(currentPage, pageCount) {\n // return { text: 'simple text', alignment: (currentPage % 2) ? 'left' : 'right' };\n // },\n footer: function (currentPage, pageCount) {\n return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', margin: [0, 10, 0, 0] };\n },\n content: [\n { text: ReportTitle, style: 'header' },\n {\n style: 'tableStyling',\n table: {\n headerRows: 1,\n widths: width,\n body: JSONData\n }\n }\n ],\n styles: {\n header: {\n fontSize: 18,\n bold: true,\n margin: [0, 0, 0, 10],\n alignment: 'center'\n },\n tableStyling: {\n fontSize: 10,\n alignment: 'center'\n }\n }\n };\n pdfMake.createPdf(docDefinition).download(fileName + '.pdf');\n }", "title": "" }, { "docid": "d7bbf3953b12cd7ed60f765efab15136", "score": "0.5370189", "text": "function exportFile(fileType) {\n\t\t\t\n\t\t\tif ('pdf' === fileType) {\n\t\t\t\tvm.objExport.constAcceptanceRequestId = vm.pycntObj.constAcceptanceRequestId;\n\t\t\t\tvm.objExport.fileType = 'pdf';\n\t\t\t\tvm.objExport.contractId = vm.item.contractId;\n\t\t\t\t$('#loading').show();\n\t\t\t\tpycntService.exportFile(vm.objExport).then(function (data) {\n\t\t\t\t\twindow.location = Constant.BASE_SERVICE_URL + \"fileservice/downloadFileATTT?\" + data.fileName;\n\t\t\t\t}).catch( function(){\n\t\t\t\t\ttoastr.error(gettextCatalog.getString(\"Lỗi khi export!\"));\n\t\t\t\t\treturn;\n\t\t\t\t}).finally(function(){\n\t\t\t\t\t$('#loading').hide();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tvm.objExport.constAcceptanceRequestId = vm.pycntObj.constAcceptanceRequestId;\n\t\t\t\tvm.objExport.fileType = 'doc';\n\t\t\t\tvm.objExport.contractId = vm.item.contractId;\n\t\t\t\t$('#loading').show();\n\t\t\t\tpycntService.exportFile(vm.objExport).then(function (data) {\n\t\t\t\t\twindow.location = Constant.BASE_SERVICE_URL + \"fileservice/downloadFileATTT?\" + data.fileName;\n\t\t\t\t}).catch( function(){\n\t\t\t\t\ttoastr.error(gettextCatalog.getString(\"Lỗi khi export!\"));\n\t\t\t\t\treturn;\n\t\t\t\t}).finally(function(){\n\t\t\t\t\t$('#loading').hide();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/*var selectedRow = [];\n\t\t\tvar grid = vm.acceptanceGrid;\n\t\t\tvm.acceptanceGrid.select(\"tr:eq(1)\");\n\t\t\tgrid.table.find(\"tr\").each(function (idx, item) {\n\t\t\t\tvar row = $(item);\n\t\t\t\tvar checkbox = $('[name=\"gridcheckbox\"]', row);\n\n\t\t\t\tif (checkbox.is(':checked')) {\n\t\t\t\t\t// Push id into selectedRow\n\t\t\t\t\tvar tr = grid.select().closest(\"tr\");\n\t\t\t\t\tvar dataItem = grid.dataItem(item);\n\n\t\t\t\t\tselectedRow.push(dataItem.constAcceptanceRequestId);\n\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (selectedRow.length > 0) {\n\t\t\t\tpycntService.exportList(selectedRow).then(function (data) {\n\t\t\t\t\twindow.location = \"/ktts-service/fileservice/downloadFileATTT?\" + data.fileName;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (vm.objExport.constAcceptanceRequestId == null) {\n\t\t\t\t\ttoastr.warning(gettextCatalog.getString(\"Chưa chọn bản ghi nào!\"));\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}*/\n\t\t}", "title": "" }, { "docid": "4bc227670a6da434a11efe06b84da385", "score": "0.5364433", "text": "function generatePDF(mode) {\n //reset image number and general notes paragraphs number\n resetTotalCounting();\n\n var isMobile = {\n Android: function() {\n return navigator.userAgent.match(/Android/i);\n },\n BlackBerry: function() {\n return navigator.userAgent.match(/BlackBerry/i);\n },\n iOS: function() {\n return navigator.userAgent.match(/iPhone|iPad|iPod/i);\n },\n Opera: function() {\n return navigator.userAgent.match(/Opera Mini/i);\n },\n Windows: function() {\n return navigator.userAgent.match(/IEMobile/i);\n },\n any: function() {\n return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());\n }\n };\n // Page start drawing from here...\n\n var docDefinition = {\n footer: function (currentPage, pageCount) {\n if (currentPage === 1)\n {\n return {\n columns: [\n determineFrontPageFooter(mode),\n {\n text: '\\nPage | ' + currentPage.toString() + ' of ' + pageCount,\n alignment: 'right',\n margin: [0, 0, 40, 0],\n fontSize: 10,\n color:'grey',\n bold:true\n }\n ]\n };\n }\n else\n {\n return {\n columns: [\n determineFooter(mode),\n {\n text: '\\nPage | ' + currentPage.toString() + ' of ' + pageCount,\n alignment: 'left',\n margin: [10, 0, 40, 0],\n fontSize: 10,\n color:'grey',\n bold:true\n }\n ]\n };\n }\n },\n content: [\n /**\n * (1) Cover Page\n * */\n {\n\n stack: [\n\n [\n {\n // Draw Cover Page image\n image: coverPageLogo,\n width: 160,\n height: 160\n },\n giveMeHugeDraft(mode),\n {\n text:[\n 'Archicentre ',\n {\n text:'Australia \\n',\n color: 'red'\n },\n {\n text:'Property \\nAssessment \\n',\n bold:true\n },\n 'Report\\n',\n {\n text:'- Commercial, Industrial & Institutional',\n fontSize:22\n }\n ],\n style: 'coverPageHeader'\n }\n\n ]\n // {\n // text:'New Home Design',\n // style: 'pageTopHeader'\n // },\n // makeAGap(),\n // {\n // text:'Feasibility Study',\n // style:'thirdHeader'\n //\n // },\n // giveMeHugeDraft(mode),\n // {\n // alignment: 'justify',\n // columns: [\n // {\n // stack:[\n //\n // makeAGap(),\n // {\n // text: archHomeFeasibilityReportText1,\n // fontSize: 9\n // },\n // makeAGap(),\n // {\n // text: archHomeFeasibilityReportText2,\n // fontSize: 9\n // },\n // makeAGap(),\n // {\n // text: archHomeFeasibilityReportText3,\n // fontSize: 9\n // }\n // ]\n //\n // },\n // //ConstructionCoverImage\n // {\n // stack: [\n // makeAGap(),\n // displayCoverImage('HomeFeasibilityCoverImage')\n // ]\n //\n // }\n //\n // // displayImage('ConstructionCoverImage')\n // ],\n // columnGap: 20\n // },\n // {\n // text: \"Client's Details\",\n // style: 'pageTopHeader',\n // margin: [0, 40, 0, 5]\n // },\n // getCustomerDetailsTable(),\n // makeAGap(),\n // getAssessmentDetailsTable(),\n // makeAGap(),\n // getAssessorDetailsTable()\n ],\n pageBreak: 'after'\n },\n /**\n * (2) Report Detail Page\n */\n {\n stack:[\n giveMeHugeDraft(mode),\n {\n\n text:[\n {\n text:'Property Assessment Report',\n color: 'red'\n },\n {\n text:' - Commercial Industrial & Institutional',\n bold:false,\n fontSize:12,\n color:'black'\n }\n ],\n style:'pageTopHeader',\n margin:[0,5,0,10]\n\n },\n {\n text:PropertyAssessmentReport,\n fontSize:10,\n margin:[0,5,0,20]\n },\n getClientDetailsTable(),\n getAssessmentDetailsTable(),\n getArchitectDetailsTable(),\n getPropertySummary()\n // getInspectionDetailsTable(),\n // getInspectorDetailsTable(),\n // getReportAuthorisation(),\n // getDoneWork(),\n // {\n // text:'Inspection Summary',\n // style:'pageTopHeader',\n // margin:[0,20,0,5]\n //\n // },\n // getInspectionSummary(),\n // {\n // text:'Descriptive Summary of Work done by Owner-Builder',\n // style:'pageTopHeader',\n // margin:[0,20,0,5]\n // },\n // getDescriptiveSummary()\n ],\n pageBreak: 'after'\n },\n\n /**\n * (3) The Scope of Page\n * */\n {\n stack: [\n {\n text: 'The Scope of Assessment',\n style: 'pageTopHeader',\n margin:[0,5,0,0]\n },\n {\n alignment:'justify',\n columns:[\n {\n stack:[\n {\n text:ScopeOfAssessment1,\n style:'colText'\n },\n {\n text:ScopeOfAssessment2,\n style:'colText'\n },\n {\n text:ScopeOfAssessment3,\n style:'colText'\n },\n {\n text:ScopeOfAssessment4,\n style:'colText'\n },\n {\n text:ScopeOfAssessment5,\n style:'colText'\n },\n {\n text:ScopeOfAssessment6,\n style:'colText'\n },\n {\n text:ScopeOfAssessment7,\n style:'colText'\n },\n {\n text:ScopeOfAssessment8,\n style:'colText'\n }\n ]\n },\n {\n stack:[\n {\n text:ScopeOfAssessment9,\n style:'colText'\n },\n {\n text:'What is included in this report',\n style: 'pageSubHeader'\n },\n {\n ul: [\n {\n text: ReportIncluded1,\n style:'colText'\n },\n {\n text: ReportIncluded2,\n style:'colText'\n },\n {\n text: ReportIncluded3,\n style:'colText'\n },\n {\n text: ReportIncluded4,\n style:'colText'\n },\n {\n text: ReportIncluded5,\n style:'colText'\n }\n ]\n },\n {\n text:'What is not included in this report',\n style: 'pageSubHeader'\n },\n {\n text:ReportNotRecorded0,\n style:'colText'\n },\n {\n ul: [\n {\n text: ReportNotRecorded1,\n style:'colText'\n },\n {\n text: ReportNotRecorded2,\n style:'colText'\n },\n {\n text: ReportNotRecorded3,\n style:'colText'\n },\n {\n text: ReportNotRecorded4,\n style:'colText'\n },\n {\n text: ReportNotRecorded5,\n style:'colText'\n },\n {\n text: ReportNotRecorded6,\n style:'colText'\n },\n {\n text: ReportNotRecorded7,\n style:'colText'\n },\n {\n text: ReportNotRecorded8,\n style:'colText'\n }\n ]\n }\n ]\n }\n ],\n columnGap: 20\n }\n ],\n pageBreak: 'after'\n },\n /**\n * (4) Attachment\n */\n {\n stack:[\n {\n text: 'Attachment',\n style: 'pageTopHeader',\n margin:[0,5,0,5]\n },\n {\n text:[\n {\n text:Attachments1,\n style: 'tableText'\n },\n {\n text: 'http://www.archicentreaustralia.com.au/report_downloads/ ',\n link: \"http://www.archicentreaustralia.com.au/report_downloads/\",\n color: 'red',\n decoration: \"underline\",\n style: 'tableText',\n margin:[0,0,0,5]\n },\n {\n text:Attachments2,\n style: 'tableText',\n margin:[0,5,0,10]\n }\n ]\n },\n getAttachmentTable(),\n {\n text: 'General Advice',\n style: 'pageTopHeader',\n margin:[0,10,0,5]\n },\n {\n alignment:'justify',\n columns:[\n {\n stack:[\n {\n ul: [\n {\n text: GeneralAdvice1,\n style:'colText'\n },\n {\n text: GeneralAdvice2,\n style:'colText'\n },\n {\n text: GeneralAdvice3,\n style:'colText'\n },\n {\n text: GeneralAdvice4,\n style:'colText'\n },\n {\n text: GeneralAdvice5,\n style:'colText'\n }\n ]\n }\n ]\n },\n {\n stack:[\n {\n ul: [\n {\n text: GeneralAdvice6,\n style:'colText'\n },\n {\n text: GeneralAdvice7,\n style:'colText'\n }\n ]\n },\n {\n text:'For Strata, Stratum and Company Title Properties',\n fontSize:10,\n bold:true,\n color:'black',\n margin:[0,20,0,5]\n },\n {\n text:GeneralAdvice8,\n style:'colText'\n }\n ]\n }\n ],\n columnGap: 20\n }\n ],\n pageBreak: 'after'\n },\n\n /**\n * (5) Terms & Conditions\n */\n {\n stack: [\n {\n text: 'Terms & Conditions',\n style: 'pageTopHeader',\n margin:[0,5,0,0]\n },\n\n {\n alignment:'justify',\n columns:[\n {\n stack:[\n {\n text:Conditions1,\n style:'colText'\n },\n {\n text:Conditions2,\n style:'colText'\n },\n {\n text:Conditions3,\n style:'colText'\n },\n {\n text:Conditions4,\n style:'colText'\n },\n {\n text:Conditions5,\n italics:true,\n style:'colText'\n },\n {\n ol:\n [\n {\n text: ConditionsNumber1,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber2,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber3,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber4,\n style:'colText',\n margin:[5,0,0,0]\n }\n ],\n fontSize:10\n }\n ]\n },\n {\n stack:[\n {\n start: 4,\n ol:\n [\n {\n text: ConditionsNumber4,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber5,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber6,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber7,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber8,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber9,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber10,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber11,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber12,\n style:'colText',\n margin:[5,0,0,0]\n },\n {\n text: ConditionsNumber13,\n style:'colText',\n margin:[5,0,0,0]\n }\n ],\n fontSize:10\n }\n ]\n }\n ],\n columnGap: 20\n }\n ],\n pageBreak: 'after'\n },\n\n /**\n * (6) Defect Definitions\n */\n {\n stack:[\n {\n text: 'Defect Definitions',\n style: 'pageTopHeader',\n margin:[0,5,0,0]\n },\n {\n table: {\n widths: [100, '*'],\n body: [\n [\n {},\n\n {\n text: 'DEFINITION',\n style: 'tableHeader'\n }\n ],\n [\n {\n text: 'Minor Defect/ Maintenance Item',\n fontSize:10,\n bold:true\n },\n {\n text:MinorDefect,\n fontSize:10\n }\n ],\n [\n {\n text: 'Major Defect',\n fontSize:10,\n bold:true\n },\n {\n stack:[\n {\n text:MajorDefect,\n fontSize:10\n },\n {\n ul:[\n {\n text:[\n MajorDefectBullet1,\n {\n text:'or',\n decoration: \"underline\"\n },\n {\n text:','\n }\n ],\n fontSize:10,\n margin:[0,2,0,2]\n },\n {\n text:[\n MajorDefectBullet2,\n {\n text:'or',\n decoration: \"underline\"\n },\n {\n text:','\n }\n ],\n fontSize:10,\n margin:[0,2,0,2]\n },\n {\n text: MajorDefectBullet3,\n fontSize:10,\n margin:[0,2,0,2]\n }\n ],\n margin:[5,2,0,3]\n\n }\n ]\n\n }\n\n ],\n [\n {\n text: 'Serious Structural Defect',\n fontSize:10,\n bold:true\n },\n {\n stack:[\n {\n text:SeriousDefect1,\n fontSize:10\n },\n {\n ul:[\n {\n text:[\n SeriousDefectBullet1,\n {\n text:'or',\n decoration: \"underline\"\n },\n {\n text:','\n }\n ],\n fontSize:10,\n margin:[0,2,0,2]\n },\n {\n text:[\n SeriousDefectBullet2,\n {\n text:'or',\n decoration: \"underline\"\n },\n {\n text:','\n }\n ],\n fontSize:10,\n margin:[0,2,0,2]\n },\n {\n text: SeriousDefectBullet3,\n fontSize:10,\n margin:[0,2,0,2]\n }\n ],\n margin:[5,2,0,3]\n\n },\n {\n text:SeriousDefect2,\n fontSize:10\n }\n ]\n\n }\n ]\n ]\n },\n margin:[0,10,0,20]\n },\n {\n text:'Assessment Access',\n style: 'pageTopHeader',\n margin:[0,5,0,0]\n },\n {\n alignment:'justify',\n columns:[\n {\n stack:[\n {\n text:AssessmentAccess1,\n style:'colText'\n },\n {\n text:AssessmentAccess2,\n style:'colText'\n },\n {\n text:AssessmentAccess3,\n style:'colText'\n }\n ]\n },\n {\n stack:[\n {\n text:AssessmentAccess4,\n style:'colText'\n },\n {\n text:AssessmentAccess5,\n style:'colText'\n },\n {\n text:AssessmentAccess6,\n style:'colText'\n }\n ]\n }\n ],\n columnGap: 20\n }\n\n\n ],\n pageBreak: 'after'\n },\n /**\n * (7) Property Assessment Summary\n */\n {\n stack:[\n {\n text: 'Your Property Assessment Summary',\n style: 'pageTopHeader',\n margin:[0,5,0,5]\n },\n {\n text:PropertyAssessmentSummary,\n fontSize:10,\n margin:[0,10,0,10]\n },\n {\n text:'Summary of the Condition of the Property:',\n style:'secondHeader'\n },\n {\n table:{\n widths:[400,'*'],\n body:[\n [\n {\n text:'Apparent condition of the building respect to its age',\n style:'thirdHeader'\n },\n {\n text:getIt('conditionOfBuilding'),\n fontSize:10\n }\n ]\n ]\n },\n margin:[0,3,0,10]\n },\n {\n text:'Major Defects:',\n style:'secondHeader'\n },\n {\n table:{\n widths:[400,'*'],\n body:[\n [\n {\n text:'Are there any Major Defects evident?',\n style:'thirdHeader'\n },\n {\n text:getIt('majorDefects'),\n fontSize:10\n }\n ]\n ]\n },\n margin:[0,3,0,10]\n },\n {\n text:'Serious Structural Defects:',\n style:'secondHeader'\n },\n {\n table:{\n widths:[400,'*'],\n body:[\n [\n {\n text:'Are there any Serious Structural Defects evident?',\n style:'thirdHeader'\n },\n {\n text:getIt('seriousDefects'),\n fontSize:10\n }\n ]\n ]\n },\n margin:[0,3,0,10]\n },\n {\n text:'Evident Defect Summary',\n style:'secondHeader'\n },\n getKeyTable(),\n getEvidentDefectTable(),\n getAssessmentSummary()\n ],\n pageBreak:'after'\n },\n /**\n * (8) Property Assessment Notes & Site\n */\n {\n stack:[\n {\n text: 'Property Assessment Notes',\n style: 'pageTopHeader'\n },\n {\n text: 'Professional and Trade Guide',\n style: 'secondHeader'\n },\n {\n text: 'Your architect may refer you to the following professional or tradespeople:',\n fontSize: 10,\n margin: [0, 0, 0, 10]\n },\n getTradeGuideTable(),\n {\n text: 'Site',\n style: 'pageTopHeader',\n margin:[0,20,0,10]\n },\n {\n text: 'Key',\n style: 'thirdHeader',\n margin:[0,2,0,0]\n },\n getKeyTable(),\n getSiteAreaTable(),\n getAccessLimitationTable('siteAccessLimitationsTable','siteAccessItem','siteAccessImageRef','SiteAccessSelect','siteAccessNotes'),\n getMinorDefectsTable('siteMinorDefectsTable','siteMaintenanceItemNo','siteMaintenanceImgRef','siteMaintenanceNotes','siteMinorRecommendationText'),\n getMajorDefectsTable('siteMajorDefectsTable','siteMajorItemNo','siteMajorImgRef','siteMajorNotes','siteMajorRecommendationText'),\n getGeneralNotes('siteGeneralNotes')\n ],\n pageBreak:'after'\n },\n /**\n * (9) Property Exterior\n */\n {\n stack:[\n {\n text: 'Property Exterior',\n style: 'pageTopHeader',\n margin:[0,20,0,10]\n },\n {\n text: 'Key',\n style: 'thirdHeader',\n margin:[0,2,0,0]\n },\n getKeyTable(),\n getAreaTable('exteriorArea','exteriorAreaName','exteriorAreaRow'),\n getAccessLimitationTable('exteriorAccessLimitationsTable','exteriorAccessItem','exteriorAccessImageRef','exteriorAccessSelect','exteriorAccessNotes'),\n getMinorDefectsTable('exteriorMinorDefectsTable','exteriorMinorDefectItemNo','exteriorMinorDefectImgRef','exteriorMinorDefectNotes','exteriorMinorRecommendationText'),\n getMajorDefectsTable('exteriorMajorDefectsTable','exteriorMajorItemNo','exteriorMajorImgRef','exteriorMajorNotes','exteriorMajorRecommendationText'),\n getGeneralNotes('exteriorGeneralNotes')\n\n // getSiteAreaTable(),\n // getAccessLimitationTable(),\n // getMinorDefectsTable(),\n // getMajorDefectsTable(),\n // getGeneralNotes()\n ],\n pageBreak:'after'\n },\n /**\n * (10) Property Interior - Dry Areas\n */\n {\n stack:[\n {\n text: 'Property Interior – Dry Areas',\n style: 'pageTopHeader',\n margin:[0,20,0,10]\n },\n {\n text: 'Key',\n style: 'thirdHeader',\n margin:[0,2,0,0]\n },\n getKeyTable(),\n getAreaTable('InteriorDryArea','InteriorDryAreaName','InteriorDryAreaRow'),\n getAccessLimitationTable('interiorDryAccessLimitationsTable','interiorDryAccessItem','interiorDryAccessImageRef','interiorDryAccessSelect','interiorDryAccessNotes'),\n getMinorDefectsTable('interiorDryMinorTable','interiorDryMinorItemNo','interiorDryMinorImgRef','interiorDryMinorNotes','interiorDryMinorRecommendationText'),\n getMajorDefectsTable('interiorDryMajorTable','interiorDryMajorItemNo','interiorDryMajorImgRef','interiorDryMajorNotes','interiorDryMajorRecommendationText'),\n getGeneralNotes('interiorDryGeneralNotes')\n ],\n pageBreak:'after'\n },\n /**\n * (11) Property Interior - Wet Areas\n */\n {\n stack:[\n {\n text: 'Property Interior – Service (wet) Areas',\n style: 'pageTopHeader',\n margin:[0,20,0,10]\n },\n {\n text: 'Key',\n style: 'thirdHeader',\n margin:[0,2,0,0]\n },\n getKeyTable(),\n getAreaTable('InteriorWetArea','InteriorWetAreaName','InteriorWetAreaRow'),\n getAccessLimitationTable('interiorWetAccessLimitationsTable','interiorWetAccessItem','interiorWetAccessImageRef','interiorWetAccessSelect','interiorWetAccessNotes'),\n getMinorDefectsTable('interiorWetMinorTable','interiorWetMinorItemNo','interiorWetMinorImgRef','interiorWetMinorNotes','interiorWetMinorRecommendationText'),\n getMajorDefectsTable('interiorWetMajorTable','interiorWetMajorItemNo','interiorWetMajorImgRef','interiorWetMajorNotes','interiorWetMajorRecommendationText'),\n getGeneralNotes('interiorWetMajorGeneralNotes')\n ],\n pageBreak:'after'\n },\n /**\n * Photographs\n */\n {\n stack:[\n getImages()\n ]\n }\n ],\n /**\n * Styles\n * */\n styles: {\n coverPageHeader: {\n fontSize: 50,\n color: 'black',\n italics: true,\n margin: [20, 50, 0, 100]\n },\n pageTopHeader: {\n fontSize: 20,\n color: 'red',\n bold: true\n },\n pageSubHeader: {\n fontSize: 11,\n color: 'red',\n bold: true,\n margin: [0, 0, 0, 2]\n },\n colText: {\n fontSize: 10,\n margin:[0,2,0,2]\n },\n secondHeader: {\n fontSize: 14,\n color: 'red',\n bold: true,\n margin: [0, 0, 0, 3]\n },\n thirdHeader: {\n fontSize: 12,\n color: 'red',\n bold: true\n },\n tableText: {\n fontSize: 10\n },\n\n\n\n\n\n firstHeader: {\n fontSize: 20,\n color: 'red',\n bold: true,\n margin: [0, 0, 0, 20]\n },\n\n\n fourthHeader: {\n fontSize: 20,\n color: 'red',\n bold: true\n },\n fifthHeader: {\n fontSize: 12,\n color: 'red',\n bold: true\n },\n paragraph1: {\n fontSize: 11,\n\n margin: [5, 2, 10, 100]\n },\n coverPageText: {\n margin: [0, 40, 0, 0]\n },\n coverPageSubHeader: {\n fontSize: 22,\n bold: true,\n color: 'red',\n margin: [0, 55, 0, 0]\n },\n boldText: {\n bold: true\n },\n table: {\n margin: [0, 15, 0, 15]\n },\n tableHeader: {\n fontSize: 10,\n bold: true,\n color: 'red'\n },\n pageTopHeader: {\n fontSize: 17,\n color: 'red',\n bold: true\n },\n tightTable: {\n margin: [0, 0, 30, 0]\n },\n smallText: {\n fontSize: 10,\n margin: [5, 2, 10, 100]\n },\n rowHeader: {\n fontSize: 12,\n bold: true\n },\n rowText: {\n fontSize: 12\n },\n tableBoldTextAlignLeft: {\n fontSize: 9,\n bold: true\n },\n\n\n paragraphMargin: {\n margin: [0, 0, 0, 6]\n },\n\n bulletMargin: {\n margin: [0, 0, 0, 5]\n },\n\n tableLongBoldJustifiedText: {\n fontSize: 9,\n bold: true,\n alignment: 'justify'\n }\n }\n };\n // Open a new tab and show the PDF\n if (mode == 'save')\n {\n //console.log('click');\n //const pdfDocGenerator = pdfMake.createPdf(docDefinition);\n pdfMake.createPdf(docDefinition).getBase64(function(encodedString){\n var base64 = encodedString;\n //$('#savingPDFAlert').show('fade');\n doSavePDF(base64);\n //console.log(base64);\n });\n\n }\n //if the mode is final or preview, open the pdf directly, depends on what device the user is using\n else\n {\n if( isMobile.any() )\n {\n var reader = new FileReader();\n\n pdfMake.createPdf(docDefinition).getBlob(function(blob){\n reader.onload = function(e){\n //window.location.href = reader.result;\n window.open(reader.result,'_blank');\n };\n reader.readAsDataURL(blob);\n });\n }\n else\n {\n console.log(\"It is on pc\");\n pdfMake.createPdf(docDefinition).open();\n }\n\n }\n\n\n}", "title": "" }, { "docid": "34204315700713288b379f10cf3e1d81", "score": "0.5357024", "text": "createPDFFile(uid, barcodeArray, barcodePNGArray, real, qr) {\r\n var doc = new PDFDocument({\r\n layout: \"landscape\",\r\n size: [595.28, 841.89]\r\n });\r\n let filename;\r\n if (real) {\r\n filename = \"../pdf/production/\" + uid + \".pdf\";\r\n }\r\n else {\r\n filename = \"../pdf/test/\" + uid + \".pdf\";\r\n }\r\n let stream = doc.pipe(fs.createWriteStream(filename));\r\n let total_double_pages = Math.ceil(barcodePNGArray.length / (this.Card_Layout[0] * this.Card_Layout[1]));\r\n //For each double page, generate front and back side\r\n for (let i = 0; i < total_double_pages; i++) {\r\n //Front Page\r\n if (i != 0) {\r\n doc.addPage({\r\n layout: \"landscape\",\r\n size: [595.28, 841.89]\r\n });\r\n }\r\n //For each card (row, column)\r\n for (let j = 0; j < this.Card_Layout[0]; j++) {\r\n for (let k = 0; k < this.Card_Layout[1]; k++) {\r\n let barcode_index = i * (this.Card_Layout[0] * this.Card_Layout[1]) + j * this.Card_Layout[1] + k;\r\n if (barcode_index < barcodePNGArray.length) {\r\n let x = j * (240 + 18) + 18;\r\n let y = k * (150 + 40) + 20;\r\n // Add the Card Border\r\n doc.image(\"../assets/img/front.jpg\", x, y, {\r\n height: this.Card_Size.height,\r\n width: this.Card_Size.width\r\n });\r\n //Add the QR Code\r\n if (qr) {\r\n doc.image(barcodePNGArray[barcode_index], x + this.QR_Coords[0], y + this.QR_Coords[1], {\r\n width: this.QR_Width,\r\n height: this.QR_Width\r\n });\r\n // Add the Barcode Number\r\n doc.text(\"\" + barcodeArray[barcode_index], x + this.QR_Coords[0], y + this.QR_Coords[1] + this.QR_Width, {\r\n width: 75,\r\n height: 15,\r\n align: \"center\"\r\n });\r\n }\r\n else {\r\n doc.image(barcodePNGArray[barcode_index], x + this.Barcode_Coords[0], y + this.Barcode_Coords[1], {\r\n width: this.Barcode_Width\r\n });\r\n }\r\n }\r\n }\r\n }\r\n //Back Page\r\n /*\r\n doc.addPage({\r\n layout: \"landscape\",\r\n size: [595.28, 841.89]\r\n });\r\n //For each card (row, column)\r\n for (let j = 0; j < this.Card_Layout[0]; j++) {\r\n for (let k = 0; k < this.Card_Layout[1]; k++) {\r\n let barcode_index = i * (this.Card_Layout[0] * this.Card_Layout[1]) + j * this.Card_Layout[1] + k;\r\n if (barcode_index < barcodeArray.length) {\r\n let x = 841.89 - (j * (240 + 18) + 18) - 240;\r\n let y = k * (150 + 40) + 20;\r\n // Add the Card Border\r\n doc.image(\"../assets/img/back.jpg\", x, y, {\r\n height: this.Card_Size.height,\r\n width: this.Card_Size.width\r\n });\r\n }\r\n }\r\n }\r\n */\r\n }\r\n /*\r\n for (var i = 0; i < barcodeArray.length; i++) {\r\n let pageIndex = i % 9;\r\n let rowIndex = pageIndex % 3;\r\n let columnIndex = (pageIndex - rowIndex) / 3;\r\n //Add new Pages\r\n if (pageIndex == 0 && i != 0) {\r\n doc.addPage({\r\n layout: \"landscape\"\r\n });\r\n }\r\n // Calculate Coordinates\r\n let x = rowIndex * (241 + 18) + 18\r\n let y = columnIndex * (150 + 40) + 41\r\n \n // Add the Card Border\r\n doc.image(\"../assets/img/box.jpg\", x, y, {\r\n height: this.Card_Size.height,\r\n width: this.Card_Size.width\r\n });\r\n doc.image(barcodeArray[i], x + this.Barcode_Coords[0], y + this.Barcode_Coords[1], {\r\n width: this.Barcode_Width\r\n });\r\n }\r\n */\r\n doc.end();\r\n return filename;\r\n }", "title": "" }, { "docid": "e329b7553751836fdef0d1f131cdb2dd", "score": "0.5348491", "text": "function onDocX(){\n\tvar controller = View.controllers.get('abRepmLsadminPropProfileCtrl');\n\t/*\n\t * KB 3029212 Ioan don't export if there is no data available\n\t */\n\tvar objOverviewPanel = View.panels.get(overviewPanelId);\n\tif (objOverviewPanel.gridRows.length == 0) {\n\t\tView.showMessage(getMessage('msg_docx_nodata'));\n\t\treturn;\n\t}\n\tvar reportConfig = {\n\t\ttitle: getMessage('msg_report_title'),\n\t\tfileName: 'ab-repm-lsadmin-prop-profile-rpt',\n\t\tcallerView: 'ab-repm-lsadmin-prop-profile.axvw',\n\t\tdataSource: 'abRepmLsadminPropProfile_ds_grid',\n\t\tprintableRestriction: controller.printableRestriction,\n\t\tfiles:[]\n\t};\n\tvar consoleRestr = \tcontroller.restriction;\n\tvar parameters = controller.parameters;\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause('property.pr_id', '', 'IS NOT NULL', ')AND(', false);\n\tvar rptFileCfg = new RptFileConfig(\n\t\t'ab-repm-lsadmin-prop-profile-details-rpt.axvw',\n\t\t{permanent: consoleRestr, temporary: restriction, parameters: parameters},\n\t\t'property.pr_id',\n\t\t{parameters :[\n\t\t\t\t{name: 'prId', type: 'value', value: 'property.pr_id'},\n\t\t\t\t{name: 'owned', type: 'text', value: getMessage(\"owned\")},\n\t\t\t\t{name: 'leased', type: 'text', value: getMessage(\"leased\")},\n\t\t\t\t{name: 'neither', type: 'text', value: getMessage(\"neither\")}]},\n\t\tnull\n\t);\n\treportConfig.files.push(rptFileCfg);\n\t\n\tonPaginatedReport(reportConfig);\n}", "title": "" }, { "docid": "5583bcf453445fbbf29bc24d86f07e2c", "score": "0.53432596", "text": "printElectroTechCon(apzId, project) {\n var token = sessionStorage.getItem('tokenInfo');\n if (token) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"get\", window.url + \"api/print/tc/electro/\" + apzId, true);\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + token);\n xhr.onload = function () {\n if (xhr.status === 200) {\n //test of IE\n if (typeof window.navigator.msSaveBlob === \"function\") {\n window.navigator.msSaveBlob(xhr.response, \"tc-\" + new Date().getTime() + \".pdf\");\n } else {\n var data = JSON.parse(xhr.responseText);\n var today = new Date();\n var curr_date = today.getDate();\n var curr_month = today.getMonth() + 1;\n var curr_year = today.getFullYear();\n var formated_date = \"(\" + curr_date + \"-\" + curr_month + \"-\" + curr_year + \")\";\n\n var base64ToArrayBuffer = (function () {\n \n return function (base64) {\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n \n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n \n return bytes; \n }\n \n }());\n\n var saveByteArray = (function () {\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n \n return function (data, name) {\n var blob = new Blob(data, {type: \"octet/stream\"}),\n url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = name;\n a.click();\n setTimeout(function() {window.URL.revokeObjectURL(url);},0);\n };\n\n }());\n\n saveByteArray([base64ToArrayBuffer(data.file)], \"ТУ-Электр-\" + project + formated_date + \".pdf\");\n }\n } else {\n alert('Не удалось скачать файл');\n }\n }\n xhr.send();\n } else {\n console.log('Время сессии истекло.');\n }\n }", "title": "" }, { "docid": "a1bd3356f5b3ab8fe83e09a655526269", "score": "0.53379005", "text": "function savePDF(domElement, options, callback) {\n\t if (options === void 0) { options = {}; }\n\t new KendoDrawingAdapter_1.default(kendo_drawing_1.drawDOM, kendo_drawing_1.exportPDF, kendo_file_saver_1.saveAs, domElement, options).savePDF(callback);\n\t}", "title": "" }, { "docid": "a427bc80ee9e3f040c233218d193e069", "score": "0.5328916", "text": "function generate_pdf(record_id,url,urlgoto){\n $.ajax({\n type: \"POST\",\n url: url,\n data: \"&id=\"+record_id,\n error: function (xhr, status, error) {\n alert(xhr.responseText);\n },\n success: function (result) {\n jsonAjax = jQuery.parseJSON(result);\n // $('[name=html_pdf]').val(jsonAjax);\n $('#record_id').val($('#selectSOP_'+$('[name=optradio]:checked').val()).val());\n window.location = urlgoto+\"&record=\"+record_id;\n }\n });\n}", "title": "" }, { "docid": "85021e3c3a70637be4a17f0c9276af49", "score": "0.5325245", "text": "constructor(formatobjeto){ //Definimos el constructor\n this.data=formatobjeto\n \n }", "title": "" }, { "docid": "3b19b2263fa05bd85d118048eb913ae9", "score": "0.5325168", "text": "function PdfAction(){/**\n * Specifies the Next `action` to perform.\n * @private\n */this.action=null;/**\n * Specifies the Internal variable to store `dictionary properties`.\n * @private\n */this.dictionaryProperties=new DictionaryProperties();// super(); -> Object()\nthis.initialize();}", "title": "" }, { "docid": "647f0741f1e2ed846718fc7ebce5aae1", "score": "0.5314992", "text": "function exportRec() {\r\n\t\t// Ext.Ajax.request({\r\n\t\t// url : 'manageplan/getPlanGatherQueryList.action',\r\n\t\t// params : {\r\n\t\t// planTime : planDate.getValue(),\r\n\t\t// editDepcode : editDepcode.getValue(),\r\n\t\t// planType : planTypeCombobox.getValue()\r\n\t\t// },\r\n\t\t// success : function(response) {\r\n\t\t// var json = eval('(' + response.responseText.trim() + ')');\r\n\t\t// var records = json.list;\r\n\t\t// //alert(records.length)\r\n\t\t// var html = ['<table\r\n\t\t// border=1><tr><th>部门</th><th>培训类别</th><th>培训项目计划</th><th>计划人数</th><th>培训课时</th><th>负责人</th></tr>'];\r\n\t\t// for (var i = 0; i < records.length; i += 1) {\r\n\t\t// var rc = records[i];\r\n\t\t// html.push('<tr><td>' + rc.deptName + '</td><td>'\r\n\t\t// + rc.planTypeName + '</td><td>' + rc.trainDetail.trainingName\r\n\t\t// + '</td><td>' + rc.trainDetail.trainingNumber + '</td><td>'\r\n\t\t// + rc.trainDetail.trainingHours + '</td><td>' +\r\n\t\t// rc.trainDetail.chargeBy\r\n\t\t// + '</td></tr>');\r\n\t\t// }\r\n\t\t// html.push('</table>');\r\n\t\t// html = html.join(''); // 最后生成的HTML表格\r\n\t\t// // alert(html);\r\n\t\t// tableToExcel(html);\r\n\t\t// },\r\n\t\t// failure : function(response) {\r\n\t\t// Ext.Msg.alert('信息', '失败');\r\n\t\t// }\r\n\t\t// });\r\n\t\tvar month = planDate.getValue().substring(0, 4) + \"-\"\r\n\t\t\t\t+ planDate.getValue().substring(5, 7);\r\n\t\tvar url = \"/powerrpt/frameset?__report=bqmis/itemPlanDep.rptdesign\";\r\n\t\turl += \"&__action=print&month=\" + month + \"&__format=xls\";\r\n\t\twindow.open(url);\r\n\t}", "title": "" }, { "docid": "3032ae4c88a220073af97609c02e9941", "score": "0.5310644", "text": "function getPdfText(serviceUrl,callback) {\n $.ajax({\n contentType: 'application/json',\n dataType: 'json',\n // beforeSend: function (xhr) { //Include the bearer token in header\n // xhr.setRequestHeader(\"Authorization\", 'Bearer '+ tokenData);\n // },\n data:{\n refid: sessionStorage.getItem('refid')\n },\n success: function(data){\n // $(\"body\").loading('stop');\n if(data.status == \"SUCCESS\"){\n callback(data.data);\n } else{\n // errorToast(data.message);\n }\n },\n error: function(error){\n // $(\"body\").loading('stop');\n // errorToast(\"error occured while fetching response\");\n console.log(error);\n },\n type: 'GET',\n url: serviceUrl\n });\n}", "title": "" }, { "docid": "14a17c6001c96619934ccc4da4638b85", "score": "0.5306087", "text": "function generaReportErm(){\n\t\n\twindow.location.href= \"/CruscottoAuditAtpoWebWeb/jsonATPO/getReportErmPDF\";\n\t\n}", "title": "" }, { "docid": "7e2c62d367f6a95ce387c28eed9de9f3", "score": "0.5298642", "text": "async downloadPdf(result) {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n let { listing, filePathAndName, filePath, fields } = result;\r\n let loc = path.join(__dirname, '..', '..', 'public', 'generate-pdf.html');\r\n let html = fs.readFileSync(loc, 'utf8');\r\n let tableHeading = \"\";\r\n tableHeading += `<tr>`;\r\n\r\n for (let i = 0; i < fields.length; i++) {\r\n tableHeading += `<td class=\"title\" width=\"5%\" style=\"padding: 1px;text-align:center;border: 1px solid #e5e5e5;color:\"black\";line-height: 1.6;vertical-align: top;\">${fields[i]}</td>`\r\n }\r\n tableHeading += `</tr>`\r\n let tableData = \"\";\r\n for (let i = 0; i < listing.length; i++) {\r\n tableData += `<tr>`;\r\n let bodyObj = listing[i];\r\n let listingKeys = Object.keys(bodyObj);\r\n let listingValues = Object.values(bodyObj);\r\n for (let j = 0; j < fields.length; j++) {\r\n let index = listingKeys.indexOf(fields[j]);\r\n if (index == -1) {\r\n tableData += `<td width=\"5%\" style=\"padding: 1px;text-align:center;border: 1px solid #e5e5e5;line-height: 1.3;vertical-align: middle;color:#595959\"> - </td>`\r\n } else {\r\n tableData += `<td width=\"5%\" style=\"padding: 1px;text-align:center;border: 1px solid #e5e5e5;line-height: 1.3;vertical-align: middle;color:#595959\">\r\n ${(listingValues[index] == '') ? '-' : listingValues[index]}\r\n </td>`\r\n }\r\n }\r\n tableData += `</tr>`\r\n }\r\n html = html.replace('{tableHeading}', tableHeading);\r\n html = html.replace('{tableBody}', tableData);\r\n let options = { format: 'A2', border: \"1px\", timeout: 300000 };\r\n pdf.create(html, options).toFile(filePath, function (err) {\r\n if (err) { reject({ status: 0, message: i18n.__('INTERNAL_SERVER_ERROR') }); }\r\n else { return resolve({ filePathAndName }); }\r\n })\r\n\r\n } catch (error) {\r\n console.log(\"error- \", error);\r\n reject({ status: 0, message: i18n.__('INTERNAL_SERVER_ERROR') });\r\n }\r\n })\r\n }", "title": "" }, { "docid": "e5fdc500fe284add7dd5c3f3a05b160e", "score": "0.5295048", "text": "function mkdfOnWindowLoad() {\n\n }", "title": "" }, { "docid": "58c8a4bf2a621bc237925b498fccfafa", "score": "0.5294644", "text": "async function callApi2pdf() {\n const url = '/.netlify/functions/api2pdf';\n\n let formData = new FormData();\n formData.append('name', document.getElementById('name').value)\n formData.append('pdfhtml', document.getElementById('pdfhtml').value)\n\n try {\n const responseData = await postFormDataAsJson({ url, formData });\n console.log(responseData );\n\n makeDownloadButton(responseData)\n // return responseData\n } catch (error) {\n var customErr = \"couldn't make document error: \" + error\n console.error(error);\n return customErr\n }\n }", "title": "" }, { "docid": "87911121cf0bce5327e7bf6673418a87", "score": "0.5285265", "text": "printGasTechCon(apzId, project) {\n var token = sessionStorage.getItem('tokenInfo');\n if (token) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"get\", window.url + \"api/print/tc/gas/\" + apzId, true);\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + token);\n xhr.onload = function () {\n if (xhr.status === 200) {\n //test of IE\n if (typeof window.navigator.msSaveBlob === \"function\") {\n window.navigator.msSaveBlob(xhr.response, \"tc-\" + new Date().getTime() + \".pdf\");\n } else {\n var data = JSON.parse(xhr.responseText);\n var today = new Date();\n var curr_date = today.getDate();\n var curr_month = today.getMonth() + 1;\n var curr_year = today.getFullYear();\n var formated_date = \"(\" + curr_date + \"-\" + curr_month + \"-\" + curr_year + \")\";\n\n var base64ToArrayBuffer = (function () {\n \n return function (base64) {\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n \n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n \n return bytes; \n }\n \n }());\n\n var saveByteArray = (function () {\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n \n return function (data, name) {\n var blob = new Blob(data, {type: \"octet/stream\"}),\n url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = name;\n a.click();\n setTimeout(function() {window.URL.revokeObjectURL(url);},0);\n };\n\n }());\n\n saveByteArray([base64ToArrayBuffer(data.file)], \"ТУ-Газ-\" + project + formated_date + \".pdf\");\n }\n } else {\n alert('Не удалось скачать файл');\n }\n }\n xhr.send();\n } else {\n console.log('Время сессии истекло.');\n }\n }", "title": "" }, { "docid": "490baa88c6e56f9df1a47c72dc255231", "score": "0.52833", "text": "function generatePDF(){\n $('#invoice tr:first th').each(function() {\n var value = $(this).css(\"position\", \"static\");\n });\n const element = document.getElementById(\"invoice\");\n $(\"#check\").hide();\n $(\"table td:nth-child(\"+($(\"#check\").index() + 1)+\")\").hide();\n \n var opt = {\n margin: 1,\n filename: 'report.pdf',\n image: { type: 'jpeg', quality: 0.98 },\n html2canvas: { scale: 2 },\n enableLinks: false,\n pagebreak: {mode: \"avoid-all\"},\n jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }\n };\n html2pdf()\n .set(opt)\n .from(element)\n .save();\n html2pdf().set(opt).from(element).toPdf().get('pdf').then(function (pdf) {\n $('#invoice tr:first th').each(function() {\n var value = $(this).css(\"position\", \"sticky\");\n $(\"#check\").show();\n $(\"table td:nth-child(\"+($(\"#check\").index() + 1)+\")\").show();\n $(\"input:checkbox[name=check]\").prop(\"checked\",true);\n });\n });\n}", "title": "" }, { "docid": "9a8087abfe26b6d2eb52dd3863ddbe95", "score": "0.52832645", "text": "async function generatePdf(data) {\n // Build the PDF\n var pdfDoc = printer.createPdfKitDocument(data)\n // Writing to Disk - dataPdf.pdf\n pdfDoc.pipe(fs.createWriteStream('dataPdf.pdf'))\n pdfDoc.end()\n}", "title": "" }, { "docid": "3f34caeeff8fe3c17f51f831d6edf4c1", "score": "0.5281054", "text": "function Fnc_DescargarGrafico(formato) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = 950;\n canvas.height = 600;\n if ($(\"#\" + WebChart.uniqueID).is(\":visible\")) {\n var imgChart = document.getElementById(WebChart.uniqueID).getElementsByTagName(\"img\")[0],\n contexto = canvas.getContext(\"2d\");\n contexto.drawImage(imgChart, 0, 0);\n } else {\n var imgChart = document.getElementById(WebChart1.uniqueID).getElementsByTagName(\"img\")[0],\n contexto = canvas.getContext(\"2d\");\n contexto.drawImage(imgChart, 0, 0);\n }\n\n\n var Base69String = canvas.toDataURL()\n if (formato == \"pdf\") {\n var doc = new jsPDF();\n doc.addImage(Base69String, 'JPEG', 15, 40, 180, 95);\n doc.save(\"Grafico.pdf\")\n return true;\n }\n else if (formato == \"png\") {\n Base69String = Base69String.replace(\"data:image/png;base64\", \"data:image/png;base64\");\n }\n else if (formato == \"jpeg\") {\n Base69String = Base69String.replace(\"data:image/png;base64\", \"data:image/jpeg;base64\");\n }\n var Save = document.createElement(\"a\")\n Save.href = Base69String;\n Save.download = \"Grafico\"\n var EventoClick = new MouseEvent(\"click\", {\n \"view\": window,\n \"bubbles\": true,\n \"cancelable\": true\n });\n Save.dispatchEvent(EventoClick);\n\n}", "title": "" }, { "docid": "6f58883030c75981171c9623d710f150", "score": "0.52770114", "text": "generateMarksPDF(marks) {\n return new Promise(next => {\n const rows = marks.reduce((a, m) => a + (m.mark >= 0 ? \"<tr><td>\" + m.name + \"</td><td>\" + m.mark + \"</td></tr>\" : ''), '');\n if (rows.length > 0) {\n this.props.alert.info({\n text: \"Export marks of marked PDF? If cancelled, marks will be lost.\",\n onConfirm: () => {\n const html = [\n `<h3>Marks for ${this.state.assignment.name}</h3>`,\n `<p>Generated at ${this.props.formatDate(new Date())}</p>`,\n `<p>Marked by ${USER_NAME}</p>`,\n `<table style='font-size: 11px'><tr><th>Name</th><th>Marks</th></tr>${rows}</table>`,\n ].reduce((a, c) => a + c, '');\n var doc = new jsPDF();\n doc.fromHTML(html, 15, 15, {\n 'width': 170,\n });\n doc.save('marks.pdf');\n if (next) next();\n }\n });\n }\n });\n }", "title": "" }, { "docid": "29047d638f6e1b1ccdbe0dc1a69879c8", "score": "0.5275017", "text": "printPhoneTechCon(apzId, project) {\n var token = sessionStorage.getItem('tokenInfo');\n if (token) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"get\", window.url + \"api/print/tc/phone/\" + apzId, true);\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + token);\n xhr.onload = function () {\n if (xhr.status === 200) {\n //test of IE\n if (typeof window.navigator.msSaveBlob === \"function\") {\n window.navigator.msSaveBlob(xhr.response, \"tc-\" + new Date().getTime() + \".pdf\");\n } else {\n var data = JSON.parse(xhr.responseText);\n var today = new Date();\n var curr_date = today.getDate();\n var curr_month = today.getMonth() + 1;\n var curr_year = today.getFullYear();\n var formated_date = \"(\" + curr_date + \"-\" + curr_month + \"-\" + curr_year + \")\";\n\n var base64ToArrayBuffer = (function () {\n \n return function (base64) {\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n \n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n \n return bytes; \n }\n \n }());\n\n var saveByteArray = (function () {\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n \n return function (data, name) {\n var blob = new Blob(data, {type: \"octet/stream\"}),\n url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = name;\n a.click();\n setTimeout(function() {window.URL.revokeObjectURL(url);},0);\n };\n\n }());\n\n saveByteArray([base64ToArrayBuffer(data.file)], \"ТУ-Телефон-\" + project + formated_date + \".pdf\");\n }\n } else {\n alert('Не удалось скачать файл');\n }\n }\n xhr.send();\n } else {\n console.log('session expired');\n }\n }", "title": "" }, { "docid": "689ca6948f7cdc9873b34f444fe7c0bd", "score": "0.52715284", "text": "onExport() {\n\t\t// you can do work before running the export using this method\n\t\t// (e.g. re-ordering paths for plotting)\n\t}", "title": "" }, { "docid": "10a39530f12d7b9968e7263d0381e9d6", "score": "0.5271121", "text": "function downloadPDF(index) {\n\tvar templateName = $(\"#page-template-\" + index).val();\n\tvar fileName = getFileName(index);\n\t\n var stream = generatePDF(templates[templateName]);\n\n // Download the blob as PDF.\n stream.on('finish', function() {\n saveAs(stream.toBlob('application/pdf'), fileName);\n });\n}", "title": "" }, { "docid": "cbbe57fce2dfbdef393e5f1a6858f259", "score": "0.52671874", "text": "function print_bono_pdf(id_table) {\n $(`#${id_table} tbody`).on('click', '.btn-dark', function() {\n const id = $(this).data('id');\n show_alert_print_bono('Esta seguro???', '¿Desea imprimir el bono?', 'question', 'Generar PDF').then((text) => {\n get_info_pdf(id).then((res) => {\n if (res.status) {\n download_pdf(res.data.bono[0].tipo, res.data, res.message, text);\n } else {\n toastr.error(res.message);\n }\n }).catch((err) => {\n show_alert('Ops!!!', err.message, 'error');\n });\n });\n });\n}", "title": "" }, { "docid": "0cc37f1f2d8743e38dc81ecef080fafe", "score": "0.52599955", "text": "function myFunction() {\n\n var PDF_URL = document.getElementById(\"uploadBox\").files[0].path;\n document.getElementById('myform').reset();\n\n PDFJS.workerSrc = 'assets/js/pdf.worker.js';\n\n\n function getPageText(pageNum, PDFDocumentInstance) {\n // Return a Promise that is solved once the text of the page is retrieven\n return new Promise(function (resolve, reject) {\n PDFDocumentInstance.getPage(pageNum).then(function (pdfPage) {\n // The main trick to obtain the text of the PDF page, use the getTextContent method\n pdfPage.getTextContent().then(function (textContent) {\n var textItems = textContent.items;\n var finalString = \"\";\n\n // Concatenate the string of the item to the final string\n for (var i = 0; i < textItems.length; i++) {\n var item = textItems[i];\n\n finalString += item.str + \" \";\n }\n\n // Solve promise with the text retrieven from the page\n resolve(finalString);\n });\n });\n });\n }\n //var file_name = document.getElementById(\"uploadBox\").value ;\n\n PDFJS.getDocument(PDF_URL).then(function (pdf) {\n\n var pdfDocument = pdf;\n // Create an array that will contain our promises \n var pagesPromises = [];\n //console.log(pdf.pdfInfo.numPages);\n for (var i = 0; i < pdf.pdfInfo.numPages; i++) {\n // Required to prevent that i is always the total of pages\n (function (pageNumber) {\n // Store the promise of getPageText that returns the text of a page\n pagesPromises.push(getPageText(pageNumber, pdfDocument));\n })(i + 1);\n }\n\n // Execute all the promises\n Promise.all(pagesPromises).then(function (pagesText) {\n\n // Display text of all the pages in the console\n // e.g [\"Text content page 1\", \"Text content page 2\", \"Text content page 3\" ... ]\n var str = [];\n for (i = 0; i < pagesText.length; i++) {\n //console.log(pagesText[i]);\n str = str.concat(pagesText[i]);\n }\n //console.log(pagesText);\n var st = str.toString();\n //for(i = 0; i <pagesText.length;i++){\n //var s = pagesText[i];\n //Array of all elements\n var info = [\"Name\", \"Gender\", \"Age\", \"Contact Number\", \"Height\", \"Weight\", \"BMI\", \"Address\", \"Color of Eyes\", \"Email\"];\n var section1 = [\"(a)\", \"(b)\", \"(c)\", \"(d)\", \"(e)\", \"(f)\", \"(g)\", \"(h)\"];\n var s1_p9 = [\"(i)\", \"(j)\", \"(k)\", \"(l)\"];\n var all = [\"Biotin\", \"Calcium\", \"Chromium\", \"Copper\", \"EssentialFattyAcids\",\n \"Protein\", \"Carbohydrates\", \"FolicAcid\", \"Iodine\", \"Iron\", \"Magnesium\", \"Manganese\",\n \"Niacin\", \"PantothenicAcid(B6)\", \"Potassium\", \"Pyridoxine(B6)\", \"Riboavin\",\n \"Selenium\", \"Thiamin\", \"VitaminA\", \"VitaminB-12\", \"VitaminC\", \"CoQ10\",\n \"VitaminD\", \"VitaminE\", \"VitaminK\", \"Zinc\"];\n array_b = [\"I.\", \"II.\", \"III.\", \"IV.\", \"V.\", \"VI.\", \"VII.\", \"VIII\", \"IX\", \"X.\", \"XI.\", \"XII.\"];\n var p_info = [];\n for (j = 0; j < info.length; j++) {\n if (st.indexOf(info[j]) >= 0) {\n p_info.push(info[j]);\n }\n }\n //console.log(i);\n //console.log(p_info); // things that are filled in the form\n\n if (p_info.length > 0) {\n for (j = 0; j < p_info.length; j++) {\n if (j < p_info.length - 1) {\n var index1 = st.indexOf(p_info[j]);\n var index2 = st.indexOf(p_info[j + 1]);\n var temp = st.substring(index1, index2);\n } else { //last member of array\n var index1 = st.indexOf(p_info[j]);\n var index2;\n for (j1 = 0; j1 < section1.length; j1++) {\n index2 = st.indexOf(section1[j1]);\n if (index2 >= 0) {\n break;\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < s1_p9.length; j1++) {\n index2 = st.indexOf(s1_p9[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < all.length; j1++) {\n index2 = st.indexOf(all[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < array_b.length; j1++) {\n index2 = st.indexOf(array_b[j1]);\n if (index2 >= 0) {\n break;\n }\n }\n }\n\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n\n var temp = st.substring(index1, index2);\n }\n if (p_info[j].localeCompare(\"Name\") == 0) {\n document.getElementById(\"name\").value = temp.replace(\"Name\", \"\");\n } else if (p_info[j].localeCompare(\"Gender\") == 0) {\n if (temp.indexOf(\"F\") >= 0) {\n document.getElementById(\"gender\").value = \"Female\";\n } else {\n document.getElementById(\"gender\").value = \"Male\";\n }\n } else if (p_info[j].localeCompare(\"Age\") == 0) {\n document.getElementById(\"age\").value = temp.replace(\"Age\", \"\");\n } else if (p_info[j].localeCompare(\"Contact Number\") == 0) {\n document.getElementById(\"contact\").value = temp.replace(\"Contact Number\", \"\");\n } else if (p_info[j].localeCompare(\"Height\") == 0) {\n document.getElementById(\"height\").value = temp.replace(\"Height\", \"\");\n } else if (p_info[j].localeCompare(\"Weight\") == 0) {\n document.getElementById(\"weight\").value = temp.replace(\"Weight\", \"\");\n } else if (p_info[j].localeCompare(\"BMI\") == 0) {\n document.getElementById(\"bmi\").value = temp.replace(\"BMI\", \"\");\n } else if (p_info[j].localeCompare(\"Color of Eyes\") == 0) {\n document.getElementById(\"eyes\").value = temp.replace(\"Color of Eyes\", \"\");\n } else if (p_info[j].localeCompare(\"Email\") == 0) {\n document.getElementById(\"email\").value = temp.replace(\"Email\", \"\");\n } else {\n\n }\n }\n\n\n }\n // Section I \n var s = st.toString().replace(/ /g, '').replace(/[^ -~]+/g, \"\");\n\n var array_p1 = [\"Fear\", \"Anger\", \"Bitterness\", \"Grief\", \"Gossip\", \"Helplessness\", \"Hopelessness\",\n \"Guilt\", \"Betrayal\", \"Envy\", \"Jealousy\", \"Insecurity\", \"Impatient\", \"Arrogance\",\n \"Pride\", \"Hatred\", \"Rage\", \"Resentment\", \"Revenge\", \"Shame\", \"Sorrow\", \"Regret\",\n \"Passivity\", \"Slander\", \"Possessiveness\", \"Rebellion\", \" Unforgiveness\", \"Gambling\",\n \"Addictions\", \"Other\"];\n var array_p2 = [\"Always Indoors\", \" Do not regularly change home air lter\", \"Home has mold\", \"Home has an air ionizer\",\n \"Have plenty of green plants in my living space\", \"Practice deep breathing exercises regularly, especially outdoors\",\n \" I live away from city smog\", \" Dizziness\", \"Headaches\", \" WateryEyes\", \"Sneezing\", \"Cough Regularly\",\n \"Fatigue\", \"Smoke cigarettes regulary\"];\n var array_p3 = [\"Dry mouth, dry eyes, dry nasal membranes\", \"Dry or leathery skin\", \"Dry or chapped lips\",\n \"Stools hard & Dry\", \"Low volume of urine, urinate infrequently\", \"Dark urine (dark yellow or orange)\",\n \"Poor skin turgor (loss of elasticity of skin)\", \"Headaches\", \"Leg and arm cramps\", \"Weakness\",\n \"Drink less than eight 8 ounce glasses of water daily\"];\n var array_p4 = [\"Depression\", \"Poor Bone Health\", \"Low Vitamin D levels\", \"Outdoors at least 30 minutes a day\"];\n var array_p5 = [\"Headaches\", \"Nausea\", \"Brain fog\", \"Sleep disorders\", \"Loss of memory\", \"Sensitive skin\", \"Dizziness\",\n \"Burning sensation\", \"Rash\", \"Vision problems\", \"Chest pains\", \"Swollen lymph nodes\", \"Live near electrical towers\",\n \"Teeth & jaw pain\", \"Constantly having cellphone to the ears\", \"On computer more than six hours\", \"Aching muscles\",\n \"Fatigue\", \"Bouts of unexplained fear or anxiety\", \"Tingling or prickly sensation across face or other parts of body\",\n \"Feeling of impeding inuenza but never quite breaks out\"];\n var array_p6 = [\"Exercise regularly at least twice a week\", \"Fatigue\", \"Weight gain\", \"Weakness\", \"Muscle atrophy\",\n \"Depression\", \"Lack of exibility and good balance\", \"Heart problems\"];\n var array_p7 = [\"Painful or hard bowel movements\", \"Constipated, less than 1 bowel movement a day\", \"Varicose veins\",\n \"Hemorrhoids or rectal ssures\", \"Use lots of toilet paper to clean yourself\",\n \"Stools are pencil size and drop to the bottom of the toilet\"];\n var array_p8 = [\"Consume six types of vegetables daily\", \"Eat at least two types of fruit daily\", \"Consume at least an ounce of raw nuts daily\",\n \"50% of my diet is made up of raw foods\", \"I do not consume dairy, wheat or gluten containing foods\",\n \"I consume very little dairy or gluten (2 to 3 meals a week)\", \"Eat fresh and/or organic foods as much as possible\",\n \"Vegetarian\", \"Vegan\", \"Eat white sh two to three times a week\"];\n var array_p9a = [\"Allergies\", \"Chronic Headaches/migraines\", \"Chronic skin problems\", \"Digestive problems\", \"Diabetes\", \"Autoimmune disease\", \"Diculty sleeping\",\n \"Depression/poor mood\", \"Low energy\", \"Liver dysfunction\", \"Overweight\", \"Sore muscles or sti joints\", \"Unhealthy cravings\", \"Chemical sensitivities/Environmental illness\",\n \"Sleepy after meals\", \"Food Allergies\"];\n var array_p9b = [\"High Blood Pressure\", \"Numbness and tingling in extremity\", \"Twitching of face and other muscles\", \"Tremors or shakes of hands, feet, head, etc.\", \"Jumpy, jittery, nervous\",\n \"Unexplained chest pains\", \"Heartbeat over 100 per minute\", \"Unexplained rashes or skin irritations\", \"Excessive itching\", \"Bloated feeling most of the time\", \"Frequent or re-occurring heartburn\",\n \"Constipated on regular basis\", \"Frequent diarrhea\", \"Depression\", \"Unexplained irritability\", \"Sudden, unexplained or unsolicited anger\", \"Constant death wish or suicidal intent\",\n \"Diculty in making simple decisions\", \"Cold hands or feet, even in warm or moderate weather\", \"Out of breath easily\", \"Headaches after eating\", \"Frequent leg cramps\",\n \"Frequent metallic taste in mouth\", \"Burning sensation on the tongue\", \"Constant or frequent ringing in the ears\", \"Frequent urination during the night\", \"Unexplained chronic fatigue\",\n \"Poor or failing memory\", \"Constant or frequent pain in joins\", \"Frequent insomnia \", \"Unexplained uid retention\"];\n var array_p10 = [\"Gas\", \"Bloating\", \"Abdominal fullness\", \"Nausea\", \"Constipation\", \"Diarrhea\", \"Abdominal cramps or pain\", \"Fatigue\", \"Hives\", \"Allergies, especially foods\", \"History of parasitic infections\",\n \"History of traveler's diarrhea\", \"Diculty overcoming intestinal yeast growth\"];\n var array_p11 = [\"Gas\", \"Bloating\", \"Constipation and/or diarrhea\", \"Spastic/irritable colon\", \"Chron's Disease, Colitis\", \"Intestinal cramping\", \"Heart Burn\", \"Itchy anus\",\n \"Continuous sinus problems\", \"Chronic or re-occurring sore throat, colds, bronchitis, ear infection\", \"Premenstrual symptoms\", \"Menstrual cramps and problems\", \"Fatigue\",\n \"Depression\", \"Irritability or chronic vaginal yeast infections\", \"Infertility\", \"Chronic rashes\", \"Recurrent bladder infections or irritation\", \"Recurrent staph infections\",\n \"Itchy ears or ringing in the ears\", \"General itching\", \"Multiple allergies\", \"Weight problems\", \"Craving for sweets, alcohol, bread, cheese\", \"Feel drunk without having ingested alcohol\",\n \"Chemical and fume intolerance\", \"Worsening of any of the above symptoms within six to twelve months after a pregnancy\",\n \"Multiple pregnancies\", \"Antibiotic use\", \"Birth control pill (oral contraceptives) use\", \"Cortisone or steroid use\", \"Chemotherpy or radiation therpy\"];\n var s1 = [];\n var count_a = 0;\n var count_b = 0;\n var count_c = 0;\n var count_d = 0;\n var count_e = 0;\n var count_f = 0;\n var count_g = 0;\n var count_h = 0;\n var count_i = 0;\n var count_j = 0;\n var count_k = 0;\n var count_l = 0;\n\n for (k = 0; k < section1.length; k++) {\n if (s.indexOf(section1[k]) >= 0) {\n s1.push(section1[k].replace(/ /g, ''));\n }\n }\n if (s1.length > 0) {\n for (n = 0; n < s1.length; n++) {\n\n if (n < (s1.length - 1)) {\n var index1 = s.indexOf(s1[n]);\n var index2 = s.indexOf(s1[n + 1]);\n var temp = s.substring(index1, index2);\n } else { //last member of array\n var index1 = s.indexOf(s1[n]);\n var index2;\n\n for (j1 = 0; j1 < s1_p9.length; j1++) {\n index2 = s.indexOf(s1_p9[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n\n if (index2 < 0) {\n for (j1 = 0; j1 < all.length; j1++) {\n index2 = s.indexOf(all[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n if (index2 < 0) {\n for (j1 = 0; j1 < array_b.length; j1++) {\n index2 = s.indexOf(array_b[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n\n var temp = s.substring(index1, index2);\n }\n\n if (s1[n].localeCompare(\"(a)\") == 0) {\n for (j = 0; j < array_p1.length; j++) {\n if (temp.indexOf(array_p1[j].replace(/ /g, '')) >= 0) {\n count_a++;\n }\n }\n document.getElementById(\"part1\").value = count_a;\n if (count_a >= 1 & count_a <= 4) {\n document.getElementById(\"p_part1\").value = \"Low\";\n } else if (count_a >= 5 & count_a <= 7) {\n document.getElementById(\"p_part1\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part1\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(b)\") == 0) {\n for (j = 0; j < array_p2.length; j++) {\n if (temp.indexOf(array_p2[j].replace(/ /g, '')) >= 0) {\n count_b++;\n }\n }\n document.getElementById(\"part2\").value = count_b;\n if (count_b >= 1 & count_b <= 2) {\n document.getElementById(\"p_part2\").value = \"Low\";\n } else if (count_b >= 3 & count_b <= 5) {\n document.getElementById(\"p_part2\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part2\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(c)\") == 0) {\n for (j = 0; j < array_p3.length; j++) {\n if (temp.indexOf(array_p3[j].replace(/ /g, '')) >= 0) {\n count_c++;\n }\n }\n document.getElementById(\"part3\").value = count_c;\n if (count_c >= 1 & count_c <= 2) {\n document.getElementById(\"p_part3\").value = \"Low\";\n } else if (count_c >= 3 & count_c <= 5) {\n document.getElementById(\"p_part3\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part3\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(d)\") == 0) {\n for (j = 0; j < array_p4.length; j++) {\n if (temp.indexOf(array_p4[j].replace(/ /g, '')) >= 0) {\n count_d++;\n }\n }\n document.getElementById(\"part4\").value = count_d;\n if (count_d == 1) {\n document.getElementById(\"p_part4\").value = \"Low\";\n } else if (count_d == 2) {\n document.getElementById(\"p_part4\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part4\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(e)\") == 0) {\n for (j = 0; j < array_p5.length; j++) {\n if (temp.indexOf(array_p5[j].replace(/ /g, '')) >= 0) {\n count_e++;\n }\n }\n document.getElementById(\"part5\").value = count_e;\n if (count_e >= 1 & count_e <= 4) {\n document.getElementById(\"p_part5\").value = \"Low\";\n } else if (count_e >= 5 & count_e <= 10) {\n document.getElementById(\"p_part5\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part5\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(f)\") == 0) {\n for (j = 0; j < array_p6.length; j++) {\n if (temp.indexOf(array_p6[j].replace(/ /g, '')) >= 0) {\n count_f++;\n }\n }\n document.getElementById(\"part6\").value = count_f;\n if (count_f >= 1 & count_f <= 2) {\n document.getElementById(\"p_part6\").value = \"Low\";\n } else if (count_f >= 3 & count_f <= 4) {\n document.getElementById(\"p_part6\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part6\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(g)\") == 0) {\n for (j = 0; j < array_p7.length; j++) {\n if (temp.indexOf(array_p7[j].replace(/ /g, '')) >= 0) {\n count_g++;\n }\n }\n document.getElementById(\"part7\").value = count_g;\n if (count_g == 1) {\n document.getElementById(\"p_part7\").value = \"Low\";\n } else if (count_g >= 2 & count_g <= 3) {\n document.getElementById(\"p_part7\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part7\").value = \"High\";\n }\n } else if (s1[n].localeCompare(\"(h)\") == 0) {\n for (j = 0; j < array_p8.length; j++) {\n if (temp.indexOf(array_p8[j].replace(/ /g, '')) >= 0) {\n count_h++;\n }\n }\n document.getElementById(\"part8\").value = count_h;\n if (count_h >= 1 & count_h <= 2) {\n document.getElementById(\"p_part8\").value = \"Low\";\n } else if (count_h >= 5 & count_h <= 4) {\n document.getElementById(\"p_part8\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part8\").value = \"High\";\n }\n } else {\n\n }\n }\n }\n\n var pos_9 = [];\n\n for (k = 0; k < s1_p9.length; k++) {\n if (s.indexOf(s1_p9[k]) >= 0) {\n pos_9.push(s1_p9[k].replace(/ /g, ''));\n }\n }\n\n if (pos_9.length > 0) {\n for (n = 0; n < pos_9.length; n++) {\n if (n < (pos_9.length - 1)) {\n var index1 = s.indexOf(pos_9[n]);\n var index2 = s.indexOf(pos_9[n + 1]);\n var temp = s.substring(index1, index2);\n } else { //last member of array\n var index1 = s.indexOf(pos_9[n]);\n var index2;\n for (j = 0; j < all.length; j++) {\n index2 = s.indexOf(all[j]);\n\n if (index2 >= 0) {\n break;\n }\n }\n if (index2 < 0) {\n for (j = 0; j < array_b.length; j++) {\n index2 = s.indexOf(array_b[j]);\n\n if (index2 >= 0) {\n break;\n }\n }\n }\n\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n var temp = s.substring(index1, index2);\n\n }\n\n if (pos_9[n].localeCompare(\"(i)\") == 0) {\n for (j = 0; j < array_p9a.length; j++) {\n if (temp.indexOf(array_p9a[j].replace(/ /g, '')) >= 0) {\n count_i++;\n }\n }\n document.getElementById(\"part9a\").value = count_i;\n if (count_i >= 1 & count_i <= 4) {\n document.getElementById(\"p_part9a\").value = \"Low\";\n } else if (count_i >= 5 & count_i <= 8) {\n document.getElementById(\"p_part9a\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part9a\").value = \"High\";\n }\n } else if (pos_9[n].localeCompare(\"(j)\") == 0) {\n for (j = 0; j < array_p9b.length; j++) {\n if (temp.indexOf(array_p9b[j].replace(/ /g, '')) >= 0) {\n count_j++;\n }\n }\n document.getElementById(\"part9b\").value = count_j;\n if (count_j >= 1 & count_j <= 8) {\n document.getElementById(\"p_part9b\").value = \"Low\";\n } else if (count_j >= 9 & count_j <= 15) {\n document.getElementById(\"p_part9b\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part9b\").value = \"High\";\n }\n } else if (pos_9[n].localeCompare(\"(k)\") == 0) {\n for (j = 0; j < array_p10.length; j++) {\n if (temp.indexOf(array_p10[j].replace(/ /g, '')) >= 0) {\n count_k++;\n }\n }\n document.getElementById(\"part10\").value = count_k;\n if (count_k >= 1 & count_k <= 3) {\n document.getElementById(\"p_part10\").value = \"Low\";\n } else if (count_k >= 4 & count_k <= 6) {\n document.getElementById(\"p_part10\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part10\").value = \"High\";\n }\n } else if (pos_9[n].localeCompare(\"(l)\") == 0) {\n for (j = 0; j < array_p11.length; j++) {\n if (temp.indexOf(array_p11[j].replace(/ /g, '')) >= 0) {\n count_l++;\n }\n }\n document.getElementById(\"part11\").value = count_l;\n if (count_l >= 1 & count_l <= 9) {\n document.getElementById(\"p_part11\").value = \"Low\";\n } else if (count_l >= 10 & count_l <= 17) {\n document.getElementById(\"p_part11\").value = \"Medium\";\n } else {\n document.getElementById(\"p_part11\").value = \"High\";\n }\n } else {\n\n }\n }\n\n }\n\n //Array of all the sympots\n var a_biotin = [\"Dermatitis\", \"Eye inammation\", \"Hair loss\", \"Loss of muscle control\", \"Insomnia\", \"Muscle weakness\"];\n var a_cal = [\"Brittle nails\", \"Cramps\", \"Delusions\", \"Depression\", \"Insomnia\", \"Irritability\",\n \"Osteoporosis\", \"Palpitations\", \"Periodontal disease\", \"Rickets\", \"Tooth decay\"];\n var a_chrom = [\"Anxiety\", \"Fatigue\", \"Glucose intolerance\", \"Adult-onset diabetes\"];\n var a_copper = [\"Anemia\", \"Arterial Damage\", \"Depression\", \"Diarrhea\", \"Fatigue\", \"Fragile Bones\", \"Hair Loss\", \"Hyperthyroidism\", \"Weakness\"];\n var a_fatty = [\"Diarrhea\", \"Dry Skin & Hair Loss\", \"Hair Loss\", \"Immune Impairment\", \"Infertility\",\n \"Poor Wound Healing\", \"Premenstrual Syndrome\", \"Acne\", \"Eczema\", \"Gall Stones\", \"Liver Degeneration\",\n \"Headaches when out in the hot sun\", \"Sunburn easily or suer sun poisening\"];\n var a_protein = [\"Increased secretion from mouth/nose/eyes.\", \"Swelling in hands and feet\", \"Muscle cramps\",\n \"Menstrual cramps\", \"Low Exercise Tolerance\", \"Cold hands and feet\", \"Bleeding Gums\", \"Low Immunity\",\n \"Fatigue\", \"Muscles more abby than normal\", \"Hair loss\", \"Splitting hair and nails\", \"Low Heart Rate\", \"Hypoglycemia\"];\n var a_carbs = [\"Decreased secretions from mouth/nose/eyes\", \"Muscle weakness\", \"Inability to concentrate\",\n \"Easily startled\", \"Diculty swallowing\", \"Voice aected by stress\"];\n var a_folic = [\"Anemia\", \"Apathy\", \"Diarrhea\", \"Fatigue\", \"Headaches\", \"Insomnia\", \"Loss of Appetite\", \"Neural Tube Defects in Fetus\",\n \"Paranoia\", \"Shortness of Breath\", \"Weakness\"];//here\n var a_ion = [\"Cretinism\", \"Fatigue\", \"Hypothyroidism\", \"Weight Gain\"];\n var a_iron = [\"Anemia\", \"Brittle nails\", \"Confusion\", \"Constipation\", \"Depression\", \"Dizziness\", \"Fatigue\", \"Headaches\", \"Inamed tongue\", \"Mouth lesions\"];//here\n var a_mag = [\"Anxiety\", \"Confusion\", \"Heart Attack\", \"Hyperactivity\", \"Insomnia\", \"Nervousness\", \"Muscular irritability\", \"Restlessness\", \"Weakness\", \"Hypertension\"];\n var a_man = [\"Atherosclerosis\", \"Dizziness\", \" Elevated cholesterol\", \"Glucose intolerance\", \"Hearing loss\", \"Loss of muscle control\", \"Ringing in ears\"];\n var a_nia = [\"Bad breath\", \"Canker sores\", \"Confusion\", \"Depression\", \"Dermatitis\", \"Diarrhea\", \"Emotional Instability\", \"Fatigue\", \"Irritability\", \"Loss of Appetite\", \"Memory Impairment\",\n \"Muscle Weakness\", \"Nausea\", \"Skin Eruptions & Inammation\", \"High Cholesterol or Triglycerides\", \"Poor Circulation\"];\n var a_acid = [\"Abdominal Pains\", \"Burning Feet\", \"Depression\", \"Eczema\", \"Fatigue\", \"Hair Loss\", \"Immune Impairment\", \"Insomnia\", \"Irritability\", \"Low Blood Pressure\", \"Muscle Spasms\",\n \"Nausea\", \"Poor Coordination\"];\n var a_pot = [\"Acne\", \"Constipation\", \"Depression\", \"Edema\", \"Excessive Water Consumption\", \"Fatigue\", \"Glucose Intolerance\", \"High Cholesterol Levels\", \"Insomnia\", \"Mental Impairment\",\n \"Muscle Weakness\", \"Nervousness\", \"Poor Reexes\"];\n var a_pyr = [\"Acne\", \"Anemia\", \"Arthritis\", \"Eye Inammation\", \"Depression\", \"Dizziness\", \"Facial Oiliness\", \"Fatigue\", \"Impaired Wound Healing\", \"Irritability\", \"Loss of Appetite\",\n \"Loss of Hair\", \"Mouth Lesions\", \"Nausea\"];\n var a_ribo = [\"Blurred Vision\", \"Cataracts\", \"Depression\", \"Dermatitis\", \"Dizziness\", \"Hair Loss\", \"Inamed Eyes\", \"Mouth Lesions\", \"Nervousness\",\n \"Neurological Symptoms (Numbness/Loss Of Sensation/\\\"Electic Shock\\\" Sensations)\", \"Seizures\", \"Sensitivity to Light\", \"Sleepiness\", \"Weakness\"];\n var a_sel = [\"Growth Impairment\", \"High Cholesterol Levels\", \"Increased Incidence of Cancer\", \"Pancreatic Insuciency (Inability to secrete adequate amounts of digestive enzymes)\",\n \"Immune Impairment\", \"Liver Impairment\", \"Male Sterility\"];\n var a_thia = [\"Confusion\", \"Constipated\", \"Digestive Problems\", \"Irritability\", \"Loss of Appetite\", \"Memory Loss\", \"Nervousness\", \"Numbness of Hands & Feet\", \"Pain Sensitivity\",\n \"Poor Coordination\", \"Weakness\", \"Slow Heart Beat or Rapid Heartbeat\", \"Enlarged Heart\", \"Heart Palpitations\"];\n var a_vita = [\"Acne\", \"Dry Hair\", \"Fatigue\", \"Growth Impairment\", \"Insomnia\", \"Hyperkeratosis (Thickening & roughness of skin)\", \"Immune Impairment\", \"Night Blindness\", \"Weight Loss\"];\n var a_vitb12 = [\"Anemia\", \"Constipation\", \"Depression\", \"Dizziness\", \"Fatigue\", \"Intestinal Disturbances\", \"Headaches\", \"Irritability\", \"Loss of Vibration Sensation\", \"Low Stomach Acid\", \"Mental Disturbances\",\n \"Moodiness\", \"Mouth Lesions\", \"Numbness\", \"Spinal Cord Degeneration\"];\n var a_vitc = [\"Bleeding Gums\", \"Depression\", \"Easy Bruising\", \"Impaired Wound Healing\", \"Irritability\", \"Joint Pains\", \"Loose Teeth\", \"Malaise\", \"Tiredness\"];\n var a_coq = [\"Ataxia\", \"Cardiomyopathy\", \"Cerebellar Atrophy\", \"Muscle Weakness\", \"Fatigue\", \"Seizures\", \"Kidney Failure\", \"Encephalopathy\", \"Learning Disabilities\", \"Myoglobinuria\",\n \"Sensorineural Deafness\", \"Scoliosis\", \"Lactic Acidemia\",\n \"Spasticity\", \"Hyper-Reexes\", \"Weakened Eye Muscles\", \"Atrophying of Muscle Tissue\", \"Gum Disease\"];\n var a_vitd = [\"Burning Sensation in Mouth\", \"Diarrhea\", \"Insomnia\", \"Myopia\", \"Nervousness\", \"Osteomalacia\", \"Osteoporosis\", \"Rickets\", \"Scalp Sweating\", \"Poor Immunity\"];\n var a_vite = [\"Gait Disturbances\", \"Poor Reexes\", \"Loss of Position Sense\", \"Loss of Vibration Sense\", \"Shortened Red Blood Cell Life\"];\n var a_vitk = [\"Bleeding Disorders\", \"Arteriolosclerosis\", \"Spurs\", \"Calcium Deposits\"];\n var a_zinc = [\"Acne\", \"Amnesia\", \"Apathy\", \"Brittle Nails\", \"Delayed Sexual Maturity\", \"Depression\", \"Diarrhea\", \"Eczema\", \"Fatigue\", \"Growth Impairment\", \"Hair Loss\", \"High Cholesterol Levels\", \"Immune Impairment\", \"Impotence\", \"Irritability\", \"Lethargy\",\n \"Loss of Appetite\", \"Loss of Sense of Taste\", \"Low Stomach Acid\", \"Male Infertility\", \"Memory Impairment\", \"Night Blindness\", \"Paranoia\", \"White Spots on Nails\", \"Wound Healing Impairment\", \"Low Testosterone\"];\n var array_positive = [];\n\n //Counters\n var c_biotin = 0;\n var c_cal = 0;\n var c_chrom = 0;\n var c_copper = 0;\n var c_fatty = 0;\n var c_protein = 0;\n var c_carbs = 0;\n var c_folic = 0;\n var c_ion = 0;\n var c_iron = 0;\n var c_mag = 0;\n var c_man = 0;\n var c_nia = 0;\n var c_acid = 0;\n var c_pot = 0;\n var c_pyr = 0;\n var c_ribo = 0;\n var c_Sel = 0;\n var c_thia = 0;\n var c_vita = 0;\n var c_vitb12 = 0;\n var c_vitc = 0;\n var c_coq = 0;\n var c_vitd = 0;\n var c_vite = 0;\n var c_vitk = 0;\n var c_zinc = 0;\n\n for (k = 0; k < all.length; k++) {\n if (s.indexOf(all[k]) >= 0) {\n array_positive.push(all[k].replace(/ /g, ''));\n }\n }\n if (array_positive.length > 0) {\n for (n = 0; n < array_positive.length; n++) {\n\n if (n < (array_positive.length - 1)) {\n var index1 = s.indexOf(array_positive[n]);\n var index2 = s.indexOf(array_positive[n + 1]);\n if (index2 - index1 > 1) {\n var temp = s.substring(index1, index2);\n } else {\n index2 = s.lastIndexOf(array_positive[n + 1]);\n var temp = s.substring(index1, index2);\n }\n\n } else { //last member of array\n var index1 = s.indexOf(array_positive[n]);\n var index2;\n for (j1 = 0; j1 < array_b.length; j1++) {\n index2 = s.indexOf(array_b[j1]);\n\n if (index2 >= 0) {\n break;\n }\n }\n if (index2 < 0) {\n index2 = pagesText.length;\n }\n var temp = s.substring(index1, index2);\n }\n\n if (array_positive[n].localeCompare(\"Biotin\") == 0) {\n for (j = 0; j < a_biotin.length; j++) {\n if (temp.indexOf(a_biotin[j].replace(/ /g, '')) >= 0) {\n c_biotin++;\n }\n }\n document.getElementById(\"biotin\").value = c_biotin;\n if (c_biotin == 1) {\n document.getElementById(\"p_biotin\").value = \"Low\";\n } else if (c_biotin >= 2 & c_biotin <= 3) {\n document.getElementById(\"p_biotin\").value = \"Medium\";\n } else {\n document.getElementById(\"p_biotin\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Calcium\") == 0) {\n for (j = 0; j < a_cal.length; j++) {\n if (temp.indexOf(a_cal[j].replace(/ /g, '')) >= 0) {\n c_cal++;\n }\n }\n document.getElementById(\"calc\").value = c_cal;\n if (c_cal >= 1 & c_cal <= 3) {\n document.getElementById(\"p_calc\").value = \"Low\";\n } else if (c_cal >= 4 & c_cal <= 5) {\n document.getElementById(\"p_calc\").value = \"Medium\";\n } else {\n document.getElementById(\"p_calc\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Chromium\") == 0) {\n for (j = 0; j < a_chrom.length; j++) {\n if (temp.indexOf(a_chrom[j].replace(/ /g, '')) >= 0) {\n c_chrom++;\n }\n }\n document.getElementById(\"chrom\").value = c_chrom;\n if (c_chrom == 1) {\n document.getElementById(\"p_chrom\").value = \"Low\";\n } else if (c_chrom == 2) {\n document.getElementById(\"p_chrom\").value = \"Medium\";\n } else {\n document.getElementById(\"p_chrom\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Copper\") == 0) {\n for (j = 0; j < a_copper.length; j++) {\n if (temp.indexOf(a_copper[j].replace(/ /g, '')) >= 0) {\n c_copper++;\n }\n }\n document.getElementById(\"copper\").value = c_copper;\n if (c_copper >= 1 & c_copper <= 2) {\n document.getElementById(\"p_copper\").value = \"Low\";\n } else if (c_copper >= 3 & c_copper <= 4) {\n document.getElementById(\"p_copper\").value = \"Medium\";\n } else {\n document.getElementById(\"p_copper\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"EssentialFattyAcids\") == 0) {\n for (j = 0; j < a_fatty.length; j++) {\n if (temp.indexOf(a_fatty[j].replace(/ /g, '')) >= 0) {\n c_fatty++;\n }\n }\n document.getElementById(\"fattyacid\").value = c_fatty;\n if (c_fatty >= 1 & c_fatty <= 3) {\n document.getElementById(\"p_fattyacid\").value = \"Low\";\n } else if (c_fatty >= 4 & c_fatty <= 6) {\n document.getElementById(\"p_fattyacid\").value = \"Medium\";\n } else {\n document.getElementById(\"p_fattyacid\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Protein\") == 0) {\n for (j = 0; j < a_protein.length; j++) {\n if (temp.indexOf(a_protein[j].replace(/ /g, '')) >= 0) {\n c_protein++;\n }\n }\n document.getElementById(\"protein\").value = c_protein;\n if (c_protein >= 1 & c_protein <= 4) {\n document.getElementById(\"p_protein\").value = \"Low\";\n } else if (c_protein >= 5 & c_protein <= 7) {\n document.getElementById(\"p_protein\").value = \"Medium\";\n } else {\n document.getElementById(\"p_protein\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Carbohydrates\") == 0) {\n for (j = 0; j < a_carbs.length; j++) {\n if (temp.indexOf(a_carbs[j].replace(/ /g, '')) >= 0) {\n c_carbs++;\n }\n }\n document.getElementById(\"carbs\").value = c_carbs;\n if (c_carbs == 1) {\n document.getElementById(\"p_carbs\").value = \"Low\";\n } else if (c_carbs >= 2 & c_carbs <= 3) {\n document.getElementById(\"p_carbs\").value = \"Medium\";\n } else {\n document.getElementById(\"p_carbs\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"FolicAcid\") == 0) {\n for (j = 0; j < a_folic.length; j++) {\n if (temp.indexOf(a_folic[j].replace(/ /g, '')) >= 0) {\n c_folic++;\n }\n }\n document.getElementById(\"folic\").value = c_folic;\n if (c_folic >= 1 & c_folic <= 3) {\n document.getElementById(\"p_folic\").value = \"Low\";\n } else if (c_folic >= 4 & c_folic <= 5) {\n document.getElementById(\"p_folic\").value = \"Medium\";\n } else {\n document.getElementById(\"p_folic\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Iodine\") == 0) {\n for (j = 0; j < a_ion.length; j++) {\n if (temp.indexOf(a_ion[j].replace(/ /g, '')) >= 0) {\n c_ion++;\n }\n }\n document.getElementById(\"iodine\").value = c_ion;\n if (c_ion == 1) {\n document.getElementById(\"p_iodine\").value = \"Low\";\n } else if (c_ion == 2) {\n document.getElementById(\"p_iodine\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iodine\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Iron\") == 0) {\n for (j = 0; j < a_iron.length; j++) {\n if (temp.indexOf(a_iron[j].replace(/ /g, '')) >= 0) {\n c_iron++;\n }\n }\n document.getElementById(\"iron\").value = c_iron;\n if (c_iron >= 1 & c_iron <= 2) {\n document.getElementById(\"p_iron\").value = \"Low\";\n } else if (c_iron >= 3 & c_iron <= 5) {\n document.getElementById(\"p_iron\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iron\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Magnesium\") == 0) {\n for (j = 0; j < a_mag.length; j++) {\n if (temp.indexOf(a_mag[j].replace(/ /g, '')) >= 0) {\n c_mag++;\n }\n }\n document.getElementById(\"mag\").value = c_mag;\n if (c_mag >= 1 & c_mag <= 2) {\n document.getElementById(\"p_mag\").value = \"Low\";\n } else if (c_mag >= 3 & c_mag <= 5) {\n document.getElementById(\"p_mag\").value = \"Medium\";\n } else {\n document.getElementById(\"p_mag\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Manganese\") == 0) {\n for (j = 0; j < a_man.length; j++) {\n if (temp.indexOf(a_man[j].replace(/ /g, '')) >= 0) {\n c_man++;\n }\n }\n document.getElementById(\"mana\").value = c_man;\n if (c_man == 1) {\n document.getElementById(\"p_mana\").value = \"Low\";\n } else if (c_man >= 2 & c_man <= 3) {\n document.getElementById(\"p_mana\").value = \"Medium\";\n } else {\n document.getElementById(\"p_mana\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Niacin\") == 0) {\n for (j = 0; j < a_nia.length; j++) {\n if (temp.indexOf(a_nia[j].replace(/ /g, '')) >= 0) {\n c_nia++;\n }\n }\n document.getElementById(\"nia\").value = c_nia;\n if (c_nia >= 1 & c_nia <= 4) {\n document.getElementById(\"p_nia\").value = \"Low\";\n } else if (c_nia >= 5 & c_nia <= 8) {\n document.getElementById(\"p_nia\").value = \"Medium\";\n } else {\n document.getElementById(\"p_nia\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"PantothenicAcid(B6)\") == 0) {\n for (j = 0; j < a_acid.length; j++) {\n if (temp.indexOf(a_acid[j].replace(/ /g, '')) >= 0) {\n c_acid++;\n }\n }\n document.getElementById(\"pana\").value = c_acid;\n if (c_acid >= 1 & c_acid <= 3) {\n document.getElementById(\"p_pana\").value = \"Low\";\n } else if (c_acid >= 4 & c_acid <= 6) {\n document.getElementById(\"p_pana\").value = \"Medium\";\n } else {\n document.getElementById(\"p_pana\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Potassium\") == 0) {\n for (j = 0; j < a_pot.length; j++) {\n if (temp.indexOf(a_pot[j].replace(/ /g, '')) >= 0) {\n c_pot++;\n }\n }\n document.getElementById(\"pot\").value = c_pot;\n if (c_pot >= 1 & c_pot <= 4) {\n document.getElementById(\"p_pot\").value = \"Low\";\n } else if (c_pot >= 5 & c_pot <= 7) {\n document.getElementById(\"p_pot\").value = \"Medium\";\n } else {\n document.getElementById(\"p_pot\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Pyridoxine(B6)\") == 0) {\n for (j = 0; j < a_pyr.length; j++) {\n if (temp.indexOf(a_pyr[j].replace(/ /g, '')) >= 0) {\n c_pyr++;\n }\n }\n document.getElementById(\"b6\").value = c_pyr;\n if (c_pyr >= 1 & c_pyr <= 4) {\n document.getElementById(\"p_b6\").value = \"Low\";\n } else if (c_pyr >= 5 & c_pyr <= 7) {\n document.getElementById(\"p_b6\").value = \"Medium\";\n } else {\n document.getElementById(\"p_b6\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Riboavin\") == 0) {\n for (j = 0; j < a_ribo.length; j++) {\n if (temp.indexOf(a_ribo[j].replace(/ /g, '')) >= 0) {\n c_ribo++;\n }\n }\n document.getElementById(\"ribo\").value = c_ribo;\n if (c_ribo >= 1 & c_ribo <= 4) {\n document.getElementById(\"p_ribo\").value = \"Low\";\n } else if (c_ribo >= 5 & c_ribo <= 8) {\n document.getElementById(\"p_ribo\").value = \"Medium\";\n } else {\n document.getElementById(\"p_ribo\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Selenium\") == 0) {\n for (j = 0; j < a_sel.length; j++) {\n if (temp.indexOf(a_sel[j].replace(/ /g, '')) >= 0) {\n c_Sel++;\n }\n }\n document.getElementById(\"sel\").value = c_Sel;\n if (c_Sel == 1) {\n document.getElementById(\"p_sel\").value = \"Low\";\n } else if (c_Sel >= 2 & c_Sel <= 3) {\n document.getElementById(\"p_sel\").value = \"Medium\";\n } else {\n document.getElementById(\"p_sel\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"Thiamin\") == 0) {\n for (j = 0; j < a_thia.length; j++) {\n if (temp.indexOf(a_thia[j].replace(/ /g, '')) >= 0) {\n c_thia++;\n }\n }\n document.getElementById(\"thia\").value = c_thia;\n if (c_thia >= 1 & c_thia <= 3) {\n document.getElementById(\"p_thia\").value = \"Low\";\n } else if (c_thia >= 4 & c_thia <= 7) {\n document.getElementById(\"p_thia\").value = \"Medium\";\n } else {\n document.getElementById(\"p_thia\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminA\") == 0) {\n for (j = 0; j < a_vita.length; j++) {\n if (temp.indexOf(a_vita[j].replace(/ /g, '')) >= 0) {\n c_vita++;\n }\n }\n document.getElementById(\"vita\").value = c_vita;\n if (c_vita >= 1 & c_vita <= 2) {\n document.getElementById(\"p_vita\").value = \"Low\";\n } else if (c_vita >= 3 & c_vita <= 4) {\n document.getElementById(\"p_vita\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vita\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminB-12\") == 0) {\n for (j = 0; j < a_vitb12.length; j++) {\n if (temp.indexOf(a_vitb12[j].replace(/ /g, '')) >= 0) {\n c_vitb12++;\n }\n }\n document.getElementById(\"vitb12\").value = c_vitb12;\n if (c_vitb12 >= 1 & c_vitb12 <= 4) {\n document.getElementById(\"p_vitb12\").value = \"Low\";\n } else if (c_vitb12 >= 5 & c_vitb12 <= 7) {\n document.getElementById(\"p_vitb12\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitb12\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminC\") == 0) {\n for (j = 0; j < a_vitc.length; j++) {\n if (temp.indexOf(a_vitc[j].replace(/ /g, '')) >= 0) {\n c_vitc++;\n }\n }\n document.getElementById(\"vitc\").value = c_vitc;\n if (c_vitc >= 1 & c_vitc <= 2) {\n document.getElementById(\"p_vitc\").value = \"Low\";\n } else if (c_vitc >= 3 & c_vitc <= 4) {\n document.getElementById(\"p_vitc\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitc\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"CoQ10\") == 0) {\n for (j = 0; j < a_coq.length; j++) {\n if (temp.indexOf(a_coq[j].replace(/ /g, '')) >= 0) {\n c_coq++;\n }\n }\n document.getElementById(\"coq\").value = c_coq; //Larry\n if (c_coq >= 1 & c_coq <= 4) {\n document.getElementById(\"p_coq\").value = \"Low\";\n } else if (c_coq >= 5 & c_coq <= 9) {\n document.getElementById(\"p_coq\").value = \"Medium\";\n } else {\n document.getElementById(\"p_coq\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminD\") == 0) {\n for (j = 0; j < a_vitd.length; j++) {\n if (temp.indexOf(a_vitd[j].replace(/ /g, '')) >= 0) {\n c_vitd++;\n }\n }\n document.getElementById(\"vitd\").value = c_vitd;\n if (c_vitd >= 1 & c_vitd <= 2) {\n document.getElementById(\"p_vitd\").value = \"Low\";\n } else if (c_vitd >= 3 & c_vitd <= 5) {\n document.getElementById(\"p_vitd\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitd\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminE\") == 0) {\n for (j = 0; j < a_vite.length; j++) {\n if (temp.indexOf(a_vite[j].replace(/ /g, '')) >= 0) {\n c_vite++;\n }\n }\n document.getElementById(\"vite\").value = c_vite;\n if (c_vite == 1) {\n document.getElementById(\"p_vite\").value = \"Low\";\n } else if (c_vite == 2) {\n document.getElementById(\"p_vite\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vite\").value = \"High\";\n }\n } else if (array_positive[n].localeCompare(\"VitaminK\") == 0) {\n for (j = 0; j < a_vitk.length; j++) {\n if (temp.indexOf(a_vitk[j].replace(/ /g, '')) >= 0) {\n c_vitk++;\n }\n }\n document.getElementById(\"vitk\").value = c_vitk;\n if (c_vitk == 1) {\n document.getElementById(\"p_vitk\").value = \"Low\";\n } else if (c_vitk == 2) {\n document.getElementById(\"p_vitk\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vitk\").value = \"High\";\n }\n }\n else {\n for (j = 0; j < a_zinc.length; j++) {\n if (temp.indexOf(a_zinc[j].replace(/ /g, '')) >= 0) {\n c_zinc++;\n }\n }\n document.getElementById(\"zinc\").value = c_zinc;\n if (c_zinc >= 1 & c_zinc <= 7) {\n document.getElementById(\"p_zinc\").value = \"Low\";\n } else if (c_zinc >= 8 & c_zinc <= 13) {\n document.getElementById(\"p_zinc\").value = \"Medium\";\n } else {\n document.getElementById(\"p_zinc\").value = \"High\";\n }\n }\n }\n }\n\n a_i = [\"Belching or gas within one hour after eating\", \"Heartburn or acid reux\", \"Bad breath\", \"Bloated within one hour after eating\", \"Loss of taste for meat\",//acid reflux\n \"Sweat has strong odor\", \"Stomach upset by taking vitamins\", \"Feel like skipping breakfast\", \"Sleepy after meals\", \"Feel better if you do not eat\",\n \"Fingernails chip, peel or break easily\", \"Anemia unresponsive to iron\", \"Stomach pains or cramps\", \"Chronic Diarrhea\", \"Diarrhea shortly after meals\",\n \"Black or tarry colored tools\", \"Undigested food in stool\"];\n a_ii = [\"Pain between shoulder blades\", \"History of morning sickness\", \"Bitter taste in mouth, especially after meals\", \"I am a recovering alcoholic\", \"Sensitive to tobacco smoke\",\n \"Sensitive to Nutrasweet (aspartame)\", \"Stomach upset by greasy foods\", \"Light or clay colored stools\", \"Become sick if you drink wine\", \" History of drug or alcohol abuse\",\n \"Pain under right side of rib cage\", \"Greasy or shinny stools\", \"Dry skin, itchy feet or skin peels on feet\", \"Easily intoxicated if you drink wine\", \" History of Hepatitis\",\n \"Hemorrhoids or varicose veins\", \"Nausea\", \"Headache over eyes\", \"Easily hung over if you drink wine\", \"Long term use of prescription or recreational drugs\",\n \"Chronic fatigue or bromyalgia\", \"Sea, car, airplane or motion sickness\", \"Gallbladder attack or removed\", //Chronic fatigue or fibromyalgia\n \"How much alcohol do you drink per week?\", \"Sensitive to chemicals\", \"Nutrasweet consumption\"];\n a_iii = [\"Food Allergies\", \"Abdominal bloating 1 to 2 hours after eating\", \"Pulse speeds after eating\", \"Specic foods make you tired or burdened\", \"Airborne allergies\",//specific \n \"Experience hives\", \"Sinus congestion\", \"Crave bread or noodles\", \"Alternating constipation and diarrhea\", \"Crohns disease\", \"Wheat or grain sensitivity\", //crohn's\n \"Asthma, sinus infections, stuy nose\", \"Dairy sensitivity\", \"Bizarre, vivid dreams, nightmares\", \"Feel spacy or unreal\", \"Use over the counter pain medications\"];//stuffy\n a_iv = [\"Anus itches\", \"Coated tongue\", \"Feel worse in moldy or dusty places\", \"Have taken antibiotics for long periods (2 to 3 months or more)\", \"Fungus or yeast infection\",\n \"Ringworm/Nail fungus\", \"Blood in stool\", \" Mucous in stool\", \"Painful to press on outer side of thighs\", \"Cramping in lower abdominal region\", \"Dark circles under eyes\",\n \"Excessive foul smelling lower bowel gas\", \"Irritable bowel or mucous colitis\", \"Strong body odors\", \"Less than 1 bowel movement daily\"];\n a_v = [\"Awaken a few hours after falling asleep, hard to get back to sleep\", \"Crave Sweets\", \"Bing or uncontrolled eating\", \"Excessive appetite\", \"Crave coee or sugar in afternoon\" //coffee\n , \"Sleepy in the afternoon\", \"Fatigue that is relieved by eating\", \"Headaches if meals are skipped\", \"Irritable before meals\", \"Shaky if meals are delayed\",\n \"Family members with diabetes\", \"Frequent thirst\", \"Frequent Urination\"];\n a_vi = [\"Tend to be a night person\", \"Diculty falling asleep\", \"Slow starter in the morning\", \"Keyed up, trouble calming down\", \"Blood pressure above 120/80\", //difficulty\n \"A headache after exercising\", \"Feeling wired or jittery after drinking coee\", \"Clench or grind teeth\", \"Calm on the outside, trouble on the inside\", //coffee\n \"Chronic low back pain, worse with fatigue\", \"Become dizzy when standing up suddenly\", \"Diculty maintaining manipulative correction\",\n \"Pain after manipulative correction\", \"Arthritic tendencies\", \"Crave salty foods\", \"Salt foods before tasting\", \"Perspire easily\",\n \"Chronic fatigue or get drowsy often\", \"Afternoon yawning\", \"After headaches\", \"Asthma, wheezing or diculty breathing\", \"Pain on the medial or inner side of the knee\",\n \"Tendency to sprain ankles or shin splints\", \"Tendency to need sunglasses\", \"Allergies and/or hives\", \"Weakness, dizziness\"];\n a_vii = [\"Sensitive/allergic to iodine\", \"Diculty gaining weight, even with large appetite\", \"Nervous, emotional, cant work under pressure\", \"Inward trembling\", \"Flush easily\",\n \"Fast pulse at rest\", \"Intolerant of high temperatures\", \"Diculty losing weight\", \"Mentally sluggish, reduced initiative\", \"Easily fatigued, sleepy during the day\",\n \"Sensitive to cold, poor circulation (cold hands and feet)\", \"Chronic constipation\", \"Excessive hair loss and/or coarse hair\", \"Morning headaches, wear o during the day\",\n \"Seasonal sadness\", \"Loss of lateral 1/3 of eyebrow\"];\n a_viii = [\"Prostate problems\", \"Diculty with urination or dribbling\", \"Dicult to start or stop urine stream\", \"Pain or burning during urination\", \"Waking to urinate at night\",\n \"Interruption of stream during urination\", \"Pain on inside of legs or heels\", \"Feeling of incomplete bowel evacuation\", \"Decreased sexual function\"];\n a_ix = [\"Depression during periods\", \"Mood swings associated with periods (PMS)\", \"Crave chocolate around period\", \"Breast tenderness associated with cycle\", \"Excessive menstrual ow\",\n \"Scanty blood ow during periods\", \"Occasional skipped periods\", \"Variations in menstrual cycle\", \"Endometriosis\", \"Uterine broids\", \"Breast broids, benign masses\",\n \"Painful intercourse\", \"Vaginal discharge\", \"Vaginal itchiness\", \"Vaginal dryness\", \"Weight gain around hips, thighs, and buttocks\", \"Excessive facial or body hair\",\n \"Thinning skin\", \"Hotashes\", \"Night sweats (in menopausal women)\"];\n a_x = [\"Aware of heavy or irregular breathing\", \"Discomfort at high altitudes\", \"Air hunger or sigh frequently\", \"Compelled to open windows in a closed room\", \"Shortness of breath with moderate exertion\",\n \"Ankles swell, especially at end of day\", \"Cough at night\", \"Blush or face turns red for no reason\", \"Muscle cramps with exertion\", \"Cold hands and feet , even in the warm season\",\n \"Dull pain or tightness in chest and/or radiate into right arm, worse with exertion\", \"Numbness in certain parts of the body\", \"Dry skin despite regular consumption of water\", \"Frequent dizziness\",\n \"Memory loss\", \"Lack of energy or frequent exhaustion\", \"Skin discoloration blemishes, or spots\", \"Weakened immune system\", \"Unexplained digestive problems\", \"Low libido (sex drive)\",\n \"Decreased cognitive ability\", \"Brittle hair and nails\", \"Hair loss\", \"Headaches\", \"Dark circles under eyes\", \"Problems with sleep\", \"Chronic pain or muscular and joint stiness\",\n \"Problems with leg ulcers or bed sores\", \"Varicose veins\"];\n a_xi = [\"Pain in mid-back region\", \"Puy around the eyes, dark circles under eyes\", \"History of kidney stones\", \"Cloudy, bloody or darkened urine\", \"Urine has a strong odor\"];\n a_xii = [\"Runny or drippy nose\", \"Catch colds at the beginning of winter\", \"Adult acne\", \"Itchy skin\", \"Cysts, boils, rashes\", \"History of Epstein Bar\", \"Frequent colds or u\",\n \"Frequent infections\", \"Mucous-producing cough\", \"History of Mono, Herpes\", \"History of Shingles, Chronic fatigue, Hepatitis or other chronic viral condition\"];\n b_pos = [];\n\n var c_i = 0;\n var c_ii = 0;\n var c_iii = 0;\n var c_iv = 0;\n var c_v = 0;\n var c_vi = 0;\n var c_vii = 0;\n var c_viii = 0;\n var c_ix = 0;\n var c_x = 0;\n var c_xi = 0;\n var c_xii = 0;\n\n for (k = 0; k < array_b.length; k++) {\n if (s.indexOf(array_b[k]) >= 0) {\n var first = s.indexOf(array_b[k]); //first occurence\n if (array_b[k] == \"V.\") {\n first = s.lastIndexOf(array_b[k]);\n }\n var previous = first - 1;\n var seconddot = first + 1;\n var thirddot = first + 2;\n var fourthdot = first + 3;/*\n console.log(\"================================\");\n console.log(\"previous :\", s.charAt(previous) , previous);\n console.log(\"firstchar :\", s.charAt(first), first);\n console.log(\"seconddot \", s.charAt(seconddot) , seconddot);\n console.log(\"thirddot :\", s.charAt(thirddot));\n console.log(\"fourthdot :\", s.charAt(fourthdot));*/\n\n if (array_b[k] == \"I.\" && s.charAt(seconddot) == \".\" && s.charAt(previous) != \"I\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"II.\" && s.charAt(thirddot) == \".\" && s.charAt(previous) != \"I\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"III.\" && s.charAt(fourthdot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"IV.\" && s.charAt(thirddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"V.\" && s.charAt(seconddot) == \".\" && s.charAt(previous) != \"I\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"VI.\" && s.charAt(thirddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"VII.\" && s.charAt(fourthdot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"X.\" && s.charAt(seconddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"XI.\" && s.charAt(thirddot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"XII.\" && s.charAt(fourthdot) == \".\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n } else if (array_b[k] == \"VIII\" || array_b[k] == \"IX\") {\n b_pos.push(array_b[k].replace(/ /g, ''));\n }\n }\n }\n //console.log(b_pos);\n if (b_pos.length > 0) {\n for (x = 0; x < b_pos.length; x++) {\n\n if (x < (b_pos.length - 1)) {\n var index1 = s.indexOf(b_pos[x]);\n var index2 = s.indexOf(b_pos[x + 1]);\n if (index2 - index1 > 1) {\n var temp = s.substring(index1, index2);\n } else {\n index2 = s.lastIndexOf(b_pos[x + 1]);\n var temp = s.substring(index1, index2);\n }\n } else { //last member of array\n var index1 = s.indexOf(b_pos[x]);\n var index2 = s.indexOf(\"List\");\n if (index2 < 0) {\n var temp = s.substring(index1, s.length);\n } else {\n var temp = s.substring(index1, index2);\n }\n }\n if (b_pos[x].localeCompare(\"I.\") == 0) {\n for (j = 0; j < a_i.length; j++) {\n if (temp.indexOf(a_i[j].replace(/ /g, '')) >= 0) {\n c_i++;\n }\n }\n document.getElementById(\"u_i\").value = c_i;\n if (c_i >= 1 & c_i <= 4) {\n document.getElementById(\"p_i\").value = \"Low\";\n } else if (c_i >= 5 & c_i <= 8) {\n document.getElementById(\"p_i\").value = \"Medium\";\n } else {\n document.getElementById(\"p_i\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"II.\") == 0) {\n for (j = 0; j < a_ii.length; j++) {\n if (temp.indexOf(a_ii[j].replace(/ /g, '')) >= 0) {\n c_ii++;\n }\n }\n document.getElementById(\"ii\").value = c_ii;\n if (c_ii >= 1 & c_ii <= 6) {\n document.getElementById(\"p_ii\").value = \"Low\";\n } else if (c_ii >= 7 & c_ii <= 12) {\n document.getElementById(\"p_ii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_ii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"III.\") == 0) {\n for (j = 0; j < a_iii.length; j++) {\n if (temp.indexOf(a_iii[j].replace(/ /g, '')) >= 0) {\n c_iii++;\n }\n }\n document.getElementById(\"iii\").value = c_iii;\n if (c_iii >= 1 & c_iii <= 4) {\n document.getElementById(\"p_iii\").value = \"Low\";\n } else if (c_iii >= 5 & c_iii <= 8) {\n document.getElementById(\"p_iii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"IV.\") == 0) {\n for (j = 0; j < a_iv.length; j++) {\n if (temp.indexOf(a_iv[j].replace(/ /g, '')) >= 0) {\n c_iv++;\n }\n }\n document.getElementById(\"iv\").value = c_iv;\n if (c_iv >= 1 & c_iv <= 4) {\n document.getElementById(\"p_iv\").value = \"Low\";\n } else if (c_iv >= 5 & c_iv <= 7) { //Larry\n document.getElementById(\"p_iv\").value = \"Medium\";\n } else {\n document.getElementById(\"p_iv\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"V.\") == 0) {\n for (j = 0; j < a_v.length; j++) {\n if (temp.indexOf(a_v[j].replace(/ /g, '')) >= 0) {\n c_v++;\n }\n }\n document.getElementById(\"v\").value = c_v;\n if (c_v >= 1 & c_v <= 3) {\n document.getElementById(\"p_v\").value = \"Low\";\n } else if (c_v >= 4 & c_v <= 6) {\n document.getElementById(\"p_v\").value = \"Medium\";\n } else {\n document.getElementById(\"p_v\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"VI.\") == 0) {\n for (j = 0; j < a_vi.length; j++) {\n if (temp.indexOf(a_vi[j].replace(/ /g, '')) >= 0) {\n c_vi++;\n }\n }\n document.getElementById(\"vi\").value = c_vi;\n if (c_vi >= 1 & c_vi <= 6) {\n document.getElementById(\"p_vi\").value = \"Low\";\n } else if (c_vi >= 7 & c_vi <= 13) {\n document.getElementById(\"p_vi\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vi\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"VII.\") == 0) {\n for (j = 0; j < a_vii.length; j++) {\n if (temp.indexOf(a_vii[j].replace(/ /g, '')) >= 0) {\n c_vii++;\n }\n }\n document.getElementById(\"vii\").value = c_vii;\n if (c_vii >= 1 & c_vii <= 4) {\n document.getElementById(\"p_vii\").value = \"Low\";\n } else if (c_vii >= 5 & c_vii <= 8) {\n document.getElementById(\"p_vii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_vii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"VIII\") == 0) {\n for (j = 0; j < a_viii.length; j++) {\n if (temp.indexOf(a_viii[j].replace(/ /g, '')) >= 0) {\n c_viii++;\n }\n }\n document.getElementById(\"viii\").value = c_viii;\n if (c_viii >= 1 & c_viii <= 2) {\n document.getElementById(\"p_viii\").value = \"Low\";\n } else if (c_viii >= 3 & c_viii <= 4) {\n document.getElementById(\"p_viii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_viii\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"IX\") == 0) {\n for (j = 0; j < a_ix.length; j++) {\n if (temp.indexOf(a_ix[j].replace(/ /g, '')) >= 0) {\n c_ix++;\n }\n }\n document.getElementById(\"ix\").value = c_ix;\n if (c_ix >= 1 & c_ix <= 5) {\n document.getElementById(\"p_ix\").value = \"Low\";\n } else if (c_ix >= 6 & c_ix <= 10) {\n document.getElementById(\"p_ix\").value = \"Medium\";\n } else {\n document.getElementById(\"p_ix\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"X.\") == 0) {\n for (j = 0; j < a_x.length; j++) {\n if (temp.indexOf(a_x[j].replace(/ /g, '')) >= 0) {\n c_x++;\n }\n }\n document.getElementById(\"x\").value = c_x;\n if (c_x >= 1 & c_x <= 3) {\n document.getElementById(\"p_x\").value = \"Low\";\n } else if (c_x >= 4 & c_x <= 6) {\n document.getElementById(\"p_x\").value = \"Medium\";\n } else {\n document.getElementById(\"p_x\").value = \"High\";\n }\n } else if (b_pos[x].localeCompare(\"XI.\") == 0) {\n for (j = 0; j < a_xi.length; j++) {\n if (temp.indexOf(a_xi[j].replace(/ /g, '')) >= 0) {\n c_xi++;\n }\n }\n document.getElementById(\"xi\").value = c_xi;\n if (c_xi == 1) {\n document.getElementById(\"p_xi\").value = \"Low\";\n } else if (c_xi = 2) {\n document.getElementById(\"p_xi\").value = \"Medium\";\n } else {\n document.getElementById(\"p_xi\").value = \"High\";\n }\n } else {\n for (j = 0; j < a_xii.length; j++) {\n if (temp.indexOf(a_xii[j].replace(/ /g, '')) >= 0) {\n c_xii++;\n }\n }\n document.getElementById(\"xii\").value = c_xii;\n if (c_xii >= 1 & c_xii <= 3) {\n document.getElementById(\"p_xii\").value = \"Low\";\n } else if (c_xii >= 4 & c_xii <= 5) {\n document.getElementById(\"p_xii\").value = \"Medium\";\n } else {\n document.getElementById(\"p_xii\").value = \"High\";\n }\n }\n }\n }\n //}\n });\n }, function (reason) {\n // PDF loading error\n console.log(\"Error loading pdf\");\n console.error(reason);\n });\n}", "title": "" }, { "docid": "e4e38397f12ca0ef7a8ad0e3b4ab4faf", "score": "0.52584326", "text": "function purchaseExcelReport(data_record_po) {\n\n}", "title": "" }, { "docid": "ed33f376d6efbf5acc56358be88ebffe", "score": "0.52449554", "text": "function downloadPdf() \n\t{\n\tdownload('pdf');\n\t}", "title": "" }, { "docid": "725c4975688ab9efd9615ff42e741639", "score": "0.52399594", "text": "function NavPrintPdf(/**string*/ baseName, /**string*/ number)\r\n{\r\n\tSeS('G_PrintMenu').DoClick();\r\n\tSeS('G_PDFMenuItem').DoClick();\r\n\tSeS('G_SavePrintedDocument').DoClick();\r\n\tvar outputFolder = Global.GetFullPath(\"OutputFiles\");\r\n\tvar filePath = NavMakeFileName(outputFolder, baseName, number, \"pdf\");\r\n\tTester.Message(\"Printing file: \" + filePath);\r\n\tSeS('G_SaveDialogFileName').DoSendKeys(filePath);\r\n\tSeS('G_SaveDialogSaveButton').DoClick();\r\n}", "title": "" }, { "docid": "930f0f04481eb5c1eb25b2b349323af6", "score": "0.5228045", "text": "function pageExportData(){\n BJUI.alertmsg(\"confirm\", \"是否确定要导出数据?\",{\n okCall:function(){\n $.fileDownload('/cmpage/page/excel_export?'+$.CurrentNavtab.find('#pagerForm').serialize(), {\n failCallback: function(responseHtml, url) {\n BJUI.alertmsg(\"warn\", \"下载文件失败!\");\n }\n });\n }\n });\n return false;\n}", "title": "" }, { "docid": "38cb43b5dc69fb831b805a6815a6fc15", "score": "0.5219488", "text": "async generatePDF(data) {\n console.log(\"the id is\", data);\n let response = await axios.get(`${API_URL}/y/generatePDF?text=${data}`);\n return response;\n }", "title": "" }, { "docid": "217100b4bacb8da6e733b4cea5e4c032", "score": "0.5214304", "text": "printWaterTechCon(apzId, project) {\n var token = sessionStorage.getItem('tokenInfo');\n if (token) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"get\", window.url + \"api/print/tc/water/\" + apzId, true);\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + token);\n xhr.onload = function () {\n if (xhr.status === 200) {\n //test of IE\n if (typeof window.navigator.msSaveBlob === \"function\") {\n window.navigator.msSaveBlob(xhr.response, \"tc-\" + new Date().getTime() + \".pdf\");\n } else {\n var data = JSON.parse(xhr.responseText);\n var today = new Date();\n var curr_date = today.getDate();\n var curr_month = today.getMonth() + 1;\n var curr_year = today.getFullYear();\n var formated_date = \"(\" + curr_date + \"-\" + curr_month + \"-\" + curr_year + \")\";\n\n var base64ToArrayBuffer = (function () {\n \n return function (base64) {\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n \n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n \n return bytes; \n }\n \n }());\n\n var saveByteArray = (function () {\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n \n return function (data, name) {\n var blob = new Blob(data, {type: \"octet/stream\"}),\n url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = name;\n a.click();\n setTimeout(function() {window.URL.revokeObjectURL(url);},0);\n };\n\n }());\n\n saveByteArray([base64ToArrayBuffer(data.file)], \"ТУ-Вода-\" + project + formated_date + \".pdf\");\n }\n } else {\n alert('Не удалось скачать файл');\n }\n }\n xhr.send();\n } else {\n console.log('Время сессии истекло.');\n }\n }", "title": "" }, { "docid": "da2cc3d52ff98cff748e61a138af4cd8", "score": "0.5213073", "text": "function onPubreceiptGenerated( message ) {\n var\n data = message.data && message.data[0];\n\n if ( !data.activityId || -1 === self.printWhenReady.indexOf( data.activityId ) ) {\n // new PUBRECEIPT was not expected, generated by another process or tab\n return;\n }\n\n //TODO: remove the activityId\n\n // show print modal\n if ( data.mediaId && '' !== data.mediaId ) {\n data.documentUrl = '/media/' + data.mediaId + '_original.APPLICATION_PDF.pdf';\n Y.doccirrus.modals.printPdfModal.show( data );\n }\n }", "title": "" }, { "docid": "caa1e0d154660a4549546925f3abc237", "score": "0.5201301", "text": "constructor (values: $Shape<ExportAsPdfStateConfig>) {\n super(values)\n }", "title": "" }, { "docid": "abb50ebbd939bd9b873951b789ac8702", "score": "0.5194384", "text": "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}", "title": "" }, { "docid": "d5340015138831fedefb26847742aaeb", "score": "0.51936156", "text": "function savePDF(domElement, options, callback) {\n if (options === void 0) { options = {}; }\n new __WEBPACK_IMPORTED_MODULE_2__KendoDrawingAdapter__[\"a\" /* default */](__WEBPACK_IMPORTED_MODULE_0__progress_kendo_drawing__[\"a\" /* drawDOM */], __WEBPACK_IMPORTED_MODULE_0__progress_kendo_drawing__[\"b\" /* exportPDF */], __WEBPACK_IMPORTED_MODULE_1__progress_kendo_file_saver__[\"a\" /* saveAs */], domElement, options).savePDF(callback);\n}", "title": "" }, { "docid": "d5340015138831fedefb26847742aaeb", "score": "0.51936156", "text": "function savePDF(domElement, options, callback) {\n if (options === void 0) { options = {}; }\n new __WEBPACK_IMPORTED_MODULE_2__KendoDrawingAdapter__[\"a\" /* default */](__WEBPACK_IMPORTED_MODULE_0__progress_kendo_drawing__[\"a\" /* drawDOM */], __WEBPACK_IMPORTED_MODULE_0__progress_kendo_drawing__[\"b\" /* exportPDF */], __WEBPACK_IMPORTED_MODULE_1__progress_kendo_file_saver__[\"a\" /* saveAs */], domElement, options).savePDF(callback);\n}", "title": "" }, { "docid": "c5941d3cd3937cbd055e0648ab255cb2", "score": "0.5186375", "text": "function masterPDF(table,column,cond,page,event) {\r\n // Prep Param\r\n param = \"table=\"+table;\r\n param += \"&column=\"+column;\r\n\r\n // Prep Condition\r\n param += \"&cond=\"+cond;\r\n\r\n // Post to Slave\r\n if(page==null) {\r\n page = 'null';\r\n }\r\n if(page=='null') {\r\n page = \"slave_master_pdf\";\r\n }\r\n\r\n showDialog1('Print PDF',\"<iframe frameborder=0 style='width:795px;height:400px' src='\"+page+\".php?\"+param+\"'></iframe>\",'800','400',event);\r\n var dialog = document.getElementById('dynamic1');\r\n dialog.style.top = '50px';\r\n dialog.style.left = '15%';\r\n}", "title": "" }, { "docid": "966826405509f8bd5cb85c2b3047c9cb", "score": "0.51813823", "text": "function onProgress () { // on progress callback\n var isCompleted = successFonts.length + failedFonts.length === fontsToProcess.length // check if all fonts are processed\n if (isCompleted) { // on complete callback\n onPreviewRenderComplete(fontsToProcess, successFonts, failedFonts)\n }\n return { // return current progress data to be consumed by on progress callback\n isCompleted: isCompleted,\n successFonts: successFonts.length,\n errorFonts: failedFonts.length,\n totalFonts: fontsToProcess.length\n }\n }", "title": "" }, { "docid": "463c729cd1d2ddb9972d3bd5c0358da7", "score": "0.5173969", "text": "async function createPDF(pdfDoc, invoiceId) {\n pdfDoc.fontSize(26).text(\"Your Invoice\");\n pdfDoc.fontSize(15).text(SEPARATOR);\n pdfDoc.fontSize(15).text(SEPARATOR);\n const order = await Order.findById(invoiceId).populate('cart.products.productId');\n order.cart.products.forEach(prod => {\n pdfDoc.fontSize(15).text(`${prod.quantity} X ${prod.productId.title} $${prod.productId.price * prod.quantity}`);\n });\n pdfDoc.fontSize(15).text(SEPARATOR);\n pdfDoc.fontSize(15).text(SEPARATOR);\n pdfDoc.text(`\\n\\nTotal: $${order.cart.totalPrice}`);\n pdfDoc.end();\n}", "title": "" }, { "docid": "79931f4c2990b99dd30bb242208690bf", "score": "0.51707405", "text": "function getDocumentProgress(progressData) {\n\t\t\t// console.log(progressData.loaded / progressData.total);\n\t\t\t$('.creating-page').html('Loading PDF '+parseInt(100*progressData.loaded / progressData.total)+'% ')\n\t\t\t$('.creating-page').show()\n\t\t}", "title": "" }, { "docid": "b9b9b8c99f48f029ed45f7d1ff1ba5f4", "score": "0.51612955", "text": "function CreatePDF(id) {\r\n let mounthData = document.getElementById('monthlyStatTable').cloneNode(true); // don't affect the HTML\r\n let heading = document.getElementById('headingTable').cloneNode(true);\r\n let element = document.getElementById('rowNum' + id).cloneNode(true);\r\n let elementNode = element.childNodes;\r\n element.removeChild(elementNode[elementNode.length - 1]); // remove table \"Print\" col\r\n\r\n heading.childNodes[1].childNodes[9].remove();\r\n\r\n let finalTable = document.createElement('table');\r\n finalTable.className = 'table table-sm mt-4 mb-5 table-bordered';\r\n finalTable.insertAdjacentElement('afterbegin', heading);\r\n finalTable.insertAdjacentElement('beforeend', element);\r\n\r\n // title\r\n\r\n let title = document.createElement('h1');\r\n title.className = \"text-center mb-3\";\r\n title.innerHTML = 'Hotel Name';\r\n\r\n let conatiner = document.createElement('div');\r\n conatiner.appendChild(title);\r\n conatiner.appendChild(mounthData);\r\n conatiner.appendChild(finalTable);\r\n\r\n html2pdf(conatiner, {\r\n margin: 1,\r\n filename: Date.now() + '.pdf',\r\n image: { type: 'jpeg', quality: 0.98 },\r\n html2canvas: { dpi: 192, letterRendering: true },\r\n jsPDF: { unit: 'in', format: 'a4', orientation: 'landscape' }\r\n });\r\n}", "title": "" }, { "docid": "eaadcdd41a8e6e71eeff5a6a820c7bfc", "score": "0.51608944", "text": "function downloadPDF() {\n var units = $(\"#unit\").val();\n \n $(\"#printDialog\").modal('hide');\n $(\"#progressDialog\").modal('show');\n piecesToPDF(\n {\n cropped: $(\"#cropped\").prop('selected'),\n trapezoidal: $(\"#trapezoidal\").prop('selected')\n },\n {\n orient: $(\"[name='orient']:checked\").val(), \n format: $(\"[name='format']:checked\").val(),\n sides: $(\"[name='sides']:checked\").val(),\n\n // Always use pt units, so do conversions upfront.\n unit: 'pt',\n margins: {\n top: Math.round(parseFloat($(\"#marginTop\").val()) * unitPt[units]),\n bottom: Math.round(parseFloat($(\"#marginBottom\").val()) * unitPt[units]),\n left: Math.round(parseFloat($(\"#marginLeft\").val()) * unitPt[units]),\n right: Math.round(parseFloat($(\"#marginRight\").val()) * unitPt[units]),\n },\n padding: Math.round(parseFloat($(\"#padding\").val()) * unitPt[units]),\n \n justif: $(\"[name='justif']:checked\").val(),\n cols: $(\"#printColumns\").val(),\n rows: $(\"#printRows\").val(),\n \n compoPos: $(\"[name='compoPos']:checked\").val(),\n pageNbPos: $(\"[name='pageNbPos']:checked\").val(),\n labelPos: $(\"[name='labelPos']:checked\").val(),\n },\n {\n maxPieces: parseInt($(\"#maxPieces\").val()),\n maxPiecesPerDoc: parseInt($(\"#maxPiecesPerDoc\").val()),\n maxPagesPerDoc: parseInt($(\"#maxPagesPerDoc\").val()),\n },\n progress,\n function() {$(\"#progressDialog\").modal('hide');}\n );\n}", "title": "" }, { "docid": "2ee968e5d1e8b814ea7a246a6916c51d", "score": "0.51562244", "text": "function GenerateReport(GenfromSavedFilters, Withemail) {\n //$('.loading').hide();\n //SetLoadingImageVisibility(false);\n hasExcelData = true;\n GenerateReportAddCall();\n}", "title": "" }, { "docid": "2ee968e5d1e8b814ea7a246a6916c51d", "score": "0.51562244", "text": "function GenerateReport(GenfromSavedFilters, Withemail) {\n //$('.loading').hide();\n //SetLoadingImageVisibility(false);\n hasExcelData = true;\n GenerateReportAddCall();\n}", "title": "" }, { "docid": "1adde69977710fc5731a0fed10c1be91", "score": "0.5156026", "text": "function exportTable() {\n\n $('#loadingModal').modal('show');\n\n //FIRST CREATE TABLE\n GetCustomers(function(myObject) {\n\n $('#btnExportToCVS').show();\n\n j2HTML.Table({\n Data: myObject,\n TableID: '#tbTest',\n AppendTo: '#divTable',\n }).Paging({\n\n TableID: '#tbTest',\n PaginationAppendTo: '#divPagination',\n RowsPerPage: 5,\n ShowPages: 8,\n StartPage: 7\n\n });\n\n\n setTableMenu('Print');\n $('#loadingModal').modal('hide');\n\n });\n\n}", "title": "" }, { "docid": "58ba989f1bae1a5cbb3c53153e9d4bc9", "score": "0.5152398", "text": "ifExist() {\n\n if (this.props.index !== -1)\n {\n if (this.state.path !== \"res/\" + this.props.competition.path_pdf)\n this.setState({path : \"res/\" + this.props.competition.path_pdf});\n\n const { pageNumber, numPages } = this.state;\n\n this.setScalePDF();\n\n return (\n <div id=\"content-2\">\n <div id='header-competition'>\n <h2>Compétition {this.props.competition.ID_type} du {this.props.competition.date_begin} au {this.props.competition.date_end}</h2>\n <h3>Organisateur : {this.props.competition.ID_club}</h3>\n {this.colorStatusHeader(this.props.competition.date_end_inscription)}\n <nav id='header-competition'>\n {this.limitInferiorPage(pageNumber)}\n {this.limitSuperiorPage(pageNumber, numPages)}\n <Button href={this.state.path} size=\"large\" variant=\"outlined\" color=\"primary\">\n <PictureAsPdfIcon />\n </Button>\n </nav>\n\n </div>\n\n <div id='content-body'>\n <Document\n file={this.state.path}\n onLoadSuccess={this.onDocumentLoadSuccess.bind(this)}\n id='pdf-reader'\n >\n <Page pageNumber={pageNumber} scale={this.scale}/>\n </Document>\n </div>\n </div>\n );\n }\n }", "title": "" }, { "docid": "484cf7469c76f427473b8abb548d4bbb", "score": "0.5146669", "text": "function print_prescription() {\n alert(\"dsdfdfdfd\");\n //get visitid\n var visit_id = $(\"#visit_id\").text();\n var patient_name = $(\"#patname\").text();\n// var visit_id = $(\"#visit_id\").text();\n// var visit_id = $(\"#visit_id\").text();\n console.log(\"this is the posted visit id\"+visit_id);\n $.ajax({\n url: \"\" + api_url + \"/v_prescriptions?filter[where][dispensed]=N&filter[where][visitid]=\" + visit_id,\n type: \"GET\",\n data: {},\n success: function (data) {\n var prescriptions = []\n for (var x = 0; x < data.length; x++) { \n \n\n \n var prescription_item = x+1 +'. '+ data[x].productname +','+ data[x].dosage +','+ data[x].dispenseqty\n \n\n prescriptions.push([prescription_item])\n\n }\n \n // download label\n var docDefinition = {\n content: [\n \n {\n // if you specify both width and height - image will be stretched\n image: \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gv4SUNDX1BST0ZJTEUAAQEAAAvoAAAAAAIAAABtbnRyUkdCIFhZWiAH2QADABsAFQAkAB9hY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAA9tYAAQAAAADTLQAAAAAp+D3er/JVrnhC+uTKgzkNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBkZXNjAAABRAAAAHliWFlaAAABwAAAABRiVFJDAAAB1AAACAxkbWRkAAAJ4AAAAIhnWFlaAAAKaAAAABRnVFJDAAAB1AAACAxsdW1pAAAKfAAAABRtZWFzAAAKkAAAACRia3B0AAAKtAAAABRyWFlaAAAKyAAAABRyVFJDAAAB1AAACAx0ZWNoAAAK3AAAAAx2dWVkAAAK6AAAAId3dHB0AAALcAAAABRjcHJ0AAALhAAAADdjaGFkAAALvAAAACxkZXNjAAAAAAAAAB9zUkdCIElFQzYxOTY2LTItMSBibGFjayBzY2FsZWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAACSgAAAPhAAAts9jdXJ2AAAAAAAABAAAAAAFAAoADwAUABkAHgAjACgALQAyADcAOwBAAEUASgBPAFQAWQBeAGMAaABtAHIAdwB8AIEAhgCLAJAAlQCaAJ8ApACpAK4AsgC3ALwAwQDGAMsA0ADVANsA4ADlAOsA8AD2APsBAQEHAQ0BEwEZAR8BJQErATIBOAE+AUUBTAFSAVkBYAFnAW4BdQF8AYMBiwGSAZoBoQGpAbEBuQHBAckB0QHZAeEB6QHyAfoCAwIMAhQCHQImAi8COAJBAksCVAJdAmcCcQJ6AoQCjgKYAqICrAK2AsECywLVAuAC6wL1AwADCwMWAyEDLQM4A0MDTwNaA2YDcgN+A4oDlgOiA64DugPHA9MD4APsA/kEBgQTBCAELQQ7BEgEVQRjBHEEfgSMBJoEqAS2BMQE0wThBPAE/gUNBRwFKwU6BUkFWAVnBXcFhgWWBaYFtQXFBdUF5QX2BgYGFgYnBjcGSAZZBmoGewaMBp0GrwbABtEG4wb1BwcHGQcrBz0HTwdhB3QHhgeZB6wHvwfSB+UH+AgLCB8IMghGCFoIbgiCCJYIqgi+CNII5wj7CRAJJQk6CU8JZAl5CY8JpAm6Cc8J5Qn7ChEKJwo9ClQKagqBCpgKrgrFCtwK8wsLCyILOQtRC2kLgAuYC7ALyAvhC/kMEgwqDEMMXAx1DI4MpwzADNkM8w0NDSYNQA1aDXQNjg2pDcMN3g34DhMOLg5JDmQOfw6bDrYO0g7uDwkPJQ9BD14Peg+WD7MPzw/sEAkQJhBDEGEQfhCbELkQ1xD1ERMRMRFPEW0RjBGqEckR6BIHEiYSRRJkEoQSoxLDEuMTAxMjE0MTYxODE6QTxRPlFAYUJxRJFGoUixStFM4U8BUSFTQVVhV4FZsVvRXgFgMWJhZJFmwWjxayFtYW+hcdF0EXZReJF64X0hf3GBsYQBhlGIoYrxjVGPoZIBlFGWsZkRm3Gd0aBBoqGlEadxqeGsUa7BsUGzsbYxuKG7Ib2hwCHCocUhx7HKMczBz1HR4dRx1wHZkdwx3sHhYeQB5qHpQevh7pHxMfPh9pH5Qfvx/qIBUgQSBsIJggxCDwIRwhSCF1IaEhziH7IiciVSKCIq8i3SMKIzgjZiOUI8Ij8CQfJE0kfCSrJNolCSU4JWgllyXHJfcmJyZXJocmtyboJxgnSSd6J6sn3CgNKD8ocSiiKNQpBik4KWspnSnQKgIqNSpoKpsqzysCKzYraSudK9EsBSw5LG4soizXLQwtQS12Last4S4WLkwugi63Lu4vJC9aL5Evxy/+MDUwbDCkMNsxEjFKMYIxujHyMioyYzKbMtQzDTNGM38zuDPxNCs0ZTSeNNg1EzVNNYc1wjX9Njc2cjauNuk3JDdgN5w31zgUOFA4jDjIOQU5Qjl/Obw5+To2OnQ6sjrvOy07azuqO+g8JzxlPKQ84z0iPWE9oT3gPiA+YD6gPuA/IT9hP6I/4kAjQGRApkDnQSlBakGsQe5CMEJyQrVC90M6Q31DwEQDREdEikTORRJFVUWaRd5GIkZnRqtG8Ec1R3tHwEgFSEtIkUjXSR1JY0mpSfBKN0p9SsRLDEtTS5pL4kwqTHJMuk0CTUpNk03cTiVObk63TwBPSU+TT91QJ1BxULtRBlFQUZtR5lIxUnxSx1MTU19TqlP2VEJUj1TbVShVdVXCVg9WXFapVvdXRFeSV+BYL1h9WMtZGllpWbhaB1pWWqZa9VtFW5Vb5Vw1XIZc1l0nXXhdyV4aXmxevV8PX2Ffs2AFYFdgqmD8YU9homH1YklinGLwY0Njl2PrZEBklGTpZT1lkmXnZj1mkmboZz1nk2fpaD9olmjsaUNpmmnxakhqn2r3a09rp2v/bFdsr20IbWBtuW4SbmtuxG8eb3hv0XArcIZw4HE6cZVx8HJLcqZzAXNdc7h0FHRwdMx1KHWFdeF2Pnabdvh3VnezeBF4bnjMeSp5iXnnekZ6pXsEe2N7wnwhfIF84X1BfaF+AX5ifsJ/I3+Ef+WAR4CogQqBa4HNgjCCkoL0g1eDuoQdhICE44VHhauGDoZyhteHO4efiASIaYjOiTOJmYn+imSKyoswi5aL/IxjjMqNMY2Yjf+OZo7OjzaPnpAGkG6Q1pE/kaiSEZJ6kuOTTZO2lCCUipT0lV+VyZY0lp+XCpd1l+CYTJi4mSSZkJn8mmia1ZtCm6+cHJyJnPedZJ3SnkCerp8dn4uf+qBpoNihR6G2oiailqMGo3aj5qRWpMelOKWpphqmi6b9p26n4KhSqMSpN6mpqhyqj6sCq3Wr6axcrNCtRK24ri2uoa8Wr4uwALB1sOqxYLHWskuywrM4s660JbSctRO1irYBtnm28Ldot+C4WbjRuUq5wro7urW7LrunvCG8m70VvY++Cr6Evv+/er/1wHDA7MFnwePCX8Lbw1jD1MRRxM7FS8XIxkbGw8dBx7/IPci8yTrJuco4yrfLNsu2zDXMtc01zbXONs62zzfPuNA50LrRPNG+0j/SwdNE08bUSdTL1U7V0dZV1tjXXNfg2GTY6Nls2fHadtr724DcBdyK3RDdlt4c3qLfKd+v4DbgveFE4cziU+Lb42Pj6+Rz5PzlhOYN5pbnH+ep6DLovOlG6dDqW+rl63Dr++yG7RHtnO4o7rTvQO/M8Fjw5fFy8f/yjPMZ86f0NPTC9VD13vZt9vv3ivgZ+Kj5OPnH+lf65/t3/Af8mP0p/br+S/7c/23//2Rlc2MAAAAAAAAALklFQyA2MTk2Ni0yLTEgRGVmYXVsdCBSR0IgQ29sb3VyIFNwYWNlIC0gc1JHQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAAAABQAAAAAAAAbWVhcwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACWFlaIAAAAAAAAAMWAAADMwAAAqRYWVogAAAAAAAAb6IAADj1AAADkHNpZyAAAAAAQ1JUIGRlc2MAAAAAAAAALVJlZmVyZW5jZSBWaWV3aW5nIENvbmRpdGlvbiBpbiBJRUMgNjE5NjYtMi0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLXRleHQAAAAAQ29weXJpZ2h0IEludGVybmF0aW9uYWwgQ29sb3IgQ29uc29ydGl1bSwgMjAwOQAAc2YzMgAAAAAAAQxEAAAF3///8yYAAAeUAAD9j///+6H///2iAAAD2wAAwHX/2wBDAAcFBQYFBAcGBQYIBwcIChELCgkJChUPEAwRGBUaGRgVGBcbHichGx0lHRcYIi4iJSgpKywrGiAvMy8qMicqKyr/2wBDAQcICAoJChQLCxQqHBgcKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKir/wAARCAC0ALQDASIAAhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAAAAYFBwMECAIB/8QARxAAAQMDAgQDBQQHBAgHAQAAAQIDBAAFBhEhBxIxQRNRYRQiMnGBCEJSkRUWI2KCobEkJTNyF0NTc6LBwvE1NkRjkrLw0f/EABkBAQADAQEAAAAAAAAAAAAAAAACAwQBBf/EACURAQACAgEDBAIDAAAAAAAAAAABAgMRMQQSIRMyQVEUQiJhcf/aAAwDAQACEQMRAD8A6RooooCiiigKKKTb5xBjQrkqy47Ddv8AfB8USIRyMerrnwoHz39KBxJ0Gp2FKN14m43bpZgxZLt3uA29itLRkua+R5dh9SKjBhF7yf8AbcQr0pyOd/0NbFqZjJHktXxufUgU42iyWuxwkxrLBjwo/wCCO2Eg+p06n1NAqfp/iBedDZsWhWdk/C9epZUoj/dNbg+hNff1YzucOa5Z0mIk9WbbbW0gfJayTT3VPWni0U8b7vjlzfH6MdfEWEo6AMvIASU6+Slc3XvpQMx4aPuDWXnWWuq7+HcA0PySigcL29PczHL0HzF3V/zTT3SzneZwcGxl27TwXVa+HHYSdC84eiQe3QknsAaCK/UC+Rd7XxBvzZ7e2BqSPyUkV89k4mWvdi6WK/IHUSoy4jivkUEp1+YpexWDnef29F+vuTSbBCle/Eg2xpKFcnZRUoE6HtrrqN9q+Zdec54a2vx0TmskgyVBhqRLZCHojivhKuTZaT9Drp9QYjxGmWjbMsUuloQPilxgJkdI8ytvdP1TTRZchtOQxParJco05ruWHAop9COoPoakkj3RzbnTelW9cOrBd5ft8dly03QbpuFsX4DwPqU7K/iBoGyiq/N2y/DP/MLByW0p63GA1yymU+bjI2WB5o+ZFN9mvltv9tRPs01qZGcGzjStdD5EdQfQ70EjRRRQFFFFAUUUUBRRRQFYJMpiHGcky3kMMNJK3HHFBKUJHUknoKJMlmHFdkynUMssoK3HFq0ShIGpJPYVXUePK4qz0zbilyPhzDmsWIrVKrooH/FcHUNa/Cnv1NB7Vc75xLcUzj7z9lxYEpcugTyyJ47hkH4Efvnc9u4r1dcrwfhBaP0dHShDwHMIUX33nFfiWT0181H5VYTTTbLSWmUpQ2gBKUpGgSB0AFJ+ecPLZlmKXCCxDjsTniZDMhLYSrxx0Uojc69D6GghzjeTcQ4fj5ZdFWWzyEczVrtLoK1pI1Bde0IVt2A0NM2DRnLdjxtq7q3dU299yI1IHxhCDoEOfvp6HTqADVS8MOI+QNWE4VFsjtxv8BammQ84G22WknQ+KSdfcJ00HUaCnrC8Yy3GMqly7tOjXONeyqRNDCfDTEfA2KQT7ySPd89k6+dA/wA2U3Bgvy3zo0w2pxZ8gkan+lc43LFbbduCce+y7hDg5EuQ/dEF2QltTwWsko3IJJSlJHrt3qzuI+YRHeEN/lQXFJUtx21hK9AS54haWPy5j8qkse4YYdabfG8KxW+S+hpIW+82HipQG6tVa6anfag0OD+fpzfFEomOA3a3gNSgerg+659dN/UH0qv/ALRK3rhmmM2UrKWHEajy5nHAgn6BI/OsF8g3HDuOCrpw6tM2ewof2+HGirDSVKPvt83Ly6HQKB6An00pp4p4ndM+xaDfrVapcC82xalphyeTxXG9idOVRGoIBA1167amjq3Y0dqJGajx0BDTSAhCR0SkDQCtS92aJf7Uu33BKlMLWhZCTodULCx/NIpIxXjJjl0trbd9mN2a7NJ5ZUWbq1yrHXQnbT06jyqbtuat5JfURcWY9vtzRJm3M6pZRtshs6ftF66a6bAd9aOF/ixxUGBsMwLW2iTepSeZCF7pZR051Abkk9B6H6x+M4ZxAvcJF0yvNrlbZL450QoaUpDQPTnGnLr+7p9aVsfs5zL7Tl6lXUeIxZ3luJQrcHwyG2x+eivpXQ1BXdoye9Y5mMXE82famiehSrZdm2w345T1bcQNgv1Gx1HnUjeMJcbujl9wuSi0XlW7qNNY03915A7/AL494a96rjjXe/aeKGG2e2q5psKSh48vVK3HEBI+fua/UVe6ypLai2nmUBsCdNTQLeM5c1en3rdcoq7XfYg/tNveOp0/G2rotB/EPrTPSA2LXxOsjc+A6u13y2PKbS82QX4EhOykK/Eg9wdlD+Uti2Sv3F9+zX9lEO/QQDIZSfcfR0DzRPVB/NJ2NA00UUUBRRRQFFFKGf32ZBgRbLYVaXy9uGNDP+xTpq48fRCd/npQQ10K+JOUu2NlahjFpdAubqDoJ0gbiOD+BOxV67etZ8jyKdPvAwvA3GWJ7bYM2dygt21roAB0Lh7J7f0noGMCx4Yiw49J9hW2z4aJSmwtQWficI13USSd+5+lU9l3Dq/8NLqMywKdLmob1VOakK8RwjqpStNOdB6nuOvqA1eIPDW8YFbf1xsuVXCXKjOIMlx9ZDnvKCQoHXccxAKTr1q0Ma4r4tdYNrYnXyG1d5UZpTzPMQlLqkglPNpy66nTTXXtSbb78ePTqLU7/dVmgoQ/cI6XgXpbvZKfJsEa82nXTv00uL/CbFrBgjt6sEdVvkw1tgoDylpfClBOhCid99dR5Gjo4uWqXgWfW3iJYW/2TroRNbTsCvTQ6+i06j5jXqadVcUjkTaI3Dq2vXma42FLfeSWo0Qka/tFnqR+FPXzrYgYgvL+H+NRcskSSy1DZclwgeX2hwJTy+Ir4tt9QCNT16VnvOX2XCkM4/j9vE258n9ntNvSE8g/Es9G0+p/nRzeuUVj/By2t2UR8ykLvslUlyWoF1xDCHF6c2iAoBW4O5Gu56VLLy7AcEj/AKLizYMTlUSIcFBdXzHzS2CdfnS67Y8iys+Jml3W1FV0tFrWWmQPJxY95z8wPKp20Y3arKyG7Tbo8ROmhLTYBPzPU/WroxT8s1uorE6r5YlcV0PH+68SyKWOzioiWUH6rUD/ACrz/pKvQ3VgV05fSSyT+XNUz4ISgqWQEgaknoBXvwNRt0qXpV+1X5F/osSuIGOynQ5lGF3aPy9X5dqS+hP8SSr+lNmPZli1+aSzj12hukDRMdCvDWkf7s6KH5VgMfaoO9YfZL6NbnbGHXOoeCeVxPyWNFD8656P1LsdTP7Q1LxaZmDcS5GbW2A/cLVc2PBujEVPM6woaaOpT94e6NQPMmvt9474lBtilWaQ7dbgsaMxG2HEEq7cxUkaDX5n0rAwjMMOIXZZy8itifit1xc/boT/AO293+SqbsWyuxZWlx63Nhi4MHSTEkNBuQwryUOv1Goqq1Zry1UyVvG4Vlws4fXu65g7nudNLakOOF6NHeTyrKyNAspPwpSNkg79PIaueYZ/IZnO47hLSJ17SgqkyFbsW5AG63D01HZP/Yxd7yDN7pkwwaOxHtMl9K3l3ttRKVxQdNWkHcOaEAjU6HfYbiQyKy2rhzwavzdnaLZMNaXJCzq48657nOtXc6q//lRTJ32bI78o5JeZbinHJDzbZWfvL95aifX3hVp5bjjl3aYn2l1MS+W8lyDJPTXu2vzQobEfXtSfwKYj2Pg63cJrrcdmS+9KcccUEpSkHk1JPbRuta1ZVfbnnEzJsXs0qTijqUMSSo6LlLSSnx2WzvsNAQPiCfPoFiYxkDWR2ZMsNKjyW1lmXFWfejvJ2Wg/I9D3BB71NUk35P6p5QzlDA5bdNKIt4QOid9GpHzSTyqP4Vfu07UBRRRQFV/hY/WjLLtmj3vRgpVutOvQMNq99wf5167+SalOJV2kWvCJTdv/APELitFvhgdfFePICPUAk/Spqw2mPYbBCtUMaMw2Usp9dBpqfU9frQSVfCARoRqDX2igoniTwzmYvPXnXDxwwHomr8qK1sAkbqWkdOXTXmR00108qmcTbvXFdNuvmXxG4VjhFLsW3o15Zj4H+MvX7g35U/1HWzbxaYt8tjtuuAUuM9oHEJUU84BB5SR2OmhHcEilzO8kcxiyRrdYmm1Xi4q9ltzAACUbbuEdkoG/5ChtoZhl8566qxbDFI/SfKDNnKHM3b2z6d3D2T9TXjHMXhY/FWiIlbsh5XPJlvHmdkL7qWo7mjF8dZx+1iM2tT8hxRdlSV7rkOndS1H1NMrDOtaq1ikbnl52TJOSdRwxtselbSI3pWy0xW0lkAdKha62mEo5zeYOMYZcLhcFJA8FTbTZ6uuKBCUDz1/pqe1UNwp4pzbBdYtmvb6pNnfWGkqcOqopJ0BB/Dr1HbqPWH4kZdcM9ztxgu8kNmQY0JlSuVCBzcvOfU9Sfp2p5P2dP0TFFxvmVxmIkYeLKIjHRKRudFFQ/PT6VVNp20xjrEaXyqN6VgcjVE8P8+t3EG1SZVuZdjriu+G6y7uRrulWo6gj+hppWyDrU4uqthhAuMelK+Q4qm4yWrna5CrZe4u8aeyN/wDIsffQe4NPbrFaDzOlXRaLRqWS1JpO6obEMjj5RLRCySAzFyazErU0RqNCCnxmT3QoHT06HtUD9oq5ex8M0RAfenTW2yPNKQVn+aU1s5ZYZUr2e72JYj322HxIjvZz8TSvNKht/wDjU1a0WHiZaLNfp0TxVwXFkRHTqGHxoFpWnuUkba+h71nvTtltxZO+P7JGDYdd8yxmzM5S25bsZt7DYYtSSUrnLA1Lrv7pVqQn/ubnYYaisIYjNIaabSEobQkBKQOgAHQVlA0G1fagua06FHuNvkQpjaXY8htTTqFdFJI0I/Kl/CJb6bbJsVxcLk6yPeyLcV8TrWmrLh/zII19QqmmlO7f3PxBtV0Rsxdm1WyT5eIAXGFH8nE/xigbKKKKBFyIfpfixjFp+Jm2sP3Z9J6FWzTR+ilKNPVI2O/27i5l81e4hsw4DR8hyFxY/NYp5oCiiig+E7a1U1jeOWZldMsd9+K2tVvtQPQMoOi3B/nXrv5DSm/iReXLFw8u0uMSJKmfAY06+I4QhOnqCrX6VG45aW7LYYNtZA5YrCW9R3IG5+p1P1q7FHnbN1FtV7Y+UzHb6VJsNela0ZFSbKNBXb2QxUZEI0r0aKp7jpxIfxe2t2Gyvlq5Tm+d15B0Uwz028lKIIB7AH0NUNcQRM64QqnZnPOD3S23B51xTztqExtMiOSdVDlJ3Tqe+hHT1rQu+HcSJFobbzq8foyzRyE+Jc7ilTY8tEoKitXkNCax8GsJvt9yGNklnnRGEWucj2hLzig4tJ3UAADrqkkbkd6nOPFjzW6ZO7MXbpEiwxGh7MqMC4htPLqtawNwdddSRpoBvRJZnB4YfBxldrw+7N3N5tXizHSgtuLWdubkUAQnbQdvXXWrIrjng3elWXirZ1lzkalOGI6NdAoODQA/xcp+ldjUcYnEaitGQ1UnWs+ip1nyqvXcIF9vrSnaH/1T4pJZHuWzJgdU/dbmIGuvpzp/MinaSjrSRxEhuuYlImQ9plrWi4RlfhW0eb+gUPrV9o7qsdZ9PItSitO1T2rrZ4dwj7tSmEPI+Skgj+tblZXoilvPYrsjCpz0UayoKUzo/n4jKg4kfXl0+tMlY3WkvNKbcAUhaSlQPcGgxxZLU2ExKZ99p9tLiD5pUNR/I0VAcPHVHAbWy6SVxEKhqKuurK1Nf9FFBHcOx4tzzOUfiXkLzWvohttIp4pG4ZjlXl6O4yeYT9Qg/wDOnmgKKKKCveK6vHTi9u7Sr2ytY/EltKlkfmBUxHHSoTiSNMqwpR+H294H5+CrSp2P2rTi9ssPUe+ISkZPSpJA0FR8boKkEfDVV2jFw9VTPGThFJyySrIMeUV3NLYQ9FcXoH0pG3KTsFaduh9D1uaqB4/5/fLRe4uO2aY9AZVGEh91hRQtwqUoBPMNwBy9uuvpVa5pfZ4s+Q2zL7t7XBlRICY/hSQ+2UDxgoFI0PUgc3yB9RV45RdrTZMcmy7+8hqCGlJcCjusEacoHcnoBVM/Z6y+/Xe93G03W4vTobUXx0e0LLi21c6U6BR30IJ29Bp3qyeKOOY5kGIr/WyZ7AxFPiNS+fQtL002H3tenL1PbejrlrC8VueYZazbseV4TqT43jrVp4CEqHvnTuCR07kV2uyhTbCEOLLikpAKyNCo+dcccLHrxE4nWo44HH3DICHghJ0UwVALKh2Ty779Dp3rswUJFY3RqKyV4c+GuxyjPCMlJ61C3COiTGeYcGqHUFCh5gjQ1OSu9RMjvWmjzsvLU4QyVyeFVl8U6rYQ5HV6eG4pA/kkU60icHN+Hjah8Kp0sp+Xjrp7rK9KBRRRQK+Ce5BvLA2DN7mgDyCnSv8A66KMH3TkCh0N8k6fTlH9RRQRuD/2XNc4t52KLm3KA9HmUnX/AITT1SIyf0XxzlNn3Wr3Z0Og/idYcKSP/gsU90BRRRQV9xaT4FtsF06JgXqOt1Xk2vmbP/2FS8c71tZzYzkuC3a1NjV1+Orwf94n3kf8SRS1h96F9xe33H77zIDo/C4Nlj6KBq/FPiYYuojzFjjGV0qRbOoqHjOVJsr1FRvC3Fbw2KpP7Q4xd/HUmZKZRkUcp9kbQdXFIKhzJUB0TpqQT3G3U1dlcs8c8Afx+/O5IbkiUxdpaj4TmzrSiNdB+JIA017bCqmgwfZms8j2683lSdIwbTFQrX4l6hSvyAT+dWFxfwBWc4zzR5jzMq3JceYZBHhvK03Ch56DQHtqfOqv+zPcH0ZbdrcFH2d6EH1J7cyFpSD+SzVs8WM1j4bhUlXip/SE1tTENoH3iojQr08kg6/PQd6O/Lnng9l8/Fc1bat1s/SZufLGWwjZzTm11SfTcnXb5da7BFct/ZwhMyeI0qQ6kKXFt61ta9lFaE6/kSPrXUgoSKxunashOlar69K7HKFp1DSkq61BXWWiDb5Utw6IjtKdV8kgk/0qWkua60i8Q3nZFhbssNWku9yW4DWnYLPvq+QQFa1qr4jbzr/yvEQZ+FENcDhZYmnRotyOZB1/9xRc/wCunGteHHahwmIkdPK0w2ltCfJIGgH5Ctisj0xQaKjcguabLjlxubmnLDjOPb9+VJP/ACoIfh6S7jL8wf8ArblNkD5KkOafyAorewy1qtOEWaA8kh1iG0lzX8fKCr/iJooF/iV/dMnHcqGybRcUokq/DHfHhuH6EpNPYOoBFR1/tDGQY/PtEv8AwZrC2VHT4dRoCPUHf6VA8NbzIumItxbmdLpaXFW+cknfxG9ub+JPKrX1oHCiiig+VVDbJw7iPNs7nuW2+KVPt6uyXv8AXNf9QHkatelzNsWayzH1RA77NNZWH4UpPxMPJ+FXy7H0JqVbds7V5KReunlhzpUmw7SLiuRO3Jt+BdmvZL3b1eFOinsrstPmhXUGmtl7TTetNoi0bhgpaaW1KdbcBFcqca4WWSsyn3K8wJabTHdLMN7kJZQ3r7uhGwKup16munWpFUJx34jXF2ZKw6NDMaGPDU++4k80joocvkkHTfuRWa0ab8d+4y/Z6xWFbsefyFE1iXLuADRQ0dfZkpOpQrXfmJ0J+Q0160ycV+HNszWyLmyHjDuEBha2ZOvu8oHMUrH4duvUfyPLFjyO8Y3MMqw3GRBeOyi0vQKHkodFD5ip2+8VczyK1rt11vS3Irg0cbbaQ14g8lFKQSPTpUVrZ4Q5Yzh/EONLl8wiSkKiPlI1KUrIIOnfRSU/TWuxddq5v+ze1BkXa7omWpuQ80ht5iY4yFeCQSCkKI90nUHb8J8q6HW/p3rsRtG1ohkdcAFaD7vWh1/1rQee113q6lGTJkY33OtK2Is/rXxCk5Coc1ssYXCgK7Ovq/xnB6Ae7r86w5Jcpt3ujeJY05pc5idZMlO4gsfecP7xGyR5n5VnvcmXZWLfw74Z+G1c0shTsle6ILIOpcWdD76z207k6bimW36wdPjmZ75WhRS/i8i9+yuRMpMA3FjTVyE6SHkHosoIBRqQRp01B0pgqhsFKGff26LasdRuu8z22nEjr4DZ8V0/LlRy/wAQpvpMsqv1h4i3S8fFDsyDa4h7KdJCpCh8iEI/hNA50UUUBVd3tX6k8R4+Qj3LRf8AkhXI/dZkDZl0+QI9wn5GrEqNvlmh5DZJdpuTfiRZbZbWO48iPIg6EHzFBJA6iq94q8TGMAtLbcZCJN2l6+zMqPuoA6rX6DsO5+RrZwO9TI0mRh+SO815tSR4TytvbY3RDw8z2V6iq/lYynNvtOXJq8pLtvs7DLvgq+FYCEFKPkVLKj56Ed6DQxbD+IvEYJvmR5TcLRBe99lLa1IU4OxS2kpCU+RO58j1p0lNZPwtjoub17lZPjragJrMxOsmMknTxEL11UB3Se35i0gAlICRoB0ApA4zZNEsHDS5NPrSZFyaVEjta7qKhoo/IJJOvy86DZyvEm8oaiZDjUtEO9MthUSYBq3IbI18NwfeQfzHUVD2HLBLnLtF6jKtV9YH7WE8fjH421dFpPmKy41fJ+McD7FdnYHtrUaEhyUjxQhaI+hIUgEaKITy7EjUd63UScI4v2ZHgvokus++goV4UqIrzH3k7990nTvU63mqnJii/wDqYbfrDc7Var9GDF6t8ac2OgfbCuX5E9PpSw9ac3xMkNITllrT8KkqDU1tPqD7rn00Jr5C4iWB5/2abKXapY+KLc2zHWk+Xvbfkavia2ZJrkxvEjgxgclfMLStjXqGpTgH5FRr3E4NYFEcCzaFPkHUB6S4oflzaUyMT2pLYcjvIdQeikKCgfqKze0HzrvpwevZsW+LAs8JMS1RGIcdPRphsISPXQVkck+tRUu6xYLZcmymY6B955wIH5mlp/iHa35CotgblX+Z08G2Ml0D5r+ED11p21ryd97+2Dg4/r3pQuWSzbvdV2DCWkTrmNpEpW8eCPxLV3V5JG/9KzM4llmWe9lEtOPWs7qt8B3nkOjyce6JHomtT9crfAnN4NwggwXp6UqK31q0jRwPiUVdXVfLX67iq7ZPiq3Hgne7pR6M1wvxZbVljv3vJrmpSkkp5nprwGpWrTohIOunQDQdTrSdwa4gWmNPnWjJm1wcjnSlLkS5Z09pc12QddOQp6BPTy3OlR2W3vixw2uMa63q7R7rAdc5SUNJLOvXkI5UqRqBsR5dadMlwGx8XsShZFASLddJUZLrUkDrt8DgHxAHbXqNPLaqGxr5C3dM14nMrwOU3bnrA2pqfdVJKkOrUQRH0HxgaEkHpqeh6tOUZJesUwqLfbmzF8SLIaF0ajlS0qaUrkJbJ0IOqkq0PqPWqowfPLnwluZxDPLd4EHxCtqW2jUp5juvUf4iD5/EOnbQOmQXSLxPuSrRAloGI23lk3i4pVoiQU++lhKvIaBSj207dwbcrysQcUYk2FaJc+78jFqSk6h1xwe6r/KB7xPkKlMZsbON45DtLCi57O3+0dPV1wnVaz6lRJ+tKuFw/wBZL0Mtfjez26O0YmPxCnlDbHRT3L2K9AB5JA86sGgKKKKAooooFTNcUdvzEe4Wh4Qr9bFF2BL7a921+aFDYj/8URi7TpGRnMbFbFqvcJn2DIsf10eKQdQ43+IjQaH7w0HWrmpPy3DnbnMZv2NyU27IoadGpBH7OQj/AGTo+8k+fUdRQKl4+0LjMCEv2aDcnrgBp7G8x4JSryWSdvprSFZsSyzjNlzd+y1t2FZkEaBSShJb118NpJ337q/mTtVz4vlsPIJjltvEBNsyKGP7RAkJBV/nbV99B8x/3mbzklrsFsnTZ8tpCYLXivICxzgdhp5noPM0FTcdskW1BtuAY8nWTOLYdZa25W9QG2x5aqH5JHnTRbuDdgi4rbYRDsS7w29RdoLhafDp3UeYdRqToDrtVc8OMN/0r5Dfcuy1DpjPOFuOG3Cgpc20KVDshISB8/SnXG8dyP8A0kOWi45JMumPWANyGvH0Di3lp9xtawNV8o97rp8O29BMcNbrlEydfbZkr7M1mzyvZGbglvkXIUNzzAbbAp+p71M5TfcOiPJt2YP25JWgLS1PbCkkEka+8NOxpjbjtMc/gtIb51FauRIHMo9SfX1qvePJQOD9z50gqLrAQSOh8VO4+mtBgg4hwlyWcpFlTbnZPKVlFunLbUEjqeVCxtuO1eBgvDVTymzeStSSUqbN+XsR2I8TWpTgzBYicKLIttlCHHGluLWEgFRUtR1J77aflVa8dLRAXxJxWKzDZbM0pQ/4aAkuAugb6depoaWVG4fcOLbCduabVb3o8dJW7IkvGQlIA1JJWpQrRt2YX6+RirhvicVFoQSlmZcHPZ23tDofDaSNdPXalrj87HxnA4FjscViBFuEsqebithtKghIOhA23PKf4RVvY6xGjYzbGYKUpjoiNJaCenLyDT+VBV8niiEXJeJ8V8fVZxKAHtDL5Uw6nXbUjcJOmhIJ7g6b1BcVsEViMyFnuAsohphqSqQzGTohHk4EjblIPKodN9e5p245Yq1kPDqVMS2DMtIMplem/IP8RPyKd/mkVq8DLwrJ+FRt9zAkiE6uCpLo5gtrlBAPmNFcvyFBDXrKHuM2ERrDi9ud9olKaVcZLyCliAUkEjnPxKJA0CddjVs45ZWMcxyDZ4hKmoTCWkqV1VoNyfUnU/WqCJmcBeKP+tdxi6np19zX/wC7ZP1B9drxs2YWm+22Tc4Ly026PuZr7ZaaWNNSUlWmoHQnprQRnEvE05hiS7ciGw9JU6gNSHSB7KCoczgPU6J12HXpSnY7HDyZhjFscSprCrSvSdLB0N2fB1LYPdGu6ld+g2qUemXHik8qJaFv27EEq5ZM8AoduWnVtrulvsVd+g71YNvt0S1W9mDb2ER4rCAhppA0CQKDM20hltLbSUoQkBKUpGgSB0AFZKKKAooooCiiigKKKKBdynDbZlLLRlh2NOjHmiXCMrkfjq80qHb0O1VtlNqbDQh8W7QJ8RI5I+VW1rlW2O3jJSNUfzT6d6uuvKkpcSUrSFJUNCCNQRQJvDWzix4si3QbnCulobUVQJUYaLUlSipQc0JSSCeo69wKc9ADrpSPO4ZRWJrlxwy4yMYnrPMsRAFRnT++wfdP00rD+subY4OTJcZF5jp6zrCrmUR6sK0Vr8jpQP8AVXfaFd8PhQ6n/aTGU/zJ/wCVMVt4oYjc3PATeWYUkbKjTwYziT5aLA3+WtKPF615TnVjbtGN2RuTDRKS+JonNaOgII0CSRpurz7etAYJgVzfwKySoebX2AH4bbojtrbU23zDXRIKem9JObWe4W7jnh8C6X2Tell2K4l2Q2hCkJMgjl90b/Dr9auPBHbvBw6JbbzYZMCTbIbbO7rTiZBSnT3ClR390fFp1HWquy2Pkl44y2fKW8PvSbbbSwkoLKVOKCFlRICVEfe8+1A5ceMVfyTh8ZMBsuSrW77SEJGpU3oQsD6aK/ho4H5oxkmCRra86P0jakCO42TupsbIWPTTQfMeoqw7fOTcoDckMPxw4D+yktFtxO+m6TuKrHKuHeF2y9m+xMjOH3DUqUuNKQ2lRPX3D5+Q2PlQOvEC6w7NgF6lXBaUtGG62EqPxqUkpSkepJApY4E41Ix3hu25ObU3IuTxl8ihoUoKQlAPzCdf4qVmF2S63Fl9pWS8SZkZWrCXG/DgtL8yVBKAfX3qdTZc6yra/XVnGberrCtJ8SQoeSnzsk/5RQR/Ed7G5WQwGb+67e3ow5oeOwmg4468dffc035dNNjoOvXpW1Dw67Zc4zKz0NxLayQY2OQ1fsUafD4yh/iEfhHuj8xTRjmI2TFY60WWChlbm7j6iVuunzUs7n89KnqDEyy2w0hplCW20JCUoQNAkDoAOwrLRRQFFFFAUUUUBRRRQFFFFAUUUUBRRRQR90slru7Bbu1uizkAbJkspcH8xSw5wiw1TqnYVuetrv44Et1j+SVafyoooPCeGTbSyI2Y5cwkdEpuvMB/8kmsquHDixoc3y76XFA/o3RRQYhwotEhI/Sl5yK5JPVMu7OkH6J0qQtfDbDrO6DCx2D4g94OvN+MsHz5l6miigZ0JShHKhISkDYAbCvdFFAUUUUBRRRQFFFFAUUUUH//2Q==\",\n width: 115,\n height: 115,\n alignment: 'center'\n },\n { text: 'BEACON OF HOPE', style: 'header1' },\n { text: 'HEALTH CENTER', style: 'header2' },\n { text: 'P.O. Box 4326-00200 Nairobi, Kenya', style: 'header3' },\n { text: 'TEL: 020 20202793 Fax: +254 716 642469', style: 'header3' },\n { text: 'Email: [email protected] Website: www.beaconafrica.org', style: 'header3' },\n { text: 'DRUG PRESCRIPTION', style: 'header2' },\n \n { text: patient_name },\n {\n table: {\n body: prescriptions\n },layout: 'noBorders'\n },\n \n \n \n \n ],\n styles: {\n header1: {\n fontSize: 20,\n bold: true,\n alignment: 'center'\n },\n header2: {\n fontSize: 15,\n bold: true,\n alignment: 'center'\n },\n header3: {\n fontSize: 13,\n bold: false,\n alignment: 'center'\n },\n anotherStyle: {\n italic: true,\n alignment: 'right'\n }\n }\n };\n\n // download the PDF \n pdfMake.createPdf(docDefinition).download('download_prescription.pdf');\n \n // for (var x = 0; x < data.length; x++) {\n\n \n // var visit_date = data[x].created;\n\n // var split_date = visit_date.split(\"T\");\n // console.log(split_date[0]);\n \n // var visitid = data[x].visitid;\n // var prescrptnid = data[x].prescriptionid;\n\n // v_table.row.add($(\n // '<tr><td>'\n // + split_date[0] +\n // '</td><td>'\n // + data[x].visitno +\n // '</td><td>'\n // + data[x].productname +\n // '</td><td>'\n // + data[x].dosage +\n // '</td><td>'\n // + data[x].dispenseqty +\n // '</td><td>\\n\\<a href=\"#\" class=\"btn btn-info\" onclick=\"return dispense_print_label(\\'' + patient_id + '\\',\\'' + data.length + '\\',\\'' + visitid + '\\',\\'' + data[x].productname + '\\',\\'' + data[x].dosage + '\\',\\'' + pname + '\\',\\'' + prescrptnid + '\\',\\'' + data[x].visitno + '\\',\\'' + pname + '\\')\">Dispense</a></td></tr>'\n\n // )).draw(false);\n\n // }\n \n },\n error: function () {\n console.log(\"error\");\n\n }\n});\n}", "title": "" }, { "docid": "0217fc152e45581816f23f96916134cb", "score": "0.51407635", "text": "function print() {\n swal({\n title: 'Caution!',\n text: \"The following Map will be created based on the extent visible in the screen would you like to continue?\",\n icon: 'warning',\n confirm: {\n text: \"Ok\",\n visible:true},\n cancel:{\n text: \"Cancel\",\n visible:true},\n }).then((result) => {\n if (result) {\n var resolution = 300;\n var dim = [612,792];\n var width = Math.round(dim[0] * resolution / 130);\n var height = Math.round(dim[1] * resolution / 310);\n var size = map.getSize();\n var viewResolution = map.getView().getResolution();\n \n map.once('rendercomplete', function() {\n var mapCanvas = document.createElement('canvas');\n mapCanvas.width = width;\n mapCanvas.height = height;\n var mapContext = mapCanvas.getContext('2d');\n Array.prototype.forEach.call(document.querySelectorAll('.ol-layer canvas'), function(canvas) {\n if (canvas.width > 0) {\n var opacity = canvas.parentNode.style.opacity;\n mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);\n var transform = canvas.style.transform;\n // Get the transform parameters from the style's transform matrix\n var matrix = transform.match(/^matrix\\(([^\\(]*)\\)$/)[1].split(',').map(Number);\n // Apply the transform to the export map context\n CanvasRenderingContext2D.prototype.setTransform.apply(mapContext, matrix);\n mapContext.drawImage(canvas, 0, 0);\n }\n });\n\n margins = {\n top: 155,\n bottom: 12,\n left: 100,\n width: 522\n };\n \n options = {\n columnStyles: {\n 0: {columnWidth: 50},\n 1: {columnWidth: 50}\n }\n };\n var img = new Image();\n img.src = './img/Logo_ffc.png';\n \n var norte = new Image();\n norte.src = './img/north.png';\n \n var scale = mapScale(150);\n \n var escala = Math.round(scale).toString() ;\n console.log(escala);\n \n var doc = new jsPDF('landscape','mm',dim);\n \n doc.addImage( mapCanvas.toDataURL('image/jpeg'), 'JPEG', 5, 6, 268, 142);\n doc.addImage( img, 'PNG', 220, 190, 60, 15);\n doc.rect(4, 4, 270, 205);\n doc.setFontSize(12);\n doc.setFontType('bold');\n doc.text(\"Reference Information\",10,160);\n doc.setFontType('bold');\n doc.setFontSize(12);\n doc.text(\"Scale: 1:\"+escala,10,170);\n doc.setFontSize(12);\n doc.text(\"EPSG:4326\",10,175);\n doc.setFontSize(12);\n doc.text(\"Projection: Mercator\",10,180);\n doc.setFontSize(12);\n doc.text(\"Datum:WGS 1984\",10,185);\n doc.setFontSize(10);\n doc.setFontType('italic');\n doc.text(\"Author:Forest Finest Consulting\",10,205);\n doc.setFontSize(14);\n doc.setFontType('italic');\n doc.text(\"Here could be added any additional information (Table, Images, Text, Graph etc.)\",80,180);\n doc.rect(4, 150, 270, 59);\n doc.addImage(norte, 'PNG', 17,12,15,15); \n doc.save('Map.pdf');\n\n map.getView().setResolution(viewResolution);\n });\n //alert(\"<br>El PDF descargado contiene la vista el formato AMCO con los elementos que visualiza en Pantalla<br>\");\n } \n })\n}", "title": "" }, { "docid": "37be893d86cc106c367936d393536d79", "score": "0.5136458", "text": "async saveToPdf(fileUrl){\n\n\t}", "title": "" }, { "docid": "2c588ac8b215eaeeea37b7241fbabc22", "score": "0.51327306", "text": "exportSequence(exportType){\n \n let requestExportType = \"\";\n if(exportType === EXPORT_TYPES.EXPORT_TYPE_LIST_PDF || exportType === EXPORT_TYPES.EXPORT_TYPE_LIST_MD){\n requestExportType = \"list\";\n } else if(exportType === EXPORT_TYPES.EXPORT_TYPE_TABLE_PDF || exportType === EXPORT_TYPES.EXPORT_TYPE_TABLE_HTML){\n requestExportType = \"table\";\n }\n\n let sequenceInfo = this.state.courseSequenceObject.sequenceInfo;\n let minTotalCredits = this.state.courseSequenceObject.minTotalCredits;\n let programName = generatePrettyProgramName(sequenceInfo.program, sequenceInfo.option, sequenceInfo.entryType, minTotalCredits);\n \n this.setState({\n \"loadingExport\": true\n }, () =>{\n $.ajax({\n type: \"POST\",\n url: \"api/export\",\n data: JSON.stringify({\n courseSequenceObject : this.state.courseSequenceObject, \n exportType: requestExportType,\n programName: programName\n }),\n success: (response) => {\n\n let downloadUrl = JSON.parse(response).exportPath;\n\n let extension = \"pdf\";\n if(exportType === EXPORT_TYPES.EXPORT_TYPE_LIST_MD){\n extension = \"md\";\n }\n if(exportType === EXPORT_TYPES.EXPORT_TYPE_TABLE_HTML){\n extension = \"html\";\n }\n\n downloadUrl = downloadUrl.replace(\"pdf\", extension);\n\n saveAs(downloadUrl, \"MySequence.\" + extension);\n\n this.setState({\"loadingExport\" : false});\n }\n });\n });\n }", "title": "" }, { "docid": "33186a62c95c2022e48d5aa891b30dd5", "score": "0.5131575", "text": "_generatesPdfDefinition() {\n let pdfTasksDocDef = [];\n angular.forEach(this.tasksArray, (task) => {\n //Create PDF definition for Task\n pdfTasksDocDef.push(this._generateTaskDocDef(task, null));\n\n //Create PDF definition foreach subtask of the previous task\n if (task.fields.subtasks) {\n let pdfSubTaskPairDocDef = { columns: [] }; //each row in the page gonna contain 2 subtasks\n\n for (let i = 0; i < task.fields.subtasks.length; i++) {\n let subtask = task.fields.subtasks[i];\n\n if (pdfSubTaskPairDocDef.columns.length < 2) {\n if (this.hideFinishedSubtasks && (subtask.fields.status.name.toLowerCase() == 'resolved' || subtask.fields.status.name.toLowerCase() == 'closed')) {\n //do nothing (the task must be hidden because it status is resolver or closed and is selected hide finished subtasks option)\n } else {\n pdfSubTaskPairDocDef.columns.push(this._generateTaskDocDef(subtask, task));\n }\n }\n\n if (pdfSubTaskPairDocDef.columns.length == 2) {\n pdfTasksDocDef.push(pdfSubTaskPairDocDef);\n pdfSubTaskPairDocDef = { columns: [] }; //reset the pair object\n }\n }\n\n //whether after the loop execution there is one remaining task in the Pair then add it to the definition\n if (pdfSubTaskPairDocDef.columns.length) {\n pdfTasksDocDef.push(pdfSubTaskPairDocDef);\n }\n }\n });\n \n this.pdfDocDef = {\n // a string or { width: number, height: number }\n pageSize: 'A4',\n\n // by default we use portrait, you can change it to landscape if you wish\n pageOrientation: 'portrait',\n\n // [left, top, right, bottom] or [horizontal, vertical] or just a number for equal margins\n pageMargins: [ 20, 50, 20, 50 ],\n\n content: pdfTasksDocDef,\n styles: {\n taskTable: {\n margin: [0, 5, 0, 15]\n },\n epicTableHeader: {\n alignment: 'center',\n bold: true,\n fontSize: 22,\n color: '#fff',\n fillColor: '#' + this.$scope.epicColor\n },\n storyTableHeader: {\n alignment: 'center',\n bold: true,\n fontSize: 22,\n color: '#fff',\n fillColor: '#' + this.$scope.storyColor\n },\n taskTableHeader: {\n alignment: 'center',\n bold: true,\n fontSize: 22,\n color: '#fff',\n fillColor: '#' + this.$scope.taskColor\n },\n subtaskTableHeader: {\n alignment: 'center',\n bold: true,\n fontSize: 18,\n color: '#fff',\n fillColor: '#' + this.$scope.subtaskColor\n },\n bugTableHeader: {\n alignment: 'center',\n bold: true,\n fontSize: 18,\n color: '#fff',\n fillColor: '#' + this.$scope.bugColor\n },\n taskTableSummary: {\n fontSize: 20\n },\n storyTableSummary: {\n fontSize: 20\n },\n subtaskTableSummary: {\n fontSize: 16,\n bold: true\n },\n epicTableSummary: {\n fontSize: 20,\n bold: true\n },\n bugTableSummary: {\n fontSize: 16,\n bold: true\n },\n taskTableFooter: {\n fontSize: 14,\n fillColor: '#efefef',\n alignment: 'right'\n }\n }\n };\n }", "title": "" }, { "docid": "7f9b7452c9fb1ceb84581e3ef1160929", "score": "0.51310015", "text": "function doProcessExportLocally()\n {\n var counter = 0;\n var arrivedCounter = 0;\n\n //var myImage = document.createElement('img');\n //document.body.appendChild(myImage);\n\n\n //******************************************\n // Attention.\n // This line modifies the legacy code\n // of Highcharts.com.\n // This is the only change and the only\n // place were this change happens in\n // this application.\n Highcharts.downloadURL = downloadURL;\n //******************************************\n\n\n ///dataURL is a thing which can be assigned to href in <a href=...\n function downloadURL(dataURL, filename) {\n try{\n //console.log( filename );\n var piggyBackCounter = parseInt(filename);\n insertImage( dataURL, piggyBackCounter )\n // //\\\\ good debug\n //if( piggyBackCounter === 1 ) ccc( dataURL );\n //myImage.src = dataURL;\n //ccc( 'chart image ' + piggyBackCounter + ' added to pdfDoc-options' );\n // \\\\// good debug\n arrivedCounter++;\n if( arrivedCounter >= contCharts.length ) {\n //ccc( 'all charts are converted' );\n //not good to reset exporter set this way here: arrivedCounter = 0;\n\n //.missing this setTimeout and calling this function directly\n //.apparently creates repeated calls to exporter in\n //.case of the function errors and leading to big mess\n setTimeout( continueAfterChartsLoaded, 1 );\n } \n } catch (err) {\n ccc( 'err in downloadURL=', err );\n }\n };\n callLocalConverter();\n return;\n\n function callLocalConverter()\n {\n var chartRack = contCharts[counter];\n chartRack.options = ns.paste( chartRack.options,\n {\n exporting: {\n filename : ''+counter,\n fallbackToExportServer: false, //true,\n error: function() { ccc( 'error in exporting: ', arguments ); },\n enabled: false // hides button\n }\n });\n chartRack.options.chart.events =\n {\n load: function( event ) {\n //ccc( Date.now() +' after load');\n if( !this.userOptions.chart.forExport ) {\n //ccc( Date.now() +' starting export of chart ' + counter +\n // ' \"' + chartRack.options.title.text + '\"');\n // chartRack.options );\n this.exportChartLocal();\n\n //.make blob ... why?\n //this.exportChartLocal({ type: 'image/svg+xml' });\n\n //ccc( Date.now() +' exportChartLocal called' );\n }\n } \n };\n\n //ccc( 'exporting chart ' + counter + ' of ' + ( contCharts.length - 1 ) );\n //if( chartRack.options.chart.type === 'columnpyramid' )\n // chartRack.options.chart.type = 'column';\n\n var container = $$.div().to(document.body)\n .css('position', 'absolute' )\n .css('left', '-10000px' )\n ();\n Highcharts.chart( container, chartRack.options );\n counter++;\n\n if( counter < contCharts.length ) {\n ////perhaps this is good to split conversion a bit,\n ////this is why delay is 1 ms\n setTimeout( callLocalConverter, 1 );\n } \n }\n }", "title": "" }, { "docid": "2ff0b58bd326e93932441789e7b920ba", "score": "0.5130063", "text": "function displayPDF_stmtAccountTrxCharges(currentPageRef,reportUrl)\n{\n\t////////////////////////////////////\n\t//object works IE8, does not work in FireFox\n\t//var chooseLanguageDivContent = '<div id=\"openPDFDivId\"><object data=\"' + certificateReportUrl + '\" type=\"application/pdf\" width=\"100%\" height=\"100%\"> <p>cannot open PDF</a></p> </object></div>';\n\n\t//IFrame works on FireFox , does not work on IE8\n\t//var chooseLanguageDivContent = '<div id=\"openPDFDivId\"><iframe src=\"' + certificateReportUrl + '\" width=\"100%\" height=\"100%\"> </iframe></div>';\n\n\t//Embed works IE8, does not work on FireFox\n\t//var chooseLanguageDivContent = '<div id=\"openPDFDivId\"><embed src=\"' + certificateReportUrl + '\" width=\"100%\" height=\"100%\"></div>';\n\n\tvar openPDFDiv = null;\n\n\tif ($.browser.msie) \n\t{\n\t\topenPDFDiv = '<div id=\"openPDFDivId_'+ currentPageRef +'\"><embed src=\"' + reportUrl + '\" width=\"100%\" height=\"100%\"></div>';\n\t} else \n\t{\n\t\topenPDFDiv = '<div id=\"openPDFDivId_'+ currentPageRef +'\"><iframe src=\"' + reportUrl + '\" width=\"100%\" height=\"100%\"> </iframe></div>';\n\t}\n\n\tvar openPDFDivElement = $(openPDFDiv);\n\n\t$('body').append(openPDFDivElement);\n\n\topenPDFDivElement.dialog( {\n\t\tmodal : true,\n\t\ttitle : stat_of_account_key,\n\t\tautoOpen : false,\n\t\t//show : 'slide',\n\t\tposition : 'center',\n\t\twidth : returnMaxWidth(950),\n\t\theight : returnMaxHeight(750),\n\t\tclose : function() \n\t\t{\n\t\t\tif ($(\"#openPDFDivId\")) \n\t\t\t{\n\t\t\t\t$(\"#openPDFDivId_\"+ currentPageRef).dialog(\"destroy\");\n\t\t\t\t$(\"#openPDFDivId_\"+ currentPageRef).remove();\n\t\t\t}\n\t\t}\n\t});\n\n\t$(openPDFDivElement).dialog(\"open\");\n\t\t\n}", "title": "" }, { "docid": "ac5a1210bc307d840afd438541be16da", "score": "0.5129124", "text": "outputData() {\n return () => {\n const csv = this.collectDataInCsv();\n var hiddenElement = document.createElement('a');\n hiddenElement.href = 'data:text/csv;charset=big5,' + encodeURI(csv);\n hiddenElement.target = '_blank';\n hiddenElement.download = this.echelonRef.current.state.echelon + 'T 員額表網路版.csv';\n hiddenElement.click();\n };\n }", "title": "" } ]
ad2bd060d76e75083b890d02cfa67f5a
Explicitly define the deps of computed.
[ { "docid": "a75be4cb9f123b25da62fe91c0555387", "score": "0.44773027", "text": "function controlledComputed(source, fn) {\n let v = undefined;\n let track;\n let trigger;\n const dirty = vueDemi.ref(true);\n vueDemi.watch(source, () => {\n dirty.value = true;\n trigger();\n }, { flush: 'sync' });\n return vueDemi.customRef((_track, _trigger) => {\n track = _track;\n trigger = _trigger;\n return {\n get() {\n if (dirty.value) {\n v = fn();\n dirty.value = false;\n }\n track();\n return v;\n },\n set() { },\n };\n });\n }", "title": "" } ]
[ { "docid": "73068abe3259b92d0398701111e17cfa", "score": "0.67811304", "text": "initComputedPropValues() {\n let computedInfo = this.computed;\n let keys = computedInfo && Object.keys(computedInfo);\n if (!keys || !keys.length) {\n return;\n }\n\n let result = {};\n keys.forEach(k => {\n result[k] = this.initDeps(k);\n });\n\n this.ctx.__setViewData(result);\n }", "title": "" }, { "docid": "177f67ea59c87bd81ee51a73884bccdc", "score": "0.6230349", "text": "dependencies() {\n return ComputeExprDependencies.of(this);\n }", "title": "" }, { "docid": "021a104cac81043b2f376ad38f3cccee", "score": "0.60420907", "text": "__bind__computed() {\n for (const key in this.computed) {\n const bindScope = this.computed[key].bind(this.data);\n this.data[key] = bindScope();\n }\n }", "title": "" }, { "docid": "9d4c517e48ae34daa2232c412c7f48bc", "score": "0.5689535", "text": "function addComputedProperty(model, computedProperty, dependencies, fn){\n \n // Use _.debounce to collapse multiple changes of dependency properties\n // into a single call to the function that computes the computed property.\n var callFn = _.debounce(function(){\n \n // Compute the arguments to pass into the function that \n // that computes the computed property; the current values\n // for each of the dependency properties from the model.\n var args = dependencies.map(function (property){\n return model.get(property);\n });\n \n // Set the value of the computed property by calling the\n // function that computes it, passing in the current values\n // of dependency properties from the model.\n model.set(computedProperty, fn.apply(null, args));\n });\n \n // Listen for changes on each of the dependency properties.\n dependencies.forEach(function(property){\n \n // Since callFn is debounced, multiple sequential calls\n // will collapse into a single call on the next tick of the event loop.\n model.on('change:' + property, callFn);\n });\n}", "title": "" }, { "docid": "b9cb8899f4ca483381b9fd597f99a633", "score": "0.5672147", "text": "[_loadDeps] () {}", "title": "" }, { "docid": "924b32b946c0b2b0092a2286be4998aa", "score": "0.5376736", "text": "getDeps() {\n\t\tthis.deps.shrunk = this.shrinkWrap.dependencies;\n\t\tthis.deps.pkgs = Object.keys(this.deps.shrunk);\n\t\tthis.deps.vers = this.deps.pkgs.map(d => this.mapVersions(d));\n\n\t\tthis.askWhichDeps();\n\t}", "title": "" }, { "docid": "da99235e9117ecbf8c7975e4fd6a3a4f", "score": "0.5362962", "text": "function buildDependencyPrequisites(pre, dependency) {\n pre.push({\n method: function (request, reply) {\n return reply(request.container.resolve(dependency));\n },\n assign: dependency\n });\n return pre;\n}", "title": "" }, { "docid": "0c1b84681559bc62e255224238dda0ff", "score": "0.5330258", "text": "function initComputeds() {\n\n var\n columns = self.selectedContactsKoTable.columns(),\n checkboxCol = columns[0];\n\n self.selectedContactSubscription = checkboxCol.checked.subscribe( function onSelectionChanged( newVal ) {\n if ( !newVal || newVal.length === 0 ) {\n self.checkedContact( null );\n } else {\n self.checkedContact( newVal[0] );\n }\n } );\n\n self.hasSelectedContact = ko.computed( function() {\n return self.checkedContact() ? true : false;\n } );\n\n // for disabling buttons\n self.selectedIsPhysician = ko.computed( function() {\n var checked = self.checkedContact();\n // disable if not a physician\n if ( !checked || checked.baseContactType !== 'PHYSICIAN' ) { return true; }\n return self.isPhysician( checked );\n } );\n\n self.selectedIsFamilyDoctor = ko.computed( function() {\n var checked = self.checkedContact();\n // disable if not a physician\n if ( !checked || checked.baseContactType !== 'PHYSICIAN' ) { return true; }\n return self.isFamilyDoctor( checked );\n } );\n\n self.selectedIsAdditionalContact = ko.computed( function() {\n var checked = self.checkedContact();\n // cannot set patient to be contact of self\n if ( !checked || 'PATIENT' === checked.baseContactType ) { return true; }\n return self.isAdditionalContact( checked );\n } );\n }", "title": "" }, { "docid": "7fa6d943dbb40db45e3716271ef92c1e", "score": "0.519631", "text": "function getComputed(dataNames) {\n var computed = {};\n\n _.each(dataNames, function (computedPropertyValue, computedPropertyName) {\n computed[computedPropertyName] = function () {\n return computedPropertyValue;\n };\n });\n\n return computed;\n}", "title": "" }, { "docid": "a3b0cdede2e3fc24da2a43fe10b75f7b", "score": "0.5185161", "text": "_setDependencies(key, deps) {\n if (!this._direct) {\n this._direct = {};\n }\n if (!this._inverse) {\n this._inverse = {};\n }\n this._direct[key] = deps;\n deps.forEach(function(dep){\n let array = this._inverse[dep] = this._inverse[dep] || [];\n let add = true;\n array.forEach(function(d){\n add &= (d !== dep); \n })\n if (add){\n array.push(key);\n }\n }.bind(this));\n }", "title": "" }, { "docid": "2a8dde756b25af20b57952ea828a545b", "score": "0.5168139", "text": "depend () {\n Dep.target.addDep(this)\n }", "title": "" }, { "docid": "8d700605678489df5737c5c28ef78567", "score": "0.5118875", "text": "depend () {\n if (Dep.target) {\n Dep.target.addDep(this)\n }\n }", "title": "" }, { "docid": "bf1954f5e9b28aa2981dda4ec5f62faf", "score": "0.50900507", "text": "addDependsOn(target) {\n // skip this dependency if the target is not part of the output\n if (!target.shouldSynthesize()) {\n return;\n }\n deps_1.addDependency(this, target, `\"${constructs_1.Node.of(this).path}\" depends on \"${constructs_1.Node.of(target).path}\"`);\n }", "title": "" }, { "docid": "097b151298cf1390b1f918eb10ac5889", "score": "0.49986476", "text": "function pureComputed(...args) {\n const readCb = args.pop();\n // The cast helps ensure that Observable is compatible with ISubscribable abstraction that we use.\n return new PureComputed(readCb, args);\n}", "title": "" }, { "docid": "f93e33a63c33e8403fff2160a7802301", "score": "0.49842146", "text": "compute() {\n\n }", "title": "" }, { "docid": "2602db21206642ea529a69e3bd41ec44", "score": "0.4931851", "text": "addDeps(...deps) {\n return this.package.addDeps(...deps);\n }", "title": "" }, { "docid": "e6cf937d0fd4c7edf5a7952482f2d794", "score": "0.49281332", "text": "function computed(computation, options) {\n const node = new ComputedImpl(computation, options?.equal ?? defaultEquals);\n // Casting here is required for g3, as TS inference behavior is slightly different between our\n // version/options and g3's.\n return createSignalFromFunction(node, node.signal.bind(node));\n}", "title": "" }, { "docid": "71aaf5c34f16e7e5bb91f966f4a8433c", "score": "0.4920215", "text": "constructor(initialValue = 0, func, dependObjectList = []) { \r\n this.func = func;\r\n this.dependObjectList = dependObjectList;\r\n this.value = initialValue;\r\n // need to go through the dependObjectList and set the usesMy_xxxx for each one\r\n }", "title": "" }, { "docid": "43745aae7f19c5408a4a372d8012dd3c", "score": "0.48977578", "text": "get install() {\n\t\treturn {\n\t\t\tall() {\n\t\t\t\tthis.installDependencies();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7bfc7ba3f14ccd84a8bd7af8463d0bf2", "score": "0.48492828", "text": "function depend(func, deferredOptions, createGetValueIds, initCallState, canAlwaysRecalc) {\n if (canAlwaysRecalc && deferredOptions != null) {\n throw new _helpers.InternalError('canAlwaysRecalc should not be deferred');\n }\n\n return deferredOptions == null ? (0, _CallState.makeDependentFunc)(func, _funcCall, createGetValueIds, initCallState, canAlwaysRecalc) : makeDeferredFunc(func, _funcCall, deferredOptions, createGetValueIds, initCallState);\n}", "title": "" }, { "docid": "0d860d09c9c2f5ec02ba87c7809102ef", "score": "0.48482898", "text": "initModelComputedProperties() {\n let model = this.get('model'),\n propName = this.get('name');\n\n if (model && propName) {\n defineProperty(this, 'validator', oneWay(`model.validations.attrs.${propName}`));\n // map the value to mode.property - this can be overridden by passing value\n // property into this component\n defineProperty(this, 'value', alias(`model.${propName}`));\n }\n }", "title": "" }, { "docid": "f466432b150a2bb7c5c14ac72a467393", "score": "0.48400828", "text": "function Dep () {\n\t this.subs = []\n\t}", "title": "" }, { "docid": "a32c218aac8188b5949b06b8dbfd6547", "score": "0.48241797", "text": "function calculateForce() {\n force = d3.layout.force()\n .nodes(nodes)\n .links(links)\n .size([width, height])\n .linkDistance(150)\n .charge(-500)\n .on('tick', tick)\n restart();\n}", "title": "" }, { "docid": "a5dca76cdc0f2ac6bbcb378ff7f2d1c0", "score": "0.4821321", "text": "depend() {\n if (Dep.target && !this.subscribers.has(Dep.target)) {\n this.subscribers.add(Dep.target);\n }\n }", "title": "" }, { "docid": "c702d26565756062d194427547b2e0ed", "score": "0.48011595", "text": "function _pureBeforeSubscriptionAdd(event) {\n // If asleep, wake up the computed by subscribing to any dependencies.\n let computedObservable = this,\n state = computedObservable[COMPUTED_STATE];\n if (!state.isDisposed && state.isSleeping && event === 'change') {\n state.isSleeping = false;\n if (state.isStale || computedObservable.haveDependenciesChanged()) {\n state.dependencyTracking = null;\n state.dependenciesCount = 0;\n if (computedObservable.evaluate()) {\n (computedObservable._versionNumber++);\n }\n } else {\n // First put the dependencies in order\n let dependenciesOrder = [],\n __dependencyTracking = state.dependencyTracking;\n \n if (__dependencyTracking) {\n for (let id of Object.keys(__dependencyTracking)) {\n dependenciesOrder[__dependencyTracking[id]._order] = id;\n }\n }\n \n // Next, subscribe to each one\n dependenciesOrder.forEach((id, order) => {\n let dependency = __dependencyTracking[id],\n subscription = computedObservable.subscribeToDependency(dependency._target);\n subscription._order = order;\n subscription._version = dependency._version;\n __dependencyTracking[id] = subscription;\n });\n \n // Waking dependencies may have triggered effects\n if (computedObservable.haveDependenciesChanged()) {\n if (computedObservable.evaluate()) {\n (computedObservable._versionNumber++);\n }\n }\n }\n\n if (!state.isDisposed) { // test since evaluating could trigger disposal\n computedObservable.notifySubscribers(state.latestValue, \"awake\");\n }\n }\n }", "title": "" }, { "docid": "4e50cefbe33bf21f9f1a4a5960b2e613", "score": "0.47989437", "text": "dependencies() {\n return this.vue.dependencies();\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.47739697", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.47739697", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.47739697", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.47739697", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.47739697", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "336b46b66ea5b1a3bb24c77e468de89f", "score": "0.47739697", "text": "computedItems() {\n return this.allItems;\n }", "title": "" }, { "docid": "83923e9aeda03edf1cc992e4561c75b2", "score": "0.47724754", "text": "evaluateDependencies(inputValues) {\n if (Object.keys(this.editorDependencies).length > 0) {\n const booleanExpressionEvaluator = new BooleanExpressionEvaluator(\n inputValues\n );\n if (\"show\" in this.editorDependencies) {\n this.show = booleanExpressionEvaluator.evaluate(\n this.editorDependencies.show\n );\n if (\"showOptions\" in this.editorDependencies) {\n if (\n \"isRequired\" in this.editorDependencies.showOptions &&\n this.editorDependencies.showOptions.isRequired\n ) {\n this.isRequired = this.show;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "8b83c8a9f64606bc41c2f92ee1c22429", "score": "0.47695088", "text": "function Uses(_dependancies,_callback,_useName){\n var aliasObject = false;\n switch(KUBE.Is(_dependancies)){\n case 'string':\n _dependancies = [_dependancies];\n break;\n\n case 'object':\n var tempDependancies = [];\n for(var key in _dependancies){\n if(_dependancies.hasOwnProperty(key)){\n tempDependancies.push(_dependancies[key]);\n }\n }\n aliasObject = _dependancies;\n _dependancies = tempDependancies;\n break;\n }\n\n\n\t\t\tvalidateEmitter();\n\t\t\treturn (validateDependancies(_dependancies,_callback) ? getPromise(_dependancies,_callback,_useName,aliasObject) : false);\n\t\t}", "title": "" }, { "docid": "64bde99bebb696d9c46ef54a04391b67", "score": "0.47390053", "text": "function req(deps) {\n\t\tif (typeof deps === 'string') deps = [deps];\n\t\treturn {\n\t\t\tdeps: function ($q, $rootScope) {\n\t\t\t\tvar deferred = $q.defer();\n\t\t\t\trequire(deps, function() {\n\t\t\t\t\t$rootScope.$apply(function () {\n\t\t\t\t\t\tdeferred.resolve();\n\t\t\t\t\t});\n\t\t\t\t\tdeferred.resolve();\n\t\t\t\t});\n\t\t\t\treturn deferred.promise;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "64bde99bebb696d9c46ef54a04391b67", "score": "0.47390053", "text": "function req(deps) {\n\t\tif (typeof deps === 'string') deps = [deps];\n\t\treturn {\n\t\t\tdeps: function ($q, $rootScope) {\n\t\t\t\tvar deferred = $q.defer();\n\t\t\t\trequire(deps, function() {\n\t\t\t\t\t$rootScope.$apply(function () {\n\t\t\t\t\t\tdeferred.resolve();\n\t\t\t\t\t});\n\t\t\t\t\tdeferred.resolve();\n\t\t\t\t});\n\t\t\t\treturn deferred.promise;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "adbebb05c0233ef1f712d879c9139b58", "score": "0.47217128", "text": "addPeerDeps(...deps) {\n return this.package.addPeerDeps(...deps);\n }", "title": "" }, { "docid": "b211d0a01cf9e5cc372578912c11bfb2", "score": "0.47189328", "text": "async function createUnsupportedDependencies(dependencies){\n\n let newDependencies = [];\n let customFieldsByName = new Map();\n\n dependencies.forEach(dep => {\n if(isCustomField(dep.type)) customFieldsByName.set(dep.name,dep)\n });\n\n let customFieldNames = [...customFieldsByName.keys()];\n let cachedFields = [];\n let uncachedFields = [];\n\n //we look at the cache to figure out for which fields we have already\n //read the metadata from\n if(cache.getFieldNames().length){\n\n customFieldNames.forEach(field => {\n\n if(cache.isFieldCached(field)) cachedFields.push(field);\n else uncachedFields.push(field);\n })\n\n }else{\n uncachedFields = customFieldNames;\n }\n\n let records = [];\n\n if(uncachedFields.length){\n let mdapi = metadataAPI(connection,logError);\n records = await mdapi.readMetadata('CustomField',uncachedFields);\n cache.cacheFieldNames(uncachedFields);\n }\n\n //we add the newly returned records to the cache for later use\n records.forEach(record => {\n cache.cacheField(record.fullName,record);\n })\n\n\n //for any field that we determined was cached, we add its data to the\n //records array\n cachedFields.forEach(field => {\n let cachedFieldData = cache.getField(field);\n if(cachedFieldData) {\n records.push(cachedFieldData);\n }\n })\n\n let lookupFields = records.filter(rec => rec.referenceTo);\n let pkValueSets = records.filter(rec => rec.valueSet && rec.valueSet.valueSetName);\n\n if(lookupFields.length){\n let lookupFieldsDependencies = await createLookupFieldDependencies(lookupFields,customFieldsByName);\n newDependencies.push(...lookupFieldsDependencies);\n }\n\n if(pkValueSets.length){\n let valueSetDependencies = createValueSetDependencies(pkValueSets,customFieldsByName);\n newDependencies.push(...valueSetDependencies);\n }\n\n return newDependencies;\n\n }", "title": "" }, { "docid": "5153f51db09408f6ae628bdeac0e87e6", "score": "0.47032863", "text": "function getExternalDeps( nodes ) {\n var res = [];\n var helpersres = [];\n\n if ( nodes && nodes.statements ) {\n res = recursiveVarSearch( nodes.statements, [], undefined, helpersres );\n }\n\n var defaultHelpers = [\"helperMissing\", \"blockHelperMissing\", \"each\", \"if\", \"unless\", \"with\"];\n\n return {\n vars : _(res).chain().unique().map(function(e){\n if ( e === \"\" ) {\n return '.';\n }\n if ( e.length && e[e.length-1] === '.' ) {\n return e.substr(0,e.length-1) + '[]';\n }\n return e;\n }).value(),\n helpers : _(helpersres).chain().unique().map(function(e){\n if ( _(defaultHelpers).contains(e) ) {\n return undefined;\n }\n return e;\n }).compact().value()\n };\n }", "title": "" }, { "docid": "c9a932d4c4977917bee331f4105fc1a1", "score": "0.46911606", "text": "get dependencies() {\n if (this._deps) {\n return this._deps;\n }\n this._deps = this._dependencyIDs.map(id => {\n const dep = this.assembly.tryGetArtifact(id);\n if (!dep) {\n throw new Error(`Artifact ${this.id} depends on non-existing artifact ${id}`);\n }\n return dep;\n });\n return this._deps;\n }", "title": "" }, { "docid": "4d69106187bb7019541f1d4e2ca06fab", "score": "0.46811867", "text": "function node(new_compute){\n // If we are in the variable capture phase (ref below), then we push this\n // node to the `capture_deps` array.\n if (capturing_deps)\n captured_deps.push(node);\n // Otherwise, we do what was described above.\n if (new_compute !== undefined){\n node.compute = wrap_function(new_compute);\n refresh(node);\n };\n return node.value;\n }", "title": "" }, { "docid": "4e238f4f48ceca574d5fe0c5332e79a3", "score": "0.46803886", "text": "compute(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 1, get);\n }", "title": "" }, { "docid": "396a2f0d1192be0d2f9ca679051dda99", "score": "0.46718267", "text": "static of(expr) {\n const dependencies = new ExprDependencies();\n expr.accept(this.instance, dependencies);\n return dependencies;\n }", "title": "" }, { "docid": "08d6c063d912eb58e1be43d969302fa8", "score": "0.46658093", "text": "get external() {\n if (!this.computed.external) {\n this.computed.external = getExternal(this);\n }\n return this.computed.external;\n }", "title": "" }, { "docid": "511aef24b8ec772b683b946d645ff0cb", "score": "0.4656533", "text": "compute(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 1 /* Provider.Single */, get);\n }", "title": "" }, { "docid": "ac5066165797eeb9714174c298aff662", "score": "0.46490136", "text": "function getExternalDeps(nodes) {\n var res = [];\n var helpersres = [];\n\n if (nodes && nodes.statements) {\n res = recursiveVarSearch(nodes.statements, [], undefined, helpersres);\n }\n\n var defaultHelpers = [\"helperMissing\", \"blockHelperMissing\", \"each\", \"if\", \"unless\", \"with\"];\n\n return {\n vars: _(res).chain().unique().map(function(e) {\n if (e === \"\") {\n return '.';\n }\n if (e.length && e[e.length - 1] === '.') {\n return e.substr(0, e.length - 1) + '[]';\n }\n return e;\n }).value(),\n helpers: _(helpersres).chain().unique().map(function(e) {\n if (_(defaultHelpers).contains(e)) {\n return undefined;\n }\n return e;\n }).compact().value()\n };\n }", "title": "" }, { "docid": "a05f857a83cedc88da49dfefb374967a", "score": "0.46418518", "text": "compute() {\n return this.inner;\n }", "title": "" }, { "docid": "aa1e4936c385bdcdf8c2c0a6d970a556", "score": "0.46348894", "text": "function dependArray(value){for(var e=void 0,i=0,l=value.length;i<l;i++){e=value[i];e&&e.__ob__&&e.__ob__.dep.depend();if(Array.isArray(e)){dependArray(e);}}}", "title": "" }, { "docid": "aa1e4936c385bdcdf8c2c0a6d970a556", "score": "0.46348894", "text": "function dependArray(value){for(var e=void 0,i=0,l=value.length;i<l;i++){e=value[i];e&&e.__ob__&&e.__ob__.dep.depend();if(Array.isArray(e)){dependArray(e);}}}", "title": "" }, { "docid": "aa1e4936c385bdcdf8c2c0a6d970a556", "score": "0.46348894", "text": "function dependArray(value){for(var e=void 0,i=0,l=value.length;i<l;i++){e=value[i];e&&e.__ob__&&e.__ob__.dep.depend();if(Array.isArray(e)){dependArray(e);}}}", "title": "" }, { "docid": "8ff062ce54bc32a558477da0496f8bb4", "score": "0.46318427", "text": "function writeDependencies() {\n\tif (cur_ns.descriptor.network_functions != null) {\n\t\tvnf_deps = [];\n\t\tfor ( var i = 0; i < cur_ns.descriptor.network_functions.length; i++) {\n\t\t\tvar vnf = cur_ns.descriptor.network_functions[i];\n\t\t\tvar vnf_dep = vnf.vnf_vendor + \":\" + vnf.vnf_name + \":\"\n\t\t\t\t\t+ vnf.vnf_version;\n\t\t\tif ($.inArray(vnf_dep, vnf_deps) < 0) {\n\t\t\t\tvnf_deps.push(vnf_dep);\n\t\t\t}\n\t\t}\n\t\tcur_ns.descriptor[\"vnf_depedency\"] = vnf_deps;\n\t}\n\tif (cur_ns.descriptor.network_services != null) {\n\t\tns_deps = [];\n\t\tfor ( var i = 0; i < cur_ns.descriptor.network_services.length; i++) {\n\t\t\tvar ns = cur_ns.descriptor.network_services[i];\n\t\t\tvar ns_dep = ns.ns_vendor + \":\" + ns.ns_name + \":\" + ns.ns_version;\n\t\t\tif ($.inArray(ns_dep, ns_deps) < 0) {\n\t\t\t\tns_deps.push(ns_dep);\n\t\t\t}\n\t\t}\n\t\tcur_ns.descriptor[\"services_depedency\"] = ns_deps;\n\t}\n}", "title": "" }, { "docid": "4ba8aeb7c40c18f07781e2f5661089d3", "score": "0.46113658", "text": "async installDependencies() {\n }", "title": "" }, { "docid": "51c2f4acca49a240ee7f0aca8bea0476", "score": "0.46100172", "text": "compute(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 1 /* Provider.Single */, get);\n }", "title": "" }, { "docid": "ca5fcb6748a9806139297b63a89dfc96", "score": "0.45753622", "text": "fvExtraRules() {\n return {};\n }", "title": "" }, { "docid": "d9e616b2a2f7f0513775cd0f14fe598c", "score": "0.45551077", "text": "dependencies(skipHead = false) {\n var elemDeps = [];\n if (!skipHead && this.head !== '_' && this.head !== null) {\n elemDeps.push([this.id, this.head, this.deprel]);\n }\n if (this.deps != '_') {\n var deparr = this.deps.split('|');\n for (let i = 0; i < deparr.length; i++) {\n var dep = deparr[i];\n var m = dep.match(util_1.Util.dependencyRegex);\n if (m) {\n elemDeps.push([this.id, m[1], m[2]]);\n }\n else {\n util_1.Util.reportError('internal error: dependencies(): invalid DEPS ' +\n this.deps);\n }\n }\n }\n return elemDeps;\n }", "title": "" }, { "docid": "36da6ae224c6b7fd96034ae5ae5d9ead", "score": "0.45347214", "text": "_resolveDef() {\n this._resolved = true;\n // set initial attrs\n for (let i = 0; i < this.attributes.length; i++) {\n this._setAttr(this.attributes[i].name);\n }\n // watch future attr changes\n new MutationObserver(mutations => {\n for (const m of mutations) {\n this._setAttr(m.attributeName);\n }\n }).observe(this, { attributes: true });\n const resolve = (def, isAsync = false) => {\n const { props, styles } = def;\n // cast Number-type props set before resolve\n let numberProps;\n if (props && !(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props)) {\n for (const key in props) {\n const opt = props[key];\n if (opt === Number || (opt && opt.type === Number)) {\n if (key in this._props) {\n this._props[key] = (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.toNumber)(this._props[key]);\n }\n (numberProps || (numberProps = Object.create(null)))[(0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)(key)] = true;\n }\n }\n }\n this._numberProps = numberProps;\n if (isAsync) {\n // defining getter/setters on prototype\n // for sync defs, this already happened in the constructor\n this._resolveProps(def);\n }\n // apply CSS\n this._applyStyles(styles);\n // initial render\n this._update();\n };\n const asyncDef = this._def.__asyncLoader;\n if (asyncDef) {\n asyncDef().then(def => resolve(def, true));\n }\n else {\n resolve(this._def);\n }\n }", "title": "" }, { "docid": "eb22d8176cc97b9f239161b9d0d54ef4", "score": "0.45339704", "text": "removeDevAndEnvDepsIfTheyAlsoRegulars() {\n // remove dev and env packages that are also regular packages\n const getNotRegularPackages = packages => (0, _difference2().default)((0, _keys2().default)(packages), (0, _keys2().default)(this.allPackagesDependencies.packageDependencies));\n\n this.allPackagesDependencies.devPackageDependencies = (0, _pick2().default)(getNotRegularPackages(this.allPackagesDependencies.devPackageDependencies), this.allPackagesDependencies.devPackageDependencies);\n this.allPackagesDependencies.compilerPackageDependencies = (0, _pick2().default)(getNotRegularPackages(this.allPackagesDependencies.compilerPackageDependencies), this.allPackagesDependencies.compilerPackageDependencies);\n this.allPackagesDependencies.testerPackageDependencies = (0, _pick2().default)(getNotRegularPackages(this.allPackagesDependencies.testerPackageDependencies), this.allPackagesDependencies.testerPackageDependencies); // remove dev dependencies that are also regular dependencies\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n const componentDepsIds = new (_bitId().BitIds)(...this.allDependencies.dependencies.map(c => c.id));\n this.allDependencies.devDependencies = this.allDependencies.devDependencies.filter(d => !componentDepsIds.has(d.id));\n }", "title": "" }, { "docid": "4c8fe51120c3fc30306713aa71c679d6", "score": "0.45242482", "text": "static resolveCriticalFromDeps (deps:? IIndicatorDeps, def: boolean): boolean {\n if (deps === undefined || deps === null || isEmpty(deps)) {\n return !!def\n }\n\n return !!find(deps, dep => dep.health().critical)\n }", "title": "" }, { "docid": "009f844028f015253fe0eb4e434ad62b", "score": "0.45238942", "text": "computeN(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 2, get);\n }", "title": "" }, { "docid": "5d267db8c1e0559af367ab748626942a", "score": "0.45156163", "text": "transitiveDeps(includeCaller) {\n let depsOfNode = this.deps();\n if (depsOfNode.length === 0) {\n return new Set();\n }\n let transitiveDependenciesOfNode = new Set(depsOfNode);\n depsOfNode.forEach((dep) => {\n dep.transitiveDeps(includeCaller).forEach((transitiveDep) => transitiveDependenciesOfNode.add(transitiveDep));\n transitiveDependenciesOfNode.add(dep);\n });\n\n if (includeCaller && this.caller) {\n transitiveDependenciesOfNode.add(this.caller);\n this.caller.transitiveDeps(true).forEach((d) => transitiveDependenciesOfNode.add(d));\n }\n return transitiveDependenciesOfNode;\n }", "title": "" }, { "docid": "0cead2bbfd1f2649b2bcc4a126fc274a", "score": "0.45018438", "text": "addDevDeps(...deps) {\n return this.package.addDevDeps(...deps);\n }", "title": "" }, { "docid": "024e560e70babb99ede39ab81da8f00b", "score": "0.4501475", "text": "function Lazy() {\n this.calls = [];\n this.add = (func, ...args) => {\n this.calls.push([func, args]);\n return this;\n };\n this.invoke = (val) => {\n this.calls.forEach(elem => {\n let prop = elem[1].concat(val);\n val = elem[0].apply(val, prop);\n }); \n return val;\n };\n }", "title": "" }, { "docid": "f700b30b3aa3c8e4846722f1b4497a50", "score": "0.4500616", "text": "shouldDeferDependency(dependency, sideEffects) {\n let defer = false;\n\n if (dependency.isWeak && sideEffects === false && !dependency.symbols.has('*')) {\n let depNode = this.getNode(dependency.id);\n (0, _assert.default)(depNode);\n let assets = this.getNodesConnectedTo(depNode);\n let symbols = new Map([...dependency.symbols].map(([key, val]) => [val.local, key]));\n (0, _assert.default)(assets.length === 1);\n let firstAsset = assets[0];\n (0, _assert.default)(firstAsset.type === 'asset');\n let resolvedAsset = firstAsset.value;\n let deps = this.getIncomingDependencies(resolvedAsset);\n defer = deps.every(d => !(d.env.isLibrary && d.isEntry) && !d.symbols.has('*') && ![...d.symbols.keys()].some(symbol => {\n var _resolvedAsset$symbol, _resolvedAsset$symbol2;\n\n let assetSymbol = (_resolvedAsset$symbol = resolvedAsset.symbols) === null || _resolvedAsset$symbol === void 0 ? void 0 : (_resolvedAsset$symbol2 = _resolvedAsset$symbol.get(symbol)) === null || _resolvedAsset$symbol2 === void 0 ? void 0 : _resolvedAsset$symbol2.local;\n return assetSymbol != null && symbols.has(assetSymbol);\n }));\n }\n\n return defer;\n }", "title": "" }, { "docid": "cc565ef896a33f6625c2b815cebe28f7", "score": "0.4500319", "text": "computeN(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 2 /* Provider.Multi */, get);\n }", "title": "" }, { "docid": "7f55de437d5f40e0f71966b33d257460", "score": "0.4498232", "text": "function catchDeps (binding) {\n if (binding.isFn) return\n utils.log('\\n- ' + binding.key)\n var got = utils.hash()\n binding.deps = []\n catcher.on('get', function (dep) {\n var has = got[dep.key]\n if (\n // avoid duplicate bindings\n (has && has.compiler === dep.compiler) ||\n // avoid repeated items as dependency\n // only when the binding is from self or the parent chain\n (dep.compiler.repeat && !isParentOf(dep.compiler, binding.compiler))\n ) {\n return\n }\n got[dep.key] = dep\n utils.log(' - ' + dep.key)\n binding.deps.push(dep)\n dep.subs.push(binding)\n })\n binding.value.$get()\n catcher.off('get')\n}", "title": "" }, { "docid": "50e8a3ff8248ffe7ccea106f316eacaf", "score": "0.44963628", "text": "dependencies() {\n let dependencies = [this.compilerName()];\n\n if (this.options.extractStyles && this.options.globalStyles) {\n dependencies.push('sass-resources-loader');\n }\n\n return dependencies;\n }", "title": "" }, { "docid": "8c7c19dde911eb9418b01045195d7511", "score": "0.4493243", "text": "add(dep) {\n this.dependables.push(dep);\n }", "title": "" }, { "docid": "b249324cbb773721f25a2b421235c79e", "score": "0.44898257", "text": "function state(compute){\n // This sets the compute function of the node, i.e., the function that is\n // used to compute a state value in function of other states. A\n // non-computed state is actually a computed state where the computing\n // function has no arguments, so we wrap such function around the value.\n function wrap_function(compute){\n if (typeof compute !== \"function\")\n return function(){ return compute; };\n else\n return compute;\n };\n node.compute = wrap_function(compute);\n\n // The state object can be called with or without an argument. If it is\n // called without an argument, it just returns its value. If it is caleld\n // with an argument, it refreshes the computing function of that state and\n // returns the new value.\n function node(new_compute){\n // If we are in the variable capture phase (ref below), then we push this\n // node to the `capture_deps` array.\n if (capturing_deps)\n captured_deps.push(node);\n // Otherwise, we do what was described above.\n if (new_compute !== undefined){\n node.compute = wrap_function(new_compute);\n refresh(node);\n };\n return node.value;\n }\n\n // The variable capture phase is a little small hack that allows us not to\n // need to specify a list of dependencies for a computed function. It works\n // by globally changing the behavior of every state object so that, instead\n // of doing what it does (get/set its state), it just reports its existence\n // to a dependency collector array. This looks ugly in code, but can be\n // seen as a workaround for a language limitation. It is mostly innofensive\n // and avoids a lot of boilerplate. \n node.depended_by = [];\n captured_deps = [];\n capturing_deps = true;\n node.compute();\n capturing_deps = false;\n node.dependencies = captured_deps;\n for (var i=0; i<captured_deps.length; ++i)\n captured_deps[i].depended_by.push(node);\n\n // When the node is properly built, we just bootstrap its initial value by\n // refreshing it. This avoids a little code duplication.\n refresh(node);\n\n return node;\n }", "title": "" }, { "docid": "47f88e54b923e81d686848794c623398", "score": "0.4485739", "text": "function addComputedDatumSetter(f) {\n computedDataSetters.push(f);\n }", "title": "" }, { "docid": "f404788a754e40942c056772d08a7cf9", "score": "0.44750392", "text": "computeN(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 2 /* Provider.Multi */, get);\n }", "title": "" }, { "docid": "4d707e0324c1a437a15f47490d26fb54", "score": "0.44685027", "text": "invokeWithDynamicDependencies(container: Container, fn: Function, staticDependencies: any[], dynamicDependencies: any[]): any {\n let i = staticDependencies.length;\n let args = new Array(i);\n\n while (i--) {\n args[i] = container.get(staticDependencies[i]);\n }\n\n if (dynamicDependencies !== undefined) {\n args = args.concat(dynamicDependencies);\n }\n\n return fn.apply(undefined, args);\n }", "title": "" }, { "docid": "dbfb8a8c55d8555edb61fa6766035e81", "score": "0.44666868", "text": "function controlledComputed(source, fn) {\r\n let v = undefined\r\n let track\r\n let trigger\r\n const dirty = Object(lib['ref'])(true)\r\n Object(lib['watch'])(\r\n source,\r\n () => {\r\n dirty.value = true\r\n trigger()\r\n },\r\n { flush: 'sync' }\r\n )\r\n return Object(lib['customRef'])((_track, _trigger) => {\r\n track = _track\r\n trigger = _trigger\r\n return {\r\n get() {\r\n if (dirty.value) {\r\n v = fn()\r\n dirty.value = false\r\n }\r\n track()\r\n return v\r\n },\r\n set() {}\r\n }\r\n })\r\n }", "title": "" }, { "docid": "442ba9e90ba7372cf89bad847433b0ab", "score": "0.4465824", "text": "function processLinked(deps, processed) {\n if(_.isEmpty(deps)) {\n return;\n }\n if(!processed) {\n processed = _.clone(deps);\n }\n\n var newDeps = {};\n var promise = when.resolve();\n _.each(deps, function(version, link) {\n promise = promise.then(function() {\n var pkgPath = path.resolve(nodeModulesDir, link, 'package.json');\n if (!fs.existsSync(pkgPath)) { throw new Error('Invalid package at '+pkgPath); }\n var linkPackage = require(pkgPath);\n\n if(!_.isEmpty(linkPackage.peerDependencies)) {\n //Install OR link peer dependencies\n self.log.verbose(\"Installing peer dependencies \" +\n JSON.stringify(_.keys(linkPackage.peerDependencies)) + \" from \"\n + linkPackage.name + \"@\" + linkPackage.version + \" into \" + cwd);\n }\n\n return self.installWorkspaceDependencies(cwd, linkPackage.peerDependencies, workspaceDescriptor, installed)\n .then(function(newResults) {\n _.extend(newDeps, newResults.linked);\n });\n });\n });\n\n return promise.then(function() {\n var diff = _.omit(newDeps, _.keys(processed));\n //update the global list\n var newProcessed = _.extend({}, processed, diff);\n //process only new links\n return processLinked(diff, newProcessed);\n });\n }", "title": "" }, { "docid": "41c1fafd9f6754f8e9a86b3a74bfb232", "score": "0.446353", "text": "checkDependencies (deps) {\n const checkedDeps = []\n if ((typeof deps === 'object') && (Array.isArray(deps))) {\n deps.forEach((item) => {\n if (!window[item]) checkedDeps.push(item)\n })\n return checkedDeps\n } else if (typeof deps === 'object') {\n Object.entries(deps).forEach((item) => {\n if (!window[item[1]]) checkedDeps.push(item[0])\n })\n return checkedDeps\n } else return (!window[deps]) ? [deps] : []\n }", "title": "" }, { "docid": "f4b46d4ead7645c6b856a09b913a5ab2", "score": "0.44566447", "text": "function setup() {\n //totals(julysalesList, julysales, julycosts)\n totals(augustsaleList, augustsales, augustcost);\n totals(septembersaleList, septembersales, septembercost);\n totals(octobersaleList, octobersales, octoberosts);\n }", "title": "" }, { "docid": "889253174784357c18a204ffe60595ae", "score": "0.44516483", "text": "function ComputeService () {}", "title": "" }, { "docid": "78de19da70c7c7c0a7ac287b674693c0", "score": "0.44404325", "text": "function shouldCompute$$1(derivation) {\n switch (derivation.dependenciesState) {\n case IDerivationState.UP_TO_DATE:\n return false;\n case IDerivationState.NOT_TRACKING:\n case IDerivationState.STALE:\n return true;\n case IDerivationState.POSSIBLY_STALE: {\n var prevUntracked = untrackedStart$$1(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing, l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue$$1(obj)) {\n if (globalState$$1.disableErrorBoundaries) {\n obj.get();\n }\n else {\n try {\n obj.get();\n }\n catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd$$1(prevUntracked);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState === IDerivationState.STALE) {\n untrackedEnd$$1(prevUntracked);\n return true;\n }\n }\n }\n changeDependenciesStateTo0$$1(derivation);\n untrackedEnd$$1(prevUntracked);\n return false;\n }\n }\n}", "title": "" }, { "docid": "78de19da70c7c7c0a7ac287b674693c0", "score": "0.44404325", "text": "function shouldCompute$$1(derivation) {\n switch (derivation.dependenciesState) {\n case IDerivationState.UP_TO_DATE:\n return false;\n case IDerivationState.NOT_TRACKING:\n case IDerivationState.STALE:\n return true;\n case IDerivationState.POSSIBLY_STALE: {\n var prevUntracked = untrackedStart$$1(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing, l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue$$1(obj)) {\n if (globalState$$1.disableErrorBoundaries) {\n obj.get();\n }\n else {\n try {\n obj.get();\n }\n catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd$$1(prevUntracked);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState === IDerivationState.STALE) {\n untrackedEnd$$1(prevUntracked);\n return true;\n }\n }\n }\n changeDependenciesStateTo0$$1(derivation);\n untrackedEnd$$1(prevUntracked);\n return false;\n }\n }\n}", "title": "" }, { "docid": "78de19da70c7c7c0a7ac287b674693c0", "score": "0.44404325", "text": "function shouldCompute$$1(derivation) {\n switch (derivation.dependenciesState) {\n case IDerivationState.UP_TO_DATE:\n return false;\n case IDerivationState.NOT_TRACKING:\n case IDerivationState.STALE:\n return true;\n case IDerivationState.POSSIBLY_STALE: {\n var prevUntracked = untrackedStart$$1(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing, l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue$$1(obj)) {\n if (globalState$$1.disableErrorBoundaries) {\n obj.get();\n }\n else {\n try {\n obj.get();\n }\n catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd$$1(prevUntracked);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState === IDerivationState.STALE) {\n untrackedEnd$$1(prevUntracked);\n return true;\n }\n }\n }\n changeDependenciesStateTo0$$1(derivation);\n untrackedEnd$$1(prevUntracked);\n return false;\n }\n }\n}", "title": "" }, { "docid": "043fa31a162349e51be73d7c945f865d", "score": "0.44274285", "text": "calcTotal(){\n return this.products\n .map( price => price )\n .reduce( (ac, price => ac + price, 0));\n }", "title": "" }, { "docid": "7541fe01ae268ddc6d1a0a812c95a54c", "score": "0.4422669", "text": "function calculate() {}", "title": "" }, { "docid": "09ea8e3e4185349c5973fc6945777b64", "score": "0.4418167", "text": "function getFactoryDependencies(meta) {\n return meta.arguments.map(function mapArgs(arg) {\n var depEntry = [\n `.${arg.replace(LD_PATT, \".\")}`\n ];\n if (meta.argumentDefaults.hasOwnProperty(arg)) {\n depEntry.push({\n \"default\": JSON.parse(meta.argumentDefaults[arg])\n });\n }\n return depEntry;\n });\n }", "title": "" }, { "docid": "46240c65536a363270d839a6c9a67ec3", "score": "0.44178718", "text": "compile() {\n this.data = {};\n this.layers.forEach((layer) => {\n const patch = layer.get();\n if (patch === undefined) return;\n this.data = this.options.mergeMethod(this.data, patch);\n });\n if (this.options.links) this.link();\n this.compilled = true;\n }", "title": "" }, { "docid": "30382ce7af8c673a810a4c7b3712df92", "score": "0.44177923", "text": "initialize() {\n for (let forPatcher of this._forPatcherDescendants) {\n for (let name of forPatcher.getIIFEAssignments()) {\n if (countVariableUsages(this.node, name) > countVariableUsages(forPatcher.node, name) &&\n this._explicitDeclarationsToAdd.indexOf(name) === -1) {\n this._explicitDeclarationsToAdd.push(name);\n }\n }\n }\n }", "title": "" }, { "docid": "acc5a3d452c6a1ba9c5168adcdfc0778", "score": "0.4408056", "text": "function dependX(func, deferredOptions, createGetValueIds, initCallState) {\n return deferredOptions == null ? (0, _CallState.makeDependentFunc)(func, funcCallX, createGetValueIds, initCallState, false) : makeDeferredFunc(func, funcCallX, deferredOptions, createGetValueIds, initCallState);\n} // endregion", "title": "" }, { "docid": "4b85a40b05825f0d90a4dbd3c241bd6c", "score": "0.4406306", "text": "function solveDependencies() {\n if ( i === self.dependencies.length ) { if ( callback ) callback(); return; }\n self.ccm.helper.solveDependency( self.dependencies, i++, solveDependencies );\n }", "title": "" }, { "docid": "e4aabcb4c13671b73fba01b2c7e8ef27", "score": "0.4403031", "text": "function depends_example (){\n var deps = [];\n /* e.g.\n if (!$.fn.datetimepicker){\n $('head').append('<link rel=\"stylesheet\" href=\"'+ ftui.config.dir + '/../lib/jquery.datetimepicker.css\" type=\"text/css\" />');\n deps.push(\"lib/jquery.datetimepicker.js\");\n }\n if(typeof Module_label == 'undefined'){\n deps.push('label');\n }\n */\n return deps;\n}", "title": "" }, { "docid": "6beacf9c931f3f071224aefd8997d22f", "score": "0.43998942", "text": "function ensureEvaluated(moduleName, seen, loader) {\n var entry = loader.defined[moduleName];\n\n // if already seen, that means it's an already-evaluated non circular dependency\n if (!entry || entry.evaluated || !entry.declarative)\n return;\n\n // this only applies to declarative modules which late-execute\n\n seen.push(moduleName);\n\n for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) {\n var depName = entry.normalizedDeps[i];\n if (indexOf.call(seen, depName) == -1) {\n if (!loader.defined[depName])\n loader.get(depName);\n else\n ensureEvaluated(depName, seen, loader);\n }\n }\n\n if (entry.evaluated)\n return;\n\n entry.evaluated = true;\n entry.module.execute.call(__global);\n }", "title": "" }, { "docid": "3571da9a8c1a92301d24d7602c6c8044", "score": "0.43939945", "text": "makeRecipeDependencies(components, uiType) {\n return components.map(i => {\n i.inRecipe = true; // eslint-disable-line no-param-reassign\n i.ui_type = uiType; // eslint-disable-line no-param-reassign\n return i;\n });\n }", "title": "" }, { "docid": "38d325b3ac73033975f43bbf7f2ee6c6", "score": "0.4390155", "text": "function computePrimaryLibraries() {\n computePairwiseGlobalAlignmentData();\n if (inputData.useLocalLibrary) computePairwiseLocalAlignmentData();\n }", "title": "" }, { "docid": "a8cc6a0fe96474699014b075e27005f9", "score": "0.43824172", "text": "function CSSComputedElementPanel() {}", "title": "" }, { "docid": "474f09c77d24b5f93897a8e886f37528", "score": "0.43800518", "text": "calcularTotalCarrito(state, getters){\n let total = 0;\n getters.listarProductosDelCarrito.forEach(item => {\n total = total + item.precio * item.cantidad\n });\n \n return total;\n }", "title": "" }, { "docid": "80e9d98f52e3c30d5ec523fa75b3afff", "score": "0.4378585", "text": "v_compute(xs0) {\n let xs;\n if (this.range instanceof FactorRange)\n xs = this.range.v_synthetic(xs0);\n else if (isArrayableOf(xs0, isNumber))\n xs = xs0;\n else\n throw new Error(\"unexpected\");\n const result = new Float64Array(xs.length);\n for (let i = 0; i < xs.length; i++) {\n const x = xs[i];\n result[i] = this._compute(x);\n }\n return result;\n }", "title": "" }, { "docid": "61ef68fbb98bb966a8146d2f4a7f2b86", "score": "0.43769407", "text": "addDeps (configObj) {\n try {\n this.peers = configObj.peers\n this.encrypt = configObj.encrypt\n } catch (err) {\n console.error('Error in orbitdb.js/addDeps()')\n throw err\n }\n }", "title": "" }, { "docid": "8abde7d69fcfe9888ab8c0b33a54a4c6", "score": "0.43717754", "text": "static _handleCssDepsForElement($elm, props = {}) {\n var _a, _b, _c, _d;\n return __awaiter(this, void 0, void 0, function* () {\n let finalDepsPath = props.css.split(\",\").map((l) => l.trim());\n $elm._sDepsCssStack = finalDepsPath;\n for (let [i, finalDepPath] of finalDepsPath.entries()) {\n if (finalDepPath.match(/[a-zA-Z0-9_-]+/) && SDepsFeature._cssFrontData.chunks) {\n if (!((_b = (_a = SDepsFeature._cssFrontData.chunks).includes) === null || _b === void 0 ? void 0 : _b.call(_a, finalDepPath))) {\n continue;\n }\n }\n const $existing = document.querySelector(`link[s-deps-css=\"${finalDepPath}\"]`);\n if ($existing) {\n (_d = (_c = $elm._sDepsCssStack) === null || _c === void 0 ? void 0 : _c.splice) === null || _d === void 0 ? void 0 : _d.call(\n _c,\n // @ts-ignore\n $elm._sDepsCssStack.indexOf(finalDepPath),\n 1\n );\n this._checkAndApplyReadyStateForElement($elm, props);\n continue;\n }\n if (!finalDepPath.match(/\\.css$/)) {\n finalDepPath += \".css\";\n }\n const $link = document.createElement(\"link\");\n $link.setAttribute(\"rel\", \"stylesheet\");\n $link.setAttribute(\"s-deps-css\", props.css);\n $link.setAttribute(\"rel\", \"preload\");\n $link.setAttribute(\"as\", \"style\");\n $link.setAttribute(\"href\", `${props.cssChunksBasePath}/${finalDepPath}`);\n document.head.appendChild($link);\n const promise = __whenStylesheetsReady($link);\n promise.then(() => {\n var _a2, _b2;\n $link.setAttribute(\"rel\", \"stylesheet\");\n (_b2 = (_a2 = $elm._sDepsCssStack) === null || _a2 === void 0 ? void 0 : _a2.splice) === null || _b2 === void 0 ? void 0 : _b2.call(\n _a2,\n // @ts-ignore\n $elm._sDepsCssStack.indexOf(finalDepPath),\n 1\n );\n this._checkAndApplyReadyStateForElement($elm, props);\n });\n }\n });\n }", "title": "" }, { "docid": "e6cf3a51779794e6705b3575a69a395d", "score": "0.4369981", "text": "init() {\n this._super(...arguments);\n\n // Define computed property dynamically.\n // It is not possible to define computed property with variable in it.\n // If sort by is defined, we can sort.\n if (this.get('sortBy')) {\n defineProperty(this, 'rowsSorted',\n computed('rows.@each.' + this.get('sortBy'), 'rows.[]', 'sortBy', 'sortReverse', function(){\n var sortBy = this.get('sortBy');\n var rows = sortBy ? this.get('rows').sortBy(sortBy) : this.get('rows');\n if (this.get('sortReverse')) {\n rows.reverseObjects();\n }\n return rows;\n })\n );\n } else {\n defineProperty(this, 'rowsSorted',\n computed('rows.[]', function(){ return this.get('rows'); })\n );\n }\n }", "title": "" }, { "docid": "58d01b4cc5da02f0a023ceb97f1f4207", "score": "0.4365757", "text": "populatePeerPackageDependencies() {\n const getPeerDependencies = () => {\n const packageJson = this._getPackageJson(); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n\n if (packageJson && packageJson.peerDependencies) return packageJson.peerDependencies;\n return {};\n };\n\n const projectPeerDependencies = getPeerDependencies();\n const peerPackages = {};\n if ((0, _isEmpty2().default)(projectPeerDependencies)) return; // check whether the peer-dependencies was actually require in the code. if so, remove it from\n // the packages/dev-packages and add it as a peer-package.\n // if it was not required in the code, don't add it to the peerPackages\n\n Object.keys(projectPeerDependencies).forEach(pkg => {\n if (this.overridesDependencies.shouldIgnorePeerPackage(pkg)) return;\n ['packageDependencies', 'devPackageDependencies'].forEach(field => {\n if (Object.keys(this.allPackagesDependencies[field]).includes(pkg)) {\n delete this.allPackagesDependencies[field][pkg];\n peerPackages[pkg] = projectPeerDependencies[pkg];\n }\n });\n });\n this.allPackagesDependencies.peerPackageDependencies = peerPackages;\n }", "title": "" }, { "docid": "6b6c82d4bbf1ed3a22c474d2aa5a70ea", "score": "0.43606654", "text": "_resolveDef() {\n if (this._resolved) {\n return;\n }\n const resolve = (def) => {\n this._resolved = true;\n // check if there are props set pre-upgrade or connect\n for (const key of Object.keys(this)) {\n if (key[0] !== '_') {\n this._setProp(key, this[key]);\n }\n }\n const { props, styles } = def;\n // defining getter/setters on prototype\n const rawKeys = props ? ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props : Object.keys(props)) : [];\n for (const key of rawKeys.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)) {\n Object.defineProperty(this, key, {\n get() {\n return this._getProp(key);\n },\n set(val) {\n this._setProp(key, val);\n }\n });\n }\n this._applyStyles(styles);\n };\n const asyncDef = this._def.__asyncLoader;\n if (asyncDef) {\n asyncDef().then(resolve);\n }\n else {\n resolve(this._def);\n }\n }", "title": "" }, { "docid": "6b6c82d4bbf1ed3a22c474d2aa5a70ea", "score": "0.43606654", "text": "_resolveDef() {\n if (this._resolved) {\n return;\n }\n const resolve = (def) => {\n this._resolved = true;\n // check if there are props set pre-upgrade or connect\n for (const key of Object.keys(this)) {\n if (key[0] !== '_') {\n this._setProp(key, this[key]);\n }\n }\n const { props, styles } = def;\n // defining getter/setters on prototype\n const rawKeys = props ? ((0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isArray)(props) ? props : Object.keys(props)) : [];\n for (const key of rawKeys.map(_vue_shared__WEBPACK_IMPORTED_MODULE_1__.camelize)) {\n Object.defineProperty(this, key, {\n get() {\n return this._getProp(key);\n },\n set(val) {\n this._setProp(key, val);\n }\n });\n }\n this._applyStyles(styles);\n };\n const asyncDef = this._def.__asyncLoader;\n if (asyncDef) {\n asyncDef().then(resolve);\n }\n else {\n resolve(this._def);\n }\n }", "title": "" }, { "docid": "00a9795918a2ea9e1524af0f1b9e38c6", "score": "0.43542635", "text": "function collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[ fromName ];\n if (immediateDeps) {\n Object.keys(immediateDeps).forEach(function(toName) {\n if (!collected[ toName ]) {\n collected[ toName ] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n });\n }\n }", "title": "" } ]
e32b43aea1562c16c55697d2b1e5b62e
All shapes should be able to print their name
[ { "docid": "ae37cbd34d0dbb64846e93b523b54ac2", "score": "0.0", "text": "printName() {\n return `name: ${this.name}`\n }", "title": "" } ]
[ { "docid": "542945f8dfcb7982b0355b5929511afd", "score": "0.735382", "text": "toString() { return \"Shape\"; }", "title": "" }, { "docid": "f144346657b204e354427c5e988edcd5", "score": "0.6603735", "text": "function getName(shape)\n{\n\tfor (var n in nodes)\n\t\t{\n\t\t\tif (nodes[n].image == shape || nodes[n].label == shape)\n\t\t\t{\n\t\t\t\treturn nodes[n].attributes[\"prov:label\"];\n\t\t\t}\n\t\t}\n\tfor (var e in edges)\n\t\t{\n\t\t\tif (edges[e].line == shape)\n\t\t\t\treturn edges[e].from.attributes[\"prov:label\"] + \" \" + edges[e].attributes[\"name\"] + \" \" + edges[e].to.attributes[\"prov:label\"];\n\t\t}\n\treturn null;\n}", "title": "" }, { "docid": "77238a12c574f8ee8ae663a7521f6d32", "score": "0.64033705", "text": "function Shape(name) {\n this.name = name;\n }", "title": "" }, { "docid": "e95edfbde060d69f35262a5bc977965d", "score": "0.6308244", "text": "getWLabel(shape) {\n var str = \"Width/Size\";\n switch (shape) {\n case 1:\n str = \"Width\";\n break;\n case 2:\n str = \"X Radius\";\n break;\n case 3:\n str = \"Width\";\n break;\n case 4:\n str = \"Size\";\n break;\n case 5:\n str = \"Width\";\n break;\n default:\n break;\n }\n return str;\n }", "title": "" }, { "docid": "aa40355b62e4efe36946b1f3782292b0", "score": "0.6281555", "text": "function Shape (){ }", "title": "" }, { "docid": "db8197dbfc15241692355ddbac21e554", "score": "0.6197524", "text": "show() {\n ellipse(this.x,this.y,this.width);\n fill(255);\n text(this.name,this.x,this.y);\n fill(0);\n }", "title": "" }, { "docid": "6c730074f3a5ac16c0ac7c25175838df", "score": "0.61435276", "text": "constructor(shapeName, dimensions){\n super();\n this.allowedShapes = ['square', 'rectangle'];\n this.shapeName = shapeName;\n this.dimensions = dimensions;\n console.log('Hello Shape Class Example');\n }", "title": "" }, { "docid": "d41edb73db09e334cbf221f33f91b299", "score": "0.6128431", "text": "function Shape() {}", "title": "" }, { "docid": "e25a119800453a2853d75b992ed41d26", "score": "0.6019676", "text": "buildShapes() {\n }", "title": "" }, { "docid": "3e67360e6bfb61aec6f7266076794319", "score": "0.5998783", "text": "function printShape(shape, height, character) {\n let str = \"\";\n\n switch (shape) {\n //Square Shape\n case \"Square\":\n for(let i = 0; i < height; i++) {\n for(let j = 0; j < height; j++) {\n str = str.concat(character)\n }\n str = str.concat(\"\\n\")\n }\n break;\n\n //Triangle Shape\n case \"Triangle\":\n for (let i = 0; i <= height; i++) {\n for (let j = 0; j < i; j++) {\n str = str.concat(character);\n }\n str = str.concat(\"\\n\")\n }\n break;\n\n //Diamond Shape\n case \"Diamond\":\n for(let i = 1; i < height; i++ ){\n for(let j = 1; j < height; j++){\n if(i <= height / 2 \n && j >= (height / 2) - (i - 1) \n && j <= (height / 2) + (i - 1) ){\n str = str.concat(character);\n }\n else if(i >= height / 2\n && j > ((height / 2) - i) * (-1)\n && j < (height - ((height / 2) - i) * (-1))){\n str = str.concat(character);\n }\n else {\n str = str.concat(\" \");\n }\n }\n str = str.concat(\"\\n\");\n }\n break;\n\n //Default invalid shape \n default:\n console.log('Invalid shape');\n break;\n }\n console.log(str);\n}", "title": "" }, { "docid": "65b443e178ac730fc229bb54b87531dc", "score": "0.5985212", "text": "get Shape() {}", "title": "" }, { "docid": "4ab9eccbc80309447950546a6ace29d1", "score": "0.5948425", "text": "function displayShape() {\n //remove previous shape\n displaySquares.forEach(square => {\n square.classList.remove(\"tetromino\");\n square.style.backgroundColor = \"\";\n });\n //add new shape\n upNextTetrominoes[nextRandNum].forEach( index => {\n displaySquares[displayIndex + index].classList.add(\"tetromino\");\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandNum];\n });\n }", "title": "" }, { "docid": "ab5047028ed25f084550ac60814a7d7e", "score": "0.5943139", "text": "function printShape(shape, height, character) {\n let symbol = \"\";\n\n switch (shape) {\n case \"Square\":\n for (let index = 0; index <= height; index++) {\n symbol = \"\";\n for (let x = 0; x < height; x++) {\n symbol += character;\n }\n console.log(symbol);\n }\n break;\n case \"Triangle\":\n for (let index = 0; index <= height; index++) {\n symbol = \"\";\n for (let x = 0; x < index; x++) {\n symbol += character;\n }\n console.log(symbol);\n }\n break;\n case \"Diamond\":\n let space = height - 1;\n for (let index = 0; index <= height; index++) {\n symbol = \"\";\n if ((index % 2) == 0) {\n continue;\n } else {\n for (let x = 0; x < space; x++) {\n symbol += \" \";\n }\n for (let x = 0; x < index; x++) {\n symbol += character;\n }\n console.log(symbol);\n space--;\n }\n }\n space += 2;\n for (let index = height - 1; index > 0; index--) {\n symbol = \"\";\n if ((index % 2) == 0) {\n continue;\n } else {\n for (let x = 0; x < space; x++) {\n symbol += \" \";\n }\n for (let x = 0; x < index; x++) {\n symbol += character;\n }\n console.log(symbol);\n space++;\n }\n }\n break;\n default: {\n console.log(\"This is not a valid option\");\n }\n }\n}", "title": "" }, { "docid": "4112db5c50232a24576ef1de21a8bc7b", "score": "0.5920497", "text": "function showNames() {\n\tvar numChildren = scene.clone().children.length;\n\n\tfor (var i = 1; i < numChildren; i++) {\n\t\t// removeObject(name);\n\t\tif (scene.children[i].name === \"project_group\") {\n\t\t\tscene.children[i].children[1].material.visible = true;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6f83d40b3c51c6038991a8f4c7e946d1", "score": "0.59147495", "text": "display(){\n noStroke();\n fill(this.color);\n this.shape(this.x, this.y, this.size, this.size);\n }", "title": "" }, { "docid": "c38ef906088b57375557170cd7cd571a", "score": "0.58694637", "text": "drawSelf() {\n\t\t// super.drawSelf();\n\t\tfor (let pin of this.getPins()) {\n\t\t\tpin.drawSelf();\n\t\t}\n\t\tlet unitHeight = max(this.myPublicOutputs.length,this.myPublicInputs.length);\n\t\tunitHeight = max(unitHeight-1,1);\n\t\tlet unitWidth = 1;\n\t\tlet unitSize = 50;\n\t\tstroke(0);\n\t\tstrokeWeight(1);\n\t\tfill(255);\n\t\trect(this.myLocation.x,this.myLocation.y,unitWidth * unitSize,unitHeight * unitSize);\n\t\tnoStroke();\n\t\tfill(0);\n\t\ttextSize(13);\n\t\ttext(this.myName,this.myLocation.x + 3, this.myLocation.y + 13);\n\t}", "title": "" }, { "docid": "8d804c46f97a1850f22a2f1fb1e2494d", "score": "0.5831052", "text": "function createShapes() {\n\n myTeapot = new Teapot();\n myCube = new Cube(10);\n myCone = new Cone(5, 5);\n myCylinder = new Cylinder(20, 10);\n mySphere = new Sphere(20, 20);\n myCone.VAO = bindVAO(myCone);\n mySphere.VAO = bindVAO(mySphere);\n myCylinder.VAO = bindVAO(myCylinder);\n myCube.VAO = bindVAO(myCube);\n myTeapot.VAO = bindVAO(myTeapot);\n}", "title": "" }, { "docid": "0a4b586873bbfbca0083fe4ed1d03722", "score": "0.58297926", "text": "function tagInfo(shape){\n \n //return the specified margins for each shape\n \n var mright;\n var mleft;\n var mtop;\n var mbottom;\n var width;\n var height;\n \n switch(shape){\n \n case 'Barrel':\n mleft = 18;\n mright = 24;\n mtop = 64;\n mbottom = 47;\n width = 251;\n height = 215; \n break;\n \n case 'Heart':\n mleft = 23;\n mright = 29;\n mtop = 44;\n mbottom = 73;\n width = 171;\n height = 189; \n break;\n \n case 'Shamrock':\n mleft = 23;\n mright = 32;\n mtop = 60;\n mbottom = 53;\n width = 178;\n height = 176;\n break;\n \n case 'Doggie':\n mleft = 23;\n mright = 27;\n mtop = 44;\n mbottom = 40;\n width = 174;\n height = 158; \n break;\n \n case 'Cat':\n mleft = 23;\n mright = 27;\n mtop = 40;\n mbottom = 32;\n width = 160;\n height = 161; \n break;\n \n case 'Star':\n mleft = 35;\n mright = 40;\n mtop = 56;\n mbottom = 38;\n width = 191;\n height = 189; \n break;\n \n case 'Bulldog':\n mleft = 59;\n mright = 63;\n mtop = 56;\n mbottom = 66;\n width = 227;\n height = 201; \n break;\n \n case 'Pawprint':\n mleft = 26;\n mright = 36;\n mtop = 53;\n mbottom = 47;\n width = 176;\n height = 188; \n break;\n \n case 'Mouse':\n mleft = 47;\n mright = 56;\n mtop = 41;\n mbottom = 39;\n width = 182;\n height = 173; \n break;\n \n case 'Octagon':\n mleft = 20;\n mright = 27;\n mtop = 38;\n mbottom = 48;\n width = 158;\n height = 157; \n break;\n \n case 'Skull':\n mleft = 59;\n mright = 63;\n mtop = 56;\n mbottom = 66;\n width = 227;\n height = 201; \n break;\n \n case 'Circle':\n mleft = 30;\n mright = 33;\n mtop = 62;\n mbottom = 44;\n width = 168;\n height = 192; \n break;\n \n case 'Shield':\n mleft = 23;\n mright = 30;\n mtop = 41;\n mbottom = 47;\n width = 174;\n height = 187; \n break;\n \n case 'Tshirt':\n mleft = 47;\n mright = 53;\n mtop = 48;\n mbottom = 36;\n width = 189;\n height = 180; \n break;\n \n case 'Bone':\n mleft = 38;\n mright = 46;\n mtop = 42;\n mbottom = 43;\n width = 264;\n height = 192; \n break;\n \n case 'Millitary':\n mleft = 29;\n mright = 51;\n mtop = 21;\n mbottom = 31;\n width = 261;\n height = 158; \n break;\n \n case 'House':\n mleft = 23;\n mright = 30;\n mtop = 50;\n mbottom = 23;\n width = 154;\n height = 170; \n break;\n \n case 'Hydrant':\n mleft = 34;\n mright = 37;\n mtop = 48;\n mbottom = 30;\n width = 164;\n height = 173; \n break;\n \n case 'Cloud':\n mleft = 33;\n mright = 36;\n mtop = 40;\n mbottom = 49;\n width = 171;\n height = 171; \n break;\n \n case 'Random':\n mleft = 20;\n mright = 20;\n mtop = 20;\n mbottom = 20;\n width = 199;\n height = 127; \n break;\n \n case 'Glitter':\n mleft = 30;\n mright = 33;\n mtop = 62;\n mbottom = 44;\n width = 168;\n height = 192; \n break;\n \n \n default:\n mleft = 30;\n mright = 45;\n mtop = 53;\n mbottom = 43;\n width = 251;\n height = 215; \n break;\n \n \n }\n \n \n var tagInfo = [mtop, mright, mbottom, mleft, width, height];\n \n return tagInfo;\n \n }", "title": "" }, { "docid": "5712d7d74c7bf785ad3a7ae272de8e5d", "score": "0.5810144", "text": "function displayNextShape() {\n nextSquares.forEach(square => {\n square.classList.remove('shape');\n });\n nextShapes[nextRandom].forEach(index => {\n nextSquares[nextGridIndex + index].classList.add('shape');\n });\n }", "title": "" }, { "docid": "4522754d5112ea53dfe1af8c1dd4ff57", "score": "0.57957065", "text": "function Shape () {\n this.type = \"shape2\";\n}", "title": "" }, { "docid": "ea7cb826ffdb0368aac6f1cfc332d772", "score": "0.5795495", "text": "function solidShape() {}", "title": "" }, { "docid": "add5415c8d810440ab2108bae3d93e39", "score": "0.57829505", "text": "function Shape(x,y) {\n this.x = x;\n this.y = y;\n this.name = \"shape\";\n}", "title": "" }, { "docid": "e8a493f3a769cdfc3ed2422d21131ddd", "score": "0.57622343", "text": "function drawShapes() {\n\n\tfor (i = 0; i < circleX.length; i++) {\n\t\tdrawCircle(circleX[i], circleY[i], circleScale[i]);\n\t}\n}", "title": "" }, { "docid": "1b11799d11ee2b327501afe1562e3793", "score": "0.576172", "text": "unsupportedShape() {\n this.message = \"This shape isnt supported\";\n return this.message;\n }", "title": "" }, { "docid": "44fbbb204084eacf4b81f20dbff62b14", "score": "0.5758941", "text": "function testTriangle() {\n \n for(counter=0;counter<sizesTriangle.length;counter++){\n try{\n printShape.triangle(sizesTriangle[counter]);\n console.log(\"\\n\");\n }\n catch(e){\n console.log(e);\n }\n }\n }", "title": "" }, { "docid": "f0ce86f8ed21f17258812aa0bc630926", "score": "0.5755294", "text": "provideTextSymbol(shape) {\n\n // Rectangle character.\n if (shape.startsWith(\"rect\")) {\n return \"\\u2759\"\n }\n // Circle character.\n if (shape == \"circle\") {\n return \"\\u2B24\"\n }\n // Default to the rectangle.\n return \"\\u2759\" \n }", "title": "" }, { "docid": "3db83e15f3afc096ccd1251511955cd5", "score": "0.57548887", "text": "displayShape() {\n // Set red, green and alpha to a random value\n this.redAndGreen = random(0, 3);\n this.alpha = random(0, 100);\n // Set x and y position to a random value\n this.x = random(this.artboardStartX, width);\n this.y = random(-50, height / 2);\n // Set properties of the filling color, stroke and display properties\n fill(this.redAndGreen, this.redAndGreen, 8, this.alpha);\n noStroke();\n ellipseMode(CENTER);\n // Draw the ellipse\n ellipse(this.x, this.y, this.dropSize);\n }", "title": "" }, { "docid": "ea0eca5416f3b07ed54a0ca4e4a7634b", "score": "0.57282346", "text": "function sayNameForAll(label) {\n console.log(label + \": \" + this.name);\n}", "title": "" }, { "docid": "b1002a230143232552462ca4ace4b7e1", "score": "0.5690274", "text": "createStartingShapes() {\n\t\tlet color = \"#00eac4\";\n\t\tfor (let i = 0, length = this.maxShapes; i < length; i++) {\n\t\t\t// Colour changing for testing purposes\n\t\t\t/*if (i === 0) {\n\t\t\t\tcolor = \"#000000\";\n\t\t\t} else {\n\t\t\t\tcolor = \"#00eac4\";\n\t\t\t}*/\n\t\t\tthis.createNewShape(false, color);\n\t\t}\n\t}", "title": "" }, { "docid": "4a4f178c2b58a2cd8353b07321a961a5", "score": "0.5690044", "text": "print() {\n console.log('ab = ', this.attrs.sides[0])\n console.log('bc = ', this.attrs.sides[1])\n console.log('ca = ', this.attrs.sides[2])\n console.log('∠cab = ', this.attrs.angles[0])\n console.log('∠cba = ', this.attrs.angles[1])\n console.log('∠bca = ', this.attrs.angles[2])\n }", "title": "" }, { "docid": "21748a997cbc2d940e5882158d332754", "score": "0.56809103", "text": "function displayShape() {\n displayShapeClear();\n for (let i = 0; i < nextRandoms.length; i++) {\n upNextTetrominoes[nextRandoms[i]].forEach((index) => {\n displaySquares[displayIndex + index].classList.add(\"tetromino\");\n displaySquares[displayIndex + index].style.backgroundImage =\n colors[nextRandoms[i]];\n });\n displayIndex += 16;\n }\n displayIndex = 0;\n }", "title": "" }, { "docid": "77b9c8129ce6f2a43dc1c70151511990", "score": "0.5670261", "text": "function drawShapes() {\n //draw rectangle if rectangle radio button pressed\n if(radio.value() === \"Rectangle\") {\n push();\n rectMode(CENTER);\n fill(255, 0, 0);\n rect(width/2, height/2, 100, 100);\n pop();\n }\n\n //draw ellipse if ellipse radio button pressed\n if(radio.value() === \"Ellipse\") {\n push();\n ellipseMode(CENTER);\n fill(50, 50, 200);\n ellipse(width/2, height/2, 100, 100);\n pop();\n }\n}", "title": "" }, { "docid": "5f5ec567a859c12096de814870ee7adf", "score": "0.5661649", "text": "function printShape(shape, w, h) {\n for (var j = 0; j < h; j++) {\n let row = \"\";\n for (var i = 0; i < w; i++) {\n row += shape[j][i];\n }\n console.log(row);\n }\n}", "title": "" }, { "docid": "6d16c0918576e17031e415f318dfb705", "score": "0.56594795", "text": "display(){\n\n fill(this.color);\n rect(this.x,this.y,this.size,this.size);\n text(this.name, this.x, this.y-10);\n\n if(this.overlay == true){\n fill(127,127);\n rect(this.x,this.y,this.size,this.size);\n }\n }", "title": "" }, { "docid": "e7d80a9bf91f99640e8613496c16e75e", "score": "0.56349397", "text": "display() {\n // Circle.\n push();\n noStroke();\n fill(237, 75, 158, 850);\n ellipse(this.x, this.y, this.size);\n\n // Text.\n fill(255, 255, 255);\n textAlign(CENTER, CENTER);\n textFont(workSansRegular);\n textSize(28);\n text(this.representation, this.x, this.y);\n pop();\n }", "title": "" }, { "docid": "5a003ea42a478a23e8b031655cca0ab5", "score": "0.5629875", "text": "function sayNameForAll(label) {\n alert(label + \":\" + this.name);\n}", "title": "" }, { "docid": "d3011081f5de30305637823bf34ca587", "score": "0.5623866", "text": "constructor(MyShapeName, MyDimensions) {\n allowedShapes.set(this, ['square', 'rectangle']);\n shapeName.set(this, MyShapeName);\n this.validateShape();\n dimensions.set(this, MyDimensions);\n console.log('Hello Shape');\n }", "title": "" }, { "docid": "fc13542b185e1f3a38d8feece0670d78", "score": "0.5607848", "text": "function displayShape() {\n displaySquares.forEach(square => {\n square.classList.remove('tetromino');\n square.style.backgroundColor = '';\n });\n upNextTetrominoes[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add('tetromino');\n displaySquares[displayIndex + index].style.backgroundColor = theTetrominoes[nextRandom].color;\n });\n }", "title": "" }, { "docid": "1fd86dd394c7562e3541c9585526845a", "score": "0.55974376", "text": "function drawShape() {\n addNewRow(selRow, ['draw', '(', 'OBJECT', ')']);\n}", "title": "" }, { "docid": "03c0a386ba21ae4573b02c98d15bdf9e", "score": "0.5579654", "text": "function sayNameForAll() {\n console.log(this.name);\n}", "title": "" }, { "docid": "698860f8d0ffc3dcf7eeb8e87bedf24d", "score": "0.5576001", "text": "display(){\n noStroke();\n fill(this.color);\n this.shape(this.x, this.y, this.size, this.size);\n for(var i=0; i<this.history.length; i++){\n var pos = this.history[i];\n this.shape(pos.x, pos.y, 8, 8);\n }\n }", "title": "" }, { "docid": "ed87eb323de55198a22cce4f4b5a357c", "score": "0.5571172", "text": "set Shape(value) {}", "title": "" }, { "docid": "f6ea9ac50298ceb789207c6c9b473a53", "score": "0.5571015", "text": "show() {\n fill(255);\n ellipse(this.pos.x, this.pos.y, 4);\n for(let ray of this.rays) {\n ray.show();\n }\n }", "title": "" }, { "docid": "8942e50298a05cd6f067481b64e1405d", "score": "0.55653566", "text": "shapeToString(shape) {\n\t\treturn shape.schema.map(stringAction =>\n\t\t\tstringAction.map(value =>\n\t\t\t\tvalue == null ? \"\" : value\n\t\t\t).join(',')\n\t\t).join(\";\") +\n\t\t\":\" +\n\t\tshape.range.map(value =>\n\t\t\tvalue == null ? \"\" : value\n\t\t).join(';');\n\t}", "title": "" }, { "docid": "c884e47b216e03a7983639b0351e6bd7", "score": "0.5555219", "text": "function sayNameForAll() {\n console.log('im ' + this.name);\n}", "title": "" }, { "docid": "1ad59a8e3c88a9857b45b6cadbaf85df", "score": "0.55278075", "text": "function drawShapes() {\n \n // middle \n drawTeapot();\n drawCubeSlab(0, -0.5);\n drawCylinder(0, -3);\n drawCubeSlab(0, -5);\n\n // right\n // why -ve is making it go to the right and not the left\n drawCone(-6, 0.6);\n drawCubeSlab(-6, -0.5);\n drawCylinder(-6, -3);\n drawCubeSlab(-6, -5);\n\n // left\n drawSphere(6, 0.6);\n drawCubeSlab(6, -0.5);\n drawCylinder(6, -3);\n drawCubeSlab(6, -5);\n}", "title": "" }, { "docid": "17a5f39077786ce695a90ba74bc22d56", "score": "0.5523675", "text": "function drawShape() {\n var point;\n var circle;\n\n for (var i = 0; i < 7; i++) { // 7 points on an shape\n point = interfaceSettings.POLYGON.points.getItem(i);\n point.x = currentState.currentPosition[i].x;\n point.y = currentState.currentPosition[i].y;\n\n circle = document.getElementById('c' + i);\n circle.setAttribute('cx', currentState.currentPosition[i].x + 'px');\n circle.setAttribute('cy', currentState.currentPosition[i].y + 'px');\n }\n checkForMatch();\n}", "title": "" }, { "docid": "e859f69e1bd75876325c51b9f7cd270a", "score": "0.5522494", "text": "toString() {\n return `Rectangle ${this.getCoords()}`;\n }", "title": "" }, { "docid": "c90895c5dca16f62231a1cd58a1e8d3b", "score": "0.5510231", "text": "function displayShape() {\n //remove any trace of a tetromino from the entire grid\n displaySquares.forEach(square => {\n square.classList.remove('tetromino')\n square.style.backgroundColor = ''\n })\n upNextTetrominoes[nextRandom].forEach(index => {\n displaySquares[index].classList.add('tetromino')\n displaySquares[index].style.backgroundColor = colors[nextRandom]\n })\n }", "title": "" }, { "docid": "af1a609babc635e9b96d494acffd488f", "score": "0.5499466", "text": "name() {\n\t\tvar xPos=1070;\n\t\tvar label='Name:';\n\t\tctx.lineWidth = 2;\n\t\tctx.font = \"25px Teko\";\n ctx.fillStyle = \"#FFF\";\n\t\t\n\t\tvar textWidth=ctx.measureText(label).width;\n\n\t\tctx.fillText(label,xPos - (textWidth/2), 640);\n\t\tctx.strokeText(label,xPos - (textWidth/2),640);\n\t\t\n\t\tctx.font = \"35px Teko\";\n\n\t\tvar username= (player.name || 'No Name')\n\t\ttextWidth=ctx.measureText(username).width;\n\t\tctx.fillText(username,xPos - (textWidth/2), 675);\n\t\tctx.strokeText(username,xPos - (textWidth/2), 675);\n\n\t}", "title": "" }, { "docid": "986a0e15dafd2a870d18e0eb29b31643", "score": "0.5498198", "text": "function displayShape() {\n // remove tetromino from the grid\n displaySquares.forEach(square => {\n square.classList.remove(\"tetromino\");\n square.style.backgroundColor = \"\";\n });\n upNextTetrominoes[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add(\"tetromino\");\n displaySquares[displayIndex + index].style.backgroundColor =\n colors[nextRandom];\n });\n }", "title": "" }, { "docid": "ec06b1baafa26cf18e71705566b636e1", "score": "0.5481452", "text": "function createShape() {\n\t\t// var area = document.getElementById('shape-area');\n\t\tvar newShape = document.createElement('div');\n\t\tnewShape.onclick = reportInfo;\n\t\tnewShape.className = 'shape'; // make sure this line is actually necessary\n\t\tsetRandomProperties(newShape);\n\t\taddText(newShape);\n\t\tarea.appendChild(newShape); // area.appendChild(newShape); // WATCH OUT FOR THIS\n\t\treturn newShape;\n\t}", "title": "" }, { "docid": "c37a6143e88e3d0111b49755b927715e", "score": "0.5474397", "text": "function Shape() {} //shape does not take x,y - must use addToPlane to pass", "title": "" }, { "docid": "5a195f4a5a05a4253f8d1b2b6b956a0f", "score": "0.5469335", "text": "getShapeClass() {\r\n return this.SHAPE_CLASS[this.type.toLowerCase()];\r\n }", "title": "" }, { "docid": "fb6add92deee74cd1bd612980b60a689", "score": "0.5467839", "text": "function displayShape () {\n displaySquares.forEach(square => {\n square.classList.remove('tetromino')\n square.style.backgroundColor = ''\n\n })\n upNextTetromino[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add('tetromino')\n displaySquares[displayIndex + index].style.backgroundColor = colours[nextRandom]\n })\n }", "title": "" }, { "docid": "289599dd4dc33e170c4ac7e517a39274", "score": "0.5459246", "text": "function drawShape() {\n addNewRow(editor.getSelectedRowIndex(), [getIndent(editor.getSelectedRowIndex()) + \"draw\", \"(\", \"OBJECT\", \")\"]);\n }", "title": "" }, { "docid": "fdfab174e1259ce895288b46cfaa83d3", "score": "0.5450493", "text": "show()\r\n {\r\n strokeWeight(1);\r\n noFill();\r\n\r\n rect(this.boundary.x, this.boundary.y, this.boundary.w, this.boundary.h);\r\n for(let p of this.points)\r\n {\r\n strokeWeight(4);\r\n point(p.x, p.y)\r\n }\r\n\r\n if(this.northwest != null)\r\n {\r\n this.northwest.show();\r\n this.northeast.show();\r\n this.southwest.show();\r\n this.southeast.show();\r\n }\r\n }", "title": "" }, { "docid": "0a9d95388e7b5a28717d4805068f02c1", "score": "0.54467845", "text": "function displayShape() {\n displaySquares.forEach(square => {\n square.classList.remove('tetromino')\n square.style.backgroundColor = ''\n })\n upNextTetrominoes[nextRandom].forEach( index => {\n displaySquares[displayIndex + index].classList.add('tetromino')\n displaySquares[displayIndex + index].style.backgroundColor = colours[nextRandom]\n })\n }", "title": "" }, { "docid": "154220d438b317bce245c5c661b46e56", "score": "0.54361176", "text": "display() {\n rect(this.x, this.y, this.dim, this.dim);\n triangle(this.x2, this.y2, this.x2 + this.dim, this.y2, (2 * this.x2 + this.dim) / 2, this.y2 * 2);\n ellipse(this.x3, this.y3, this.dim, this.dim);\n\n\n\n }", "title": "" }, { "docid": "ecbf909481c66863fe508a95209d3d8d", "score": "0.5434351", "text": "display() {\n noFill();\n strokeWeight(this.thickness);\n stroke(\n `rgba(${this.color.r},${this.color.g},${this.color.b},${this.color.a})`\n );\n ellipse(this.location.x, this.location.y, this.radius * 2, this.radius * 2);\n }", "title": "" }, { "docid": "788adb940aedf51710763896d069a9ea", "score": "0.5429165", "text": "display(){\n fill(this.R, this.G, this.B);\n box(this.sizeXYZ);\n }", "title": "" }, { "docid": "1c1de640ca8454be1cd764200cba23e3", "score": "0.5427746", "text": "toString() {\n return `Ellipse enclosed in ${this.getCoords()}`;\n }", "title": "" }, { "docid": "80cb9de97ab6b64fab291fcdf81b6784", "score": "0.54210424", "text": "toString() {\n return `Triangle: color: ${this.color}, Area: ${this.getArea()}`\n }", "title": "" }, { "docid": "d9811ca37cffbe6aad5714cb7921f1ec", "score": "0.5420642", "text": "function render_shape_list(shape_list, grid_canv_name){\n Object.entries(shape_list).forEach( ([key, value]) => {\n let ii = value[0][0];\n let jj = value[0][1];\n let ss = value[1][0];\n let cc = value[1][1];\n let boxstr = grid_canv_name+ii+jj;\n let spritee = to_sprite(ss, cc);\n $(boxstr).css(\"background-image\", 'url(assets/'+spritee+'.png)');\n });\n}", "title": "" }, { "docid": "5775c3742fb887e6d3f37479e2a870e2", "score": "0.5407038", "text": "function sayNameForAll(label) {\n\talert(label + \":\" + this.name);\n}", "title": "" }, { "docid": "5775c3742fb887e6d3f37479e2a870e2", "score": "0.5407038", "text": "function sayNameForAll(label) {\n\talert(label + \":\" + this.name);\n}", "title": "" }, { "docid": "b81107dc449292bbfe894d5125a7888f", "score": "0.5406864", "text": "function Shape(type) {\n this.type = type;\n this.get_type = function() {\n return this.type;\n }\n}", "title": "" }, { "docid": "7a9c4d57c485d41eb4167178e82b0130", "score": "0.5403301", "text": "function flrTyp() {\r\n this.name = \"\";\r\n this.w = fIn;\r\n this.d = dIn - rIn - sIn;\r\n this.x = 0;\r\n this.y = 0;\r\n this.display = function(){\r\n fill(255);\r\n stroke(0, 0, 0);\r\n strokeWeight(5);\r\n rect(this.x, this.y, this.w, this.d)\r\n };\r\n}", "title": "" }, { "docid": "ef0b73698be0f444f2d36ec25d6041cc", "score": "0.5402589", "text": "function displayShape() {\n //remove any trace of a tetromino form the entire grid\n displaySquares.forEach(square => {\n square.classList.remove('tetromino')\n square.style.backgroundColor = ''\n })\n upNextTetrominoes[nextRandom].forEach( index => {\n displaySquares[displayIndex + index].classList.add('tetromino')\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom]\n })\n }", "title": "" }, { "docid": "c9d7291662e5c6bc40e55eb9377c5010", "score": "0.53905904", "text": "function toggle_xshape(s){\r\n var new_shape = s[0];\r\n var prev_shape = s[1];\r\n for (var i = 0; i < beam.length; ++i)\r\n {\r\n if (typeof beam[i].type != \"undefined\")\r\n {\r\n var parts = beam[i].type.split(\"_\");\r\n if(parts[0] == \"xsect\"){\r\n if((parts[1] != new_shape)){\r\n beam[i].hide();\r\n } else {\r\n beam[i].show();\r\n }\r\n }\r\n }\r\n }\r\n beam.data(\"xsect\",new_shape);\r\n return [prev_shape,new_shape];\r\n}", "title": "" }, { "docid": "f6f595c4bfc4d49f9d3d480e84a85d4e", "score": "0.53899074", "text": "function getGenesNames(){\n return ['xScale0',\n 'xScale1',\n 'xScale2',\n 'xScale3',\n 'yScale0',\n 'yScale1',\n 'yScale2',\n 'yScale3',\n 'red',\n 'green',\n 'blue',\n 'depth'];\n }", "title": "" }, { "docid": "f926f4481ca894d71e70e84a284c4111", "score": "0.5388515", "text": "function allShapes(ss){\n if(value7!=ss){\n if(value7!=\"triangle\"){\n document.getElementById(value7).style.backgroundColor=\"black\";\n }else{\n document.getElementById(value7).style.borderColor=\"transparent transparent black transparent\";\n }\n if(ss!=\"triangle\"){\n document.getElementById(ss).style.backgroundColor=\"darkseagreen\";\n }else{\n document.getElementById(ss).style.borderColor=\"transparent transparent darkseagreen transparent\";\n }\n \n if(ss==\"circle\"){\n document.getElementById(\"b6\").classList.add(\"hides\");\n }else{\n document.getElementById(\"b6\").classList.remove(\"hides\");\n }\n value7=ss;\n }\n}", "title": "" }, { "docid": "ca1733c01d9c31b606b04162da8c7958", "score": "0.5383281", "text": "_drawShape() {\n this._viewer.setCreateShapeNodeInteractions((points) => {\n const node = new b2.ShapeNode({\n name: '',\n styles: {\n 'shapenode.closed': true,\n 'vector.fill.color': 'rgba(255,255,255,0.4)',\n 'vector.outline.width': 2,\n 'vector.outline.color': '#000000',\n 'label.position': 'center',\n 'shadow.xoffset': 0,\n 'shadow.yoffset': 0,\n 'select.padding': 0,\n },\n clients: {\n selectable: true,\n movable: true,\n },\n });\n node.setLayerId('bottom');\n node.setPoints(points);\n this._model.getSelectionModel().setSelection(node);\n this._lastData = this._viewer.getSelectionModel().getLastData();\n this._lastPoint = node.getCenterLocation();\n this._viewer.setEditInteractions();\n return node;\n });\n }", "title": "" }, { "docid": "0e885b707d6cb2628193b067f292727b", "score": "0.53807086", "text": "display() {\n push();\n noStroke();\n fill(this.fillColor);\n this.radius = this.health;\n //////////////// FIXED = changed \"two\" from string to value\n ellipse(this.x, this.y, this.radius * 2);\n pop();\n }", "title": "" }, { "docid": "3a6a3e289fb9c88fb76b200ce8b6c4e9", "score": "0.53804916", "text": "function mxShapeMockupPrint(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}", "title": "" }, { "docid": "7c1b3d257e8827d955b450ef3cb36858", "score": "0.53787124", "text": "showSelf() {\n stroke(240, 100, 100);\n noFill();\n rect(this.x, this.y, this.size, this.size);\n noStroke();\n }", "title": "" }, { "docid": "dd5a6d7571876bfb22dbdfb80c087868", "score": "0.5370976", "text": "function createShape(shapeType) {\r\n\r\n // General shared attributes\r\n var x = window.innerWidth / 8;\r\n var y = document.documentElement.clientWidth / 8;\r\n var width = 0;\r\n var height = 0;\r\n var label = \"\";\r\n var category = 1;\r\n var fontSize = 15;\r\n\r\n // Assign updated values based on shapeType\r\n if (shapeType === \"building\") {\r\n width = 100;\r\n height = 100;\r\n label = \"Building\";\r\n category = 0;\r\n }\r\n else if (shapeType === \"room\") {\r\n width = 10;\r\n height = 10;\r\n label = \"Room\";\r\n fontSize = 4;\r\n\r\n x = savedShapes[buildingBeingViewed].x + savedShapes[buildingBeingViewed].width / 2;\r\n y = savedShapes[buildingBeingViewed].y + savedShapes[buildingBeingViewed].height / 2;\r\n\r\n }\r\n else if (shapeType === \"path\") {\r\n width = 50;\r\n height = 50;\r\n\r\n }\r\n else {\r\n width = 10;\r\n height = 10;\r\n }\r\n\r\n // Create basic new shape\r\n var newShape = {\r\n x: x,\r\n y: y,\r\n width: width,\r\n height: height,\r\n selected: false,\r\n label: label,\r\n fontSize: fontSize,\r\n name: shapeType,\r\n selected: false,\r\n textAlign: \"center\",\r\n rotation: 0,\r\n category: category,\r\n points: [x,\r\n y,\r\n x + width,\r\n y,\r\n x + width,\r\n y + height,\r\n x,\r\n y + height\r\n ]\r\n }\r\n\r\n // Add additional parameters based on shapeType\r\n if (shapeType === \"building\") {\r\n newShape.internal = [[]];\r\n newShape.lifts = [];\r\n newShape.stairs = [];\r\n newShape.entrance = null;\r\n }\r\n else if (shapeType === \"lifts\" || shapeType === \"stairs\") {\r\n var floors = [];\r\n\r\n for (var i = 0; i < savedShapes[buildingBeingViewed].internal.length; i++) {\r\n floors.push(false);\r\n }\r\n\r\n floors[floorBeingViewed] = true;\r\n newShape.floors = floors;\r\n newShape.index = savedShapes[buildingBeingViewed][shapeType].length;\r\n }\r\n else if (shapeType === \"entrance\") {\r\n newShape.floorNumber = floorBeingViewed;\r\n }\r\n\r\n // Add shape to list\r\n var allShapes = [...shapes];\r\n\r\n allShapes.push(newShape);\r\n\r\n // Assign new shape as attribute if activeStep is 1 and based on shapeType\r\n if (activeStep === 1) {\r\n if (shapeType === \"lifts\") {\r\n savedShapes[buildingBeingViewed].lifts.push(newShape);\r\n }\r\n else if (shapeType === \"stairs\") {\r\n savedShapes[buildingBeingViewed].stairs.push(newShape);\r\n }\r\n else if (shapeType === \"entrance\") {\r\n savedShapes[buildingBeingViewed].entrance = newShape;\r\n }\r\n else {\r\n savedShapes[buildingBeingViewed].internal[floorBeingViewed].push(newShape);\r\n }\r\n\r\n }\r\n\r\n // Update shapes\r\n setShapes(allShapes);\r\n }", "title": "" }, { "docid": "917c33bb252e68846e6060f5d73e3fad", "score": "0.5359136", "text": "function Shape() {\n this.m_type;\n this.m_radius;\n}", "title": "" }, { "docid": "6e4e52717913de03c956044367621f0b", "score": "0.53459364", "text": "display() {\n push(); ////////////////////FIXED (Changed I for U)\n noStroke();\n fill(this.fillColor);\n this.radius = this.health;\n ellipse(this.x, this.y, this.radius * 2);\n pop(); ////////////////////FIXED (Changed I for O)\n }", "title": "" }, { "docid": "7714a29b8fe75ac0d119356931eeb40e", "score": "0.5333048", "text": "printDescription () {\r\n console.log(`I am a Rectangle of Length ${this.length} cm X and width ${this.width} cm, with Color ${this.color} and Texture ${this.texture}`);\r\n }", "title": "" }, { "docid": "accc34513728f2e3fe5f82e705055f28", "score": "0.53316224", "text": "draw() {\n this.cls();\n this.shapes.forEach(element => {\n element.draw();\n });\n }", "title": "" }, { "docid": "12b2848adccfc74b2b5a823da4f52414", "score": "0.5327718", "text": "function OR(root, addName=true) { \n // width=\"30\" height=\"25\"\n var g = root.append(\"g\");\n g.append(\"path\")\n .attr(\"d\", OR_SHAPE_PATH);\n g.attr(\"transform\", \"scale(0.8) translate(0, 3)\");\n if (addName)\n root.append(\"text\")\n .attr(\"x\", 5)\n .attr(\"y\", 16)\n .text(\"or\");\n return g;\n }", "title": "" }, { "docid": "2cf4b5cf03afc5ef1176e79a70be7903", "score": "0.53164715", "text": "printSurface(){\n\n for( let i= 0; i < this.size_x; i++ ) console.log(this.surface[i].join('|'));\n }", "title": "" }, { "docid": "7a69ed057ac0ef6b2e0b48a9edca1123", "score": "0.53094685", "text": "function drawBoxes(objects) {\n\t\n //clear the previous drawings\n drawCtx.clearRect(0, 0, drawCanvas.width, drawCanvas.height);\n\t\n //filter out objects that contain a class_name and then draw boxes and labels on each\n objects.forEach(face => {\n let scale = 1;\n let _x = face.x / scale;\n let y = face.y / scale + rect.top;\n let width = face.w / scale;\n let height = face.h / scale;\n //flip the x axis if local video is mirrored\n if (mirror) {\n x = drawCanvas.width - (_x + width)\n } else {\n x = _x + rect.left;\n }\n\n //let rand_conf = face.confidence.toFixed(2);\n let title = \"\";\n if (face.name != \"unknown\") {\n drawCtx.strokeStyle = \"magenta\";\n drawCtx.fillStyle = \"magenta\";\n title += ' - ' + face.name\n \n title += \"[\" + face.predict_proba + \"]\";\n \n } else {\n drawCtx.strokeStyle = \"cyan\";\n drawCtx.fillStyle = \"cyan\";\n }\n drawCtx.fillText(title , x + 5, y - 5);\n drawCtx.strokeRect(x,y, width, height);\n\n\n });\n}", "title": "" }, { "docid": "c541c268bd27daecb1259396fa69c3d6", "score": "0.5308905", "text": "function displayShape() {\n //remove a peça anterior\n displaySquares.forEach(square => {\n square.classList.remove('tetromino')\n square.style.background = ''\n })\n upNextTetrominoes[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add('tetromino')\n\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom]\n displaySquares[displayIndex + index].style.backgroundImage = `url('./img/${colors[nextRandom]}.png')`;\n displaySquares[displayIndex + index].style.backgroundSize = `cover`;\n })\n }", "title": "" }, { "docid": "3bef50cf0b624e4abf1be2ed059a048b", "score": "0.53025055", "text": "get name() {\r\n return this.dygraph.getLabels()[1];\r\n }", "title": "" }, { "docid": "8f50ba144f490cba97f240c8443d0e31", "score": "0.5288914", "text": "function drawVertexShape(room) {\n\tswitch(room) {\n\t\tcase 1:\n\t\t\t// first \n\t\t\tbeginShape();\n\t\t\tvertex(227, 390);\n\t\t\tvertex(227, 0);\n\t\t\tvertex(0, 0);\n\t\t\tvertex(0, 500);\n\t\t\tvertex(97, 500);\n\t\t\tendShape(CLOSE);\n\t\t\t// second\n\t\t\tbeginShape();\n\t\t\tvertex(373, 390);\n\t\t\tvertex(373, 0);\n\t\t\tvertex(width, 0);\n\t\t\tvertex(width, 500);\n\t\t\tvertex(width - 97, 500);\n\t\t\tendShape(CLOSE);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tbeginShape();\n\t\t\tvertex(width, 423);\n\t\t\tvertex(423, 373);\n\t\t\tvertex(211, 373);\n\t\t\tvertex(211, 0);\n\t\t\tvertex(width, 0);\n\t\t\tendShape(CLOSE);\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "2f0aa8494e4b42cd2ba0f67c7d633084", "score": "0.5288731", "text": "function displayTarget() {\r\n\tvar scrNames = new Array(\"graphics/blueCircle.png\", \"graphics/blueSquare.png\",\r\n \"graphics/blueTriangle.png\", \"graphics/redCircle.png\", \"graphics/redSquare.png\", \"graphics/redTriangle.png\",\r\n \"graphics/yellowCircle.png\", \"graphics/yellowSquare.png\", \"graphics/yellowTriangle.png\", \"graphics/greenCircle.png\",\r\n\t\t\"graphics/greenSquare.png\", \"graphics/greenTriangle.png\", \"graphics/orangeCircle.png\", \"graphics/orangeSquare.png\",\r\n\t\t\"graphics/orangeTriangle.png\", \"graphics/purpleCircle.png\", \"graphics/purpleSquare.png\",\"graphics/purpleTriangle.png\");\r\n\t\t\r\n\tvar checkTarget = document.querySelector(\".targetShape\");\r\n\tif (checkTarget != null) {\r\n\t\tcheckTarget.parentNode.removeChild(checkTarget);\r\n\t}\r\n\tvar theBucket = document.querySelector(\".bucket\");\r\n\tvar targetShape = document.createElement(\"img\");\r\n\ttargetShape.src = scrNames[theBucket.shape];\r\n\ttargetShape.setAttribute(\"class\", \"targetShape\");\r\n\tdocument.body.appendChild(targetShape);\t\r\n\r\n\t// Choses target image based on bonanza mode activation\r\n\tif (firstCatch == 0) {\r\n\t\ttargetShape.src = \"graphics/star.png\"\r\n\t} else {\r\n\t\ttargetShape.src = scrNames[theBucket.shape];\r\n\t}\r\n}", "title": "" }, { "docid": "cd3e1ae05a9dea6337a0dba877ed5b73", "score": "0.5279251", "text": "function testSquare() {\n for(counter=0;counter<sizesSquare.length;counter++){\n try{\n printShape.square(sizesSquare[counter]);\n console.log(\"\\n\");\n }\n catch(e){\n console.log(e);\n }\n }\n}", "title": "" }, { "docid": "af5881fb8bbdb62825141431f659b225", "score": "0.52784485", "text": "function shapeCreate() {\n for (var i = 0; i < arrayRandomized.length; i++) {\n var div = document.createElement(\"div\");\n div.className = arrayRandomized[i];\n\n //call random number for color of the shape\n var colorType = randNum(11);\n switch (colorType) {\n case (1):\n div.className += \" gray1\";\n break;\n case (2):\n div.className += \" gray2\";\n break;\n case (3):\n div.className += \" green1\";\n break;\n case (4):\n div.className += \" green2\";\n break;\n case (5):\n div.className += \" red1\";\n break;\n case (6):\n div.className += \" blue1\";\n break;\n case (7):\n div.className += \" blue2\";\n break;\n case (8):\n div.className += \" blue3\";\n break;\n case (9):\n div.className += \" purple\";\n break;\n case (10):\n div.className += \" yellow\";\n break;\n case (11):\n div.className += \" orange\";\n break;\n }\n\n var board = document.getElementById('container');\n board.appendChild(div);\n }\n }", "title": "" }, { "docid": "9d74458e7fabcfc014233aa0bab7bf40", "score": "0.5272633", "text": "getShapeType() {\n return this.shapeType;\n }", "title": "" }, { "docid": "f7028fb931d38c982e7a3728bc1cf74c", "score": "0.5262738", "text": "toString() {\n return this.name + ' is part of the ' + Penguin.scientificName() + ' species';\n }", "title": "" }, { "docid": "1690f957704950de1eebd53e6641d0ed", "score": "0.5252886", "text": "printChildrenDebug() {\n this.children.forEach(item => console.log(item.name));\n }", "title": "" }, { "docid": "90a6f0f81022273d9c748671e27fb3e8", "score": "0.52463263", "text": "getRandomShape() {\n // this.shapeType = this.getRanShapeType();\n this.shapeType = 'I';\n switch (this.shapeType) {\n case 'O':\n this.createO();\n break;\n case 'I':\n this.createI();\n break;\n case 'T':\n this.createT();\n break;\n case 'L':\n this.createL();\n break;\n case 'J':\n this.createJ();\n break;\n case 'S':\n this.createS();\n break;\n case 'Z':\n this.createZ();\n break;\n }\n }", "title": "" }, { "docid": "612da3290196725ad5e0a1363b2739b6", "score": "0.52412826", "text": "function logSVG() {\n console.log(this.id);\n }", "title": "" }, { "docid": "740f4a96d8f83fff1ae13907ed369871", "score": "0.52387935", "text": "show() {\n noFill();\n stroke('red');\n rect(this.x, this.y, 110, 110);\n fill(255);\n noStroke();\n text(this.data, this.x + 5, this.y + 5, 100, 100);\n text(this.id, this.x, this.y - 10);\n }", "title": "" }, { "docid": "b209657245666904d4d49904efe683e9", "score": "0.5237725", "text": "toString(){\n return `Circle at ${this.getPosition().toString()} [${this.circle.radius} radius] [${this.color.fill} fill with ${this.color.stroke} stroke].`;\n }", "title": "" }, { "docid": "51817975a5ff0b395a9117ecabb3d93f", "score": "0.5235288", "text": "show() {\n stroke(1);\n strokeWeight(2);\n fill(this.clr);\n rect(this.x, this.y, this.w, this.w);\n }", "title": "" }, { "docid": "cde8129a7575ad8f8d49dba8ae45f8ab", "score": "0.52348214", "text": "print() {\n console.log(this.properties);\n this.children.forEach((scope) => { scope.print(); });\n }", "title": "" }, { "docid": "460719c60d5c5587d2065bbeb20fb571", "score": "0.52241045", "text": "get format_shapes () {\n return new IconData(0xe25e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "968fcbfb01c2bde3c624d69be91e8864", "score": "0.52192736", "text": "function drawShape(currentShape) {\n upCount = 0\n scoreCheck()\n const drawNShape = nextShape.map(element => element - 2)\n //Clears the next shape board\n shapeSpace.forEach(element => {\n cells[element].classList.remove('next')\n })\n //Draws next shape\n drawNShape.forEach(element => {\n cells[element].classList.add('next')\n })\n //Draws current shape\n currentShape.forEach(element => {\n cells[element].classList.add('player')\n })\n }", "title": "" } ]
3facdcf52024e92fcef1a0e94b965681
function du bouton DELETE
[ { "docid": "d13af82810e961f337171e81e2ec4147", "score": "0.0", "text": "function supprimArt(btn){\n let idArt = btn.getAttribute('data-id');\n let user = JSON.stringify(userObject())\n let init = {method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ' + localStorage.getItem(\"token\"),\n 'Access' : idArt,\n },\n body : user\n };\n fetch(`http://localhost:3000/api/article/deleteonearticleadmin`, init)\n .then((response) => response.json())\n .then(response => {\n window.alert(\"votre article est bien supprimé\")\n })\n .then(response => {\n document.location.reload();\n })\n}", "title": "" } ]
[ { "docid": "b94afa9e6b47607ac67d9c312f4fb704", "score": "0.71544826", "text": "delete() {\n \n }", "title": "" }, { "docid": "9ac5fd069bc9b5d6626d1d6fe76d419f", "score": "0.71141565", "text": "function deletarBD(id){\n var xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", BASE_URL_SERVICO + \"/propostaTecnica/\"+ id);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send();\n}", "title": "" }, { "docid": "87fb33c0c80d924bee6802af507566f6", "score": "0.70673454", "text": "function doDelete(bId){\n let i = String(bId).split(\"e\")[3]; //gets the row number of the id from the button id\n let body = getBody(i);\n ajaxReq(\"DELETE\",\"/call\",alertGood, body);\n}", "title": "" }, { "docid": "730da8704e7510c1728e0a3be3d95306", "score": "0.7034655", "text": "deletefn(cartoon) {\n superagent\n .del('http://eclipseche3.niit-mts.com:33977/cartoons/'+cartoon.id)\n .end((err, res) => {\n if(err){\n console.log(\"error\");\n }\n const cartoons = this.state.cartoons;\n const index = cartoons.indexOf(cartoon);\n cartoons.splice(index, 1);\n this.setState({cartoons: cartoons});\n });\n }", "title": "" }, { "docid": "0bb114e79c66bffd458e3bef2658a297", "score": "0.70278245", "text": "delete(callback,connection) {\n\t\tconnection = (connection ? connection : this.connection );\n\t\tif (this.attrs.id === undefined) {\n\t\t\tcallback(null);\n\t\t\treturn;\n\t\t}\n\t\tvar id = this.attrs.id;\n\t\tvar q = 'DELETE FROM ' + this.tbname + ' WHERE id = ?';\n\t\tconnection.query(q,[id],function(err,result) {\n\t\t\tconsole.log(err);\n\t\t\tcallback(null);\n\t\t});\n\t}", "title": "" }, { "docid": "3e5e0e69cb310ca4c612174803a72483", "score": "0.7021783", "text": "function delete_Maniputaltion(row,_st) {\r\n const id = row[0].children[0].getAttribute(\"data\")\r\n if (confirm(\"are you sure?\")) request.deleteFromDb(id,_st)\r\n }", "title": "" }, { "docid": "3e5d287f56c878b40e52ff2f927dce2c", "score": "0.6974483", "text": "function deletedBS(numero) {\n EliminarBS(numero); \n cargarTablaEnviados();\n location.reload();\n}", "title": "" }, { "docid": "967f65c6a8e95fe6528e71506fe35e1f", "score": "0.6972639", "text": "function eliminar(){\n\n\tvar active = capDb.result;\n\tvar dato = active.transaction([\"fly\"], \"readwrite\");\n\tvar objeto = dato.objectStore(\"fly\");\t\n\n\tvar index = objeto.index(\"by_name\");\n\tvar request = index.get(document.querySelector(\"#eliminar\").value);\n\n\n\t\n\trequest.onsuccess = function() {\n\t\tvar result = request.result;\n\t\tobjeto.delete(result.id);\n\t\talert(\"Has eliminado el vuelo\")\n\t}\n\t\n}", "title": "" }, { "docid": "95ebbf1aceec95353f41837f76405407", "score": "0.6889587", "text": "function User_Delete_Comptes_auxiliaires_Liste_des_comptes_auxiliaires0(Compo_Maitre)\n{\n var Table=\"compteaux\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\nvar CompoLie = GetSQLCompoAt(84);\nvar CompoLieMaitre = CompoLie.my_Affichable.my_MaitresLiaison.getAttribut().GetComposant();\nvar CleLiasonForte = CompoLieMaitre.getCleVal();\nif (CleLiasonForte!=-1)\n{\n SuprimerAssociation(CompoLie,CleMaitre,CleLiasonForte);\n}\nelse\n{\n alert(\"Erreur \"+CompoLieMaitre.getLabel()+\" correspondant(e) Introuvable\");\n return CleMaitre;\n}\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "2a92227c02f58a53029d932e4b374bad", "score": "0.6877237", "text": "function deletarBD(id) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", BASE_URL_SERVICO + \"/atividadeCalendarioContabil/\" + id);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send();\n}", "title": "" }, { "docid": "409148490a737e0bee9d99c19dd18069", "score": "0.6848724", "text": "function deleteTodo(connection , id ,data ){\n\n connection.query(`DELETE FROM TASK1 where(id = ?) `, [id] , function( error , results , fields ){\n if(error) throw error\n data(results) ;\n }) ;\n\n}", "title": "" }, { "docid": "90425698725eaf2d6ad9a34850379b19", "score": "0.6776388", "text": "function User_Delete_Personnes_Adresses_7(Compo_Maitre)\n{\n var Table=\"adresse\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "ef37d6049f603ef633d2a75190623984", "score": "0.6774917", "text": "function User_Delete_Journaux_Liste_des_journaux0(Compo_Maitre)\n{\n var Table=\"journal\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "bf57d4302a91408c70d85669cafdf177", "score": "0.676168", "text": "async postDelete () {\n\t}", "title": "" }, { "docid": "4db0bd15bc627fd5866dfbb36b478fd3", "score": "0.6756933", "text": "function User_Delete_Personnes_Liste_des_personnes0(Compo_Maitre)\n{\n var Table=\"personne\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "f0f7cc773d6e48e58266e44478d47e57", "score": "0.6750234", "text": "function User_Delete_Lieu_Liste_des_lieus0(Compo_Maitre)\n{\n var Table=\"lieu\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "fb4814666e336875a0c82204c6db8170", "score": "0.67408216", "text": "function User_Delete_Sujets_Sujets_3(Compo_Maitre)\n{\n var Table=\"sujet\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "d9560a0e0ae66b7bdc98d62a13c91a59", "score": "0.67059624", "text": "function deleteBM(e) {\n\t\tcount--;\n\t\tvar target = $(e.target);\n\t\tvar mid = target.data('id');\t// getting the unique ID of bookmark\n\t\ttarget.closest('div.col').fadeOut();\n\t\ttarget.closest('div.col').remove();\t// removing the mark from DOM\n\t\tfirebase.database().ref('bookmarks/'+firebase.auth().currentUser.uid+'/'+mid).remove();\t// actually removing the mark from database\n\t\tMaterialize.toast('Bookmark Deleted !',2000);\t// notifying the user \n\t}", "title": "" }, { "docid": "f1e0e30b2488240661817657ea1de3a1", "score": "0.6698366", "text": "delete() {\n\n\t}", "title": "" }, { "docid": "dbc097de8a9a720609ab44fff22bc789", "score": "0.6669492", "text": "function User_Delete_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 Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\nvar CompoLie = GetSQLCompoAt(103);\nvar CompoLieMaitre = CompoLie.my_Affichable.my_MaitresLiaison.getAttribut().GetComposant();\nvar CleLiasonForte = CompoLieMaitre.getCleVal();\nif (CleLiasonForte!=-1)\n{\n SuprimerAssociation(CompoLie,CleMaitre,CleLiasonForte);\n}\nelse\n{\n alert(\"Erreur \"+CompoLieMaitre.getLabel()+\" correspondant(e) Introuvable\");\n return CleMaitre;\n}\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "79ae2454ea2a907621c0cd85aaa3ed06", "score": "0.6654217", "text": "deleteARow(req, res){\n var params = /[^/]*$/.exec(req.url)[0];\n\n connection.query('DELETE FROM kriminal WHERE id = ?',\n [ parseInt(params)],\n function(error, rows, fields){\n if(error){\n var response = [\n {\n \"message\": \"DELETE operation failed!\",\n \"status\": 400\n },\n ];\n res.statusCode = 400;\n res.setHeader('content-Type', 'Application/json');\n res.end(JSON.stringify(response));\n }else{\n var response = [\n {\n \"message\": \"DELETE operation success!\",\n \"status\": 200\n }\n ];\n res.statusCode = 200;\n res.setHeader('content-Type', 'Application/json');\n res.end(JSON.stringify(response));\n }\n })\n }", "title": "" }, { "docid": "1719a33b8fe5908747db720d4af0b41c", "score": "0.66524506", "text": "delete(id, callback)\n {\n /*delete reply or post*/\n const eng = fork(\"connect_sql.js\", [\"delete_post\"]);\n eng.send(JSON.stringify({ID:id, USER:this.userid}));\n eng.on(\"message\", msg => {\n if(msg==\"success\")\n {\n return callback(\"success\");\n }\n else {\n return callback(\"fail\");\n }\n });\n }", "title": "" }, { "docid": "54b3cc8d34ebf3d3b73a2de16db69230", "score": "0.6646622", "text": "delete (condition, cb) {\n orm.deleteOne (\"burgers\", condition, (res) => {\n cb(res);\n })\n }", "title": "" }, { "docid": "83df2374fbe9752f4bb52bb440dd86c4", "score": "0.6639716", "text": "function deletar(id){\n var xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", BASE_URL_SERVICO + \"/comarca/\"+ id);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send();\n}", "title": "" }, { "docid": "8b171d02cf19f3efc1893e81108d3bc0", "score": "0.66294557", "text": "function delete_data() {\n db.transaction(delDB, errorHandler);\n}", "title": "" }, { "docid": "dedcbc67e203f5cb5f975ea97bc84dad", "score": "0.6628921", "text": "function Del(notran)\r\n{\r\n\tparam='method=delete'+'&notran='+notran;\r\n\t//alert(param);\r\n\ttujuan='pabrik_slave_perbaikan.php';\r\n\tif(confirm(' Anda yakin ingin menghapus nomor transaksi '+notran+' '))\r\n\t{\r\n\t\tpost_response_text(tujuan, param, respog);\t\r\n\t}\r\n\tfunction respog()\r\n\t{\r\n\t\t if(con.readyState==4)\r\n\t\t {\r\n\t\t\t\tif (con.status == 200) {\r\n\t\t\t\t\tbusy_off();\r\n\t\t\t\t\tif (!isSaveResponse(con.responseText)) {\r\n\t\t\t\t\t\talert('ERROR TRANSACTION,\\n' + con.responseText);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t document.getElementById('contain').innerHTML=con.responseText;\r\n\t\t\t\t\t\tloadData();\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbusy_off();\r\n\t\t\t\t\terror_catch(con.status);\r\n\t\t\t\t}\r\n\t\t }\t\r\n\t}\r\n}", "title": "" }, { "docid": "e5ead281df7a86165a21b02b806161e3", "score": "0.6587373", "text": "static delete(req, res) {\n\n const getIdUser = parseInt(req.params.user)\n\n GEN_DATA_DIRI_PEMOHON.destroy({ where: { UserId: getIdUser } })\n .then((data) => {\n res.status(200).json({\n message: \"delete Data success\",\n result: data\n })\n })\n .catch((err) => {\n res.status(500).json({\n message: \"Internal Server Error\",\n log: err\n })\n })\n }", "title": "" }, { "docid": "6fe6d024d857f028d3902ef310904b55", "score": "0.65726686", "text": "async delete(chaine_id)\n {\n var validate =window.confirm('Etes-vous sure de vouloir supprimer cette chaine?');\n if (validate)\n {\n return fetch('http://localhost:8081/chaine/'+chaine_id,{\n method: 'DELETE' , \n },\n fetch('/chaine/')\n .then(res => res.json())\n .then(chaines => this.setState({chaines})) \n ); \n \n\n }\n\n}", "title": "" }, { "docid": "4e18932ecf3c25b6d44ea31b4d499d4b", "score": "0.65608066", "text": "function User_Delete_Exercice_Liste_des_exercices_comptables0(Compo_Maitre)\n{\n var Table=\"exercice\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "7074b5da63528ab28d1af32a29cc88a3", "score": "0.655142", "text": "function deletebtn() {\n let id = parseInt(event.target.dataset.id);\n db.products.delete(id);\n table();\n\n}", "title": "" }, { "docid": "77c1ca4576b81031d5404d3b007a32a0", "score": "0.6544601", "text": "massDeleteFunction() {\n\n }", "title": "" }, { "docid": "c7c1e1cb95714d0e1a481087dbadbedd", "score": "0.6536053", "text": "function reallyDelete(id)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t // alert('delete ID: '+id);\n\t\t\t\t\t\t var myDB = systemDB;\n\t\t\t\t\t\t \n\t\t\t\t\t\t myDB.transaction(\n\t\t\t\t\t\t\t\t\t\t new Function(\"transaction\", \"transaction.executeSql('UPDATE county set deleted=1 where id=?;', [ \"+id+\" ], /* array of values for the ? placeholders */\"+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"deleteUpdateResults, errorHandler);\")\n\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t \n\t\t\t\t\t\t }", "title": "" }, { "docid": "95384b3b22b72f6b3129c216fb2ec62d", "score": "0.6527403", "text": "function del(id){\n if(confirm('melanjutkan untuk menghapus data?'))\n $.ajax({\n url:dir,\n type:'post',\n data:'aksi=hapus&replid='+id,\n dataType:'json',\n success:function(dt){\n var cont,clr;\n if(dt.status!='sukses'){\n cont = '..Gagal Menghapus '+dt.terhapus+' ..';\n clr ='red';\n }else{\n viewTB();\n cont = '..Berhasil Menghapus '+dt.terhapus+' ..';\n clr ='green';\n }\n notif(cont,clr);\n }\n });\n }", "title": "" }, { "docid": "35ec06ba3db79f0867a61510e0accf25", "score": "0.6510078", "text": "function CancelDeleteTapholdHandler()\n{\n console.log(\"taphold CancelDelete occured\");\n btn_del(true);\n}", "title": "" }, { "docid": "342f59054b9251c3bd35d393cedbcce1", "score": "0.6505662", "text": "function deleteCupom(req, res) {\r\n Cupom.remove({_id : req.params.id}, (err, result) => {\r\n // Retorna esta mensagem\r\n res.json({ message: \"Cupom deletado com sucesso!\", result });\r\n });\r\n}", "title": "" }, { "docid": "4a2123c4b82936d22e54ce3b87df7b23", "score": "0.65025824", "text": "function deleteDoituong(event) {\n event.preventDefault();\n setLoader(true);\n var data = new FormData();\n data.append('_method', 'DELETE');\n fetch('/api/doituong/' + id, {\n method: 'POST',\n headers: {\n 'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content')\n },\n body: data\n })\n .then((response) => response.json())\n .then((data) => {\n setLoader(false);\n hideDeleteDialog();\n showSuccessSnackBar(\"Xóa đối tượng thành công !\");\n removeDoituong(id);\n })\n .catch((error) => {\n console.log('Request failed', error);\n });\n }", "title": "" }, { "docid": "9c35f7513dbbfd5d0378ee95ec9b7609", "score": "0.649603", "text": "delete(req, res) {\n PokemonLearnset.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 }", "title": "" }, { "docid": "3b80fc26ab2b1678682123186a0a68da", "score": "0.6490565", "text": "_actionDelete(_data){\n var _info={\n info:_data,\n action:'delete'\n };\n this._actionGo(_info);\n }", "title": "" }, { "docid": "88db2618e498d054fb27fd8e9e8bd9d4", "score": "0.6478313", "text": "function delDB(tx){\n tx.executeSql('DELETE FROM Gebruiker;');\n $('#lbGebruikers').html('');\n}", "title": "" }, { "docid": "f574e7be1321e0f3eb63e4150ed4fff1", "score": "0.647751", "text": "function queryDB_delete(tx) {\n tx.executeSql('SELECT * FROM DEMO WHERE id='+idDelete, [], querySuccessDelete, errorCB);\n }", "title": "" }, { "docid": "1efd9b13ced7e741316ef96248c8e9d2", "score": "0.64701486", "text": "function del(){\r\n\thandleSchemaNode('deleteNode');\r\n}", "title": "" }, { "docid": "931c7edc1c5eb5eb3d1bf60cecd664c0", "score": "0.6460731", "text": "async delete(req, res) {\n try {\n\n // DELETE data transaksi\n var sql = 'DELETE FROM transaksi t WHERE id = ?'\n\n connection.query(\n sql,\n [req.params.id],\n (err, result) => {\n if (err) {\n res.json({\n status: \"Error\",\n error: err\n });\n } // If error\n\n // If success it will return JSON of result\n res.json({\n status: 'Success',\n data: result\n })\n }\n )\n } catch (err) {\n // If error will be send Error JSON\n res.json({\n status: \"Error\",\n error: err\n })\n }\n }", "title": "" }, { "docid": "2ef379f5483f12f3629ee5ab6f86a482", "score": "0.6455037", "text": "function User_Delete_Groupe_Liste_des_groupes0(Compo_Maitre)\n{\n var Table=\"groupe\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "690404e8f9fb5945ddc247e6ccc54164", "score": "0.64544934", "text": "async delete() {\n const { id } = this.req.params;\n\n const data = await Cart.findOne({\n where: {\n id,\n },\n });\n if (!data) {\n return null;\n }\n await Cart.destroy({\n where: {\n id,\n },\n });\n\n // TODO setelah delete data, maka tampilan semua item di keranjang lewat response\n return this.sendResponse({\n status: 'ok',\n server_message: 'record deleted',\n });\n }", "title": "" }, { "docid": "896f85ac60b0619de07b26614c5bdcfd", "score": "0.644992", "text": "OnDelete()\n {\n\n }", "title": "" }, { "docid": "29485a0bc1a962349457950e931d2d80", "score": "0.64485824", "text": "function supprimeAgences(argument) {\n if(confirm(\"Voulez vous vraiment supprimer cette agence ?\")){\n\n querygetSupprimeAgences = \"DELETE FROM `agenceVoyage` WHERE `id_agence`=\"+argument;\n bdd.connection.query(querygetSupprimeAgences);\n alert(\"Votre agence est supprimer!\");\n }\n return window.location.reload();\n}", "title": "" }, { "docid": "8db04f30f4df8730ceb65d008994fd8d", "score": "0.6447319", "text": "delete(e) {\n e.preventDefault();\n axios.delete('http://dummy.restapiexample.com/api/v1/delete/{this.state.id}')\n .then(res => console.log(res.data));\n }", "title": "" }, { "docid": "62fe098f8697db210df6b9df70b62b29", "score": "0.6443689", "text": "function deleteClubAndTags(bDelete,clubId){\n if(bDelete){\n console.log(\"deleting club: \"+clubId);\n cleanInvites(clubId);\n cleanTags(clubId);\n cleanRatingJunction(clubId);\n cleanMemberJunctions(clubId);\n var clubTable = tables.getTable('Club');\n clubTable.del(clubId);\n \n }else{\n console.log(\"saving club: \"+clubId);\n }\n}", "title": "" }, { "docid": "323dcc0e64e8f8649686f0910dfcfeba", "score": "0.6440812", "text": "function eliminarbd(){\n mostrarMensaje(2,perfil.etiquetas.lbMsgFunEliminar,elimina);\n function elimina(btnPresionado)\n {\n if (btnPresionado == 'ok')\n {\n Ext.Ajax.request({\n url: 'eliminarRolesDB',\n method:'POST',\n params:{\n \t\tuser: usuario,\n\t\t\t\t\t\t\tip: ipservidor,\n\t\t\t\t\t\t\tgestor: gestorBD,\n\t\t\t\t\t\t\tpassw: password,\n\t\t\t\t\t\t\tbd: baseDato,\n\t\t\t\t\t\t\toid: sm.getSelected().data.oid,\n\t\t\t\t\t\t\trolname: sm.getSelected().data.rolname,\n\t\t\t\t\t\t\tidservidor: idservidor,\n \tidgestor: idgestor\n \t\t},\n callback: function (options,success,response){\n responseData = Ext.decode(response.responseText); \n if(responseData.codMsg == 1)\n {\n mostrarMensaje(responseData.codMsg,responseData.mensaje);\n stGpBd.reload();\n sm.clearSelections();\n btnEliminar.disable();\n }\n }\n });\n }\n }\n }", "title": "" }, { "docid": "902e250d8cf2648a2f0b038bccca8b54", "score": "0.64402807", "text": "function deleteEntrie(){\n const url = \"/api/delete-entrie?postId=\" + postId;\n const req = new XMLHttpRequest();\n\n req.open(\"post\", url, true);\n req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n req.onreadystatechange = (event) => {\n if (req.readyState === 4)\n if (req.status === 200) {\n this.posts = JSON.parse(req.responseText);\n this.buildPosts();\n } \n else console.error(req.statusText);\n };\n req.send(\"postId=\" + postId);\n\n $($(\"#D\" + postId).parent().parent()[0]).remove();\n modalTrasher.close();\n}", "title": "" }, { "docid": "101f0cbfa0c09f4ea7f2743538e482d7", "score": "0.6428007", "text": "function deleteEntities() {\n \n if(!canUserWrite()) { \n alert(\"Vous n'avez pas les droits suffisants.\");\n return;\n }\n \n var selected = getSelectedRows();\n if (noRowsSelected(selected, \"entit\\351\")) {return;}\n \n try{\n \n var listeRid=[];\n var listeSujets=[];\n var currentRow ;\n \n // On fait la liste des sujets et de leurs identifiants\n for(var rowIndex in selected){\n currentRow =commandResponse.result[selected[rowIndex]-1];\n listeRid.push(currentRow[\"rid\"]);\n listeSujets.push(currentRow[\"Sujet\"]);\n }\n \n // On demande confirmation\n if(\tselected.length ==1 && !confirm(\"Voulez-vous vraiment supprimer l'entit\\351 \"+ listeSujets[0] +\" et ses relations ?\")){\n return;\n }\n if(\tselected.length > 1 && !confirm(\"Voulez-vous vraiment supprimer les entit\\351s \"+ listeSujets.join(', ') +\" et leurs relations ?\")){\n return;\n }\n \n var nbRelationsDeleted = 0;\n \n //on recupere les rids des edges a supprimer. On les supprime un par un et on supprime le sujet\n //TODO: a changer absolument, performances nulles !\n var edgesList = (execute('find references (select from ['+ listeRid +'])')).result;\n if(!edgesList) {\n alert(\"Une erreur est survenue\");\n return;\n }\n for(i in edgesList) {\n for (j in edgesList[i].referredBy) {\n execute('delete edge '+edgesList[i].referredBy[j]);\n nbRelationsDeleted ++;\n }\n }\n \n execute('delete from ['+listeRid+']');\n \n //On affiche la trace\n clearOutput();\n var deletedMessages = (selected.length ==1) ? \"L'entit\\351 \"+listeSujets.join(', ')+\" et ses \" : \"Les entit\\351s \"+listeSujets.join(', ')+ \" et leurs \";\n printMessage(new Date(), \" - INFO - \"+ deletedMessages +nbRelationsDeleted +\" relations ont \\351t\\351 supprim\\351es\");\n \n // On supprime visuellement les lignes supprimes et on vide la selection\n deleteSelectedRowsInGrid(selected);\n selArr=[];\n }\n catch(e){\n alert(e.message);\n }\n}", "title": "" }, { "docid": "d5bd4aeb871c63adf08c841dc7da2814", "score": "0.6425736", "text": "delete(id) {\n return db.run(\"DELETE FROM todos WHERE rowid = ?\", id)\n }", "title": "" }, { "docid": "c2ffa0c86894f5285c2a49fac08d0e4d", "score": "0.64106876", "text": "function deleteNorma(id,primary,field) {\r\n var fieldJs = field.split('##');\r\n var primJs = primary.split('##');\r\n \r\n param = \"proses=delete\";\r\n param += \"&primary=\"+primary;\r\n param += \"&primVal=\";\r\n for(i=1;i<primJs.length;i++) {\r\n tmp = document.getElementById(primJs[i]+\"_norma\");\r\n if(!tmp) {\r\n tmp = document.getElementById(primJs[i]+\"_\"+id);\r\n }\r\n param += \"##\"+tmp.value;\r\n }\r\n \r\n for(i=1;i<fieldJs.length;i++) {\r\n tmp = document.getElementById(fieldJs[i]+\"_\"+id);\r\n param += \"&\"+fieldJs[i]+\"=\";\r\n if(tmp.options) {\r\n param += tmp.options[tmp.selectedIndex].value;\r\n } else {\r\n param += tmp.value;\r\n }\r\n }\r\n \r\n function respon(){\r\n if (con.readyState == 4) {\r\n if (con.status == 200) {\r\n busy_off();\r\n if (!isSaveResponse(con.responseText)) {\r\n alert('ERROR TRANSACTION,\\n' + con.responseText);\r\n } else {\r\n // Success Response\r\n\t\t row = document.getElementById(\"detail_tr_\"+id);\r\n\t\t if(row) {\r\n\t\t\trow.style.display=\"none\";\r\n\t\t } else {\r\n\t\t\talert(\"Row undetected\");\r\n\t\t }\r\n }\r\n } else {\r\n busy_off();\r\n error_catch(con.status);\r\n }\r\n }\r\n }\r\n \r\n post_response_text('setup_slave_kegiatan_norma.php', param, respon);\r\n}", "title": "" }, { "docid": "82b105dd3330bb831907a8770424c2ce", "score": "0.64049256", "text": "async delete(root, args, context, info) {}", "title": "" }, { "docid": "ff63c693751e7c952c842f720d7ef80c", "score": "0.64029944", "text": "deleteFunc(table, id) {\n return this.connection.query(`DELETE FROM ?? WHERE ?`, [table, id]);\n }", "title": "" }, { "docid": "ad637a8d03be87af63d45c5bc541abf0", "score": "0.6402894", "text": "function eliminar(tabla,id){\r\n\t\r\n\treturn $.ajax({\r\n\t\t\r\n\t\ttype : \"DELETE\",\r\n\t\t\r\n\t\turl : host+\"/\"+tabla+\"/eliminar?id=\"+id\r\n\r\n\t}).fail(function(jqXHR, textStatus, errorThrown) {\r\n\r\n\t\tconsole.log(\"La solicitud a fallado: \" + textStatus);\r\n\t});\r\n\t\t\r\n}", "title": "" }, { "docid": "347fa50447844b3ff1bece571dbf12b9", "score": "0.64023346", "text": "sendDelete(id) {\n // url de backend\n const url = baseUrl + \"/cliente/delete\"; // parametro del datapost\n // red\n axios\n .post(url, {\n id: id\n })\n .then(response => {\n if (response.data.success) {\n Swal.fire(\"¡Eliminado!\", \"El cliente ha sido eliminado.\", \"correcto\");\n this.loadCliente();\n }\n })\n .catch(error => {\n alert(\"Error 325 \");\n });\n }", "title": "" }, { "docid": "11f744c16b61b2b5122ec99ec572945d", "score": "0.6399711", "text": "function del(req,callback){\n var sql = \"DELETE from week WHERE agenda = ('\"+req.body.agenda+\"')\";\n con.query(sql, function (err, res) {\n var res={}\n if(err){\n res.msg = \"error\"\n callback(400,res)\n }else{\n console.log(\"one item deleted\");\n res.msg = (\"no of item deleted:\"+result.affectedRows)\n callback(200,res)\n }\n });\n}", "title": "" }, { "docid": "67614d618cc0e9ff046a3ffa34a9e810", "score": "0.63984835", "text": "function bindDeleteButton(bttn, id) {\n bttn.addEventListener('click', function (event) {\n event.preventDefault(); // Stop page from reloading\n let queryString = \"id=\" + String(id);\n \n queryServer(queryString, \"/delete\");\n });\n}", "title": "" }, { "docid": "94339fa0e474cac7b7af3c625386a083", "score": "0.63949436", "text": "function User_Delete_Sujets_Liste_des_types_de_sujets0(Compo_Maitre)\n{\n var Table=\"typesujet\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "3f69df9439fd47a33f1e6007fe0d82d9", "score": "0.63924736", "text": "function deleteFromDatabase(index) {\n console.log(\"delete :\", index);\n $.ajax({\n dataType: 'json',\n data: {\n 'api_key': '7cdgnHXVY4',\n 'student_id': index\n },\n method: 'POST',\n url: 'http://s-apis.learningfuze.com/sgt/delete',\n success: function (response) {\n console.log('AJAX Success function called', response);\n if(response.success){\n deleteData=true;\n }\n\n }\n\n\n })\n\n }", "title": "" }, { "docid": "809ab95dc2f5734dc97478bbda8d7068", "score": "0.63861823", "text": "function deleteData(res, model, query) {\n model.remove(query, function(err) {\n if (err)\n res.status(500).json(err.errmsg);\n\n else\n res.status(200).json('deleted');\n });\n}", "title": "" }, { "docid": "09a2cde38365de6712d837aabda1442e", "score": "0.6384988", "text": "delete(req, res) {\n try {\n let id = req.params._id;\n GpioModel_1.model.delete(id)\n .then((numberDelete) => {\n res.send({ 'success': 'successfully deleted _id: ' + id });\n })\n .catch((error) => {\n res.status(400).send({ 'error': error.message });\n });\n }\n catch (e) {\n console.log(e);\n res.status(500).send({ 'error': 'error in your request' });\n }\n }", "title": "" }, { "docid": "ef616b5032c666a9e29db8ac863dba06", "score": "0.6384326", "text": "function idbDelete(db,table,guid,oncomplete,onerror){\n\tidbOpen(db,doDelete);\n\tfunction doDelete(){\n\t\tif (!guid){\n\t\t\tguid = table.record[table.primarykeyfield]\n\t\t}\t\n\t\t//console.log('do delete record with ' + table.primarykeyfield + ' = ' + guid );\n\t\tvar request = db.handle.transaction([table.name],\"readwrite\").objectStore(table.name).delete(guid);\n\n\t\t// callbacks for request \n\t\trequest.onsuccess = function(event) {\n\t\t\t//console.log('delete was a success');\n\t\t\tdb.errorcode = 0;\n\t\t\tdb.error = \"\";\n\t\t\tif (oncomplete)\t{oncomplete()}\t\t\t\t\n\t\t}\n\t\trequest.onerror = function(){\n\t\t\tif (onerror){ onerror()};\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7bf7006fead24460f3eee767b4870903", "score": "0.6379842", "text": "delete({ insurance }, res) {\n insurances.splice(insurances.indexOf(insurance), 1);\n res.sendStatus(204);\n }", "title": "" }, { "docid": "7505f6e041be2a07331b136ec9c4d035", "score": "0.6378537", "text": "handleDelete() {\n let id = this.state.id;\n if (window.confirm(\"Do you want to delete Hurtownia\" + id) === true)\n fetch('api/Hurtownias/' + id, {\n method: 'DELETE'\n }).then(setTimeout(this.refresh, 300));\n }", "title": "" }, { "docid": "14c7c0ff11beb674ebbfc9020587dbc6", "score": "0.6370949", "text": "function deleteRow(url,obj){\n\t\t\tsalesfactoryData.getData(url,'POST',obj)\n\t\t\t.then((resp)=>{\n\t\t\t\tif(resp.data.status!= undefined && (resp.data.status==true || resp.data.status ==\"success\")){\n\t\t\t\t\t// wihout_selection\n\t\t\t\t\t$scope.showLoaderTable = false;\n\t\t\t\t}else{\n\t\t\t\t\t$scope.showLoaderTable = false;\n\t\t\t\t}\n\t\t\t},(error)=>{\n\t\t\t\t$scope.showLoaderTable = false;\n\t\t\t\t_errorHandler();\n\t\t\t})\n\t\t\t.finally(()=>{\n\t\t\t\tconsole.log;\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "b0b35242865da8f71fe5c4ddc60b12ff", "score": "0.63704693", "text": "function deleteMe(){\n var buttonId = $(this).attr('data-id').split(\" \")[1];\n $.ajax({\n url: 'http://api.doughnuts.ga/doughnuts/'+ buttonId,\n method: 'DELETE',\n dataType: 'json',\n }).done(function(json){\n\n console.log(json);\n $('tr[id=\"doughnut ' + buttonId + '\"]').remove();\n });\n }", "title": "" }, { "docid": "a2ba67d34b14964b8c5a74f5adc27512", "score": "0.63650507", "text": "delete(db, condition, callback) {\n //Execute delete query\n this.connection.query('DELETE FROM ?? WHERE ?', [db, condition])\n .then(([rows]) => {\n callback({ result: true, data: rows });\n })\n .catch((err) => {\n //Check if there was an error\n if(err !== null) {\n callback({ result: false, err: '[DBController.js]:delete() Failed to query ' + err });\n }\n });\n }", "title": "" }, { "docid": "f77a8d91daaefbb89425507708363f04", "score": "0.63639385", "text": "delete(req, res) {\n const numero = req.params.numero;\n\n Paises.destroy({\n where: { numero: numero }\n })\n .then(num => {\n if (num == 1) {\n res.send({\n msg: \"PAIS was deleted successfully!\"\n });\n } else {\n res.send({\n msg: `Cannot delete PAIS with NUMERO=${id}. Maybe PAIS was not found!`\n });\n }\n })\n .catch(err => {\n res.status(500).send({\n msg: \"Could not delete PAIS with NUMERO= \" + id\n });\n });\n }", "title": "" }, { "docid": "9b73eefccfc2cf61ca6fbfe45ed0894d", "score": "0.6360322", "text": "del(table, id) {}", "title": "" }, { "docid": "934e83d923e4b0f12fd17ffc06cf3512", "score": "0.6359986", "text": "function deleteID(req, res) {\n //create and execute the read query in the database\n const id_crime_nature = req.sanitize('id_crime_nature').escape();\n connect.con.query('DELETE from Crime_Nature where id_crime_nature = ?', id_crime_nature, function (err, rows, fields) {\n if (!err) {\n //checks the results, if the number of rows is 0 returns data not found, otherwise sends the results (rows).\n if (rows.length == 0) {\n res.status(404).send({\n \"msg\": \"data not found\"\n });\n } else {\n res.status(200).send({\n \"msg\": \"success\"\n });\n }\n } else\n console.log('Error while performing Query.', err);\n });\n}", "title": "" }, { "docid": "999970860a0a826968ae7007581a1e96", "score": "0.63565123", "text": "function toDelete(element) {\n\n console.log(element);\n\n var SuggestieID = $(element).val();\n\n if (!window.openDatabase) {\n // not all mobile devices support databases if it does not, the following will show\n alert('Databases are not supported in this browser.');\n return;\n }\n\n db.transaction(function(transaction) {\n var query = 'UPDATE Suggesties SET CheckDone=\"Deleted\" WHERE suggestieID='+SuggestieID+'';\n //'= \"'+ SuggestieID +'\";';\n console.log(query);\n transaction.executeSql(query, [], function(){}, errorHandler);\n },errorHandler,nullHandler);\n alert('De suggestie is verwijdert! Je zal deze niet meer zien.');\n //location.reload();\n\n $('#'+SuggestieID+'todo').hide();\n $('.fancybox-skin').hide();\n $('.fancybox-close').hide();\n $('.fancybox-overlay').hide();\n $('#'+SuggestieID+'todoLink').hide();\n $('#'+SuggestieID+'line').hide();\n\n return;\n}", "title": "" }, { "docid": "630c8fc8fda0d7e019fc6cf372e510a0", "score": "0.6351462", "text": "function deleteElement(id){\n $.ajax(\n {\n url: \"http://157.230.17.132:3016/todos/\"+id,\n method: \"DELETE\",\n success: function(risposta){\n replace();\n }\n }\n )\n}", "title": "" }, { "docid": "3e73d3897e2a500ad29a3c87f6f056ab", "score": "0.6351298", "text": "function deleteClientInDB(oButton) {\n\n var clientIdInTable = oButton.getAttribute('clientLogin');\n\n CLIENT_VIEW_SERVICE_RESPONSE_TYPE = 7;\n\n let commandQuery = \"deleteByLogin\";\n let queryName = clientIdInTable;\n\n httpRequest = new XMLHttpRequest();\n\n if (!httpRequest) {\n console.log('Unable to create XMLHTTP instance');\n return false;\n }\n\n let params = \"commandQuery=\" + commandQuery + \"&\" + \"queryName=\" + queryName;\n httpRequest.open('POST', '/ClientController' + \"?\" + params, true);\n httpRequest.responseType = 'json';\n httpRequest.send();\n httpRequest.onreadystatechange = responseFunctionForClientView;\n}", "title": "" }, { "docid": "19f247f68d9338f706f22d698c241b06", "score": "0.63503", "text": "function deleteDBAdr(tx){\n tx.executeSql('DROP TABLE IF EXISTS ADRESSE');\n}", "title": "" }, { "docid": "5a3dbdd1d3e29ab9312911e0404fdb6d", "score": "0.6350207", "text": "delete(table, condition, cb) {\n db.query(`DELETE FROM ${table} WHERE ${condition}`, (err, res) => {\n if (err) throw err;\n\n cb(res);\n })\n }", "title": "" }, { "docid": "e29e3fc63bfbcf810bbe739c41af1de4", "score": "0.6348268", "text": "function deleteAddress() {\n F.functions.log(\"\\n[/api/deleteAddress/] deleteAddress\");\n let self = this;\n try {\n if (self.body.userId && self.body.addressId) {\n let query = 'BEGIN;' +\n 'DELETE FROM #' + self.body.addressId + ';' +\n 'UPDATE #' + self.body.userId + ' REMOVE userAddress = #' + self.body.addressId + ';' +\n 'SELECT expand(userAddress[status = true]) FROM #' + self.body.userId + ' order by createdAt desc;' +\n 'COMMIT;';\n\n F.functions.query(query)\n .then(function (response) {\n F.functions.json_response(self, 200, response);\n }\n ).catch(function (error) {\n F.functions.sendCrash(error);\n error = F.functions.handleError(error);\n F.functions.json_response(self, 400, error);\n });\n } else {\n F.functions.json_response(self, 400, {msg: \"Mandatory parameters id\"});\n }\n } catch (e) {\n F.functions.sendCrash(e);\n F.functions.json_response(self, 500, {msg: \"Ups! Lo sentimos, algo salió mal. Intenta nuevamente.\"});\n }\n}", "title": "" }, { "docid": "f9405aa565889eec4534bc2f709c56c9", "score": "0.634294", "text": "deleteNote(request, response){\t\t\t\t\n\t\tconst id = request.params.id;\t\t\t//get note id from response parameters\n\t\tnote.deleteNote(id);\t\t\t\t\t\t//invoke note's delete method\n\t\t\n\t}", "title": "" }, { "docid": "04d31ac895db4b255dc94580eb78fabc", "score": "0.6340909", "text": "function eliminar_adjunto(doc) {\n var url = base_url(\"index.php/poliza/crear/eliminar_adjunto/\" + doc);\n var item = document.getElementById(\"item_adjunto\").value;\n var dua = document.getElementById(\"dua_adjunto\").value;\n $.post(url, function(data) {\n lista_adjuntos(item, dua);\n $.notify(\"documento adjunto ha sido eliminado con exito\", \"success\");\n });\n}", "title": "" }, { "docid": "b97d6d582eccfde8c50d44a9e9028371", "score": "0.6337066", "text": "function deletePhotosAndBackgrounds(connection, callback) {\n var deletePhoto = \"delete from photos \"+\n \"where refer_type = 4 and refer_id = ?\";\n connection.query(deletePhoto, [bid], function(err, result) {\n if(err) {\n connection.release();\n err.message = \"photos테이블에서 해당 배경사진에 관한 자료를 제거하는데 오류가 발생하였습니다.\";\n logger.log('errer', req.user.nickname+'님 '+err.message);\n callback(err);\n } else {\n console.log('photos테이블 삭제 완료');\n }\n });\n\n var deleteSql = \"delete from background \"+\n \"where id = ?\";\n connection.query(deleteSql, [bid], function(err) {\n if(err) {\n connection.release();\n err.message = \"background테이블에서 해당 자료를 삭제하는데 오류가 발생하였습니다.\";\n logger.log('errer', req.user.nickname+'님 '+err.message);\n callback(err);\n } else {\n callback(null, {\"message\" : bid+\"번 ID의 배경사진을 삭제하였습니다.\"});\n }\n });\n }", "title": "" }, { "docid": "8aa12df618052c7347445cfc5847ed67", "score": "0.632945", "text": "function eliminarCliente(seleccionado) {\n delete_registrer(seleccionado, 'persona/eliminar')\n}", "title": "" }, { "docid": "c1c66be9010b27e6376736f97101dbaa", "score": "0.6328647", "text": "async function callToDelete(_id) {\n const query = new URLSearchParams();\n query.append(\"id\", _id);\n //const url: string = \"http://127.0.0.1:8100/delete\" + \"?\" + query.toString();\n const url = \"https://annasgissosse21.herokuapp.com/delete\" + \"?\" + query.toString();\n //await fetch(url);\n if (await fetch(url)) {\n clearResponse();\n const url = \"https://annasgissosse21.herokuapp.com/get\";\n const response = await fetch(url);\n const respArr = await response.json();\n if (respArr) {\n print(respArr);\n }\n }\n }", "title": "" }, { "docid": "585edfe368ee3df200c2ff00a045b6a9", "score": "0.6326945", "text": "_handleDelete() {\n if (this._deleteType == \"project\") {\n this.$.backend.method = \"DELETE\";\n this.$.backend.body = this.projectToDelete;\n this.$.backend.url =\n this.endPoint +\n \"/api/projects/\" +\n this.projectToDelete +\n \"?token=\" +\n this.csrfToken;\n this.$.backend.generateRequest();\n } else if (this._deleteType == \"assignment\") {\n this.$.backend.method = \"DELETE\";\n this.$.backend.body = this.assignmentToDelete;\n this.$.backend.url =\n this.endPoint +\n \"/api/assignments/\" +\n this.assignmentToDelete +\n \"?token=\" +\n this.csrfToken;\n this.$.backend.generateRequest();\n }\n }", "title": "" }, { "docid": "89ef69f628312a2bffac30a4a29740f0", "score": "0.6322634", "text": "function deleteItem(e){\n\n}", "title": "" }, { "docid": "1e326a83a1c8bbfc3cb443026debfbb2", "score": "0.63195384", "text": "function deleteHandler(req,res){\n\tlet id=req.params.id;\n\tlet sql='DELETE FROM countries WHERE id=$1;'\n\tlet value=[id];\n\tclient.query(sql,value)\n\t.then((results)=>{\n\t\tres.redirect('/myRecords')\n\t}).catch(()=>{\n\t\terrorHandler('error')\n\t})\n}", "title": "" }, { "docid": "78aaa80920b157661bd80065621f0677", "score": "0.6317757", "text": "delete(req, res) {\n Generation.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 }", "title": "" }, { "docid": "5b83f80911db374d7696312c8086ba1f", "score": "0.631758", "text": "function eliminar(data, event, thisElem){\n\t event.preventDefault(); //Previene comportamiento por defect (no se refresca).\n\t let pos = $(thisElem).attr(\"id\"); //Guarda el 'ID' de este boton en la variable 'pos'. (El ID corresponde a la fila donde se encuentra ese dato en el arreglo del servidor).\n\t $.ajax({\n\t\t\"url\": \"http://web-unicen.herokuapp.com/api/thing/\" + data.information[pos]._id, //Borra la 'data' ubicada en la posicion de 'information' con el '_id' correspondiente.\n\t\t\"method\": \"DELETE\",\n\t\t\"success\": function(result){\n\t\t quitarDatosFila(result, pos); //Llama a la función 'quitarDatosFila' y le pasa 'result' y 'pos' por parámetro.\n\t\t }\n\t });\n\t}", "title": "" }, { "docid": "2e3b9ba707ea7c1e04bea356fa5c2bf5", "score": "0.6316798", "text": "remover(tarefa) {\n axios.delete(`http://localhost:3003/api/tarefas/${tarefa._id}`)\n .then(resp => this.buscaTarefas())\n }", "title": "" }, { "docid": "d73dce44474b2f787fb972d1f720a47e", "score": "0.6304334", "text": "function deleteOpdrachtgever(event) {\n let removeid = event.currentTarget.id\n console.log(removeid)\n removeid = removeid.substr(1);\n\n console.log(\"remove in progress\");\n let params = \"removeid=\" + removeid;\n console.log(params);\n let xhr = new XMLHttpRequest();\n xhr.open('POST', 'process6.php', true);\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n xhr.onload = function () {\n herlaadOpdrachtGevers();\n }\n\n xhr.send(params);\n}", "title": "" }, { "docid": "b1f17c315a9b16249bf626239fd370fd", "score": "0.63011324", "text": "function deleteById(id) {\n let url = path + \"allobjects(\\'\" + id + \"\\')\";\n let xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", url, true);\n xhr.onload = function () {\n if ( xhr.status === \"200\") {\n console.log(\"Deleted\");\n } else {\n console.error(\"Error\");\n }\n };\n xhr.send(null);\n}", "title": "" }, { "docid": "32c3236a604989262afa16b28bdd8719", "score": "0.6299617", "text": "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"neighbor\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/neighbors/\" + id\n })\n .then(getNeighbor);\n }", "title": "" }, { "docid": "dde1622a81341a1958862e689daedc85", "score": "0.62995917", "text": "onDelete(id) {\n fetchDeletePost(id)\n }", "title": "" }, { "docid": "966fe104b6a29f06917a66286b17ea03", "score": "0.6294276", "text": "deleteChef(req, res) {\n let id = req.params.id_chef\n let sql = `DELETE FROM chef WHERE id_chef = ${id}`\n connection.query(sql, (error, result) => {\n if (error) throw error\n res.redirect('/')\n })\n }", "title": "" }, { "docid": "015ec77979b81bd48ef7061f497c6059", "score": "0.6285905", "text": "deleteBank({commit}, payload){\n db.collection(\"banks\").doc(payload.id).delete().then(function() {\n console.log(\"Dokumen berhasil dihapus!\");\n }).catch(function(error) {\n commit('clearError')\n console.error(\"Error removing document: \", error);\n });\n \n }", "title": "" }, { "docid": "0367f9e57bcfef605ed6144252bf9a1d", "score": "0.6281852", "text": "async deleteItemFromTrash(db) {\n\n }", "title": "" }, { "docid": "8bd6aa5e814f58642f93629af0b7be21", "score": "0.6278903", "text": "function del(w){\n\n var delFromServer = w.getAttribute(\"id\")\n firebase.database().ref(\"Todo Task/\"+ delFromServer).remove()\n\n w.parentNode.remove();\n}", "title": "" }, { "docid": "75fd13cb1dbf3f2365d731c05a7fef4f", "score": "0.6277611", "text": "onClickDelete() {\n this.onDelete();\n }", "title": "" }, { "docid": "a16a6393edbc686b98c00c3ae9656093", "score": "0.6269228", "text": "deleteOne(\n id: number,\n callback: (number, { affectedRows: number }) => mixed\n ) {\n super.query('delete from Comment where id = ?', [id], callback);\n }", "title": "" }, { "docid": "7c1d6df18e19e8a77ab9ca316afc4c83", "score": "0.6267744", "text": "delete(Pelicula) {\n this.database.ref('Peliculas/' + Pelicula.id).remove().then(() => {\n console.info(\"Baja exitosa\");\n }).catch((e) => {\n console.info(\"Fallo la baja:\" + e);\n });\n }", "title": "" }, { "docid": "2580ec9cc91fc77767f2b18227b93400", "score": "0.6264677", "text": "OnClientDelete()\n {\n\n }", "title": "" } ]
8f2a6d7e0f969f55979c0ac94b6f0c4f
this function is to get the formatable date
[ { "docid": "0480365677f6e83eee89fa38cc9b9b51", "score": "0.0", "text": "function formatDate(date){\n var mydate = new Date(date);\n var day = mydate.getDate();\n var month = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"][mydate.getMonth()];\n var formatedDate = month + ' '+day+',' + mydate.getFullYear();\n return formatedDate;\n}", "title": "" } ]
[ { "docid": "f38f2d698a3fe6536d630f62ea0c2cde", "score": "0.7977278", "text": "dateformat(date) { return \"\"; }", "title": "" }, { "docid": "ed348a9446516d58a0d6ca589edd4111", "score": "0.7579188", "text": "function format(date) \n {\n date = new Date(date); \n var day = ('0' + date.getDate()).slice(-2);\n var month = ('0' + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear();\n return year + '-' + month + '-' + day;\n }", "title": "" }, { "docid": "1cda1755f26e2c512c44adaf1b5d4612", "score": "0.7568088", "text": "function get_formatted_date(date) {\r\n\tfunction get_formatted_num(num, expected_length) {\r\n\t\tvar str = \"\";\r\n\t\tvar num_str = num.toString();\r\n\t\tvar num_zeros = expected_length - num_str.length;\r\n\t\tfor (var i = 0; i < num_zeros; ++i) {\r\n\t\t\tstr += '0';\r\n\t\t}\r\n\t\tstr += num_str;\r\n\t\treturn str;\r\n\t}\r\n\tvar msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\r\n\tmsg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\r\n\tmsg += get_formatted_num(date.getDate(), 2) + \" \";\r\n\tmsg += get_formatted_num(date.getHours(), 2) + \":\";\r\n\tmsg += get_formatted_num(date.getMinutes(), 2) + \":\";\r\n\tmsg += get_formatted_num(date.getSeconds(), 2);\r\n\treturn msg;\r\n}", "title": "" }, { "docid": "16534256922d041cf0ca7c4607c9f139", "score": "0.7504067", "text": "function get_formatted_date(date){\r\n function get_formatted_num(num, expected_length){\r\n var str = \"\";\r\n var num_str = num.toString();\r\n var num_zeros = expected_length - num_str.length;\r\n for(var i = 0; i < num_zeros; ++i){\r\n str += '0';\r\n }\r\n str += num_str;\r\n return str;\r\n }\r\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\r\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\r\n msg += get_formatted_num(date.getDate(), 2) + \" \";\r\n msg += get_formatted_num(date.getHours(), 2) + \":\";\r\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\r\n msg += get_formatted_num(date.getSeconds(), 2);\r\n return msg;\r\n}", "title": "" }, { "docid": "5beb49f134ac0528ff48f4624603ce90", "score": "0.74171597", "text": "formatDate(date){\n\t\treturn date.getFullYear()+\"/\"+this.appendLeadingZeroes(date.getMonth()+1)+\"/\"+ this.appendLeadingZeroes(date.getDate()) ; \n\t}", "title": "" }, { "docid": "3130ba1a707c842acadbd24840e06fac", "score": "0.73801136", "text": "formatDate(date) {\n\n var dd = date.getDate();\n if (dd < 10) dd = '0' + dd;\n \n var mm = date.getMonth() + 1;\n if (mm < 10) mm = '0' + mm;\n \n var yy = date.getFullYear() ;\n if (yy < 10) yy = '0' + yy;\n \n return yy + '-' + mm + '-' + dd;\n }", "title": "" }, { "docid": "358ad6ea7d286c492e45453dc425c65c", "score": "0.7276552", "text": "formatDate(date_unformatted){\n var day = date_unformatted.substr(8, 2);\n var month = date_unformatted.substr(5, 2);\n var year = date_unformatted.substr(0, 4);\n var date_formatted = day + '.' + month + '.' + year;\n return date_formatted;\n }", "title": "" }, { "docid": "23ee49055942b55fc88f8779c74d3c90", "score": "0.72741127", "text": "function myformatter(date){\n var y = date.getFullYear();\n var m = date.getMonth()+1;\n var d = date.getDate();\n return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);\n }", "title": "" }, { "docid": "179a0c9704d62379e6b768cf16ab64ee", "score": "0.72701496", "text": "formatDate(date_obj){\n var month_string = (\"0\" + String(date_obj.getMonth()+ 1)).slice(-2); \n var day_string = (\"0\" + String(date_obj.getDate())).slice(-2); \n var year_string = String(date_obj.getFullYear());\n return month_string + \"/\" + day_string + \"/\" + year_string\n }", "title": "" }, { "docid": "e0026ed35af46f48081994b06a2a0368", "score": "0.7254886", "text": "function dateformat(date) {\n\t\t\t\tvar formattedDate = '';\n\t\t\t\tvar todayTime = new Date(date);\n\t\t\t\tvar month = todayTime.getMonth() + 1;\n\t\t\t\tvar day = todayTime.getDate();\n\t\t\t\tvar year = todayTime.getFullYear();\n\t\t\t\tformattedDate = year + '' + (month < 10 ? '0' : '') + month + '' + (day < 10 ? '0' : '') + day;\n\t\t\t\treturn formattedDate;\n\t\t\t}", "title": "" }, { "docid": "ac98f5489378882d222bbb220df09365", "score": "0.7233978", "text": "function getDataFormat(el){\r\n var date = getDate(el)\r\n if(parseInt(date.day)<10)\r\n date.day = \"0\"+date.day;\r\n if(parseInt(date.month)<10)\r\n date.month = \"0\"+date.month;\r\n return date.day+\".\"+date.month+\".\"+date.year\r\n }", "title": "" }, { "docid": "8f24939b0aa9f2b73bff56821320126d", "score": "0.7220893", "text": "_formateDate() {\n // Format Time\n this.h = this.h < 10 ? '0' + this.h : this.h;\n this.m = this.m < 10 ? '0' + this.m : this.m;\n this.s = this.s < 10 ? '0' + this.s : this.s;\n\n // Format Date\n this.D = this.D < 10 ? '0' + this.D : this.D;\n this.M = this.M < 10 ? '0' + this.M : this.M;\n\n // Format String\n this.formatedDate = `${this.M}/${this.D}/${this.Y}: ${this.h}:${this.m}:${this.s}`;\n }", "title": "" }, { "docid": "0ed138b89fae8fd406f8ace481d0d540", "score": "0.7179947", "text": "function formatDate(date){\n\t\t\t var dd = date.getDate();\n\t\t\t var mm = date.getMonth()+1;\n\t\t\t var yyyy = date.getFullYear();\n\t\t\t if(dd<10) {dd='0'+dd}\n\t\t\t if(mm<10) {mm='0'+mm}\n\t\t\t date = dd+'-'+mm+'-'+yyyy;\n\t\t\t return date;\n\t \t\t}", "title": "" }, { "docid": "2af94ceaee033f91aca6c4f278fdb333", "score": "0.7175711", "text": "function formattedDate(date) {\r\n\t\t\t\t\t\t\t var d = new Date(date),\r\n\t\t\t\t\t\t\t month = '' + (d.getMonth() + 1),\r\n\t\t\t\t\t\t\t day = '' + d.getDate(),\r\n\t\t\t\t\t\t\t year = d.getFullYear();\r\n\r\n\t\t\t\t\t\t\t if (month.length < 2) month = '0' + month;\r\n\t\t\t\t\t\t\t if (day.length < 2) day = '0' + day;\r\n\t\t\t\t\t\t\t return [year,month,day].join('-');\r\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "fafdb79a2e9b765506576ad9224704f7", "score": "0.7162283", "text": "function getDateFormat(date) {\n var dayofweek = days[date.getDay()];\n var month = months[date.getMonth()];\n var day = date.getDate();\n var year = date.getFullYear();\n return dayofweek + \" \" + day + \" \" + month + \", \" + year;\n }", "title": "" }, { "docid": "ffb2f7af4083971a2ae5cfd158ff720b", "score": "0.7156349", "text": "getDate(){\n let [month,day,year] = format(this._date, 'MM/dd/yyyy').split('/');\n month = parseInt(month).toString();\n day = parseInt(day).toString();\n year = parseInt(year).toString();\n return `${month}/${day}/${year}`\n }", "title": "" }, { "docid": "17d8ad68c7607dcc93e573583d322447", "score": "0.71508586", "text": "function formatDate ( date ) {\n\t\t/*return date.getDate() + nth(date.getDate()) + \" \" +\n\t\t\tmonths[date.getMonth()] + \" \" +\n\t\t\tdate.getFullYear();*/ \n\t\treturn date.getFullYear() + \"/\" + months[date.getMonth()] + \"/\" + numFormat(date.getDate());\t\n\t}", "title": "" }, { "docid": "e9842566c29834dc9869e51f85218cc6", "score": "0.7138196", "text": "function formatDate(date) {\n let d = new Date(date);\n return d.toLocaleDateString();\n }//end formatDate", "title": "" }, { "docid": "22c2acb64d98a9ed60a8bd7cd1756e1a", "score": "0.7135492", "text": "function CalendarGetDateInFormat(date) {\n\tvar yearStr = date.getFullYear();\n\tvar monthStr = \"\";\n\tvar dayStr = \"\";\n\t\n\tif (date.getMonth() < 9) {\n\t\tmonthStr += \"0\";\n\t}\n\tmonthStr += (date.getMonth() + 1);\n\t\n\tif (date.getDate() < 10) {\n\t\tdayStr += \"0\";\n\t}\n\tdayStr += date.getDate();\n\t\n\treturn (dayStr + \".\" + monthStr + \".\" + yearStr);\n}", "title": "" }, { "docid": "1619d5f7b5d71bcb0972a9e38e0668a3", "score": "0.7132918", "text": "function GetFormatedDate(date) {\n if (date != undefined && date != null) {\n //date = new Date(date);\n return (paddingLeft(date.getDate().toString(), \"00\") + \" \" + (monthNames[date.getMonth()]).substring(0, 3) + \", \" + date.getFullYear());\n }\n return date;\n}", "title": "" }, { "docid": "8805880ee25b8eed28e7e39f4e4ab816", "score": "0.71279716", "text": "function getFormattedDate(_d,_format){\n\t\tvar t = _format;\n\t\tvar d = _d;\n\t\t//\n\t\tt = t.split(\"YYYY\").join(d.getFullYear())\n\t\tt = t.split(\"MM\").join(formatDigit(d.getMonth()+1,2));\n\t\tt = t.split(\"DD\").join(formatDigit(d.getDate(),2));\n\t\t//\n\t\tt = t.split(\"hh\").join(formatDigit(d.getHours(),2));\n\t\tt = t.split(\"mm\").join(formatDigit(d.getMinutes(),2));\n\t\tt = t.split(\"ss\").join(formatDigit(d.getSeconds(),2));\n\t\tt = t.split(\"ms\").join(formatDigit(d.getMilliseconds(),3));\n\t\tt = t.split(\"month\").join(month[lang][d.getMonth()]);\n\t\tt = t.split(\"week\").join(week[lang][d.getDay()]);\n\t\t//\n\t\tt = t.split(\"RRRRRRRRRR\").join(getRandamCharas(10));\n\t\tt = t.split(\"RRRRR\").join(getRandamCharas(5));\n\t\tt = t.split(\"RRRR\").join(getRandamCharas(4));\n\t\tt = t.split(\"RRR\").join(getRandamCharas(3));\n\t\tt = t.split(\"RR\").join(getRandamCharas(2));\n\t\tt = t.split(\"R\").join(getRandamCharas(1));\n\t\treturn t;\n\t}", "title": "" }, { "docid": "a125d2f4e8596137218e6c451a9446bb", "score": "0.7112272", "text": "getFormattedDate(dateCreated) {\n dateCreated = dateCreated.toDate();\n var day = dateCreated.getDate();\n var month = dateCreated.getMonth() + 1;\n var year = dateCreated.getFullYear();\n var formattedDate = month + \"-\" + day + \"-\" + year;\n return formattedDate;\n }", "title": "" }, { "docid": "4c49f63de2091a6fdf1e78300509ed66", "score": "0.71110874", "text": "function getFormattedDate () {\r\n var today = new Date(); \r\n var dd = today.getDate(); \r\n var mm = today.getMonth()+1;//January is 0! \r\n var yyyy = today.getFullYear(); \r\n if(dd<10){dd='0'+dd} \r\n if(mm<10){mm='0'+mm} \r\n var formatted_date = yyyy+'-'+mm+'-'+dd;\r\n return formatted_date;\r\n}", "title": "" }, { "docid": "765c5d365efd5b921500fb62dd269d28", "score": "0.71038294", "text": "function getFormattedDate(date) {\n var date = new Date(date);\n var year = date.getFullYear();\n \n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n \n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n \n return month + '/' + day + '/' + year;\n }", "title": "" }, { "docid": "2a1a2e258da2b9c6a9ce9b6832049bbe", "score": "0.70790714", "text": "formatDate(date) {\n const temp = date.split(/[-T]/);\n return `${temp[1]}/${temp[2]}/${temp[0]}`\n }", "title": "" }, { "docid": "91f30baaf63f1d6bed5caceb23fd5b2b", "score": "0.7075456", "text": "function formatDate(date,dformat){\r\n var date1 = \"\";\r\n month = date.substring(4,6);\r\n year = date.substring(0,4);\r\n date = date.substring(6,8);\r\n switch (dformat){\r\n case '1':\r\n date1 = date + \".\" + month + \".\" + year;\r\n break;\r\n case '2':\r\n date1 = month + \"/\" + date + \"/\" + year; \r\n break;\r\n case '3':\r\n date1 = month + \"-\" + date + \"-\" + year; \r\n break;\r\n case '4':\r\n date1 = year + \".\" + month + \".\" + date; \r\n break;\r\n case '5':\r\n date1 = year + \"/\" + month + \"/\" + date; \r\n break;\r\n case '6':\r\n date1 = year + \"-\" + month + \"-\" + date;\r\n break;\r\n }\r\n return (date1); \r\n}", "title": "" }, { "docid": "b9ea75b889fa92c659336d92102a33d9", "score": "0.7062738", "text": "function ossFormatDateAsString( date, format )\n{\n if( format == undefined )\n format = '1';\n\n var day = ( date.getDate() < 10 ? '0' : '' ) + date.getDate();\n var month = ( date.getMonth() + 1 < 10 ? '0' : '' ) + ( date.getMonth() + 1 );\n\n // case values correspond to OSS_Date DF_* constants\n switch( format )\n {\n case '2': // mm/dd/yyyy\n return month + \"/\" + day + \"/\" + date.getFullYear();\n break;\n\n case '3': // yyyy-mm-dd\n return date.getFullYear() + \"-\" + month + \"-\" + day;\n break;\n\n case '4': // yyyy/mm/dd\n return date.getFullYear() + \"/\" + month + \"/\" + day;\n break;\n\n case '5': // yyyymmdd\n return date.getFullYear() + month + day;\n break;\n\n case '1': // dd/mm/yyyy\n default:\n return day + \"/\" + month + \"/\" + date.getFullYear();\n break;\n }\n}", "title": "" }, { "docid": "b8b4ea9924442e5efa1bc47d50261dc6", "score": "0.70624495", "text": "function formatDate(date,formatStr){return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString,date)}", "title": "" }, { "docid": "fd9582083a239662db33bdf4e0090192", "score": "0.7060606", "text": "function getFormattedDate(date) {\n\n var month = date.getMonth() + 1;\n var day = date.getDate();\n var hour = date.getHours();\n var min = date.getMinutes();\n var sec = date.getSeconds();\n\n month = (month < 10 ? \"0\" : \"\") + month;\n day = (day < 10 ? \"0\" : \"\") + day;\n hour = (hour < 10 ? \"0\" : \"\") + hour;\n min = (min < 10 ? \"0\" : \"\") + min;\n sec = (sec < 10 ? \"0\" : \"\") + sec;\n\n var str = date.getFullYear() + \"-\" + month + \"-\" + day + \" \" + hour + \":\" + min + \":\" + sec;\n\n return str;\n }", "title": "" }, { "docid": "852b533d55126d3f6a997b48c6b1a217", "score": "0.70318073", "text": "static formatDate(date, formatStr) {\n\n if (formatStr == null) return null;\n\n var str = formatStr;\n var Week = ['日', '一', '二', '三', '四', '五', '六'];\n var month = date.getMonth() + 1;\n\n str = str.replace(/yyyy|YYYY/, date.getFullYear());\n str = str.replace(/yy|YY/, (date.getYear() % 100) > 9 ? (date.getYear() % 100).toString() : '0' + (date.getYear() % 100));\n\n\n str = str.replace(/MM/, month > 9 ? month : '0' + month);\n str = str.replace(/M/g, month);\n\n str = str.replace(/w|W/g, Week[date.getDay()]);\n\n str = str.replace(/dd|DD/, date.getDate() > 9 ? date.getDate().toString() : '0' + date.getDate());\n str = str.replace(/d|D/g, date.getDate());\n\n str = str.replace(/hh|HH/, date.getHours() > 9 ? date.getHours().toString() : '0' + date.getHours());\n str = str.replace(/h|H/g, date.getHours());\n str = str.replace(/mm/, date.getMinutes() > 9 ? date.getMinutes().toString() : '0' + date.getMinutes());\n str = str.replace(/m/g, date.getMinutes());\n\n str = str.replace(/ss|SS/, date.getSeconds() > 9 ? date.getSeconds().toString() : '0' + date.getSeconds());\n str = str.replace(/s|S/g, date.getSeconds());\n\n str = str.replace(/t/g, date.getHours() < 12 ? 'am' : 'pm');\n str = str.replace(/T/g, date.getHours() < 12 ? 'AM' : 'PM');\n\n return str;\n }", "title": "" }, { "docid": "1be64b0b686041b807d33884d1db50ae", "score": "0.7027712", "text": "function getCorrectFormat(date) {\n var day_of_week = getWeekDay(date);\n var month = getMonth(date);\n var day_of_month = date.getDate();\n var ordinal = getOrdinal(day_of_month);\n var year = date.getFullYear();\n var hour = date.getHours();\n var minutes = date.getMinutes();\n if (parseInt(minutes) < 10) {\n minutes = \"0\" + minutes;\n }\n var result = day_of_week + \", \" + month + \" \" + day_of_month + ordinal + \" \" + year + \", \" + hour + \":\" + minutes;\n return result;\n}", "title": "" }, { "docid": "ce0d0692c656fddfa1f44441ad0d9c48", "score": "0.70243204", "text": "function dateFormatter() {\n let date = new Date()\n // console.log(date)\n\n let day = date.getDate()\n day = convertToTwoDigit(day)\n // console.log(day)\n\n let month = date.getMonth() + 1\n month = convertToTwoDigit(month).toString()\n // console.log(month)\n\n const year = date.getFullYear()\n\n const combined = year + month + day\n return combined.toString()\n }", "title": "" }, { "docid": "b7d4fc5d678a2aa9f4acd9f726423977", "score": "0.70213026", "text": "function GetDateFormat(){\n let d=new Date('Jun 5 2016').toLocaleString('en-us', {year: 'numeric', month: '2-digit', day: '2-digit'}).replace(/(\\d+)\\/(\\d+)\\/(\\d+)/, '$3-$1-$2');\n return d;\n}", "title": "" }, { "docid": "246e62bcdc51e25087b445444289b311", "score": "0.70121044", "text": "function get_date() { return (new Date()).toJSON().slice(0, 19).replace(/[-T]/g, ':');}", "title": "" }, { "docid": "28def2c3ef61c353f57c31b56cf62c10", "score": "0.7011396", "text": "function formatDate(d){\r\n var day = d.getDate();\r\n var mon = d.getMonth()+1; // Runs from 0-11, we want 1-12\r\n var year = ''+d.getFullYear(); // Convert to a string\r\n\r\n if (day < 10) day = \"0\"+day; // Don't forget to pad with 0's\r\n if (mon < 10) mon = \"0\"+mon;\r\n year = year[2] + year[3]; // Two-digit year only\r\n\r\n switch (g_date_format){\r\n case '0': return day + '.' + mon + '.' + year; // Euro\r\n case '1': return mon + '/' + day + '/' + year; // US\r\n default: \r\n case '2': return day + '/' + mon + '/' + year; // UK\r\n case '3': return year + '/' + mon + '/' + day; // ISO\r\n }\r\n}", "title": "" }, { "docid": "20e6238c319b0e373e596fa773642fea", "score": "0.70086473", "text": "function getFormattedDate(t) {\r\n var e = new Date(t),\r\n s = e.getDate(),\r\n a = e.getMonth();\r\n a++;\r\n var n = e.getFullYear();\r\n return s + \"-\" + a + \"-\" + n\r\n }", "title": "" }, { "docid": "f92b69a0a2b82a6ef11b24449fb946e4", "score": "0.70048636", "text": "function getDateString(date, type) {\r\n\t\r\n\tvar yyyy = date.getFullYear().toString();\r\n\tvar mm = (date.getMonth()+1).toString(); \r\n\tvar dd = date.getDate().toString();\r\n\t\r\n\tif(type == \".\"){\r\n\t\treturn yyyy + \".\" + (mm[1]?mm:\"0\"+mm[0]) + \".\" +(dd[1]?dd:\"0\"+dd[0]);\r\n\t}\r\n\t\r\n\tif(type == \"-\"){\r\n\t\treturn yyyy + \"-\" + (mm[1]?mm:\"0\"+mm[0]) + \"-\" +(dd[1]?dd:\"0\"+dd[0]);\r\n\t}\r\n\t\r\n\treturn yyyy + \"\" + (mm[1]?mm:\"0\"+mm[0]) + \"\" +(dd[1]?dd:\"0\"+dd[0]);\r\n}", "title": "" }, { "docid": "cf78b316a8eaa05e54a490ed6ec5fc45", "score": "0.70034057", "text": "function dateToString(date, format)\n{\n var dd = date.getDate(),\n mm = date.getMonth() + 1,\n yyyy = date.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n\n if (mm < 10) {\n mm = '0' + mm;\n }\n\n var formattedDate = null;\n\n switch (format) {\n case 'mm-dd-yyyy' :\n formattedDate = mm + '-' + dd + '-' + yyyy;\n break;\n case 'yyyy-mm-dd' :\n formattedDate = yyyy + '-' + mm + '-' + dd;\n break;\n case 'dd-mm-yyyy' :\n formattedDate = dd + '-' + mm + '-' + yyyy;\n break;\n case 'dd-mmm-yyyy' :\n var monthes = {\n '01' : 'Jan',\n '02' : 'Feb',\n '03' : 'Mar',\n '04' : 'Apr',\n '05' : 'May',\n '06' : 'Jun',\n '07' : 'Jul',\n '08' : 'Aug',\n '09' : 'Sep',\n '10' : 'Oct',\n '11' : 'Nov',\n '12' : 'Dec'\n };\n formattedDate = dd + '-' + monthes[mm] + '-' + yyyy;\n break;\n }\n\n return formattedDate;\n}", "title": "" }, { "docid": "4a323fef2cff80ea89c4ea300fe7f712", "score": "0.7000483", "text": "function toDateFormat( str ) {\r\n\tif( !chkNull( str ) || str.length < 8 ) return \"-\";\r\n\treturn str.substring( 0, 4 ) + DATESEPERATOR + str.substring( 4, 6 ) + DATESEPERATOR + str.substring( 6, 8 ); \r\n}", "title": "" }, { "docid": "377d7f9edbca1704f33015c34fab2bd0", "score": "0.69942164", "text": "formatDate(date) {\n return moment(date, 'YYYY-MM-DD')\n .format('DD-MM-YYYY');\n }", "title": "" }, { "docid": "9ab49691d0cf8fcfa8c4b4d080403075", "score": "0.6974999", "text": "function formatDate(val) {\r\n\tvar dt = toDate(val);\r\n\tvar y = dt.getFullYear().toString();\r\n\tvar m = \"0\" + (dt.getMonth() + 1).toString();\r\n\tvar d = \"0\" + dt.getDate().toString();\r\n\tif (m.length>2) { m = m.substring(1);}\r\n\tif (d.length>2) { d = d.substring(1);}\r\n\treturn y + \"-\" + m + \"-\" + d;\r\n}", "title": "" }, { "docid": "dfd1f77907624cb266faa67de0452061", "score": "0.69730324", "text": "function formatDate(date){\n \n var y = date.getFullYear().toString();\n var mm = (date.getMonth()+1).toString();\n var dd = date.getDate().toString();\n \n return y+\"/\" + (mm[1]?mm:'0'+mm[0]) + \"/\" + (dd[1]?dd: '0'+dd[0]);\n \n}", "title": "" }, { "docid": "fa5e8f66dbaf74e5ae49ef4adc6d1a85", "score": "0.69719094", "text": "function getdate()\n{\nvar oDate = new Date()\nreturn dateString(oDate)\n}", "title": "" }, { "docid": "a3d264686cad3b398f0281039bf40a1a", "score": "0.6951899", "text": "function getFormattedDate(data) {\n var date = new Date(data);\n return date.getFullYear()\n + \"-\"\n + (\"0\" + (date.getMonth() + 1)).slice(-2)\n + \"-\"\n + (\"0\" + date.getDate()).slice(-2);\n}", "title": "" }, { "docid": "2d8716007123001a0dbc731ef9481f66", "score": "0.6948893", "text": "function formatDate(date) {\n \tvar date = date.split('T')[0];\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "2d591ab0c240bf7f32ddf92b8afb798c", "score": "0.69402254", "text": "function getFormattedDate(date) {\n \n //var month = (1 + date.getMonth()).toString();\n //month = month.length > 1 ? month : '0' + month;\n \n var month = date.toLocaleString('default', { month: 'short' });\n\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n \n return month + ' ' + day ;\n}", "title": "" }, { "docid": "b914fb606e8304040608c4fa9b1b336f", "score": "0.6939717", "text": "function FormatDate(date) {\r\n return new Date( parseInt( date.substr(6) ) );\r\n}", "title": "" }, { "docid": "9c00b95b23ad490dc5d37023f55ee152", "score": "0.6939459", "text": "function stFormatDate(data){\n\t if(data == null || data == \"\"){\n\t\t return \"\";\n\t }\n\t var date = new Date(data);\n var month = date.getMonth() + 1;\n return date.getDate() + \"/\" + (String(month).length > 1 ? month : \"0\" + month) + \"/\" + date.getFullYear();\n}", "title": "" }, { "docid": "8c836d57472a297bde39bab34674df3c", "score": "0.6936594", "text": "function formatDate ( date ) {\r\n\t\t\treturn weekdays[date.getDay()] + \", \" +\r\n\t\t\tdate.getDate() + nth(date.getDate()) + \" \" +\r\n\t\t\tmonths[date.getMonth()] + \" \" +\r\n\t\t\tdate.getFullYear();\r\n\t\t}", "title": "" }, { "docid": "37b8deb4ab4d698dbca2eb74fe0becca", "score": "0.69363165", "text": "function formatDate(date) {\r\n\tif (date.value.substring(0,4)==Number(date.value.substring(0,4))&&date.value.substring(5,7)==Number(date.value.substring(5,7))&&date.value.substring(8,10)==Number(date.value.substring(8,10))) { //test for correct format\r\n\t\tdate.value=date.value.substring(0,4)+\"-\"+date.value.substring(5,7)+\"-\"+date.value.substring(8,10);\r\n\t} else {\r\n\tdatev=new Date(date.value);\r\n\tformat = \"yyyy-MM-dd\";\r\n\tvar result = \"\";\r\n\tvar i_format = 0;\r\n\tvar c = \"\";\r\n\tvar token = \"\";\r\n\tvar y = datev.getYear()+\"\";\r\n\tvar M = datev.getMonth()+1;\r\n\tvar d = datev.getDate();\r\n\tvar H = datev.getHours();\r\n\tvar m = datev.getMinutes();\r\n\tvar s = datev.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\t// Year\r\n\tif (y.length < 4) {\r\n\t\tif (y < 60) {\r\n\t\t\ty = y-0+100;\r\n\t\t}\r\n\t\ty = y-0+1900;\r\n\t\t}\r\n\ty = \"\"+y;\r\n\tyyyy = y;\r\n\tyy = y.substring(2,4);\r\n\t// Month\r\n\tif (M < 10) { MM = \"0\"+M; }\r\n\t\telse { MM = M; }\r\n\tMMM = MONTH_NAMES[M-1];\r\n\t// Date\r\n\tif (d < 10) { dd = \"0\"+d; }\r\n\t\telse { dd = d; }\r\n\t// Hour\r\n\th=H+1;\r\n\tK=H;\r\n\tk=H+1;\r\n\tif (h > 12) { h-=12; }\r\n\tif (h == 0) { h=12; }\r\n\tif (h < 10) { hh = \"0\"+h; }\r\n\t\telse { hh = h; }\r\n\tif (H < 10) { HH = \"0\"+K; }\r\n\t\telse { HH = H; }\r\n\tif (K > 11) { K-=12; }\r\n\tif (K < 10) { KK = \"0\"+K; }\r\n\t\telse { KK = K; }\r\n\tif (k < 10) { kk = \"0\"+k; }\r\n\t\telse { kk = k; }\r\n\t// AM/PM\r\n\tif (H > 11) { ampm=\"PM\"; }\r\n\telse { ampm=\"AM\"; }\r\n\t// Minute\r\n\tif (m < 10) { mm = \"0\"+m; }\r\n\t\telse { mm = m; }\r\n\t// Second\r\n\tif (s < 10) { ss = \"0\"+s; }\r\n\t\telse { ss = s; }\r\n\t// Now put them all into an object!\r\n\tvar value = new Object();\r\n\tvalue[\"yyyy\"] = yyyy;\r\n\tvalue[\"yy\"] = yy;\r\n\tvalue[\"y\"] = y;\r\n\tvalue[\"MMM\"] = MMM;\r\n\tvalue[\"MM\"] = MM;\r\n\tvalue[\"M\"] = M;\r\n\tvalue[\"dd\"] = dd;\r\n\tvalue[\"d\"] = d;\r\n\tvalue[\"hh\"] = hh;\r\n\tvalue[\"h\"] = h;\r\n\tvalue[\"HH\"] = HH;\r\n\tvalue[\"H\"] = H;\r\n\tvalue[\"KK\"] = KK;\r\n\tvalue[\"K\"] = K;\r\n\tvalue[\"kk\"] = kk;\r\n\tvalue[\"k\"] = k;\r\n\tvalue[\"mm\"] = mm;\r\n\tvalue[\"m\"] = m;\r\n\tvalue[\"ss\"] = ss;\r\n\tvalue[\"s\"] = s;\r\n\tvalue[\"a\"] = ampm;\r\n\twhile (i_format < format.length) {\r\n\t\t// Get next token from format string\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\ti_format++;\r\n\t\t\t}\r\n\t\tif (value[token] != null) {\r\n\t\t\tresult = result + value[token];\r\n\t\t\t}\r\n\t\telse {\r\n\t\t\tresult = result + token;\r\n\t\t\t}\r\n\t\t}\r\n\tdate.value=result;\r\n\t}\r\n\t}", "title": "" }, { "docid": "40cccad4d746a8d7ebdd9b10c437478b", "score": "0.6932841", "text": "function makeDate(fmt,fulldate) {\n if(fulldate.match(/[a-z]+, [0-9]+ [a-z]+ [0-9]{4}/gi)) { // dddd dd mmmm yyyy\n var day = fulldate.match(/[a-z]+/gi)[0],\n date = fulldate.match(/[0-9]+/)[0],\n month = fulldate.match(/[a-z]+/gi)[1],\n year = fulldate.match(/[0-9]{4}/)[0];\n if(fmt === \"dmy\") {\n return day+\", \"+date+\" \"+month+\" \"+year;\n } else if(fmt === \"mdy\") {\n return day+\", \"+month+\" \"+date+\", \"+year;\n } else if(fmt === \"ymd\") {\n return year+\" \"+month+\" \"+date+\" (\"+day+\")\";\n }\n } else if(fulldate.match(/[0-9]+ [a-z]+ [0-9]{4}/i)) { // dd mmmm yyyy\n var date = fulldate.match(/[0-9]+/)[0],\n month = fulldate.match(/[a-z]+/i)[0],\n year = fulldate.match(/[0-9]{4}/)[0];\n if(fmt === \"dmy\") {\n return date+\" \"+month+\" \"+year;\n } else if(fmt === \"mdy\") {\n return month+\" \"+date+\", \"+year;\n } else if(fmt === \"ymd\") {\n return year+\" \"+month+\" \"+date;\n }\n } else if(fulldate.match(/[0-9]+ [a-z]+/i)) { // dd mmmm\n var date = fulldate.match(/[0-9]+/)[0],\n month = fulldate.match(/[a-z]+/i)[0];\n if(fmt === \"dmy\") {\n return date+\" \"+month;\n } else if(fmt === \"mdy\" || fmt === \"ymd\") {\n return month+\" \"+date;\n }\n } else if(fulldate.match(/[a-z]+ [0-9]{4}/i)) { // mmmm yyyy\n var month = fulldate.match(/[a-z]+/i)[0],\n year = fulldate.match(/[0-9]{4}/)[0];\n if(fmt === \"dmy\" || fmt === \"mdy\") {\n return month+\" \"+year;\n } else if(fmt === \"ymd\") {\n return year+\" \"+month;\n }\n } else {\n return fulldate;\n }\n}", "title": "" }, { "docid": "bdca5fdb5ea7f804f8dcbf00f397b159", "score": "0.69317716", "text": "static formatDate(date) {\n\n var _date = new Date(date); // convert json date string to javascript date object.\n\n var dd = _date.getDate();\n var mm = _date.getMonth() + 1; // month starts from 0 for January, hence need to add 1 to the result.\n var yy = _date.getFullYear();\n\n // add leading 0 padding for date formats\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n\n var formattedDate = dd + '/' + mm + '/' + yy;\n\n return formattedDate;\n }", "title": "" }, { "docid": "d9e93a0610a19d1870e95aa847b5eabc", "score": "0.6930692", "text": "function formatDate(date, format) {\n return format\n .replace(/yyyy/i, toString(date.getFullYear()))\n .replace(/MM/i, padStart(date.getMonth() + 1))\n .replace(/M/i, toString(date.getMonth() + 1))\n .replace(/dd/i, padStart(date.getDate()))\n .replace(/d/i, toString(date.getDate()));\n }", "title": "" }, { "docid": "9300270c345cd2091957cc1593dfcde5", "score": "0.6930241", "text": "dateFormatter(dt) {\n var date = (dt.date() < 10 ? '0' : '') + dt.date();\n var month = ((dt.month()+1) < 10 ? '0' : '') + (dt.month()+1);\n var year = dt.year();\n return date + '.' + month + '.' + year;\n }", "title": "" }, { "docid": "89b7931ad3c46e2b4ea35e059b7af560", "score": "0.6929249", "text": "function SysFmtDateTime(){}", "title": "" }, { "docid": "c419db6f995ab52332eb5db5db268245", "score": "0.69141215", "text": "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "4a7a7196dfcec1fe5c87b0798cb74eab", "score": "0.69137365", "text": "function __getDate(){\n const curDate = new Date();\n const dateFormat = __pad(curDate.getFullYear(), 2)\n + __pad((curDate.getMonth()+1), 2)\n + __pad(curDate.getDate(), 2)\n + __pad(curDate.getHours(), 2)\n + __pad(curDate.getMinutes(), 2)\n + __pad(curDate.getSeconds(), 2);\n return dateFormat;\n }", "title": "" }, { "docid": "89522a1d29f47c01e74b3283e373438b", "score": "0.6905907", "text": "function getCurrentDateFormatted() {\r\n var date = new Date();\r\n var month = date.getMonth() + 1;\r\n var day = date.getDate();\r\n var year = date.getFullYear();\r\n\r\n var formattedDate = year + \"-\" + \r\n ((\"\" + month).length < 2 ? \"0\" : \"\") + month + \"-\" +\r\n ((\"\" + day).length < 2 ? \"0\" : \"\") + day;\r\n\r\n return formattedDate;\r\n}", "title": "" }, { "docid": "a9e5c2d3b51c47c1957d2ff4786f192b", "score": "0.6900443", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "01dca1cc17b424c814049b9269028fb8", "score": "0.6900086", "text": "function calendarDateFormatter(date){\n return appendLeadingZeroes(date.getDate()) + \".\" + appendLeadingZeroes(date.getMonth() +1);\n}", "title": "" }, { "docid": "d253b914bf665fd0da20d4c704bf6c15", "score": "0.68994427", "text": "function formatDate(date) {\n var dd = date.getDate();\n dd = dd >= 10 ? dd : \"0\" + dd;\n var mm = date.getMonth() + 1;\n mm = mm >= 10 ? mm : \"0\" + mm;\n var yyyy = date.getFullYear();\n return yyyy + \"-\" + mm + \"-\" + dd;\n}", "title": "" }, { "docid": "42d952019146a3d0ea2f0e1d69f7de5f", "score": "0.68978554", "text": "function formatDate(date){\n \tlet month = '' + (date.getMonth() + 1),\n \tday = '' + date.getDate(),\n \tyear = date.getFullYear();\n\n \tif (month.length < 2) \n \tmonth = '0' + month;\n \tif (day.length < 2) \n \tday = '0' + day;\n\n \treturn [year, month, day].join('-');\n }", "title": "" }, { "docid": "7b3b81c2ec31ac435e0615baea622e55", "score": "0.6895615", "text": "function dateToString(value){ \n\t\tif(value instanceof Date){ \n\t\t\treturn new Date(value).format(\"Y-m\"); \n\t\t\t}else if(value!=''&&value!=null){ \n\t\t\treturn value.substring(0,7); \n\t\t} \n\t}", "title": "" }, { "docid": "d875892d34893395ed4f05218e1a48b8", "score": "0.6894606", "text": "formatDate(date) {\n const year = date.getFullYear();\n const month = (`0${(date.getMonth() + 1)}`).slice(-2);\n const day = (`0${(date.getDate())}`).slice(-2);\n\n return `${year}-${month}-${day}`;\n }", "title": "" }, { "docid": "07d790626db5220ac10e2cdbced46dcc", "score": "0.68939847", "text": "function FormatDate(date) {\r\n var dd = date.getDate(); //yeilds day\r\n if (dd < 10) dd = \"0\" + dd;\r\n\r\n var MM = date.getMonth() + 1; //yeilds month\r\n if (MM < 10) MM = \"0\" + MM;\r\n\r\n var yyyy = date.getYear() + 1900; //yeilds year\r\n\r\n var HH = date.getHours(); //yeilds hours \r\n if (HH < 10) HH = \"0\" + HH;\r\n\r\n var mm = date.getMinutes(); //yields minutes\r\n if (mm < 10) mm = \"0\" + mm;\r\n\r\n var ss = date.getSeconds(); //yields seconds\r\n if (ss < 10) ss = \"0\" + ss;\r\n\r\n return dd + \"/\" + MM + \"/\" + yyyy + \" \" + HH + ':' + mm + ':' + ss;\r\n}", "title": "" }, { "docid": "ec112a0d097384921261ad010db4afe4", "score": "0.6893876", "text": "function getFormattedDate() {\n const date = new Date();\n\n const days = date.getDate();\n const month = date.getMonth();\n const year = date.getFullYear();\n\n return `${days}/${month}/${year}`;\n}", "title": "" }, { "docid": "485cd61eb151f491107aaf0609209142", "score": "0.6882743", "text": "get getDateformate() {\n return /(\\d{2})\\/(\\d{2})\\/(\\d{4})/\n }", "title": "" }, { "docid": "492799b9869efe3e2519c81c3ffd1c01", "score": "0.6879616", "text": "function formattedDate(formatDate) {\n var day;\n var month;\n var year;\n formatDate = formatDate.slice(1, -1);\n formatDate = formatDate.split(\" \")[0];\n formatDate = formatDate.split(\"-\");\n year = formatDate[0];\n month = formatDate[1];\n day = formatDate[2];\n if (year.length < 4) {\n year = \"2\" + year;\n }\n var myDate = month + \"/\" + day + \"/\" + year;\n return myDate;\n}", "title": "" }, { "docid": "42f71a2385f5ac2415271e947d505af1", "score": "0.68755007", "text": "function DateFormat() {\n}", "title": "" }, { "docid": "db6dd77dd7c74e2bd03d57a8815394b6", "score": "0.68728197", "text": "function getFormattedDate() {\n const currDate = new Date();\n return (\"0\" + currDate.getDate()).slice(-2) + \"-\" + \n (\"0\" + currDate.getMonth()).slice(-2) + \" \" + \n (\"0\" + currDate.getHours()).slice(-2) + \":\" + \n (\"0\" + currDate.getMinutes()).slice(-2) + \":\" + \n (\"0\" + currDate.getSeconds()).slice(-2)\n}", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.68720007", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.68720007", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "2b1cd4ad963a1f6a2ef8271e029b2c2e", "score": "0.6859376", "text": "function formatDate(date) {\r\n var d = new Date(date),\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n\r\n if (month.length < 2)\r\n month = '0' + month;\r\n if (day.length < 2)\r\n day = '0' + day;\r\n\r\n return `${day}${month}${year}`;\r\n }", "title": "" }, { "docid": "1939b2ed643427009e263e090f2f063f", "score": "0.6858939", "text": "formatDate(dateObj) {\n const { month, day, year } = dateObj;\n return `${this.getMonthStr(month)} ${day}, ${year}`;\n }", "title": "" }, { "docid": "28b34150ff3f7c671a00f50f1bbe908b", "score": "0.68512934", "text": "toDateString() {\n return `${this.nepaliYear.toString()}/${this.nepaliMonth}/${\n this.nepaliDay\n }`;\n }", "title": "" }, { "docid": "9dd04e6664c9052bbc3945fed9d6de94", "score": "0.6850844", "text": "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 }", "title": "" }, { "docid": "921172e94a86b189a3e498d0bb822b47", "score": "0.6844576", "text": "function date_format(value, format) {\r\n\t\r\n\t//var datetime = (typeof(value)=='object' ? value : new Date(value)), \r\n\t//alert(format);\r\n\tvar result = format;\r\n\tvar datetime = new Date(value); /* (value instanceof Date ? value : new Date(value)),*/\r\n\tresult = result.replace('Y', datetime.getFullYear());\r\n\tresult = result.replace('d', datetime.getDate()<10 ? ('0'+ datetime.getDate()) : datetime.getDate()); \r\n\tresult = result.replace('m', (datetime.getMonth() + 1<10) ? ('0'+ (datetime.getMonth() + 1)) : (datetime.getMonth() + 1));\r\n\tresult = result.replace('H', (datetime.getHours()<10) ? ('0'+ datetime.getHours()) : datetime.getHours()); \r\n\tresult = result.replace('i', (datetime.getMinutes()<10) ? ('0'+ datetime.getMinutes()) : datetime.getMinutes());\r\n\tresult = result.replace('s', (datetime.getSeconds()<10) ? ('0'+ datetime.getSeconds()) : datetime.getSeconds());\r\n\tvar hours = datetime.getHours();\r\n\tresult = result.replace('a', (hours >= 12) ? 'pm' : 'am');\r\n\tvar ghours = hours > 12 ? (hours - 12) : hours;\r\n\tresult = result.replace('g', (ghours<10) ? ('0'+ ghours) : ghours);\r\n\treturn result;\r\n}", "title": "" }, { "docid": "eb2c3d1cc5a7cbae1c1f10aa8255a2b6", "score": "0.68434155", "text": "function dateFormat(d) {\n return (d.getDate() + \"\").padStart(2, \"0\")\n + \"/\" + ((d.getMonth() + 1) + \"\").padStart(2, \"0\")\n + \"/\" + d.getFullYear();\n}", "title": "" }, { "docid": "d69b8dd2a7bcbfb74969bfdd3a2313f3", "score": "0.68411845", "text": "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 }", "title": "" }, { "docid": "a674d324a1898ffa859d946d2773cbb4", "score": "0.68393517", "text": "function getFormatedDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth();\n var yy = date.getFullYear();\n return [dd, mm, yy].join('-');\n}", "title": "" }, { "docid": "fb61704f0546b9a5d52a076c4477a10f", "score": "0.68348634", "text": "function getFormattedStringDate(inputDate){\n console.log(\"inputDate\");\n console.log(inputDate);\n var sptdate = String(inputDate).split(\"/\");\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n var myMonth = sptdate[0];\n var myDay = sptdate[1];\n var myYear = sptdate[2];\n var combineDatestr = myDay + \" \" + months[myMonth - 1] + \" \" + myYear;\n \n return combineDatestr;\n}", "title": "" }, { "docid": "e50e2584afce784f39ac8bbc3debe342", "score": "0.6831986", "text": "function formateDate(date) {\n\n const regEx_Date_YYYY_MM_DD = /^\\d{4}-\\d{2}-\\d{2}$/;\n const regEx_Date_YYYY_MM = /^\\d{4}-\\d{2}$/;\n const regEx_Date_YYYY = /^\\d{4}$/;\n if(date.match(regEx_Date_YYYY_MM_DD))\n {\n const when = new Date(date);\n return when.getDate() + \".\" + (when.getMonth()+1) + \".\" + when.getFullYear();\n }\n else if(date.match(regEx_Date_YYYY_MM))\n {\n const when = new Date(date);\n return (when.getMonth()+1) + \".\" + when.getFullYear();\n }\n else if(regEx_Date_YYYY)\n return date;\n else\n {\n return false\n } \n\n}", "title": "" }, { "docid": "19aed501bc17b3a923a64a5ed745d00a", "score": "0.68291724", "text": "function formatDate(date,format) {\n\tformat=format+\"\";\n\tvar result=\"\";\n\tvar i_format=0;\n\tvar c=\"\";\n\tvar token=\"\";\n\tvar y=date.getYear()+\"\";\n\tvar M=date.getMonth()+1;\n\tvar d=date.getDate();\n\tvar E=date.getDay();\n\tvar H=date.getHours();\n\tvar m=date.getMinutes();\n\tvar s=date.getSeconds();\n\tvar yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;\n\t// Convert real date parts into formatted versions\n\tvar value=new Object();\n\tif (y.length < 4) {y=\"\"+(y-0+1900);}\n\tvalue[\"y\"]=\"\"+y;\n\tvalue[\"yyyy\"]=y;\n\tvalue[\"yy\"]=y.substring(2,4);\n\tvalue[\"M\"]=M;\n\tvalue[\"MM\"]=LZ(M);\n\tvalue[\"MMM\"]=MONTH_NAMES[M-1];\n\tvalue[\"NNN\"]=MONTH_NAMES[M+11];\n\tvalue[\"d\"]=d;\n\tvalue[\"dd\"]=LZ(d);\n\tvalue[\"E\"]=DAY_NAMES[E+7];\n\tvalue[\"EE\"]=DAY_NAMES[E];\n\tvalue[\"H\"]=H;\n\tvalue[\"HH\"]=LZ(H);\n\tif (H==0){value[\"h\"]=12;}\n\telse if (H>12){value[\"h\"]=H-12;}\n\telse {value[\"h\"]=H;}\n\tvalue[\"hh\"]=LZ(value[\"h\"]);\n\tif (H>11){value[\"K\"]=H-12;} else {value[\"K\"]=H;}\n\tvalue[\"k\"]=H+1;\n\tvalue[\"KK\"]=LZ(value[\"K\"]);\n\tvalue[\"kk\"]=LZ(value[\"k\"]);\n\tif (H > 11) { value[\"a\"]=\"PM\"; }\n\telse { value[\"a\"]=\"AM\"; }\n\tvalue[\"m\"]=m;\n\tvalue[\"mm\"]=LZ(m);\n\tvalue[\"s\"]=s;\n\tvalue[\"ss\"]=LZ(s);\n\twhile (i_format < format.length) {\n\t\tc=format.charAt(i_format);\n\t\ttoken=\"\";\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\n\t\t\ttoken += format.charAt(i_format++);\n\t\t\t}\n\t\tif (value[token] != null) { result=result + value[token]; }\n\t\telse { result=result + token; }\n\t\t}\n\treturn result;\n\t}", "title": "" }, { "docid": "bc5d895679ef22cf98f7c9eee00e616d", "score": "0.6817342", "text": "function getDateString(dateVal)\n{\nvar dayString = \"00\"+dateVal.getDate();\nvar monthString = \"00\"+(dateVal.getMonth()+1);\ndayString = dayString.substring(dayString.length-2);\nmonthString = monthString.substring(monthString.length-2);\nswitch (dateFormat) {\ncase \"dmy\" :\nreturn dayString+dateSeparator+monthString+dateSeparator+dateVal.getFullYear();\ncase \"ymd\" :\nreturn dateVal.getFullYear()+dateSeparator+monthString+dateSeparator+dayString;\ncase \"mdy\" :\ndefault :\nreturn monthString+dateSeparator+dayString+dateSeparator+dateVal.getFullYear();\n}\n}", "title": "" }, { "docid": "ee23231bfb099be347b264d005ece797", "score": "0.6815043", "text": "function formatDate(given_date) {\n if(given_date == null) {\n return \"\";\n }\n var d = new Date(given_date);\n var dd = d.getDate();\n // +1 because of zero-indexing\n var mm = d.getMonth()+1;\n var yyyy = d.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 }", "title": "" }, { "docid": "a4040bc377a4a08aaf7234c247f21aed", "score": "0.6813932", "text": "function date2str(x,y) {\r\nvar z = {M:x.getMonth()+1,d:x.getDate(),h:x.getHours(),m:x.getMinutes(),s:x.getSeconds()};\r\ny = y.replace(/(M+|d+|h+|m+|s+)/g,function(v) {return ((v.length>1?\"0\":\"\")+eval('z.'+v.slice(-1))).slice(-2)});\r\nreturn y.replace(/(y+)/g,function(v) {return x.getFullYear().toString().slice(-v.length)});\r\n}", "title": "" }, { "docid": "f714974ec58ccf58a4be21973f86ecd6", "score": "0.68086773", "text": "function formatDate(date) {\n var dateInMMDDYYYY = date.substr(0, 10);\n return dateInMMDDYYYY;\n }", "title": "" }, { "docid": "f4ebd20489222224a5764901b3af7a21", "score": "0.68060654", "text": "function formatDate(date, format) {\r\n format = format + \"\";\r\n var result = \"\";\r\n var i_format = 0;\r\n var c = \"\";\r\n var token = \"\";\r\n var y = date.getYear() + \"\";\r\n var M = date.getMonth() + 1;\r\n var d = date.getDate();\r\n var E = date.getDay();\r\n var H = date.getHours();\r\n var m = date.getMinutes();\r\n var s = date.getSeconds();\r\n var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k;\r\n // Convert real date parts into formatted versions\r\n var value = new Object();\r\n if (y.length < 4) { y = \"\" + (y - 0 + 1900); }\r\n value[\"y\"] = \"\" + y;\r\n value[\"yyyy\"] = y;\r\n value[\"yy\"] = y.substring(2, 4);\r\n value[\"M\"] = M;\r\n value[\"MM\"] = LZ(M);\r\n value[\"MMM\"] = MONTH_NAMES[M - 1];\r\n value[\"NNN\"] = MONTH_NAMES[M + 11];\r\n value[\"d\"] = d;\r\n value[\"dd\"] = LZ(d);\r\n value[\"E\"] = DAY_NAMES[E + 7];\r\n value[\"EE\"] = DAY_NAMES[E];\r\n value[\"H\"] = H;\r\n value[\"HH\"] = LZ(H);\r\n if (H == 0) { value[\"h\"] = 12; }\r\n else if (H > 12) { value[\"h\"] = H - 12; }\r\n else { value[\"h\"] = H; }\r\n value[\"hh\"] = LZ(value[\"h\"]);\r\n if (H > 11) { value[\"K\"] = H - 12; } else { value[\"K\"] = H; }\r\n value[\"k\"] = H + 1;\r\n value[\"KK\"] = LZ(value[\"K\"]);\r\n value[\"kk\"] = LZ(value[\"k\"]);\r\n if (H > 11) { value[\"a\"] = \"PM\"; }\r\n else { value[\"a\"] = \"AM\"; }\r\n value[\"m\"] = m;\r\n value[\"mm\"] = LZ(m);\r\n value[\"s\"] = s;\r\n value[\"ss\"] = LZ(s);\r\n while (i_format < format.length) {\r\n c = format.charAt(i_format);\r\n token = \"\";\r\n while ((format.charAt(i_format) == c) && (i_format < format.length)) {\r\n token += format.charAt(i_format++);\r\n }\r\n if (value[token] != null) { result = result + value[token]; }\r\n else { result = result + token; }\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "1b5c8aff70d7fcee9bd13796a70d9d37", "score": "0.6805098", "text": "function date_formatted(date) {\n var _date = new Date(date);\n return _date.getDate() + \"/\" + _date.getMonth() + \"/\" + _date.getFullYear();\n}", "title": "" }, { "docid": "ca335d76c64cd1b3a345b67ed9f8b603", "score": "0.6802592", "text": "function formatDate(date) {\n\t\t\t\tvar days = date.getDate() < 10 ? \"0\" + date.getDate() : date.getDate(),\n\t\t\t\t\t\tmonth = (date.getMonth() + 1) < 10 ? \"0\" + (date.getMonth() + 1) : (date.getMonth() + 1),\n\t\t\t\t\t\tyear = date.getFullYear(),\n\t\t\t\t\t\ttime = \"00:00:00\"; // Default\n\n\t\t\t\treturn days + \"-\" + month + \"-\" + year + \" \" + time;\n\t\t\t}", "title": "" }, { "docid": "a0ed38e8056e5da577cf4c9de3e433ff", "score": "0.68020916", "text": "function cambiarFormato(fecha){\n\t//01/07/2015\n\tvar newfecha=fecha.substring(6)+'-'+fecha.substring(3,5)+'-'+fecha.substring(0,2);\n\treturn newfecha;\n}", "title": "" }, { "docid": "39123b5484fba4e39bf74a666bb7d28e", "score": "0.6802011", "text": "function dateWriter(year, month, day) {\n \n var date1 = new Date().toDateString();\n ; return date1;\n /*\n ;Output of above code is: Today's date is Sat Jun 02 2018\n ;close but doesn't pass in values and cannot get rid of Sat\n */\n // new Date().toLocaleDateString();\n // return Date();\n // ouput of above code is Today's date is \n // Sat Jun 02 2018 05:09:24 GMT-0500 (Central Daylight Time)\n // cannot get if formated that way I want\n // return dateWriter.day + \" \" + dateWriter.month + \", \" + dateWriter.year;\n // above code doesn't return \"fully qualified\" date object\n \n}", "title": "" }, { "docid": "930c5aba52d69e477cf34fbcee2a74c5", "score": "0.6790629", "text": "function GetFormattedDate(dat) {\n var todayTime = new Date(dat);\n \n\n var month = (todayTime .getMonth() + 1);\n \n var day = (todayTime .getDate());\n var year = (todayTime .getFullYear());\n if(month<10)\n month='0'+month;\n if(day<10)\n day='0'+day;\n \n return day + \"-\" + month + \"-\" + year;\n}", "title": "" }, { "docid": "930c5aba52d69e477cf34fbcee2a74c5", "score": "0.6790629", "text": "function GetFormattedDate(dat) {\n var todayTime = new Date(dat);\n \n\n var month = (todayTime .getMonth() + 1);\n \n var day = (todayTime .getDate());\n var year = (todayTime .getFullYear());\n if(month<10)\n month='0'+month;\n if(day<10)\n day='0'+day;\n \n return day + \"-\" + month + \"-\" + year;\n}", "title": "" }, { "docid": "9234d6bb609cc27c48e36bf71f9406a9", "score": "0.6785514", "text": "function convertToString(date){\n dateString = {day:'', month:'',year:''};\n if(date.day<10){\n dateString.day = '0'+date.day.toString();\n }\nelse {\n dateString.day = date.day.toString();\n}\n\nif(date.month<10){\n dateString.month = '0'+date.month.toString();\n}\nelse{\n dateString.month = date.month.toString();\n}\n \ndateString.year = date.year.toString();\n\nreturn(dateString);\n}", "title": "" }, { "docid": "5b3acef40b0a0762157d3da07b33de98", "score": "0.67852885", "text": "function dateString(date)\r\n{\r\n var tanggal = date.split(\"-\");\r\n var year = tanggal[0];\r\n switch(tanggal[1])\r\n {\r\n case \"01\" : mounth = \"January\"; break;\r\n case \"02\" : mounth = \"February\"; break;\r\n case \"03\" : mounth = \"March\"; break;\r\n case \"04\" : mounth = \"April\"; break;\r\n case \"05\" : mounth = \"May\"; break;\r\n case \"06\" : mounth = \"June\"; break;\r\n case \"07\" : mounth = \"July\"; break;\r\n case \"08\" : mounth = \"August\"; break;\r\n case \"09\" : mounth = \"September\"; break;\r\n case \"10\" : mounth = \"October\"; break;\r\n case \"11\" : mounth = \"November\"; break;\r\n case \"12\" : mounth = \"December\"; break;\r\n }\r\n var day = tanggal[2];\r\n return day+\" \"+mounth+\" \"+year;\r\n}", "title": "" }, { "docid": "bec83ce91d96110383b1ee08e4f103c0", "score": "0.67806447", "text": "function formatDate(date, format) {\r\n format = format + \"\";\r\n var result = \"\";\r\n var i_format = 0;\r\n var c = \"\";\r\n var token = \"\";\r\n var y = date.getYear() + \"\";\r\n var now = new Date();\r\n if (date.getYear() < 0) y = now.getYear() + \"\";\r\n var M = date.getMonth() + 1;\r\n var d = date.getDate();\r\n var E = date.getDay();\r\n var H = date.getHours();\r\n var m = date.getMinutes();\r\n var s = date.getSeconds();\r\n var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, KK, K, kk, k;\r\n // Convert real date parts into formatted versions\r\n var value = new Object();\r\n if (y.length < 4) { y = \"\" + (y - 0 + 1900); }\r\n value[\"y\"] = \"\" + y;\r\n value[\"yyyy\"] = y;\r\n value[\"yy\"] = y.substring(2, 4);\r\n value[\"M\"] = M;\r\n value[\"MM\"] = LZ(M);\r\n value[\"MMM\"] = MONTH_NAMES[M - 1];\r\n value[\"NNN\"] = MONTH_NAMES[M + 11];\r\n value[\"d\"] = d;\r\n value[\"dd\"] = LZ(d);\r\n value[\"E\"] = DAY_NAMES[E + 7];\r\n value[\"EE\"] = DAY_NAMES[E];\r\n value[\"H\"] = H;\r\n value[\"HH\"] = LZ(H);\r\n if (H == 0) { value[\"h\"] = 12; }\r\n else if (H > 12) { value[\"h\"] = H - 12; }\r\n else { value[\"h\"] = H; }\r\n value[\"hh\"] = LZ(value[\"h\"]);\r\n if (H > 11) { value[\"K\"] = H - 12; } else { value[\"K\"] = H; }\r\n value[\"k\"] = H + 1;\r\n value[\"KK\"] = LZ(value[\"K\"]);\r\n value[\"kk\"] = LZ(value[\"k\"]);\r\n if (H > 11) { value[\"a\"] = \"PM\"; }\r\n else { value[\"a\"] = \"AM\"; }\r\n value[\"m\"] = m;\r\n value[\"mm\"] = LZ(m);\r\n value[\"s\"] = s;\r\n value[\"ss\"] = LZ(s);\r\n while (i_format < format.length) {\r\n c = format.charAt(i_format);\r\n token = \"\";\r\n while ((format.charAt(i_format) == c) && (i_format < format.length)) {\r\n token += format.charAt(i_format++);\r\n }\r\n if (value[token] != null) { result = result + value[token]; }\r\n else { result = result + token; }\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "2325481264cd0d2e619b5304cbb42672", "score": "0.6779649", "text": "function getDateAsString(d) { var d = new Date(); return (d.getMonth() + 1) + \"/\" + d.getDate() + \"/\" + d.getFullYear(); }", "title": "" }, { "docid": "8093d1fb0cb6015ddb29d9f2e894b0c9", "score": "0.6779333", "text": "function format_date(date, lang, format) {\n var temp_date = moment(date).locale(lang);\n if (typeof temp_date.format === 'function'){\n return temp_date.format(format);\n }\n return \"\";\n }", "title": "" }, { "docid": "4bfa4d061f8a5aa671f980224972e0d6", "score": "0.6778919", "text": "function formatDate(date) {\n\t\tfunction addZero(num) {\n\t\t\treturn num < 10 ? '0' + num : num;\n\t\t}\n\t\treturn addZero(date.getDate()) + '/' + addZero(date.getMonth() + 1) + '/' + date.getFullYear();\n\t}", "title": "" }, { "docid": "c74fb4f35e114e6b5547fe3fd1a97575", "score": "0.677423", "text": "editStartDate(date){\n return this.dateStringToObject(date).toLocaleDateString('en-US', {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n })\n }", "title": "" } ]
2392b31733028eca5460d8353fab4d44
cierra el componente. se executa desde el componente padre que renderea este componente.
[ { "docid": "3e22033262a35e7e74dfadc185254e0b", "score": "0.0", "text": "function handleClose() {\n props.handleDialog(false);\n }", "title": "" } ]
[ { "docid": "c6c0f1a774884aefffa6daecbc4fbea2", "score": "0.6713322", "text": "render() { // permite vc escrever o que vai ser renderizado.\n\t\t// OBS sempre que o JSX for mais de uma linha tem que ser envolvido por parentese\n\t\treturn <PlacarContainer {...dados} />; //ES6 - Repassa as propriedades dados dentro Plcarcontainer\n\t}", "title": "" }, { "docid": "f563ccd3faac529e5daaf02fe9e8ed24", "score": "0.64236283", "text": "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "title": "" }, { "docid": "c9f55d8734e377009bad9e21a351f180", "score": "0.6419541", "text": "render(){\n // Si la variable mostrarComponente es TRUE muestra el componente\n if(this.state.mostrarComponente){\n return(\n <div>\n <h4>Cilo desmontaje: ComponentWillUnMount</h4>\n <ComponenteADesmontar />\n <button onClick={()=>{this.setState({mostrarComponente:false})}}>Desmontar</button>\n </div>\n );\n }\n return(\n <p>El componente se ha desmontado</p>\n )\n }", "title": "" }, { "docid": "acb706058311a4204dfd452142f1d9ab", "score": "0.63710445", "text": "function renderizar(resultadosBusqueda){\n ReactDOM.render(<ListaResultados list={resultadosBusqueda}/>,document.getElementById(\"Cuerpo\"));\n controlEventosJquery();\n}", "title": "" }, { "docid": "6c94262737ee5596ad072f58b28fef19", "score": "0.6318984", "text": "function PratoDoDiaComponent() {\n }", "title": "" }, { "docid": "aa38fa313f8414cd670e6666f05dc11b", "score": "0.6300796", "text": "function render() {\n\t\t\t}", "title": "" }, { "docid": "11f9ee04927e69c8c8b51ea68d9c793b", "score": "0.62984115", "text": "salir() {\n this.state.productosCarroCompra.limpiarCarroCompras();\n ReactDOM.render(<ComponenteCatalogo/>,\n document.getElementById('contenido')\n )\n}", "title": "" }, { "docid": "d0bae09943fbea3cca8e1f86bc707fd5", "score": "0.6263451", "text": "function render() {\n\n\t\t\t}", "title": "" }, { "docid": "e9eb011a694732235b872be68bb9d04e", "score": "0.62278533", "text": "render() { \n //aplico un destructuring antes del return() para acceder a los datos del state\n const {total, plazo, cantidad, cargando} = this.state;\n\n //cargar un componente condicionalmente\n let componente;\n if (total=== '' && !cargando) {\n componente=<Mensaje />;\n } else if(cargando){\n componente=<Spinner />;\n } else {\n componente=<Resultado \n total={total}\n plazo={plazo}\n cantidad={cantidad}\n />;\n }\n return ( \n <Fragment>\n <h1>Cotizador de prestamos</h1>\n <div className=\"container\">\n <Formulario \n //en la variable datosPrestamo en viamos el contenido de la función datosPrestamo()\n datosPrestamo={this.datosPrestamo}\n />\n <div className=\"mensajes\">\n {componente}\n </div>\n </div>\n </Fragment>\n );\n }", "title": "" }, { "docid": "655e6c811a0722268b4eabbb46c07470", "score": "0.6181402", "text": "render() {\r\n\t\tvar clicarFilaAux = this.props.clicarFila;\r\n\t\tvar filMuesAux = this.props.filaMuestra;\r\n\t\tvar tam = this.props.tamanio;\r\n\t\tvar i = this.props.indice;\r\n\t\treturn (\r\n\t\t <div className=\"board-row\">\r\n\t\t\t\t{this.creaCasillasDeFila(i,tam,filMuesAux,clicarFilaAux)}\r\n\t\t </div>\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "677cce8c1c1d6c3f649e852cf48bf14e", "score": "0.6177622", "text": "postRender() {\n // Take component render method and apply UUID\n const componentElement = this.render();\n\n componentElement.setAttribute('data-component', this.uuid);\n\n this._element = componentElement;\n this.postUpdate();\n }", "title": "" }, { "docid": "e9c391c61e3ddcb05297456785f2c6fe", "score": "0.61063313", "text": "build() {\n const componentsRenderer =\n this.namespace().ComponentRenderer.new({ rootComponent: this })\n\n this.renderWith(componentsRenderer)\n }", "title": "" }, { "docid": "19830d44e8779783536e7f580261d071", "score": "0.6064272", "text": "function render() {\n\t\t\n\t}", "title": "" }, { "docid": "51dab5de34261861b18d6091d194bc4b", "score": "0.6021251", "text": "onRender()/*: void*/ {\n this.render();\n }", "title": "" }, { "docid": "d3b156011295fe937bdd523a8f311e4e", "score": "0.59920627", "text": "function render() {\n\t}", "title": "" }, { "docid": "f4da02bac1d6da5801439de81084ba8e", "score": "0.59914285", "text": "_renderScreen() {\n\t\tif (this._el && this._component) {\n\t\t\tthis._component.render(this._el);\n\t\t}\n\t}", "title": "" }, { "docid": "0ab1c75d672cfb98280bf68ca91daab1", "score": "0.59863484", "text": "render()\n {\n return(\n <div>\n <div>Estas son las empresas disponibles</div><br/>\n <div>NOTA: Para ver el procesamiento de datos se puede observar la consola: (F12)</div> \n {console.log(\"RE:\",this.renderEmpresas())}\n </div>\n );\n }", "title": "" }, { "docid": "a971c430ad213b806ed4cf7ea51b4980", "score": "0.5939404", "text": "renderIncDom() {\n\t\tif (this.component_.render) {\n\t\t\tthis.component_.render();\n\t\t} else {\n\t\t\tIncrementalDOM.elementVoid('div');\n\t\t}\n\t}", "title": "" }, { "docid": "20f563607e1da3269d49f03cc465300b", "score": "0.59013146", "text": "function render () {\r\n ctx.clearRect(0,0,canvas.width,canvas.height);\r\n cenario.fase();\r\n cenario.gera();\r\n player.calculoContagens();\r\n detectaEstado(); \r\n objchao.mostra()\r\n fisica.calculo();\r\n limites();\r\n }", "title": "" }, { "docid": "317de3eb094bee161390e76c15e0adac", "score": "0.58718145", "text": "function frender() {\n render.renderizarEnZona(0, 0, KPTF.Camara.ANCHO, KPTF.Camara.ALTO);\n render.renderizar(escena, camara);\n\n render.renderizarEnZona(KPTF.Camara.ANCHO, 0, KPTF.Camara.ANCHO, KPTF.Camara.ALTO);\n render.renderizar(escena, camara2);\n \n if(estadoJuego===EST_JUGANDO){\n render.renderizarEnZona(KPTF.Camara.ANCHO*3.5/5,0,KPTF.Camara.ANCHO*3/5, KPTF.Camara.ALTO/5);\n render.renderizar(escena, camara_mini);\n }\n}", "title": "" }, { "docid": "ef096ad2d87a5ac8c65a290292eafb95", "score": "0.5852914", "text": "RenderDeviceElectrovannePage(){\n // Clear view\n this._DeviceConteneur.innerHTML = \"\"\n // Clear Menu Button\n this.ClearMenuButton()\n // Add Back button in settings menu\n NanoXAddMenuButtonSettings(\"Back\", \"Back\", IconModule.Back(), this.RenderDeviceStartPage.bind(this))\n // Conteneur\n let Conteneur = NanoXBuild.DivFlexColumn(\"Conteneur\", null, \"width: 100%;\")\n // Titre\n Conteneur.appendChild(NanoXBuild.DivText(\"Electrovannes\", null, \"Titre\", null))\n // Add all electrovanne\n if (this._DeviceConfig != null){\n // Add all electrovanne\n this._DeviceConfig.Electrovannes.forEach(Electrovanne => {\n Conteneur.appendChild(this.RenderButtonAction(Electrovanne.Name, this.ClickOnElectrovanne.bind(this, Electrovanne), this.ClickOnTreeDotsElectrovanne.bind(this, Electrovanne)))\n });\n } else {\n // Add texte Get Config\n Conteneur.appendChild(NanoXBuild.DivText(\"No configuration get from device\", null, \"Texte\", \"margin: 1rem;\"))\n }\n // Button back\n let DivButton = NanoXBuild.DivFlexRowSpaceAround(null, \"Largeur\", \"\")\n DivButton.appendChild(NanoXBuild.Button(\"Back\", this.RenderDeviceStartPage.bind(this), \"Back\", \"Button Text WidthButton1\", null))\n Conteneur.appendChild(DivButton)\n // add conteneur to divapp\n this._DeviceConteneur.appendChild(Conteneur)\n // Espace vide\n this._DeviceConteneur.appendChild(NanoXBuild.Div(null, null, \"height: 2rem;\"))\n }", "title": "" }, { "docid": "514861cf29f358f2f05e8a92750aad30", "score": "0.5812032", "text": "onRender () {\n\n }", "title": "" }, { "docid": "dd33623b39c47c7466c506efd832c7dd", "score": "0.5796472", "text": "render() {\n // Dependiendo el estado del componente se visualiza una palabra o la otra\n return <h1>La copa { this.state.llena ? 'tiene' : 'tenia' } { this.props.contenido }</h1>\n }", "title": "" }, { "docid": "e3facdfaa11728a08ed3dc32b2e941a3", "score": "0.57867813", "text": "constructor() {\n super();\n this.render();\n }", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.57838255", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.57838255", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "5517fded71223de144bc095fcbd9a04a", "score": "0.5774502", "text": "limpiarCarroCompras(){\n this.productosCarroCompras=[];\n this.componenteNavegacion.forceUpdate();\n}", "title": "" }, { "docid": "d873a8d92686d17639d8fb3ac0105b71", "score": "0.57724243", "text": "render(){\r\n\r\n\t}", "title": "" }, { "docid": "e2812f1afa245dd5b340c902bc1bd37a", "score": "0.57532376", "text": "render(){\n //esto es lo que te devuelve esta funcion\n return <div></div>;\n }", "title": "" }, { "docid": "f03b704ed230c2ee2e85aebd9b83f983", "score": "0.57410175", "text": "postRender()\n {\n super.postRender();\n }", "title": "" }, { "docid": "697ec3b9889d75f63564c6dbce95a3a8", "score": "0.5723793", "text": "render() {\n\n\t}", "title": "" }, { "docid": "697ec3b9889d75f63564c6dbce95a3a8", "score": "0.5723793", "text": "render() {\n\n\t}", "title": "" }, { "docid": "3485796169c974d20b6da7754f5b90f9", "score": "0.5717122", "text": "function renderScript(componet) {\n componet.startFunc = function () {\n this.color = \"#FFFFFF\";\n }\n componet.updateFunc = function () {\n this.obj.position.x += Math.random() * 2 - 1;\n this.obj.position.y += Math.random() * 2 - 1;\n }\n componet.renderFunc = function () {\n\n }\n}", "title": "" }, { "docid": "abe7d8bf0a5c7561940544f18a8cc52d", "score": "0.5714898", "text": "function frmInicio_(container, opc){\n \n //Crear Panel Vertical\n var vPanel = container.createVerticalPanel()\n .setWidth(\"810\")\n .setStyleAttribute(\"padding\",\"20px\")\n .setStyleAttribute(\"fontSize\", \"12pt\")\n .setId(\"panel\");\n \n // Mensaje Inicial\n var lblTitulo = container.createLabel()\n .setId(\"lblTitulo\")\n .setText(\"Registrar Movimientos de Activos\");\n \n // Mensaje Busqueda\n var lblBusqueda = container.createLabel()\n .setId(\"lblBusqueda\")\n .setText(\"Busqueda General:\");\n \n // Sub-Mensaje Busqueda\n var lblsBusqueda = container.createLabel()\n .setId(\"lblsBusqueda\")\n .setText(\"Introduzca Palabra a Buscar\");\n \n // Text Box Busqueda\n var txtBuscar = container.createTextBox()\n .setFocus(true)\n .setName(\"txtBuscar\")\n // Accion Boton Buscar\n \n //Style\n styleTitulo_(lblTitulo);\n styleLbl_(lblBusqueda);\n styleSublbl_(lblsBusqueda);\n styleTxt_(txtBuscar);\n \n //Imagen\n var imgFondo = container.createImage(URLIMAGEN)\n .setStyleAttribute(\"margin-top\",\"20px\");\n \n //Crear Panel Horizontal\n var hPanel = container.createHorizontalPanel();\n \n //Boton Buscar\n var btnBuscar = container.createButton()\n .setText(\"Buscar\");\n \n //Boton Nuevo \n var btnNuevo = container.createButton()\n .setText(\"Crear Registro\");\n \n //Style\n styleBtn_(btnBuscar);\n styleBtn_(btnNuevo); \n \n // Accion Boton Buscar\n var lnzBuscar = container.createServerHandler('clickBuscarGral_')\n .addCallbackElement(vPanel);\n btnBuscar.addClickHandler(lnzBuscar);\n \n // Accion Boton Nuevo\n var lnzNuevo = container.createServerHandler('clickNuevo_')\n .addCallbackElement(vPanel);\n btnNuevo.addClickHandler(lnzNuevo);\n \n //Agregar al Panel Horizontal\n hPanel.add(btnBuscar);\n hPanel.add(btnNuevo);\n \n // Agrega a Panel Vertical\n vPanel.add(lblTitulo);\n vPanel.add(lblBusqueda);\n vPanel.add(lblsBusqueda);\n vPanel.add(txtBuscar);\n vPanel.add(hPanel);\n vPanel.add(imgFondo);\n \n \n //Agregar a APP\n container.add(vPanel);\n}", "title": "" }, { "docid": "47d14775064279d2d922ae2184835399", "score": "0.57137954", "text": "didRender() {\n console.log('didRender ejecutado!');\n }", "title": "" }, { "docid": "4275d549afb50cc7d445b89b5fc0804d", "score": "0.5712991", "text": "renderComponents() {\n this.algedonodeActivators.forEach(aa => {\n aa.render(this.renderer)\n })\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.rows.forEach(r => {\n r.forEach(c => {\n c.render(this.renderer)\n })\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.render(this.renderer))\n })\n }", "title": "" }, { "docid": "4936dad971b4f876353048ecb55940d6", "score": "0.5676329", "text": "render () {\n\t\t// se retorna la vista \n\t\treturn (\n\t\t\t// div about\n\t\t\t<div className=\"About\">\n\t\t\t\t// se coloca el titulo \n\t\t\t\t<h1>Acerca de.</h1>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "556c4c626e41ec75c2cf71226acac2e7", "score": "0.56620413", "text": "afterRender() { }", "title": "" }, { "docid": "556c4c626e41ec75c2cf71226acac2e7", "score": "0.56620413", "text": "afterRender() { }", "title": "" }, { "docid": "85523d159da92c1366e571276e18daa7", "score": "0.56616545", "text": "render() {\n return (\n <div>\n < h2 > Ajouter ou modifier un organisme référent </h2>\n <MenuAllForm />\n <br />\n <AddOrgaRefForm />\n </div>\n );\n }", "title": "" }, { "docid": "d32b1dfa90f4307196f323c6513e4402", "score": "0.56589776", "text": "constructor() {\n // class (etiqueta html) (web-component)\n // Instanciar a la clase\n // Clase esta lista\n // Clase se destruye\n this.ancho = 200;\n this.cambioSueldo = new EventEmitter(); // evento\n this.mostrarResultados = new EventEmitter();\n this.suma = 0;\n this.resta = 0;\n this.multiplicacion = 0;\n this.division = 0;\n console.log('instanciando');\n }", "title": "" }, { "docid": "512933eeba64dbcaffabe1e705958523", "score": "0.56551284", "text": "onAfterRendering() {}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.5653356", "text": "render() { }", "title": "" }, { "docid": "7579d1710e3244a94c7239acc076f457", "score": "0.5649437", "text": "render(){\n\t\treturn(\n\t\t\tlet objetoPropiedades = {\n\t\t\tbackground: this.props.colorFondo,\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "925eeb71b1aafc0fb3404fb7c295c107", "score": "0.5643328", "text": "static rendered () {}", "title": "" }, { "docid": "925eeb71b1aafc0fb3404fb7c295c107", "score": "0.5643328", "text": "static rendered () {}", "title": "" }, { "docid": "ea4ce333a1808413a304d1ffd7625f45", "score": "0.5625746", "text": "function initializeComponent() {\n\n lblName.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Name\"));\n lblDepartment.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Department\"));\n lblEmployeeGrade.text(VIS.Msg.translate(VIS.Env.getCtx(), \"EmployeeGrade\"));\n lblDateOfBirth.text(VIS.Msg.translate(VIS.Env.getCtx(), \"DateOfBirth\"));\n lblBottomMsg.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Bottom Message\"));\n\n $root = $(\"<div style='width: 100%; height: 100%; background-color: white;'>\");\n\n $btnPartial = $(\"<input class='VIS_Pref_btn-2' style='float: left;height: 38px;' type='button' value='SampleDialoge1'>\");\n $btnSample = $(\"<input class='VIS_Pref_btn-2' style='float: left;height: 38px;' type='button' value='SampleDialoge2'>\");\n $okBtn = $(\"<input class='VIS_Pref_btn-2' style=' margin-right: 3px;height: 38px;' type='button' value='Save'>\");\n $cancelBtn = $(\"<input class='VIS_Pref_btn-2' style=' margin-right: 15px ;width: 70px;height: 38px;' type='button' value='Clear'>\");\n\n //left side div\n leftSideDiv = $(\"<div style='float: left; margin-left: 0px;height: 95%;width:20%;margin-top: 1px;position: relative; background-color: #F1F1F1;'>\");\n leftSideBottomDiv = $(\"<div style='float: left; position: absolute; bottom: 0;height: 60px;width:100%; background-color: #F1F1F1'>\");\n \n bottumDiv = $(\"<div style='width: 100%; height: 60px; float: left; margin-bottom: 0px;'>\");\n\n var tble = $(\"<table style='width: 100%;'>\");\n //add table into div\n leftSideDiv.append(tble);\n\n var tr = $(\"<tr>\");\n var td = $(\"<td style='padding: 4px 15px 2px;'>\");\n\n tble.append(tr);\n tr.append(td);\n td.append(lblName.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(txtName.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblDepartment.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(cmbDepartment.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblEmployeeGrade.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(cmbEmployeeGrade.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n \n\n \n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblDateOfBirth.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(vdate.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n //add button to left bottom div\n leftSideBottomDiv.append($cancelBtn).append($okBtn);\n //then to left div\n leftSideDiv.append(leftSideBottomDiv);\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append($btnPartial);\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append($btnSample);\n\n\n //Right Side Div Declaration\n rightSideDiv = $(\"<div style='float: right;width: 78%; height: 95%; margin-right: 15px;margin-top: 1px; border: 1px solid darkgray;'>\");\n //Bottom div\n bottumDiv.append(lblBottomMsg.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n\n //add value to root\n $root.append(leftSideDiv).append(rightSideDiv).append(bottumDiv);\n\n //Event\n $okBtn.on(VIS.Events.onTouchStartOrClick, function () {\n saveEmployee();\n });\n\n $cancelBtn.on(VIS.Events.onTouchStartOrClick, function () {\n //if (confirm(\"wanna close this form?\")) {\n // $self.dispose();\n //}\n\n txtName.val(\"\");\n cmbEmployeeGrade.prop('selectedIndex', -1);\n cmbDepartment.prop('selectedIndex', -1);\n vdate.val(\"\");\n lblBottomMsg.text(\"Please Fill value to insert record.\");\n });\n\n $btnPartial.on(VIS.Events.onTouchStartOrClick, function () {\n \n\n });\n\n $btnSample.on(VIS.Events.onTouchStartOrClick, function () {\n var obj = new VAT.EmployeeFormByDialog($self.windowNo);\n obj.showDialoge();\n });\n\n\n // getDepartmentData();\n // getEmployeeGradeData();\n }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.56174576", "text": "render(){}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.56174576", "text": "render(){}", "title": "" }, { "docid": "5b36260245314cc67278700083dd84c5", "score": "0.5614454", "text": "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "title": "" }, { "docid": "03540ee24af3d8942bab86d5e9cb14a5", "score": "0.561238", "text": "render(){\n\n \tif(this.props.ICOarray === null){\n \t\treturn(\n \t\t\t<p> Cargando... </p>\n \t\t);\n \t}\n\n \t//lista procedente de componente padre\n let lista = [];\n\n \tlista = this.props.ICOarray.map((icoID,index) => {\n \t\treturn(<IcoDetail key={index} ico={icoID} \n instancia={this.props.instancia} \n getID={this.getIDfromDetail} \n navControl={this.navControlList} \n clickedICO={this.clickedICO}\n />);\n\n \t});\n\n var instanciaContrato = this.props.instancia;\n\n \t// devolvemos la lista\n \treturn(\n <div>\n <Table responsive>\n <thead>\n <tr>\n <th>Name</th>\n <th>Opening date</th>\n <th>Closing date</th>\n <th>Token name</th>\n <th>Token price (in ether)</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n {lista} \n </tbody> \n </Table>\n </div>\n \t);\n }", "title": "" }, { "docid": "25326a209c23e0b84fe416af0fd544ba", "score": "0.56047654", "text": "function mostEsconComponet(componente, mostrar) {\n mostrar ? componente.setAttribute('style', 'display:block;') : componente.setAttribute('style', \"display:none;\");\n return;\n}", "title": "" }, { "docid": "932c9c6376445a9b4d589e149461cb5c", "score": "0.5603845", "text": "function drawcomponent(component) {\n ctx.beginPath();\n ctx.fillStyle = component.color;\n ctx.fillRect(component.x, component.y, component.width, component.height);\n ctx.closePath();\n \n //ctx.drawImage();\n}", "title": "" }, { "docid": "d70f58fc59c3d734b1021c7443bbe2ed", "score": "0.5599209", "text": "RenderDeviceScenePage(){\n // Clear view\n this._DeviceConteneur.innerHTML = \"\"\n // Clear Menu Button\n this.ClearMenuButton()\n // Add Back button in settings menu\n NanoXAddMenuButtonSettings(\"Back\", \"Back\", IconModule.Back(), this.RenderDeviceStartPage.bind(this))\n // Conteneur\n let Conteneur = NanoXBuild.DivFlexColumn(\"Conteneur\", null, \"width: 100%;\")\n // Titre\n Conteneur.appendChild(NanoXBuild.DivText(\"Scenes\", null, \"Titre\", null))\n // Add all scenes\n if (this._DeviceConfig != null){\n if (this._DeviceConfig.Scenes.length != 0){\n let SceneCount = 0\n this._DeviceConfig.Scenes.forEach(Scene => {\n Conteneur.appendChild(this.RenderButtonAction(Scene.Name, this.ClickOnScene.bind(this, Scene.Name, Scene.Sequence), this.ClickOnTreeDotsScene.bind(this, Scene, SceneCount)))\n SceneCount ++\n });\n } else {\n Conteneur.appendChild(NanoXBuild.DivText(\"No scene defined\", null, \"Text\", \"\"))\n }\n }else {\n // Add texte Get Config\n Conteneur.appendChild(NanoXBuild.DivText(\"No configuration get from device\", null, \"Texte\", \"margin: 1rem;\"))\n }\n // Div Button\n let DivButton = NanoXBuild.DivFlexRowSpaceAround(null, \"Largeur\", \"margin-top: 3rem;\")\n Conteneur.appendChild(DivButton)\n // Button Add Scene\n if (this._DeviceConfig != null){\n DivButton.appendChild(NanoXBuild.Button(\"Add Scene\", this.ClickOnAddScene.bind(this), \"addscene\", \"Button Text WidthButton1\", null))\n }\n // Button Back\n DivButton.appendChild(NanoXBuild.Button(\"Back\", this.RenderDeviceStartPage.bind(this), \"Back\", \"Button Text WidthButton1\", null))\n // add conteneur to divapp\n this._DeviceConteneur.appendChild(Conteneur) \n // Espace vide\n this._DeviceConteneur.appendChild(NanoXBuild.Div(null, null, \"height: 2rem;\"))\n }", "title": "" }, { "docid": "854f7aa374e01e7c25f878fc3c35684a", "score": "0.55977356", "text": "build() {\r\n this.defineComponents();\r\n this.render();\r\n this.initEventHandlers();\r\n }", "title": "" }, { "docid": "1f76175384c89d83703a47b82569624a", "score": "0.55966014", "text": "render() {\n this.el.innerHTML = this.template();\n\n setTimeout(() => {\n this.bindUIElements();\n }, 0);\n }", "title": "" }, { "docid": "074ce4877c6f29dadd62b578d8212882", "score": "0.55947876", "text": "function Component() { }", "title": "" }, { "docid": "88c4a3c93ba7c3d4ecc67104fb95cc09", "score": "0.5589756", "text": "componentDidMount() {\r\n console.log(\"El componente se renderizó\");\r\n }", "title": "" }, { "docid": "e79e5349cc5beb4b44315d9ed3496157", "score": "0.5582289", "text": "function GridDiaria(raw) {\n // const [data, setData] = useState([]);\n // const [loading, setLoading] = useState(false);\n \n\n\n\nreactDom.render(\n <RenderGridDiaria dados={raw}/>, \n document.getElementById('grid-diarias')\n);\n\n\n\n\n}", "title": "" }, { "docid": "69bea0af79ace947b5fd4bdeade8c9e7", "score": "0.5582237", "text": "render() {\n\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n \n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.5579948", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "5ac7c5efbdd6f4613e10116b2779a894", "score": "0.5576457", "text": "render(container) {\n this.renderer.render(container);\n }", "title": "" }, { "docid": "67dd954e43eb0f060ee187312a90be27", "score": "0.5569945", "text": "_renderNewRootComponent(/* instance, ... */) { }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5563386", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5563386", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5563386", "text": "render() {}", "title": "" }, { "docid": "8296e214d4093a2a79de917866425b0d", "score": "0.55583394", "text": "function Component(params) {\n\n //default type\n this.type = \"div\";\n\n //default children = empty array\n this.children = [];\n\n //initalize object with specified parameters\n for (var property in params) {\n if (params.hasOwnProperty(property)) {\n this[property] = params[property];\n }\n }\n\n this.render = function(target) {\n\n if (target instanceof Component) {\n //ref for adding child\n var targetComponent = target;\n target = target.ref;\n }\n\n //default target is body tag\n if (!target) {\n target = document.body;\n }\n\n //create element, DIV if not specified\n var element = document.createElement(this.type);\n\n //loop through compontent properties and add to element\n for (var property in this) {\n if (this.hasOwnProperty(property)) {\n if (property === \"id\") {\n element.id = this.id;\n } else if (property === \"classes\") {\n for (var i = 0; i < this.classes.length; i++) {\n element.classList.add(this.classes[i]);\n }\n } else if (property === \"text\") {\n element.textContent = this.text;\n } else if (property === \"src\") {\n element.src = this.src;\n } else if (property === \"listener\") {\n element.addEventListener(this.listener[0], this.listener[1].bind(this), false);\n }\n }\n }\n\n //if not top level component\n if (this.parent) {\n //if position of compontent unspecified, default to last position\n if (arguments[2] == null) {\n target.appendChild(element);\n }\n\n //if specified, add element to position\n else {\n if (this.position === 0) {\n target.prepend(element);\n } else if (this.position === this.parent.children.length - 1) {\n target.appendChild(element);\n } else {\n target.insertBefore(element, target.children[this.position]);\n }\n }\n } \n \n //if top level component\n else {\n if (arguments[2] == null) {\n target.appendChild(element);\n }\n\n else {\n if (arguments[2] === 0) {\n target.prepend(element);\n } else if (arguments[2] === this.containerElement.children.length - 1) {\n target.appendChild(element);\n } else {\n target.insertBefore(element, target.children[arguments[2]]);\n }\n }\n }\n \n //DOM reference to component\n this.ref = element;\n //DOM reference to parent element\n this.containerElement = this.ref.parentElement;\n\n //if called from parent, parent object passed in as second argument\n //if component is child of another component, store parent and positional information\n if (arguments[1]) {\n this.parent = arguments[1];\n this.position = arguments[1].children.indexOf(this);\n }\n\n //render all children of this element\n if (this.hasOwnProperty(\"children\")) {\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].render(this.ref, this);\n }\n } \n\n if (targetComponent && targetComponent.children.indexOf(this) === -1) {\n targetComponent.children.push(this);\n }\n };\n\n //pass in object containing paramaters to change\n //automatically updates and re-renders component\n this.update = function(params) {\n\n for (var property in params) {\n if (params.hasOwnProperty(property)) {\n this[property] = params[property];\n }\n }\n\n //if top level component, must remember position via DOM positions\n if (!this.parent) {\n var position = Array.prototype.slice.call(this.containerElement.children).indexOf(this.ref);\n }\n \n //remove component from dom\n this.containerElement.removeChild(this.ref);\n\n if (this.parent) {\n //update parent to contain updated component\n this.parent.children[this.position] = this;\n //render component is same place\n this.render(this.containerElement, false, this.position);\n } else {\n this.render(this.containerElement, false, position);\n }\n }\n}", "title": "" }, { "docid": "f92c48f7bb741e42a74a4c5e52ec76f6", "score": "0.5551072", "text": "function RenderEvent() {}", "title": "" }, { "docid": "6e6eee0fe6cbbbe16c00a83f6d9dd1ff", "score": "0.5545607", "text": "render() {\n return (\n <div className=\"containerNav\">\n <div>\n <p className=\"titleNav\">ADMINISTRACIÓN DE REGISTROS</p>\n <br/> \n </div> \n </div>\n );\n }", "title": "" }, { "docid": "fe99c732c0d0a37404fabc4060537755", "score": "0.55377054", "text": "function init(){\n buildComponent();\n attachHandlers();\n addComponents();\n doSomethingAfterRendering(); // 렌더 이후 처리함수 (예 - 서버접속)\n }", "title": "" }, { "docid": "bc1a86e7f93f0e2545f61ed6d8c6d517", "score": "0.5534105", "text": "function ciclo(){\n\tleerTecla();\n\tleerMouse();\n\tcalcularEstado();\n\trenderer.render(escena, camara);\n\trequestAnimationFrame(ciclo);\n}", "title": "" }, { "docid": "cab92ce7f7467d82fb9e8208f1d74ea9", "score": "0.5528299", "text": "constructor() {\n super(); // loading the parent component methods and properties\n return this.buildComponenent(); // this function should always be called, it returns the object to render\n }", "title": "" }, { "docid": "03d720731a48eb3b1c36345c043fdae2", "score": "0.55175763", "text": "function Render() {\n ClearScreen();\n RenderEnergeticDroplets();\n ResetRenderingConditions();\n}", "title": "" }, { "docid": "3d27b5c743894c696be6af7d867b9728", "score": "0.5517393", "text": "render() {\n const self = this;\n const data = self.get('data');\n if (!data) {\n throw new Error('data must be defined first');\n }\n self.clear();\n self.emit('beforerender');\n self.refreshLayout(this.get('fitView'));\n self.emit('afterrender');\n }", "title": "" }, { "docid": "5d9e165e18c18f60bae16ce88f1f70b1", "score": "0.5515848", "text": "function comportement (){\n\t }", "title": "" }, { "docid": "47fad82a344b7363cf0035883a594adb", "score": "0.551556", "text": "function iniciarRenderizado() {\n render = new KPTF.Renderizador();\n escena = new KPTF.Escena();\n camara = new KPTF.Camara();\n camara_mini = new KPTF.Camara();\n camara2 = new KPTF.Camara();\n \n camara.cambiarAspecto((window.innerWidth / 2) / window.innerHeight);\n camara2.cambiarAspecto((window.innerWidth / 2) / window.innerHeight);\n camara_mini.cambiarAspecto((window.innerWidth*3 / 2) / window.innerHeight);\n\n KPTF.Renderizador.lienzo(\"canvas\", render);\n\n new KPTF.Modelo(\"modelo/aguila.js\", \"modelo/aguila.png\", fModeloAguila, {x: 5, y: 2.5, z: -2.5}, 4.5);\n \n new KPTF.Modelo(\"modelo/shuriken.js\", null, fModeloShuriken, {x: 75, y: 2.5, z: -2.5}, 0.3);\n \n for(var i=0;i<muros.length;i++){\n escena.añadir(muros[i].objeto);\n }\n \n cuboG = new THREE.BoxGeometry(10, 5, 5);\n cuboM = new THREE.MeshBasicMaterial({color: 0xFF0000, wireframe: true});\n cubo = new THREE.Mesh(cuboG, cuboM);\n cubo2 = new THREE.Mesh(cuboG, cuboM);\n \n cubo.position=new THREE.Vector3(10-5, 5-2.5, 0-2.5);\n cubo2.position=new THREE.Vector3(80-5, 5-2.5, 0-2.5);\n \n escena.añadir(foco);\n escena.añadir(foco2);\n escena.añadir(ambiente);\n escena.añadir(cubo);\n escena.añadir(cubo2);\n \n mundo3d.añadirA(escena);\n\n KPTF.miHilo.añadirTarea(frender, 0, true);\n \n KPTF.Teclado.añadirFuncionTeclaArriba(controlTeclado);\n \n window.addEventListener('resize', onWindowResize, false);\n}", "title": "" }, { "docid": "0ce8474e7099560937702082d446a5c5", "score": "0.55151767", "text": "render() {\n\n }", "title": "" }, { "docid": "092633938ffb2e6d66f93d04d41d974f", "score": "0.5512132", "text": "static finishedRenderingComponent() {\n\t\trenderingComponents_.pop();\n\t}", "title": "" }, { "docid": "cc78cba2f13875dae498bd7e79963e5e", "score": "0.5511117", "text": "Render(){\n throw new Error(\"Render() method must be implemented in child!\");\n }", "title": "" }, { "docid": "bb57cbe1124c36c8b0d7893d771959d4", "score": "0.5506428", "text": "render() {\n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n );\n \n }", "title": "" }, { "docid": "be16e00304e8edd26966327413d0cf88", "score": "0.550033", "text": "function generatePDFComponentSB(container) {\n var\n formElementClass = 'component-form',\n componentsClass = 'component',\n lang = {\n indonesia: 'in_ID',\n english: 'en_US'\n },\n componentNames = [\n 'idAndMailType',\n 'docTitle',\n 'docAddr',\n 'docContact',\n 'line',\n 'docMailNum',\n 'docDate',\n 'docFor',\n 'docSubject',\n 'lineBreak',\n 'leftMargin',\n 'docContents',\n 'docSignature'\n ],\n // human readable name\n componentNamesHR = {\n in_ID: {\n idAndMailType: 'ID dan Jenis Surat',\n docTitle: 'Header Surat > Nama Instansi Surat',\n docAddr: 'Header Surat > Alamat Instansi Surat',\n docContact: 'Header Surat > Kontak Instansi Surat',\n line: 'Header Surat > Garis Bawah',\n docMailNum: 'Nomor Surat',\n docDate: 'Tanggal Surat',\n docFor: 'Nama Penerima',\n docSubject: 'Perihal',\n lineBreak: 'Line Break',\n leftMargin: 'Margin Kiri',\n docContents: 'Isi Surat',\n docSignature: 'Tanda Tangan'\n },\n en_US: {}\n }\n formSubmitClass = 'component-form-submit',\n i = 0;\n\n lang = lang[$.cookie('language')];\n //console.log($.cookie('language'));\n $('<button></button>').addClass('button close-btn').html('<i class=\"fa fa-times-circle\"></i>').appendTo(container);\n $('<form></form>').attr({\n class: formElementClass,\n action: 'javascript:void(0)',\n method: 'post'\n }).appendTo(container);\n // Layout Name\n $('<label></label>')\n .attr('for', 'layout_name')\n .text('Nama Layout: ')\n .appendTo(container + ' form');\n $('<input>').attr({\n type: 'text',\n name: 'layout_name',\n id: 'layoutName'\n }).appendTo(container + ' form');\n // Layout Orientation\n $('<label></label>')\n .attr('for', 'layout_orientation')\n .text('Orientasi Layout: ')\n .appendTo(container + ' form');\n $('<select></select>').attr({\n name: 'layout_orientation',\n id: 'orientation'\n }).appendTo(container + ' form');\n $('<option></option>').attr('value', 'P').text('Potrait').appendTo(container + ' form #orientation');\n $('<option></option>').attr('value', 'L').text('Landscape').appendTo(container + ' form #orientation');\n // Layout Unit\n $('<label></label>')\n .attr('for', 'layout_unit')\n .text('Unit Layout: ')\n .appendTo(container + ' form');\n $('<select></select>').attr({\n name: 'layout_unit',\n id: 'unit'\n }).appendTo(container + ' form');\n $('<option></option>').attr('value', 'mm').text('mm').appendTo(container + ' form #unit');\n $('<option></option>').attr('value', 'cm').text('cm').appendTo(container + ' form #unit');\n // Layout Format\n $('<label></label>')\n .attr('for', 'layout_format')\n .text('Format Layout: ')\n .appendTo(container + ' form');\n $('<select></select>').attr({\n name: 'layout_format',\n id: 'format'\n }).appendTo(container + ' form');\n $('<option></option>').attr('value', 'A4').text('A4').appendTo(container + ' form #format');\n $('<option></option>').attr('value', 'A5').text('A5').appendTo(container + ' form #format');\n for (; i < componentNames.length; i++) {\n $(container + ' .' + formElementClass).append('<input type=\"checkbox\" name=\"' + componentNames[i] +\n '\" class=\"' + componentsClass +\n '\" id=\"' + componentNames[i] +\n '\"><span>' + componentNamesHR[lang][componentNames[i]] + '</span>');\n }\n $(container + ' .' + formElementClass + ' .' + componentsClass).prop('checked', 'checked');\n $('<button></button>').addClass('button ' + formSubmitClass).html('Ok <i class=\"fa fa-check-circle\"></i>').appendTo('.' + formElementClass);\n $(container).css('display', 'block'); // show the box\n $(container + ' .close-btn').click(function() {\n $(container).css('display', 'none');\n $(container + ' .close-btn').unbind('click');\n $(container + ' .' + formSubmitClass).unbind('click');\n $(container + ' .close-btn').remove();\n $(container + ' form').remove();\n $('.pdf-layout-create-btn').removeAttr('disabled');\n });\n $('.' + formSubmitClass).unbind('click');\n $('.' + formSubmitClass).click(function() {\n var\n choicedCD = [], // choiced component data\n pageSetup = {\n orientation: $('.component-form #orientation').val(),\n unit: $('.component-form #unit').val(),\n format: $('.component-form #format').val()\n }, // pdf page setup\n pdfLayoutBox = $('.pdf-layout-box'),\n pdfLayoutBoxNextID = pdfLayoutBox.length + 1,\n layoutName = xss_clean($('.component-form #layoutName').val());\n //console.log(pageSetup);\n for (var i = 0; i < componentNames.length; i++) {\n if ($('.component-form #' + componentNames[i]).is(':checked')) {\n choicedCD.push(componentNames[i]);\n }\n }\n // add xss_clean (escape all special characters)\n $.ajax({\n type: \"POST\",\n url: baseURL() + '/add_pdf_layout',\n data: {\n data: JSON.stringify({\n t: $.cookie('t'),\n choiced_cd: choicedCD,\n layout_name: layoutName,\n page_setup: pageSetup\n })\n },\n dataType: \"json\",\n }).done(function() {\n\n }).fail(function() {\n\n }).always(function(result) {\n if (result.status == 'success') {\n $('.action-msg-notification').html('<p><i class=\"fa fa-check-circle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').addClass('success');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n $(container).css('display', 'none');\n $(container + ' .close-btn').unbind('click');\n $(container + ' .' + formSubmitClass).unbind('click');\n $(container + ' .close-btn').remove();\n $(container + ' form').remove();\n $('.pdf-layout-create-btn').removeAttr('disabled');\n $('<div></div>').attr({\n class: 'pdf-layout-box',\n id: 'layout' + pdfLayoutBoxNextID\n }).appendTo('.pdf-layout-list-container');\n $('<i></i>').addClass('fa fa-file-pdf fa-inverse pdf-icon').appendTo('#layout' + pdfLayoutBoxNextID);\n $('<div></div>').addClass('pdf-layout-action-container').appendTo('#layout' + pdfLayoutBoxNextID);\n $('<p></p>').addClass('pdf-layout-name').text(layoutName).appendTo('#layout' + pdfLayoutBoxNextID);\n $('<button></button>').addClass('button pdf-layout-action edit').html('<i class=\"fa fa-edit fa-fw fa-lg\"></i>').appendTo('#layout' + pdfLayoutBoxNextID + ' .pdf-layout-action-container');\n $('<button></button>').addClass('button pdf-layout-action view').html('<i class=\"fa fa-eye fa-fw fa-lg\"></i>').appendTo('#layout' + pdfLayoutBoxNextID + ' .pdf-layout-action-container');\n $('<button></button>').addClass('button pdf-layout-action active-non-active').html('<i class=\"fa fa-toggle-off fa-fw fa-lg\"></i>').appendTo('#layout' + pdfLayoutBoxNextID + ' .pdf-layout-action-container');\n $('<button></button>').addClass('button pdf-layout-action remove').html('<i class=\"fa fa-trash-alt fa-fw fa-lg\"></i>').appendTo('#layout' + pdfLayoutBoxNextID + ' .pdf-layout-action-container');\n pdfLayoutActionEdit(pdfLayoutBoxNextID);\n pdfLayoutActionView(pdfLayoutBoxNextID);\n pdfLayoutActionToggleActive(pdfLayoutBoxNextID);\n pdfLayoutActionRemove(pdfLayoutBoxNextID);\n } else if (result.status === 'error') {\n $('.action-msg-notification').html('<p><i class=\"fa fa-exclamation-circle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').addClass('error');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n $(container).css('display', 'none');\n $(container + ' .close-btn').unbind('click');\n $(container + ' .' + formSubmitClass).unbind('click');\n $(container + ' .close-btn').remove();\n $(container + ' form').remove();\n $('.pdf-layout-create-btn').removeAttr('disabled');\n } else if (result.status === 'failed') {\n $('.action-msg-notification').html('<p><i class=\"fa fa-exclamation-circle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').addClass('failed');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n $(container).css('display', 'none');\n $(container + ' .close-btn').unbind('click');\n $(container + ' .' + formSubmitClass).unbind('click');\n $(container + ' .close-btn').remove();\n $(container + ' form').remove();\n $('.pdf-layout-create-btn').removeAttr('disabled');\n } else if (result.status === 'warning') {\n $('.action-msg-notification').html('<p><i class=\"fa fa-exclamation-triangle\"></i> ' + result.message + '</p>');\n $('.action-msg-notification').removeClass('success');\n $('.action-msg-notification').removeClass('error');\n $('.action-msg-notification').removeClass('failed');\n $('.action-msg-notification').addClass('warning');\n $('.action-msg-notification').removeClass('hide');\n $('.action-msg-notification').fadeOut({\n duration: 3000,\n complete: () => {\n $('.action-msg-notification').addClass('hide');\n $('.action-msg-notification').removeAttr('style');\n }\n });\n $(container).css('display', 'none');\n $(container + ' .close-btn').unbind('click');\n $(container + ' .' + formSubmitClass).unbind('click');\n $(container + ' .close-btn').remove();\n $(container + ' form').remove();\n $('.pdf-layout-create-btn').removeAttr('disabled');\n }\n });\n });\n }", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.5488685", "text": "render() {\n }", "title": "" }, { "docid": "8a7dc652530a70b7f95d6516c6443142", "score": "0.54858214", "text": "componentDidMount(){\n console.log(\"metodo de react que se ejecuta despues de renderizar el conponente\")\n this.cargarCursos();\n }", "title": "" }, { "docid": "fd94b786d540c82e74765a0bf84d3cb8", "score": "0.54853", "text": "componentDidMount(){\n //console.log(\"el componente fue montado...\");\n this.Obtenertareas();\n }", "title": "" }, { "docid": "de21ca94dcdc43be373c2f89d95a2a74", "score": "0.54829997", "text": "render() {\n this.update();\n }", "title": "" }, { "docid": "4d3ace5847843371d51192fb9eb013a5", "score": "0.5478277", "text": "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 }", "title": "" }, { "docid": "fd5158ba0f2e6c283427fb0b4817cf28", "score": "0.5473174", "text": "render() {\n let name = \"ken\";\n let product = {\n id:1,\n name: 'IphoneX',\n price:100,\n img:\"https://picsum.photos/100/100\"\n }\n\n\n let renderProduct =() =>{\n //Khi nội dung return là component thì phải đc bao phut bới 1 thẻ\n return <div className=\"container\">\n {this.renderSinhVien()}\n <ul>\n <li>Mã số sinh viện: {this.sinhVien.ma}</li> \n <li>Ten sinh viện: {this.sinhVien.ten}</li> \n\n </ul>\n <p>{product.name} </p>\n </div>\n }\n return (\n <div>\n <p id=\"title\">{name}</p>\n <br />\n \n <div className=\"card text-left\">\n <img className=\"card-img-top\" src={product.img} alt={product.img} />\n <div className=\"card-body\">\n <h4 className=\"card-title\">{product.name}</h4>\n <p className=\"card-text\">{product.name}</p>\n </div>\n </div>\n {renderProduct()}\n </div>\n )\n }", "title": "" }, { "docid": "d6feedfea88a0122c922aa57d82d24b5", "score": "0.5473168", "text": "render( ) {\n return null;\n }", "title": "" }, { "docid": "dbc7560841f8db93f45c29cfee0a86d1", "score": "0.5473066", "text": "function o(e) {\n for (var t; t = e._renderedComponent; ) e = t;\n return e;\n }", "title": "" }, { "docid": "795dd61a0c9cb87bbc4719a537121eff", "score": "0.5472826", "text": "render(){\n\n return(\n <p>Registro</p>\n )\n }", "title": "" }, { "docid": "0fc7b06e209f1c69f85461132601ff40", "score": "0.54712945", "text": "function general_render(obj) {\n obj.render();\n }", "title": "" }, { "docid": "6b7db54a9e478830da513491a5b9fef1", "score": "0.5467118", "text": "_render() {\n this._reactComponent = this._getReactComponent();\n if (!this._root) this._root = createRoot(this._container.getElement()[0]);\n this._root.render(this._reactComponent);\n }", "title": "" }, { "docid": "dce1530ae1203ab4aaf91299662560ff", "score": "0.546049", "text": "_render() {\n const loaderInner = htmlHelper.createDivWithClass('');\n this.loader.appendChild(loaderInner);\n }", "title": "" }, { "docid": "214154b790cc64b3910f44538a35e534", "score": "0.54578763", "text": "atualizaNome() //controler\r\n {\r\n this._elemento.textContent = `[${this._idade}] ${this._nome}`;\r\n }", "title": "" }, { "docid": "bc44701b25e5de55ed194b1935a9d954", "score": "0.54552585", "text": "function renderizar(objetoDePersonas) {\n\n\t//crear h1\n\tvar h1Container = document.createElement('h1')\n\t//meter text\n\th1Container.innerHTML = objetoDePersonas.titulo;\n\t//apendearlo en la pantalla\n\tvar contenedorDeTitulo = document.querySelector('header');\n\n\tcontenedorDeTitulo.appendChild(h1Container);\n\n\t//crear ul\n\tvar ul = document.createElement('ul');\n\n\tfor (var i = 0; i < objetoDePersonas.actores.length; i++) {\n\t\n\t\tvar li = document.createElement('li');\n\t\tli.innerHTML = objetoDePersonas.actores[i];\n\t\tul.appendChild(li);\n\n\t}\n\n\tvar section = document.getElementById('personas');\n\tsection.appendChild(ul);\n\n}", "title": "" }, { "docid": "562cc2d6d60248f812d6f809120b2654", "score": "0.5455239", "text": "function component(componentName, data) {\n\t\t// Make sure that the component exists and has a domElement\n\t\tlet component = liquid.create(componentName, data);\n\t\tif (typeof(component.const.domElement) === 'undefined') {\n\t\t\tcomponent.renderAndUpdate();\n\t\t}\n\t\t\n\t\t// Setup child components (to be used when replacing placeholders)\n\t\tcurrentRenderComponent.const.subComponents[component.const.id] = component;\n\t\t\n\t\t// Return placeholder\n\t\treturn `<div component_id = ${ component.const.id }></div>`;\n\t}", "title": "" }, { "docid": "0a27cd613456d8de7df270d7943fefac", "score": "0.54490393", "text": "render() {\n return (\n <section className=\"home\">\n <div className=\"home-container\">\n <div className=\"home-form\">\n <Titulo>Buscador de Peliculas</Titulo>\n <Formulariobusqueda onResults={this.handleResults}></Formulariobusqueda>\n </div>\n\n <div className=\"home-description\">\n { /*si el usuario ingreso el texto de una pelicula a buscar entonces se renderizan los*/}\n {\n this.state.usedSearch\n ? this.renderResults()\n : <h6>Podes buscar peliculas,series y Videojuegos</h6>\n }\n </div>\n\n <div className=\"home-credits\">\n <p><i>\n Aplicacion construida con ReactJS\n </i></p>\n <small>Desarrollador: Almiron Cristian</small>\n \n </div>\n\n </div>\n </section>\n );\n }", "title": "" }, { "docid": "e4fde00acd17096d7d9b3891dde3c6f9", "score": "0.54421467", "text": "render() { return super.render(); }", "title": "" }, { "docid": "bde4de8314187ceb8b827b5e240d867e", "score": "0.54420716", "text": "render() {\n let title = 'CYBERSOFT';\n let imgSrc = 'http://picsum.photos/200/200';\n // binding data là hàm\n const renderImg = ()=>{\n // giá trị hàm muốn render ra giao diện phải trả về chuổi , số, jsx\n return (\n <div className=\"card text-white bg-primary\">\n <img className=\"card-img-top\" src={imgSrc} alt />\n <div className=\"card-body\">\n <h4 className=\"card-title\">{title}</h4>\n <p className=\"card-text\">Text</p>\n </div>\n </div>\n );\n \n }\n \n return (\n <div className=\"container\">\n <div id=\"title\">{title}</div>\n \n <div className=\"w-25\">\n <img src={imgSrc}/>\n </div>\n <input className=\"w-25 form-control\" value={title}/>\n <div>\n {renderImg()}\n </div>\n <h2 className=\"display-5\">Thông tin học viên</h2>\n <ul>\n <li>Mã học viên:{this.hocVien.ma}</li>\n <li>Tên học viên:{this.hocVien.tenHocVien}</li>\n <li>Avata:<img src={this.hocVien.avata} width=\"100\" height=\"100\"></img></li>\n </ul>\n <div className=\"col-2\">\n {this.renderHocVien()}\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "d610758b32f176666b4349cbd6c444bd", "score": "0.5438084", "text": "constructor() {\n super();\n this.renderCoreStyles();\n this.render();\n }", "title": "" }, { "docid": "017a6720245ffe4a23846e16471f78ad", "score": "0.5434654", "text": "render() {\n // Subclasses should override\n }", "title": "" } ]
967019f070c97c23d337fbc6bf1c2c6f
Time O(N) | O(D) where d is the depth; essentially depth is O(log n)
[ { "docid": "c66475a8eeb3b3a417a0b4e97a3afe66", "score": "0.0", "text": "function invertBinaryTreeRecursive(tree) {\n if (!tree) return;\n swapNodeVals(tree);\n invertBinaryTreeRecursive(tree.left);\n invertBinaryTreeRecursive(tree.right);\n return tree;\n}", "title": "" } ]
[ { "docid": "83f953fa51d7b3627aa65243aac3cfa5", "score": "0.7294959", "text": "traverseDepthFirst(fn) {}", "title": "" }, { "docid": "9ce5117b6070b23e0c958731abfe41d6", "score": "0.7239991", "text": "traverseDepthFirstInOrder(fn) {}", "title": "" }, { "docid": "0592fa57ad8b0fac7f6a3727031fd1c1", "score": "0.6632771", "text": "function iterative_deepening_search(initial_state) {\n \n var d = 0;\n while(true){\n let temp = depth_limited_search(initial_state, d);\n if (temp != null){\n return temp;\n }\n ++d;\n }\n}", "title": "" }, { "docid": "af0119406dc03b4649988eb301fa55d8", "score": "0.652048", "text": "minDepth() {\n if (!this.root) return 0;\n let checked = 0;\n let toSearch = [this.root];\n while (toSearch.length) {\n checked++;\n let curr = toSearch.shift();\n if (!curr.left && !curr.right) break;\n if (curr.left) toSearch.push(curr.left);\n if (curr.right) toSearch.push(curr.right);\n }\n return 1 + Math.floor(Math.log2(checked));\n }", "title": "" }, { "docid": "2e2749e88eb64bfa4c0232782d39d10e", "score": "0.6311872", "text": "function dfs(root, level){\n if(!root) return \n if(root.left === null && root.right === null && level >= depth){\n array.push(root.val)\n if(depth < level) depth = level\n } \n \n dfs(root.left, level + 1 )\n dfs(root.right, level + 1)\n }", "title": "" }, { "docid": "fc8aecc0a12fc7ee01a43b2234e8e4d2", "score": "0.6224308", "text": "function depthFirstIter(node) {\r\n let visited = new Set(); // a set doesn't have duplicates (only unique) and it is immutable... can have as many values\r\n let stack = [node];\r\n\r\n while (stack.length) {\r\n let node = stack.pop();\r\n\r\n if (visited.has(node.val)) continue; //checking if already in set\r\n\r\n console.log(node.val);\r\n visited.add(node.val);\r\n\r\n stack.push(...node.neighbors);\r\n }\r\n}", "title": "" }, { "docid": "5c12d42bf31e095568cd4e0cca97e665", "score": "0.61732984", "text": "function findDepth(root, level){\n if(!root) return \n\n if(level > depth) depth = level\n findDepth(root.left, level + 1)\n findDepth(root.right, level + 1)\n }", "title": "" }, { "docid": "d194d85f1ec784e7d23246e164e69b0f", "score": "0.61455894", "text": "traverseDepthFirst(fn) {\n function goDown(node) {\n let status = false;\n if (node.value) {\n status = true;\n }\n if (node.children.length === 0 && status === true) {\n fn(node);\n return;\n }\n\n goDown(node.children[0]);\n }\n goDown(this);\n }", "title": "" }, { "docid": "3640d2e8c0a7bb32c1dcb5fc992efa3d", "score": "0.60894454", "text": "minDepth() {\n let stack = [this.root];\n if (stack[0] === null) return 0;\n let min;\n\n while (stack.length) {\n let current = stack.pop();\n\n current.count += 1;\n\n\n if (current.right !== null) {\n current.right.count = current.count;\n\n stack.push(current.right)\n } else {\n\n if (current.count < min || min === undefined) min = current.count;\n }\n if (current.left !== null) {\n current.left.count = current.count;\n stack.push(current.left)\n } else {\n if (current.count < min || min === undefined) min = current.count;\n }\n\n }\n return min;\n }", "title": "" }, { "docid": "8581dc08c51692038aa2963573da7715", "score": "0.608673", "text": "depth(val){\n\t\tif(undefined === val || null === val){\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet queue = new Queue(), e = null;\n\t\tqueue.enqueue({depth:0, node: this._root});\n\t\t\n\t\twhile( queue.length ){\n\t\t\te = queue.dequeue();\n\t\t\t\n\t\t\tif(val === e.node.val){\n\t\t\t\treturn e.depth;\n\t\t\t}\n\t\t\t\n\t\t\tif(e.node.left)\n\t\t\t\tqueue.enqueue({node: e.node.left, depth:e.depth + 1});\n\n\t\t\tif(e.node.right)\n\t\t\t\tqueue.enqueue({node: e.node.right, depth:e.depth + 1});\n\t\t}\n\t}", "title": "" }, { "docid": "8fb3aecc40648ba0f11620a0050866a3", "score": "0.60813594", "text": "function Depth(obj) {\n var depth = 0;\n if (obj.children) {\n obj.children.forEach(function (d) {\n var tmpDepth = Depth(d)\n if (tmpDepth > depth) {\n depth = tmpDepth\n }\n })\n }\n return 1 + depth\n}", "title": "" }, { "docid": "0db24fb2e1fbf2716a097a4a9ba21165", "score": "0.60313195", "text": "function depthFirst(graph){\n let visited = new Set();\n for (node in graph){\n _depthFirstRecur(node, graph, visited)\n }\n}", "title": "" }, { "docid": "cb6c78b6b3895272ee26831d26251460", "score": "0.60262036", "text": "depthFirstSearch(start) {\n let saw = new Set();\n let arr = [];\n\n function traverse(n) {\n // if there is no vertex\n if (!n) return null;\n\n saw.add(n)\n arr.push(n.value);\n // check if vertex was seen\n n.adjacent.forEach(neighbor => {\n if (!saw.has(neighbor)) {\n return traverse(neighbor);\n }\n });\n // It did not pass test\n /* for (let neighbor of n.adjacent) {\n if (!saw.has(neighbor)) {\n return traverse(neighbor);\n }} */\n }\n\n traverse(start)\n return arr;\n }", "title": "" }, { "docid": "2f4d73813998e22cbae73ef5efa36280", "score": "0.60151744", "text": "function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m]}", "title": "" }, { "docid": "2f4d73813998e22cbae73ef5efa36280", "score": "0.60151744", "text": "function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m]}", "title": "" }, { "docid": "3e1a4a25338084f2ce0e68c2d17aca40", "score": "0.599461", "text": "function nodeDepths2(root) {\n\tlet sumOfDepth = 0;\n\tlet depthStack = [{node: root, depth: 0}];\n\twhile (depthStack.length > 0) {\n\t\tconst {node, depth} = depthStack.pop();\n\t\tsumOfDepth+=depth;\n\t\tif (node.left) depthStack.push({node: node.left, depth: depth + 1});\n\t\tif (node.right) depthStack.push({node: node.right, depth: depth + 1});\n\t}\n\treturn sumOfDepth;\n}", "title": "" }, { "docid": "ef37024ecc0d2a9d2e7e4d4d2c6f1e66", "score": "0.59712267", "text": "minDepth() {\n let count = 0;\n if (!this.root) return count;\n\n let queueToVisit = [this.root];\n while (queueToVisit.length) {\n let currNode = queueToVisit.shift();\n if (!currNode.val) return count;\n else if (!(currNode.left || currNode.right)) return count + 1;\n queueToVisit.push(currNode.left);\n queueToVisit.push(currNode.right);\n count += 1;\n }\n }", "title": "" }, { "docid": "506edacd1e9888cb6c8e9a954e76277e", "score": "0.59648526", "text": "function tree(t) {\n if (!t) { //O(n)\n return 0; //O(n)\n }\n return tree(t.left) + t.value + tree(t.right) //O(n)\n}", "title": "" }, { "docid": "2f5a57e4ff5d83fba4dc676204334599", "score": "0.5962961", "text": "function depthSolved(tacNode) {\n if (tacNode.children.length <= 1) {\n if (!hasGrandParent(tacNode)) { return 0; }\n return 1 + depthSolved(tacNode.parent.parent);\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "7933ed502cf53de90091a168a10f7610", "score": "0.5954032", "text": "_dfs(item, maxDepth = Infinity, traversal = [], _depth = 0) {\n traversal.push({ item, depth: _depth });\n\n if (!this.props.isExpanded(item)) {\n return traversal;\n }\n\n const nextDepth = _depth + 1;\n\n if (nextDepth > maxDepth) {\n return traversal;\n }\n\n const children = this.props.getChildren(item);\n const length = children.length;\n for (let i = 0; i < length; i++) {\n this._dfs(children[i], maxDepth, traversal, nextDepth);\n }\n\n return traversal;\n }", "title": "" }, { "docid": "dbbc994370c7d2512ab2221823313170", "score": "0.5931385", "text": "function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m];}", "title": "" }, { "docid": "dbbc994370c7d2512ab2221823313170", "score": "0.5931385", "text": "function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m];}", "title": "" }, { "docid": "dbbc994370c7d2512ab2221823313170", "score": "0.5931385", "text": "function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m];}", "title": "" }, { "docid": "dbbc994370c7d2512ab2221823313170", "score": "0.5931385", "text": "function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m];}", "title": "" }, { "docid": "c058c2cb1cf29d66f506daf15b84f3e8", "score": "0.5923035", "text": "function breadthTraverse(tree) {\n\tlet buffer = \"\";\n\tif(tree == null) {\n\t\treturn buffer;\n\t}\n\tlet temp = tree;\n\tlet height = 0;\n\twhile(temp != null) {\n\t\ttemp = temp.left;\n\t\t++height;\n\t}\n\tfor(let i = 1; i <= height; ++i) {\n\t\tbuffer += printLevel(tree, i) + \"<br />\";\n\t}\n\treturn buffer;\n}", "title": "" }, { "docid": "0af911c5a2b8a596cfde7bd7d90e53f7", "score": "0.5900519", "text": "function dfs(tree){\n if(tree){\n console.log(tree.value);\n dfs(tree.left);\n dfs(tree.right);\n }\n}", "title": "" }, { "docid": "3a13e71214dca99a2e6a5f14853a0e0f", "score": "0.5880024", "text": "depthFirstSearchIterative(startingVertex) {\n // create a stake to keep track of the vertex(use a list or array)\n const stack = [startingVertex];\n // create a list to store the end result, then return that list at the end.\n const result = [];\n //create object to store visited vertex\n const visited = {};\n // add starting vertex to stack and mark them as visited\n visited[startingVertex] = true;\n // whille stack got something in it\n while (stack.length) {\n console.log(stack);\n //take out or pop the vertex from the stack\n let currentVertexToPopOut = stack.pop();\n //add it to the result list\n result.push(currentVertexToPopOut);\n this.adjacencyList[currentVertexToPopOut].forEach((neighbor) => {\n //if the vertex have not yet been visited, then mark it as visited\n if (!visited[neighbor]) {\n visited[neighbor] = true;\n // push all of it neighbors into the stack\n stack.push(neighbor);\n }\n });\n }\n //return the result array\n console.log(result);\n return result;\n }", "title": "" }, { "docid": "a4a1241fa081cb2e166ca10a79a51e82", "score": "0.5853211", "text": "function deep() { deeper(); }", "title": "" }, { "docid": "f02133b43824dd874585516759135894", "score": "0.58520454", "text": "depthFirstForEach(cb) {\n cb(this.value);\n if (this.left) this.left.depthFirstForEach(cb);\n if (this.right) this.right.depthFirstForEach(cb)\n }", "title": "" }, { "docid": "ed7186a6e8675e5fa53aedc33bbb8667", "score": "0.58314943", "text": "minDepth() {\n\n //initialize a count \n let depth = 0;\n //keep track of the queue\n let queue = [this.root];\n //check if tree is empty\n if (this.root === null) {\n return depth;\n }\n\n //loop while there is something in the queue\n while (queue.length) {\n //keep track of nodes;\n let numOfNodes = queue.length;\n while (numOfNodes > 0) {\n let current = queue.shift();\n //check if there are any children\n if (queue.left === null && queue.right === null) {\n depth++;\n return depth;\n }\n //if there is a left, push\n if (current.left) {\n queue.push(current.left)\n }\n //if there is a right, push\n if (current.left) {\n queue.push(current.left)\n }\n numOfNodes--;\n }\n depth++;\n }\n return depth;\n }", "title": "" }, { "docid": "db0df441bbf03342a13c17ea15afd693", "score": "0.58295196", "text": "function depthFirst(root) {\n let stack = [root];\n while (stack.length) {\n let node = stack.pop();\n console.log(node.val);\n if (node.right) stack.push(node.right);\n if (node.left) stack.push(node.left);\n }\n}", "title": "" }, { "docid": "ac1bbf8c04dd7cf579386c17f65078db", "score": "0.58166003", "text": "depthFirstSearch(start) {\n\t\t// let toVisitQueue = [ start ];\n\t\t// let visited = new Set(toVisitQueue);\n\t\t// while (toVisitQueue.length) {\n\t\t// \tlet currNode = toVisitQueue.shift();\n\n\t\t// \tif (!currNode.adjacent.size) return visited;\n\t\t// \tfor (let vertex of currNode.adjacent) {\n\t\t// \t\tif (!visited.has(vertex)) {\n\t\t// \t\t\ttoVisitQueue.push(vertex);\n\t\t// \t\t\tvisited.add(vertex);\n\t\t// \t\t}\n\t\t// \t}\n\t\t// }\n\n\t\t// return [ ...visited ];\n\t\t// Create an empty stack\n\n\t\tconst stack = [ start ]; //solution code\n\t\tconst result = [];\n\t\tconst visited = new Set();\n\t\tlet currentVertex;\n\n\t\t// visit node\n\t\tvisited.add(start);\n\n\t\t// while there are still neighbors to visit\n\t\twhile (stack.length) {\n\t\t\tcurrentVertex = stack.pop();\n\t\t\tresult.push(currentVertex.value);\n\n\t\t\t// visit neighbors and push onto stack\n\t\t\tcurrentVertex.adjacent.forEach((neighbor) => {\n\t\t\t\tif (!visited.has(neighbor)) {\n\t\t\t\t\tvisited.add(neighbor);\n\t\t\t\t\tstack.push(neighbor);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}", "title": "" }, { "docid": "e9e32a8ada85b0f01086278629dca03c", "score": "0.57987255", "text": "depthInOrder() {\n let data = [];\n let current = this.root;\n\n function traverse(node) {\n if (node.left) traverse(node.left);\n data.push(node.value);\n if (node.right) traverse(node.right);\n }\n\n traverse(current);\n\n return data;\n }", "title": "" }, { "docid": "a0f01cdd3d267f1c8e6c902a132d70ce", "score": "0.5796578", "text": "function dfs(i, ancestors, indices) {\n for (let num of ancestors) {\n const gcd = getGCD(nums[i], num)\n if (gcd === 1) {\n output[i] = indices[num]\n break\n }\n }\n\n if (output[i] === null) output[i] = -1\n ancestors = [nums[i], ...ancestors.filter((x) => x !== nums[i])]\n indices[nums[i]] = i\n for (let next of graph.get(i)) {\n if (output[next] === null) {\n dfs(next, ancestors, [...indices])\n }\n }\n }", "title": "" }, { "docid": "93ce30eb6128dbacbf9750355f5a50d2", "score": "0.57799554", "text": "generateDepthString1() {\n let queue = [];\n\n if (this.root) {\n queue.unshift(this.root);\n }\n\n while (queue.length > 0) {\n let tmpqueue = [];\n let ans = [];\n\n queue.forEach(item => {\n ans.push(item.key);\n item.left ? tmpqueue.push(item.left) : '';\n item.right ? tmpqueue.push(item.right) : '';\n });\n console.log(...ans);\n queue = tmpqueue;\n }\n }", "title": "" }, { "docid": "580131fb6e6be2ef65df78cd21e45bf1", "score": "0.5772888", "text": "depthPreOrder() {\n let data = [];\n let current = this.root;\n\n function traverse(node) {\n data.push(node.value);\n if (node.left) traverse(node.left);\n if (node.right) traverse(node.right);\n }\n\n traverse(current);\n\n return data;\n }", "title": "" }, { "docid": "959c9f56beabb5cb2db2cf9790c7b5c5", "score": "0.57686585", "text": "minDepth() {\n let res = Infinity;\n const findMin = (node, level=1) => {\n if(node && node.left) {\n findMin(node.left, level +1);\n } else {\n res = Math.min(res, level);\n }\n if(node && node.right) {\n findMin(node.right, level +1);\n } else {\n res = Math.min(res, level);\n }\n }\n findMin(this.root);\n return this.root ? res : 0;\n }", "title": "" }, { "docid": "0c6bbda949b6d6382fdb9c27b6877f46", "score": "0.5764325", "text": "depthFirstForEach(cb) {\n cb(this.value); \n if (this.left) this.depthFirstForEach.call(this.left, cb);\n if (this.right) this.depthFirstForEach.call(this.right, cb);\n }", "title": "" }, { "docid": "bd21ef56a6586e2492e865228448320e", "score": "0.5763493", "text": "get depth() { return parseInt( this._base.depth()) }", "title": "" }, { "docid": "8029db8fad97e828c3aaa0be4f637603", "score": "0.5754061", "text": "depthFirstOrder(graph) {\n let marked = Array(graph.length).map(() => false)\n const stack = []\n\n // Run dfs from first vertex.\n // It fills marked array completely if all vertices are connected each other\n for (let i = 0; i < graph.length; i++) {\n if (!marked[i]) {\n dfs(i)\n }\n }\n\n function dfs(vertex) {\n // Mark vertex as visited\n marked[vertex] = true\n\n // Iterate edges of the current vertex\n for (let i = 0; i < graph[vertex].length; i++) {\n // Check if edge vertex is not visited yet\n if (!marked[graph[vertex][i]]) {\n // Re-run function for the current linked vertex\n dfs(graph[vertex][i])\n }\n }\n\n stack.push(vertex)\n }\n\n // Return stack\n return stack.reverse()\n }", "title": "" }, { "docid": "535b983b76fb5cfad1f50ba6765ad694", "score": "0.5750841", "text": "dFirst1() { // iteratively\n let stack = [this.root];\n while (stack.length) {\n let top = stack.pop();\n console.log(top.val);\n if (top.right) stack.push(top.right);\n if (top.left) stack.push(top.left);\n }\n }", "title": "" }, { "docid": "42c0b077f4a2a0eed669529ac3cb11e1", "score": "0.5740262", "text": "function getDepth(object) {\n let depth = 0\n if (object.children) {\n object.children.forEach(function (d) {\n const tempDepth = getDepth(d)\n if (tempDepth > depth) {\n depth = tempDepth\n }\n })\n }\n return 1 + depth\n }", "title": "" }, { "docid": "2cc5b70a6b62dfddfe9788d8542eea18", "score": "0.5735778", "text": "depthFirstSearchInOrder() {\n let visited = [];\n\n function recursiveTraverse(node) {\n if (node.left) recursiveTraverse(node.left);\n visited.push(node.value);\n if (node.right) recursiveTraverse(node.right);\n }\n\n recursiveTraverse(this.root);\n return visited;\n }", "title": "" }, { "docid": "0973cfb9c52eb245032b549abb596518", "score": "0.5735708", "text": "function depthFirstTraverse(root) {\n const stack = [];\n\n stack.push(root); // first in, last out\n\n while(stack.length > 0) {\n let node = stack.pop();\n\n console.log(node.value);\n\n if (node.right) {\n stack.push(node.right);\n }\n\n if (node.left) {\n stack.push(node.left);\n }\n }\n}", "title": "" }, { "docid": "ff2f4fcc644dc5b7bd62a634917838f4", "score": "0.5734075", "text": "function depth_limited_search(initial_state,depth_limit) {\n var stack = [];\n \n stack.push(wrap_dfs_state(initial_state, null, null, 1)); \n while (stack.length != 0 && !is_goal_state(stack[stack.length-1].state)) {\n let state = stack.pop();\n\n if (state.depth < depth_limit) {\n let successors = find_successors(state.state);\n for (var i = 0; i < successors.length; i++) {\n let successor = successors[i];\n stack.push(wrap_dfs_state(successor.resultState, state, successor.actionID, state.depth + 1))\n }\n }\n }\n\n return stack.length == 0 ? null: compute_path(stack[stack.length-1]);\n}", "title": "" }, { "docid": "ba3120e236e8cbb244e719dc5ca395a5", "score": "0.5733285", "text": "dfsRecursive(node) {\n const result = [];\n const seen = {};\n const dfs = (node) => {\n seen[node] = true;\n result.push(node);\n const neighbors = this.adjacencyList[node];\n for (let neighbor of neighbors) {\n if (!seen[neighbor]) {\n dfs(neighbor);\n }\n }\n };\n return result;\n }", "title": "" }, { "docid": "519761f7573089b83f9eca23a7f2ffdc", "score": "0.5730936", "text": "maxDepth() {\n if (!this.root) return 0;\n let count = 1;\n\n let queueToVisit = [this.root];\n while (queueToVisit.length) {\n let currNode = queueToVisit.shift();\n if (currNode.left || currNode.right) {\n count += 1;\n if (currNode.left) queueToVisit.push(currNode.left);\n if (currNode.right) queueToVisit.push(currNode.right);\n }\n }\n return count;\n }", "title": "" }, { "docid": "918d48408a527b23c9086610f87fb353", "score": "0.5726089", "text": "function findDepth(node) {\n //if there are no children, return 1 for depth\n if (node.left === null && node.right=== null) {\n return 1;\n }\n //If no left, run findDepth on right(recurse) adding 1 to depth each time\n if (node.left === null) {\n return findDepth(node.right) + 1\n }\n //If no right, run findDepth on left(recurse) adding 1 to depth each time\n if (node.right === null) {\n return findDepth(node.left) + 1;\n }\n //return the value with the higher depth + 1 for root node\n return (findDepth(node.left) > findDepth(node.right) ? findDepth(node.left) : findDepth(node.right)) + 1\n //If no right, run findDepth on left\n }", "title": "" }, { "docid": "d492a529bd8408728ea73b3f4130d594", "score": "0.5717623", "text": "maxDepth() {\n let stack = [this.root];\n if (stack[0] === null) return 0;\n let max;\n\n while (stack.length) {\n let current = stack.pop();\n\n current.count += 1;\n\n if (current.right !== null) {\n current.right.count = current.count;\n\n stack.push(current.right)\n } else {\n\n if (current.count > max || max === undefined) max = current.count;\n }\n if (current.left !== null) {\n current.left.count = current.count;\n stack.push(current.left)\n } else {\n if (current.count > max || max === undefined) max = current.count;\n }\n\n }\n return max;\n }", "title": "" }, { "docid": "716636a12c0935f33626b0855ae3252c", "score": "0.5704793", "text": "depthFirstSearch(start) {\n const visited = new Set();\n const result = [];\n\n function traverse(vertex) {\n // base case\n if (!vertex) {\n return null;\n }\n // visit node\n visited.add(vertex);\n result.push(vertex.value);\n\n // visit neighbors\n vertex.adjacent.forEach(neighbor => {\n if (!visited.has(neighbor)) {\n return traverse(neighbor);\n }\n });\n }\n\n traverse(start);\n\n return result;\n }", "title": "" }, { "docid": "23c7cf598951980642bc1456ea8b5299", "score": "0.5693648", "text": "function main() {\n let input =\n [[\"dog\", \"mammal\"],\n [\"shark\", \"fish\"],\n [\"cat\", \"mammal\"],\n [\"mammal\", \"animal\"],\n [\"fish\", \"animal\"],\n [\"whitecat\", \"cat\"],\n [\"sheep\", \"mammal\"],\n [\"sparrow\", \"bird\"],\n [\"blacksheep\", \"sheep\"]];\n\n\n let map = {};\n let result = {};\n\n for (let item of input) {\n if (map.hasOwnProperty(item[1])) {\n \n let data = map[item[1]];\n map[item[1]].push(item[0]);\n } else {\n map[item[1]] = [item[0]];\n }\n }\n\n\n let keys = Object.keys(map);\n\n for (let i = 0; i < keys.length; i++) {\n let temp = keys.slice();\n temp.splice(i, 1);\n let count = 0;\n for (let tempKey of temp) {\n if (map[tempKey].length > 0) {\n if (map[tempKey].includes(keys[i])) {\n count++;\n }\n }\n }\n // if parent property call DFS\n if (count == 0) {\n result[keys[i]] = dfs(keys[i]);\n }\n\n }\n\n function dfs(parent) {\n let store = {};\n let children = map[parent];\n if (children) {\n for (let child of children) {\n store[child] = dfs(child);\n }\n }\n\n return store;\n }\n console.log(result);\n}", "title": "" }, { "docid": "791de88f8d4284ec80228047c82ae79c", "score": "0.56911105", "text": "function recurseBuild2d(current, bigObj,depth,dateStart,dateEnd){\n\tvar node = bigObj[current];\n\tvar depthFactor = 5;\n\tif(node.children.length == 0){\n\t\t\tif(node.coord instanceof THREE.Vector3 || ( (dateStart != undefined && dateEnd != undefined) && !(new Date(node.date) >= new Date(dateStart) && new Date(node.date) <= new Date(dateEnd)))){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t// This is a leaf node and so needs to be placed in its relative position\n\t\t\t// based upon depth and breadth\n\n\t\t\t// z is easy as we are building to 2 dimensions\n\t\t\tvar z = 0;\n\t\t\t// x is going to be the maximum depth;\n\t\t\tvar x = (totalDepth * depthFactor)/2;\n\t\t\t// calculate y:\n\t\t\tvar sepFactor = .3;\n\t\t\tvar halved = totalBreadth/2;\n\t\t\tvar relHalf = halved +(halved * sepFactor);\n\t\t\tvar y = relHalf - (leafPlace + (leafPlace * sepFactor));\n\n\t\t\tnode.coord = new THREE.Vector3(x,y,z);\n\n\t\t\t// make a sphere to represent this node, I'll give it a color to indicate\n\t\t\t// that it is a leaf\n\t\t\tvar sphere = createSphere(0xfffc32, current,node.coord);\n\t\t\tfreshNodes.push(sphere);\n\t\t\tleafPlace++;\n\n\t\t\treturn 1;\n\t}\n\n\n\telse{\n\t\tvar childPositions = [];\n\t\tvar childDates = [];\n\t\tfor(var i = 0; i < node.children.length; i++){\n\n\t\t\t\tvar child = node.children[i];\n\t\t\t\t// This handles the case where a node may be recursive\n\t\t\t\tif (child == current){\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tvar recRet = recurseBuild2d(child, bigObj,depth + 1,dateStart, dateEnd);\n\n\t\t\t\t//conlines.push.apply(conlines,recRet);\n\t\t\t\tvar childCoord = bigObj[child].coord\n\t\t\t\t// pull the child's recorded date for comparison\n\t\t\t\tvar childDate = bigObj[child].date\n\t\t\t\t// In some cases the child Coordinate may be NONE or the child\n\t\t\t\t// may not fall within the currently specified date range.\n\t\t\t\tif(childCoord != \"NONE\" && ((dateStart == undefined || dateEnd == undefined)||(new Date(childDate) >= new Date(dateStart) && new Date(childDate) <= new Date(dateEnd)))){\n\t\t\t\t\t\tchildPositions.push(childCoord);\n\t\t\t\t\t\tchildDates.push(childDate);\n\t\t\t\t}\n\n\t\t}\n\t\tvar midPoint = null;\n\t\t// on return from recursion, calculate the midpoint location of this node\n\n\t\t//var midLength = midPoint.length()\n\t\tvar distanceBetweenCenter = 0//firstPoint.clone().sub(secondPoint.center).length();\n\t\t//midPoint.normalize();\n\t\t//midPoint.multiplyScalar( midLength + distanceBetweenCenter * 0.4 );\n\t\tvar avg = 0;\n\n\n\t\t// calculate the date of the current point based upon the date of its children\n\n\n\t\tif(!(dateStart == undefined || dateEnd == undefined)){\n\t\t\tvar highestChildDate;\n\t\t\tfor(var i = 0; i < childDates.length; i++){\n\t\t\t\tif(highestChildDate == undefined){\n\t\t\t\t\thighestChildDate = childDates[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.date = highestChildDate;\n\t\t}\n\n\n\t\t// calculate the midpoint of the current point based upon the location\n\t\t// of its children\n\t\tfor(var i = 0; i < childPositions.length; i++){\n\n\t\t\t// If a midpoint doesnt already exist\n\t\t\tif(midPoint == null){\n\t\t\t\t// if there is only a single child then clone the position of this midpoint\n\t\t\t\t// to be the same as that child only raised slightly more above the surface\n\t\t\t\t// of the earth\n\t\t\t\tif(childPositions.length == 1){\n\t\t\t\t\tmidPoint = childPositions[i].clone();\n\n\t\t\t\t\t// calculate the nodes x position:\n\t\t\t\t\tvar x = depth * 5 - ((totalDepth * 5)/2);\n\t\t\t\t\tmidPoint.setX(x);\n\t\t\t\t\tmidPoint.setZ(0);\n\n\t\t\t\t}\n\t\t\t\t// Otherwise start calculating the midpoint between all of the\n\t\t\t\t// current point's children.\n\t\t\t\telse{\n\t\t\t\t\tvar firstPoint = childPositions[i];\n\t\t\t\t\ti= i + 1;\n\t\t\t\t\tvar secondPoint = childPositions[i];\n\n\n\t\t\t\t\tmidPoint = firstPoint.clone().lerp(secondPoint.clone(),.5);\n\t\t\t\t\tvar x = depth * 5 - ((totalDepth * 5)/2);\n\t\t\t\t\tmidPoint.setX(x);\n\t\t\t\t\tmidPoint.setZ(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tvar nextPoint = childPositions[i];\n\t\t\t\tmidPoint = midPoint.clone().lerp(nextPoint,.5);\n\t\t\t\tvar x = depth * 5 - ((totalDepth * 5)/2);\n\t\t\t\tmidPoint.setX(x);\n\t\t\t\tmidPoint.setZ(0);\n\n\t\t\t}\n\t\t}\n\n\t\t// if at this point the midPoint does not exist then assume that this branch\n\t\t// should not exist. This is likely going to be due to a date restriction.\n\t\tif(midPoint == null){\n\t\t\treturn currentLevel + 1;\n\t\t}\n\n\t\tbigObj[current].coord = midPoint;\n\t\t//\t\tbigObj[current].level = currentLevel;\n\n\t\t// create the node's circle\n\t\tvar sphere = createSphere(0xfff4234, current,midPoint);\n\t\tfreshNodes.push(sphere);\n\n\n\n\t\t//create and push newly made lines\n\t\tfor(var i = 0; i < childPositions.length; i++){\n\t\t\tvar currentGeometry = new THREE.Geometry();\n\t\t\t// determine if the line needs to be curved\n\t\t\tvar distOfLine = midPoint.distanceTo(childPositions[i]);\n\n\n\n\n\n\t\t\tif (distOfLine > 35){\n\t\t\t\tvar linepeak = midPoint.clone().lerp(childPositions[i],.5);\n\t\t\t\t//linepeak.setLength(midPoint.length());\n\n\n\t\t\t\tvar latepeak = linepeak.clone().lerp(childPositions[i],.5);\n\t\t\t\t//latepeak.setLength(midPoint.length());\n\n\t\t\t\t//material.color.setHSL( .4, 0.1, .8 );\n\n\n\t\t\t\tvar lineMat = new THREE.LineBasicMaterial({color: 0xc5c5c5});\n\t\t\t\t//var curve = new THREE.CubicBezierCurve3(midPoint,linepeak,latepeak,childPositions[i]);\n\n\t\t\t\t//var curvePointsOne = segmentLine(midPoint,linepeak,10)\n\t\t\t\t//var curvePointsTwo = segmentLine(linepeak,childPositions[i],15);\n\n\t\t\t\tvar curvePoints = []\n\t\t\t\tcurvePoints.push(midPoint);\n\t\t\t\tcurvePoints.push(latepeak);\n\t\t\t\t//curvePoints = curvePoints.concat(curvePointsOne);\n\t\t\t\t//curvePoints = curvePoints.concat(segmentLine(midPoint,childPositions[i],10));\n\t\t\t\t//curvePoints.push(linepeak);\n\t\t\t\t//urvePoints = curvePoints.concat(curvePointsTwo);\n\t\t\t\tcurvePoints.push(childPositions[i]);\n\n\t\t\t\t// this still needs work but it may be on the right track\n\t\t\t\tvar curve = new THREE.SplineCurve3(curvePoints);\n\n\t\t\t\tcurrentGeometry.vertices = curve.getPoints(50);\n\t\t\t\t//generateParticles(currentGeometry.vertices, curve.getLength());\n\t\t\t\tvar currentLine = new THREE.Line(currentGeometry,lineMat);\n\t\t\t\t//currentLine.name = current + \" -> \" + node.children[i]\n\t\t\t\tfreshLines.push(currentLine);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//currentGeometry.vertices.push(midPoint,childPositions[i]);\n\t\t\t\tvar streightCurve = new THREE.LineCurve3(midPoint,childPositions[i])\n\t\t\t\tcurrentGeometry.vertices = streightCurve.getPoints(50);\n\t\t\t\t//generateParticles(currentGeometry.vertices,streightCurve.getLength());\n\t\t\t\tvar lineMat = new THREE.LineBasicMaterial({color: 0xc5c5c5});\n\t\t\t\tvar currentLine = new THREE.Line(currentGeometry,lineMat);\n\t\t\t\t//currentLine.name = current + \" -> \" + node.children[i]\n\t\t\t\tfreshLines.push(currentLine);\n\t\t\t}\n\n\t\t}\n\t\t//console.log(conlines);\n\t\treturn 1;\n\t}\n\n}", "title": "" }, { "docid": "53cd59f2babbc3d029898ff391ca526c", "score": "0.56743616", "text": "function dfs(root) {\n let left = { maxLevel: 0, diameter: 0 };\n if (root.left) {\n left = dfs(root.left);\n }\n\n let right = { maxLevel: 0, diameter: 0 };\n if (root.right) {\n right = dfs(root.right);\n }\n\n const maxLevel = Math.max(left.maxLevel, right.maxLevel) + 1;\n const diameter = Math.max(left.diameter, right.diameter, left.maxLevel + right.maxLevel);\n return { maxLevel, diameter };\n}", "title": "" }, { "docid": "e41ee7def794b3bfc423c3298bde885a", "score": "0.56739855", "text": "minDepth() {\n if(!this.root){\n return 0;\n }\n\n function findMin(currNode, count = 0){\n count += 1;\n if(!currNode.left && !currNode.right){\n return count;\n }\n\n return Math.min(findMin(currNode.left, count), findMin(currNode.right, count));\n }\n\n return findMin(this.root)\n }", "title": "" }, { "docid": "f085a416b71ddba70ab756b0ba41349a", "score": "0.5667309", "text": "traverseBreadthFirst(fn) {}", "title": "" }, { "docid": "282f4cafc9b902656f0915f64639ebb6", "score": "0.5666017", "text": "function depthCount(branch) {\n if (!branch.children) {\n return 1;\n }\n return 1 + d3.max(branch.children.map(depthCount));\n}", "title": "" }, { "docid": "4129e38e9b3f765eb164e677066205a7", "score": "0.56656396", "text": "minDepth() {\n\n if (!this.root) return 0;\n\n function findMinDepth(node) {\n if (node.left === null && node.right === null) return 1;\n if (node.left === null) return findMinDepth(node.right);\n if (node.right === null) return findMinDepth(node.left);\n return Math.min(findMinDepth(node.left) + 1, findMinDepth(node.right) + 1);\n\n }\n return findMinDepth(this.root);\n\n }", "title": "" }, { "docid": "b9831c41184fb44e7bf3c623b6ec5efd", "score": "0.5657702", "text": "depthPostOrder() {\n let data = [];\n let current = this.root;\n\n function traverse(node) {\n if (node.left) traverse(node.left);\n if (node.right) traverse(node.right);\n data.push(node.value);\n }\n\n traverse(current);\n\n return data;\n }", "title": "" }, { "docid": "4a9ec01b24beba261cfcfd682c489d07", "score": "0.5647904", "text": "countDepth() {\r\n if (this.parent !== null) {\r\n return this.parent.depth + 1;\r\n } else {\r\n return 0;\r\n }\r\n }", "title": "" }, { "docid": "5534461d9c74692911256efdfee8efb0", "score": "0.56406885", "text": "function path(n1, n2) {\n if (n1.id === n2.id) { return [n1]; }\n if (n1.depth < n2.depth) {\n var res = path(n1, n2.parent);\n res.push(n2);\n return res;\n } else if (n1.depth > n2.depth) {\n var res = path(n1.parent, n2);\n res.unshift(n1);\n return res;\n } else {\n var res = path(n1.parent, n2.parent);\n res.unshift(n1);\n res.push(n2);\n return res;\n }\n}", "title": "" }, { "docid": "4fc6499e59313e5a90f732e36af4ad4f", "score": "0.56295866", "text": "depthFirstSearchPostOrder() {\n let visited = [];\n\n function recursiveTraverse(node) {\n if (node.left) recursiveTraverse(node.left);\n if (node.right) recursiveTraverse(node.right);\n // recursion doesn't stop until there's no left and right-- until you've reached a leaf\n visited.push(node.value);\n }\n\n recursiveTraverse(this.root);\n return visited;\n }", "title": "" }, { "docid": "7ee579b86d00a0a8e0d169c0173a8c0f", "score": "0.5616477", "text": "maxDepth() {\n\n //check to see if there is root\n if (this.root === null) return 0;\n\n //function takes in a node \n function findDepth(node) {\n //if there are no children, return 1 for depth\n if (node.left === null && node.right=== null) {\n return 1;\n }\n //If no left, run findDepth on right(recurse) adding 1 to depth each time\n if (node.left === null) {\n return findDepth(node.right) + 1\n }\n //If no right, run findDepth on left(recurse) adding 1 to depth each time\n if (node.right === null) {\n return findDepth(node.left) + 1;\n }\n //return the value with the higher depth + 1 for root node\n return (findDepth(node.left) > findDepth(node.right) ? findDepth(node.left) : findDepth(node.right)) + 1\n //If no right, run findDepth on left\n }\n return findDepth(this.root)\n\n }", "title": "" }, { "docid": "fc2362d6e381155e25b6e7728d446080", "score": "0.5601758", "text": "maxDepth() {\n // no root then we return 0\n if(!this.root) return 0;\n // lets make a function we can call recursively to find the longest chain of depth \n function maxDepthHelper(node){\n // in the case the root node is our only node \n if(node.left === null && node.right === null) return 1;\n // in case we come to a node that has a null left side \n if(node.left === null) return maxDepthHelper(node.right) + 1;\n // and the inverse as well\n if(node.right === null) return maxDepthHelper(node.left) + 1;\n\n return(\n Math.max(maxDepthHelper(node.left),maxDepthHelper(node.right)) + 1\n );\n }\n return maxDepthHelper(this.root);\n }", "title": "" }, { "docid": "cde1d99767d7ed82484ad6bab92a0b86", "score": "0.55996984", "text": "function deepest(node) {\r\n if (!node.data) return null;\r\n\r\n let deep = {level: -1};\r\n const stack = [[node, 0]];\r\n\r\n while (stack.length) {\r\n const [curr, level] = stack.pop();\r\n \r\n if (curr) {\r\n if (level > deep.level) deep = {node: curr, level: level};\r\n \r\n stack.push([curr.left, level + 1], [curr.right, level + 1]);\r\n }\r\n }\r\n\r\n console.log(deep.node.data, deep.level); // leaf and it's depth\r\n}", "title": "" }, { "docid": "f98181ee25fe377f31fda2dcd519453d", "score": "0.55990595", "text": "maxDepth() {\n let res = 0;\n const findMax = (node, level=0) => {\n if(node && node.left) {\n findMax(node.left, level +1);\n } else if(node) {\n res = Math.max(res, 1 + level);\n }\n if(node && node.right) {\n findMax(node.right, level +1);\n } else if(node) {\n res = Math.max(res, 1 + level);\n }\n }\n findMax(this.root);\n return res;\n }", "title": "" }, { "docid": "72b293e80fc1b02a8abaa5b81d0287eb", "score": "0.5591931", "text": "function scanTree(element){return scanLevel(element)||(scanDeep?scanChildren(element):null);}", "title": "" }, { "docid": "223755281aab31af3b54e5faf9d14e3e", "score": "0.55823874", "text": "DFSPostOrder() {\n let visited = [],\n current = this.root;\n function traverse(node) {\n if (node.left) {\n traverse(node.left);\n }\n if (node.right) {\n traverse(node.right);\n }\n visited.push(node.value);\n }\n traverse(current);\n return visited;\n }", "title": "" }, { "docid": "ba06686a161d1e6870eeabe77bc74189", "score": "0.5582183", "text": "function nodeDepths(root, depth = 0) {\n\t// Write your code here.\n\tif (root === null) return 0;\n\treturn depth + nodeDepths(root.left, depth + 1) + nodeDepths(root.right, depth + 1);\n}", "title": "" }, { "docid": "277c94d6631422031de210e023bc7fc5", "score": "0.5578782", "text": "depthFirstSearch(start) {\n //add start into seen Set\n //add neighbours into queue\n //take from start of queue and, if not in seen, add to seen and array\n //add neighbours into queue\n //repeat\n //when queue is empty return array\n\n let nodeQueue = [];\n nodeQueue.push(start);\n let current = nodeQueue.pop();\n if(!seen.has(current)){\n for(let neighbour of current.adjacent){\n console.log(neighbour);\n // nodeQueue.push(neighbour);\n seen.add(neigbour);\n }\nconsole.log(\"seen: \", seen);\n }\n console.log(\"nodeQueue: \", nodeQueue);\n }", "title": "" }, { "docid": "cb5c79f921ff3af381838b0f924db6a5", "score": "0.55778456", "text": "function findDepth()\n {\n maxDepth = 1;\n findDepthR(nodes[0], 1);\n return maxDepth;\n }", "title": "" }, { "docid": "52843b3d8821d4c369775ae084d7d9b5", "score": "0.55725443", "text": "keyPath(id: number, nodes: Immutable.List, memo: Array<number|string> = []): Array<number|string> {\n nodes.forEach((node, i) => {\n if (this.contains(id, node)) {\n memo.push(i);\n var children = node.get('children');\n if (id !== node.get('id') && children && !children.isEmpty()) {\n memo.push('children');\n this.keyPath(id, children, memo);\n }\n return false;\n }\n });\n return memo;\n }\n\n /**\n * Updates the reference cache for a sub-tree at a given node.\n *\n * @param path - A reference path to the node parent.\n * @param node - The node itself.\n * @param i - Index position of the node in the parent \"children\" List.\n */\n pruneCache(path: Immutable.List, node: Immutable.Map, i: number) {\n var children = node.get('children');\n path = this.cache[node.get('id')] = path.push('children', i);\n if (children && !children.isEmpty()) {\n children.forEach((child, i) => {\n this.pruneCache(path, child, i);\n });\n }\n }\n\n /**\n * Calculates a reference path for a specific node id.\n *\n * @param id - The node id.\n */\n find(id: number): Immutable.List {\n var path = this.cache[id] = Immutable.List.of(...this.keyPath(id, this.data));\n return path;\n }", "title": "" }, { "docid": "4b02b131b92a890b2bfc769418874dbc", "score": "0.5572047", "text": "minDepth() {\n if (!this.root) return 0;\n\n function depthPlumber(node) {\n if (node.left === null && node.right === null) return 1;\n if (node.left === null) return depthPlumber(node.right) + 1;\n if (node.right === null) return depthPlumber(node.left) + 1;\n return Math.min(depthPlumber(node.left), depthPlumber(node.right))\n }\n\n return depthPlumber(this.root);\n\n }", "title": "" }, { "docid": "a9fe05acfcfd71a0e8ba0e43c5a5387d", "score": "0.55635756", "text": "dfsInOrder(){\n let result =[]\n const traverse =node =>{\n\n // if left child exists go left again\n if(node.left) traverse(node.left)\n //capture root node value\n result.push(node.value)\n\n // if right child exists go right again \n if(node.right) traverse(node.right)\n \n }\n traverse(this.root)\n\n return result\n}", "title": "" }, { "docid": "122b05afd2de9ff864da883ee558a337", "score": "0.5553311", "text": "function maxDepthHelper(node){\n // in the case the root node is our only node \n if(node.left === null && node.right === null) return 1;\n // in case we come to a node that has a null left side \n if(node.left === null) return maxDepthHelper(node.right) + 1;\n // and the inverse as well\n if(node.right === null) return maxDepthHelper(node.left) + 1;\n\n return(\n Math.max(maxDepthHelper(node.left),maxDepthHelper(node.right)) + 1\n );\n }", "title": "" }, { "docid": "a41b9152dacebf88658e7157342be2c4", "score": "0.5552915", "text": "function breadthFirstSearch(obj,id1,id2,depth){\n var visitedNodes = {}, queue = new Queue();\n queue.enqueue(id1)\n visitedNodes[id1] = id1; //keeps track of already visited nodes so that they are not visited again\n var currDepth = 0; leftTillIncreaseDep = 1; futureTillIncreaseDep = 0; //these counters determine the level being explored\n while (queue.getLength() > 0){\n var id = queue.dequeue();\n if(id === id2){\n return \"trusted\"\n }\n leftTillIncreaseDep -= 1; //every time something is dequeued this variable decreases by one\n var idChildren = obj[id];\n if (idChildren){\n var childrenNodes = findUnvisitedNodes(visitedNodes,idChildren) //prevents from looking at already visited nodes\n futureTillIncreaseDep += childrenNodes.length;\n if (leftTillIncreaseDep === 0){\n currDepth += 1\n if (currDepth > depth){\n return \"unverified\"\n }\n leftTillIncreaseDep = futureTillIncreaseDep;\n futureTillIncreaseDep = 0;\n }\n childrenNodes.forEach((key)=>{\n queue.enqueue(key)\n });\n }\n else{\n if (leftTillIncreaseDep === 0){\n currDepth += 1\n if (currDepth > depth){\n return \"unverified\"\n }\n leftTillIncreaseDep = futureTillIncreaseDep;\n futureTillIncreaseDep = 0;\n }\n }\n }\n}", "title": "" }, { "docid": "811a45d65d5a9852476af850f5110079", "score": "0.555284", "text": "depthFirstSearchRecursive(startingVertex) {\n // create a list to store the result and it will be returned at the end\n const result = [];\n // create object to store visited vertex or nodes\n const visited = {};\n const adjacencyList = this.adjacencyList;\n // create helper function that accepts a vertex .\n (function dfsHelper(vertex) {\n // helper function return in early stage if vertex list is empty\n if (!vertex) {\n return null;\n }\n // place the vertex into the visited object and push it into the result array\n visited[vertex] = true;\n result.push(vertex);\n //loop thru all the values in the adjacencyList for that vertex\n adjacencyList[vertex].forEach((neighbor) => {\n // if any of that value or vertex have not been visited, recursively invoke the function on them so that they should be visited.\n\n if (!visited[neighbor]) {\n return dfsHelper(neighbor);\n }\n });\n })(startingVertex);\n console.log(result);\n return result;\n }", "title": "" }, { "docid": "e5b9b791e7631775b43d53d74b5ee82b", "score": "0.5547998", "text": "function DEPTH(state) {\n var stack = state.stack;\n\n if (DEBUG) console.log(state.step, 'DEPTH[]');\n\n stack.push(stack.length);\n}", "title": "" }, { "docid": "7c21d87cda5d4b1efda67ffcba32c1b0", "score": "0.554694", "text": "function dfs(node) {\n if (!node) {\n return\n }\n \n dfs(node.left)\n arr.push(node.val)\n dfs(node.right)\n}", "title": "" }, { "docid": "0e3a3e3965080048a1e31ad5c011de0a", "score": "0.55423516", "text": "function nodeDepths(root) {\n let stack = [{ node: root, depth: 0 }];\n let sum = 0;\n while (stack.length) {\n let { node, depth } = stack.pop();\n sum += depth;\n if (node.left) stack.push({ node: node.left, depth: depth + 1 });\n if (node.right) stack.push({ node: node.right, depth: depth + 1 });\n }\n return sum;\n}", "title": "" }, { "docid": "4cf351976d636a7366b5fd2e0d702ec8", "score": "0.55371916", "text": "function max_lvl_depth(tmp_arr){\n max_dp = 1.0;\n a = 0;\n for(j = 0 ; j < (tmp_arr.length/3) ; j++){\n if(tmp_arr[a+1]*1.0 > max_dp){\n max_dp = tmp_arr[a+1]*1.0;\n }\n a = a + 3;\n }\n return max_dp;\n}", "title": "" }, { "docid": "1c86effb0727a3b2b12b6ceac7b5cb63", "score": "0.55340254", "text": "function dfs(l, r, c, index, n) {\n if (index === n) \n return 1;\n\n var ans = 0;\n\n for (var i = 0; i < n; i++) {\n var tmp = 1 << i;\n if ((tmp & l) || (tmp & r) || (tmp & c)) continue;\n ans += dfs((tmp | l) << 1, (tmp | r) >> 1, tmp | c, index + 1, n);\n }\n\n return ans;\n}", "title": "" }, { "docid": "e90d0a96803dc929f8c4c0809c0b9e19", "score": "0.5523783", "text": "function listOfDepthsDFS(head) {\n let depths = [];\n function dfs(treeNode, depth = 0) {\n let linkedListNode = depths[depth] || null;\n // Build linked list by adding to the front of it. \n depths[depth] = {\n data: treeNode.data, \n next: linkedListNode\n };\n // If nodes exist, recurse\n if (treeNode.right) {\n dfs(treeNode.right, depth + 1);\n }\n if (treeNode.left) {\n dfs(treeNode.left, depth + 1);\n }\n }\n dfs(head);\n return depths;\n}", "title": "" }, { "docid": "e528b2ad002a2807e20c30e66bdc89e8", "score": "0.55228776", "text": "function computeNodeDepths(iterations) {\n\t // Group nodes by breath.\n\t var nodesByBreadth = d3.nest()\n\t .key(function(d) { return d.x; })\n\t .sortKeys(d3.ascending)\n\t .entries(nodes)\n\t .map(function(d) { return d.values; });\n\n\t //\n\t initializeNodeDepth();\n\t resolveCollisions();\n\t computeLinkDepths();\n\t for (var alpha = 1; iterations > 0; --iterations) {\n\t relaxRightToLeft(alpha *= .99);\n\t resolveCollisions();\n\t computeLinkDepths();\n\t relaxLeftToRight(alpha);\n\t resolveCollisions();\n\t computeLinkDepths();\n\t }\n\n\t function initializeNodeDepth() {\n\t // Calculate vertical scaling factor.\n\t var ky = d3.min(nodesByBreadth, function(nodes) {\n\t return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);\n\t });\n\n\t nodesByBreadth.forEach(function(nodes) {\n\t nodes.forEach(function(node, i) {\n\t node.y = i;\n\t node.dy = node.value * ky;\n\t });\n\t });\n\n\t links.forEach(function(link) {\n\t link.dy = link.value * ky;\n\t });\n\t }\n\n\t function relaxLeftToRight(alpha) {\n\t nodesByBreadth.forEach(function(nodes, breadth) {\n\t nodes.forEach(function(node) {\n\t if (node.targetLinks.length) {\n\t // Value-weighted average of the y-position of source node centers linked to this node.\n\t var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value);\n\t node.y += (y - center(node)) * alpha;\n\t }\n\t });\n\t });\n\n\t function weightedSource(link) {\n\t return (link.source.y + link.sy + link.dy / 2) * link.value;\n\t }\n\t }\n\n\t function relaxRightToLeft(alpha) {\n\t nodesByBreadth.slice().reverse().forEach(function(nodes) {\n\t nodes.forEach(function(node) {\n\t if (node.sourceLinks.length) {\n\t // Value-weighted average of the y-positions of target nodes linked to this node.\n\t var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value);\n\t node.y += (y - center(node)) * alpha;\n\t }\n\t });\n\t });\n\n\t function weightedTarget(link) {\n\t return (link.target.y + link.ty + link.dy / 2) * link.value;\n\t }\n\t }\n\n\t function resolveCollisions() {\n\t nodesByBreadth.forEach(function(nodes) {\n\t var node,\n\t dy,\n\t y0 = 0,\n\t n = nodes.length,\n\t i;\n\n\t // Push any overlapping nodes down.\n\t nodes.sort(ascendingDepth);\n\t for (i = 0; i < n; ++i) {\n\t node = nodes[i];\n\t dy = y0 - node.y;\n\t if (dy > 0) node.y += dy;\n\t y0 = node.y + node.dy + nodePadding;\n\t }\n\n\t // If the bottommost node goes outside the bounds, push it back up.\n\t dy = y0 - nodePadding - size[1];\n\t if (dy > 0) {\n\t y0 = node.y -= dy;\n\n\t // Push any overlapping nodes back up.\n\t for (i = n - 2; i >= 0; --i) {\n\t node = nodes[i];\n\t dy = node.y + node.dy + nodePadding - y0;\n\t if (dy > 0) node.y -= dy;\n\t y0 = node.y;\n\t }\n\t }\n\t });\n\t }\n\n\t function ascendingDepth(a, b) {\n\t return a.y - b.y;\n\t }\n\t }", "title": "" }, { "docid": "1300c0097ceff3813a8b9c845ce35c41", "score": "0.55181074", "text": "function nodeDepths1(root, depth = 0) {\n\tif (!root) return 0;\n\tlet sum = depth + nodeDepths1(root.left, depth + 1) + nodeDepths1(root.right, depth + 1);\n\treturn sum;\n}", "title": "" }, { "docid": "0ab00ae97f7b0e621afda1410915a841", "score": "0.55130166", "text": "DFSPreOrder() {\n let visited = [],\n current = this.root;\n function helper(node) {\n visited.push(node.value);\n if (node.left) {\n helper(node.left);\n }\n if (node.right) {\n helper(node.right);\n }\n return visited;\n }\n return helper(current);\n }", "title": "" }, { "docid": "566527c31cf88a78a8818835418aa16b", "score": "0.54951626", "text": "get depth() {\r\n\t\treturn this._depth;\r\n\t}", "title": "" }, { "docid": "3e747632dc59bf07e6d22c2e93f4c98e", "score": "0.54906493", "text": "function arrayception (array) {\n var maxDepth = 0;\n\n function goDeep (innerArray, depth) {\n debugger;\n if (!Array.isArray(innerArray)) {\n if (depth > maxDepth) {\n maxDepth = depth;\n return;\n }\n }\n for (var i = 0; i < innerArray.length; i++) {\n goDeep(innerArray[i], depth + 1);\n }\n }\n\n goDeep(array, 0);\n\n return maxDepth\n}", "title": "" }, { "docid": "1a1ee3a6bb391b4b32c562f6c2eb9801", "score": "0.54869324", "text": "depthFirstSearchPreOrder() {\n let visited = [];\n\n function recursiveTraverse(node) {\n visited.push(node.value);\n if (node.left) recursiveTraverse(node.left);\n if (node.right) recursiveTraverse(node.right);\n }\n\n recursiveTraverse(this.root);\n return visited;\n }", "title": "" }, { "docid": "0e254c2a1fdad00f9dc304a2446a8605", "score": "0.54822874", "text": "DFSInorder(){\n let results=[]\n function traverse(currentNode){\n if(currentNode.left) traverse(currentNode.left)\n results.push(currentNode.value)\n if(currentNode.right) traverse(currentNode.right)\n }\n traverse(this.root)\n return results\n }", "title": "" }, { "docid": "6642fcfdb77e0a443c3e461d27cb0999", "score": "0.54728", "text": "dfsRecursive(start){\n const results = [];\n const visited = {};\n const adjacencyList = this.adjacencyList;\n \n function dfs(vertex){\n if(!vertex) return null;\n visited[vertex] = true;\n results.push(vertex);\n adjacencyList[vertex].forEach(neighbor => {\n if(!visited[neighbor]){\n return dfs(neighbor);\n }\n });\n }\n dfs(start);\n return results;\n }", "title": "" }, { "docid": "e87243fa498d83a9ac6057e60328cce8", "score": "0.5469539", "text": "function traverse(n) {\r\n let connections = graph.get(n);\r\n connections.forEach( element => {\r\n if(!set.has(element)) {\r\n set.add(element);\r\n traverse(element);\r\n }\r\n })\r\n}", "title": "" }, { "docid": "e49e1d88fb1adb6ecef4ae71386961a7", "score": "0.54691905", "text": "depthFirstSearch(start, visited = new Set(), nodes = []) {\n visited.add(start);\n for (let node of start.adjacent) {\n if (!visited.has(node)) {\n nodes = this.depthFirstSearch(node, visited, nodes);\n }\n }\n nodes.push(start);\n return nodes;\n }", "title": "" }, { "docid": "998bbbfdcf9cf9957751d6818d95e8a3", "score": "0.5468595", "text": "depthFirstSearch (start) {\n\t\tlet toVisitStack = [ start ]; // start by exploring connections from the start\n\t\tlet seen = new Set();\n\t\tlet result = [];\n\t\tseen.add(start);\n\n\t\twhile (toVisitStack.length) {\n\t\t\tlet curr = toVisitStack.pop();\n\t\t\tresult.push(curr.value);\n\n\t\t\tfor (let neighbor of curr.adjacent) {\n\t\t\t\tif (!seen.has(neighbor)) {\n\t\t\t\t\ttoVisitStack.push(neighbor);\n\t\t\t\t\tseen.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "title": "" }, { "docid": "8806d6ca0b49509401824337f3bfa13e", "score": "0.54666984", "text": "function nodeDepths(root) {\r\n var sum = 0;\r\n var queue = [{ node: root, depth: 0 }];\r\n\r\n while (queue.length !== 0) {\r\n var curr = queue.shift();\r\n sum += curr.depth;\r\n\r\n if (curr.node.left) {\r\n queue.push({ node: curr.node.left, depth: curr.depth + 1 });\r\n }\r\n if (curr.node.right) {\r\n queue.push({ node: curr.node.right, depth: curr.depth + 1 });\r\n }\r\n\r\n }\r\n\r\n return sum;\r\n}", "title": "" }, { "docid": "b590992b3f8cc1968b5ff592c936dff6", "score": "0.54604137", "text": "function MTDF_ID(depth) {\n localMTDfIdCount = 0\n let evenFirstGuess = 0\n let oddFirstGuess = 0\n let index\n let isEvenPly = false\n for (let d = 1; d <= depth; ++d) {\n if (isEvenPly) {\n ;({g: evenFirstGuess, index} = MTDF(evenFirstGuess, d))\n } else {\n ;({g: oddFirstGuess, index} = MTDF(oddFirstGuess, d))\n }\n isEvenPly = !isEvenPly\n }\n console.log('MTDF_ID: nodeCount', localMTDfIdCount)\n globalMTDfIdCount += localMTDfIdCount\n return index\n}", "title": "" }, { "docid": "fd0ea64b5bb018013f37ce5337aeb0fc", "score": "0.54561985", "text": "function fillDepth(parent , i , depth) {\n \n // If depth[i] is already filled\n if (depth[i] != 0) {\n return;\n }\n \n // If node at index i is root\n if (parent[i] == -1) {\n depth[i] = 1;\n return;\n }\n \n // If depth of parent is not evaluated before, then evaluate\n // depth of parent first\n if (depth[parent[i]] == 0) {\n fillDepth(parent, parent[i], depth);\n }\n \n // Depth of this node is depth of parent plus 1\n depth[i] = depth[parent[i]] + 1;\n }", "title": "" }, { "docid": "eea0b46dfedb5502ea88f251708b6f08", "score": "0.54555166", "text": "function getLevelDepth(e, id, waypoint, cnt) {\n\tcnt = cnt || 0;\n\tif (e.id.indexOf(id) >= 0) return cnt;\n\tif ($(e).hasClass(waypoint)) {\n\t\t++cnt;\n\t}\n\treturn e.parentNode && getLevelDepth(e.parentNode, id, waypoint, cnt);\n}", "title": "" }, { "docid": "cba1383d5f9e5e3e002e516673b61535", "score": "0.5450999", "text": "function DEPTH(state) {\n const stack = state.stack;\n\n if (exports.DEBUG) console.log(state.step, 'DEPTH[]');\n\n stack.push(stack.length);\n}", "title": "" }, { "docid": "300f59333772805bc5a41371893774cf", "score": "0.5444962", "text": "function getLevelDepth(e, id, waypoint, cnt) {\n cnt = cnt || 0;\n if (e.id.indexOf(id) >= 0) return cnt;\n if (classie.has(e, waypoint)) {\n ++cnt;\n }\n return e.parentNode && getLevelDepth(e.parentNode, id, waypoint, cnt);\n }", "title": "" }, { "docid": "8bc006af80642eef7752785d08b9ba40", "score": "0.5442538", "text": "dfsInOrder(current = this.root) {\n let visited = [];\n if (current) {\n if (current.left) visited = visited.concat(this.dfsInOrder(current.left));\n visited.push(current.val);\n if (current.right) visited = visited.concat(this.dfsInOrder(current.right));\n }\n return visited;\n }", "title": "" }, { "docid": "0445e2dcc7e3fbb2787967a6001adebd", "score": "0.54422355", "text": "function expand1Level(d) {\n var q = [d]; // non-recursive\n var cn;\n var done = null;\n while (q.length > 0) {\n cn = q.shift();\n if (done !== null && done < cn.depth) { return; }\n if (cn._children) {\n done = cn.depth;\n cn.children = cn._children;\n cn._children = null;\n cn.children.forEach(collapse);\n }\n if (cn.children) { q = q.concat(cn.children); }\n }\n // no nodes to open\n }", "title": "" } ]
bc6f208b9eea7bfe3ed887a5848b88d7
const setCategory = new Set(); const setDeckName = new Set(); const setTags = new Set();
[ { "docid": "ef37b3b5b2ba78fe3cae6a6c484291c7", "score": "0.0", "text": "function renderSentences() {\n // Called from immersionkit response, and on settings save\n let examples = state.immersionKitData;\n const exampleLenBeforeFilter = examples.length;\n\n // examples.map((ex) => {\n // setCategory.add(ex.category);\n // setDeckName.add(ex.deck_name);\n // ex.tags.map((t) => setTags.add(t));\n // });\n // console.log(examples[0], setCategory, setDeckName, setTags);\n\n // Filter out excluded titles\n if (state.filterOut.length) {\n examples = examples.filter((s) => {\n for (const f of state.filterOut) {\n if (f instanceof RegExp) {\n if (f.test(s.deck_name)) return false;\n } else {\n if (s.deck_name.toLocaleLowerCase().includes(f.toLocaleLowerCase()))\n return false;\n }\n }\n return true;\n });\n }\n\n if (state.settings.sentenceLengthSort === 'asc') {\n examples.sort((a, b) => a.sentence.length - b.sentence.length);\n }\n\n // Filter selected titles first\n if (state.filterFirst.length) {\n const fn = (s) => {\n let i = 0;\n for (const f of state.filterFirst) {\n if (f instanceof RegExp) {\n if (f.test(s.deck_name)) break;\n } else {\n if (s.deck_name.toLocaleLowerCase().includes(f.toLocaleLowerCase()))\n break;\n }\n i++;\n }\n\n return i;\n };\n examples = examples.sort((a, b) => fn(a) - fn(b));\n }\n\n let showJapanese = state.settings.showJapanese;\n let showEnglish = state.settings.showEnglish;\n let showFurigana = state.settings.showFurigana;\n let playbackRate = state.settings.playbackRate;\n\n const sentencesEl = /** @type {HTMLDivElement} */ (state.sentencesEl);\n\n sentencesEl.onscroll = null;\n\n const ATTR_INDEX = 'data-examples-index';\n sentencesEl.removeAttribute(ATTR_INDEX);\n\n const ATTR_SEARCH = 'data-examples-search';\n sentencesEl.removeAttribute(ATTR_SEARCH);\n\n if (exampleLenBeforeFilter === 0) {\n sentencesEl.innerText = 'No sentences found.';\n } else if (examples.length === 0 && exampleLenBeforeFilter > 0) {\n // TODO show which titles have how many examples\n sentencesEl.innerText =\n 'No sentences found for your selected movies & shows.';\n } else {\n sentencesEl.textContent = '';\n\n const filterExamples = (q) => {\n let filterIn = examples;\n const filterOut = [];\n\n if (q) {\n q.split(/([\\p{sc=Han}\\p{sc=Katakana}\\p{sc=Hiragana}ー]+)/gu).map(\n (s, i) => {\n s = s.trim();\n if (!s) return;\n\n if (i % 2) {\n s = toHiragana(s);\n\n const exExact = [];\n const exRe = [];\n\n const re = new RegExp(\n `${s.replace(/\\p{sc=Hiragana}+/gu, (p) => {\n return `(${Array.from(p)\n .map((_, i) => p.substring(0, i + 1))\n .join('|')})?`;\n })}`,\n );\n filterIn.map((ex) => {\n for (let t of [ex.sentence, ex.sentence_with_furigana]) {\n t = toHiragana(t);\n if (t.includes(s)) return exExact.push(ex);\n if (re.test(t)) return exRe.push(ex);\n }\n filterOut.push(ex);\n });\n\n filterIn = [...exExact, ...exRe];\n } else {\n s = s.toLocaleLowerCase();\n\n filterIn = filterIn.filter((ex) => {\n if (\n [\n ex.deck_name,\n ex.category,\n ...ex.tags,\n ex.translation,\n ].some((t) => t.toLocaleLowerCase().includes(s))\n ) {\n return true;\n }\n filterOut.push(ex);\n });\n }\n },\n );\n }\n\n return { filterIn, filterOut };\n };\n\n const displayEl = document.createElement('div');\n const x = filterExamples(state.queryString);\n examples = [...x.filterIn, ...x.filterOut];\n let subExample = examples;\n\n sentencesEl.append(\n new MakeHTMLElement(\n '<input class=\"quiz-input__input\" autocomplete=\"off\" autocapitalize=\"none\" autocorrect=\"off\" id=\"user-response\" name=\"anime-context-filter\" placeholder=\"Filter\" type=\"text\" enabled=\"true\">',\n ).apply((el) => {\n const inputEl = /** @type {HTMLInputElement} */ (el);\n inputEl.value = state.queryString;\n\n inputEl.oninput = () => {\n subExample = filterExamples(inputEl.value.trim()).filterIn;\n displayEl.setAttribute(ATTR_INDEX, '0');\n displayEl.textContent = '';\n loadExample();\n };\n\n inputEl.onkeydown = (ev) => {\n if (ev.key === 'Enter') {\n const q = inputEl.value.trim();\n if (q) doSearch(q);\n }\n };\n }).el,\n displayEl,\n );\n displayEl.setAttribute(ATTR_INDEX, '0');\n\n const loadExample = () => {\n const idx = Number(displayEl.getAttribute(ATTR_INDEX) || '0');\n if (idx >= subExample.length) return;\n\n const BATCH_SIZE = 10;\n const currentExs = subExample.slice(idx, idx + BATCH_SIZE);\n\n displayEl.setAttribute(ATTR_INDEX, idx + BATCH_SIZE);\n\n for (const example of currentExs) {\n const japaneseText =\n state.settings.showFurigana === 'never'\n ? example.sentence\n : new Furigana(example.sentence_with_furigana).ReadingHtml;\n\n displayEl.append(\n new MakeHTMLElement('div', 'anime-example')\n .apply((a) => {\n a.onclick = function () {\n let audio = /** @type {HTMLAudioElement} */ (\n this.querySelector('audio')\n );\n if (audio.paused) {\n displayEl.querySelectorAll('audio').forEach((a) => {\n a.pause();\n a.currentTime = 0;\n });\n }\n audio.play();\n };\n })\n .append(\n example.image_url\n ? new MakeHTMLElement('img').attr({ src: example.image_url })\n : null,\n new MakeHTMLElement('div', 'anime-example-text').append(\n new MakeHTMLElement('div', 'title')\n .attr({ title: example.id })\n .append(example.deck_name),\n new MakeHTMLElement('div', 'ja').attr({ lang: 'ja' }).append(\n new MakeHTMLElement(\n 'span',\n showJapanese === 'onhover' ? 'show-on-hover' : '',\n showFurigana === 'onhover' ? 'show-ruby-on-hover' : '',\n showJapanese === 'onclick' ? 'show-on-click' : '',\n ).innerHTML(japaneseText),\n new MakeHTMLElement('span').append(\n new MakeHTMLElement(\n 'button',\n 'audio-btn audio-idle fa-solid fa-volume-off',\n ),\n ),\n new MakeHTMLElement('audio')\n .attr({ src: example.sound_url })\n .apply((el) => {\n const a = /** @type {HTMLAudioElement} */ (el);\n a.preload = 'none';\n a.playbackRate = playbackRate;\n\n a.onplay = () => {\n const button = a.parentNode.querySelector('button');\n if (!button) return;\n button.setAttribute(\n 'class',\n 'audio-btn audio-play fa-solid fa-volume-high',\n );\n };\n a.onpause = () => {\n const button = a.parentNode.querySelector('button');\n if (!button) return;\n button.setAttribute(\n 'class',\n 'audio-btn audio-idle fa-solid fa-volume-off',\n );\n };\n }),\n ),\n new MakeHTMLElement('div', 'en')\n .attr({ lang: 'en' })\n .append(\n new MakeHTMLElement(\n 'span',\n showEnglish === 'onhover' ? 'show-on-hover' : '',\n showEnglish === 'onclick' ? 'show-on-click' : '',\n ).append(example.translation),\n ),\n ),\n )\n .apply((el) => {\n el.querySelectorAll('.show-on-click').forEach((a) => {\n a.onclick = function () {\n this.classList.toggle('show-on-click');\n };\n });\n }).el,\n );\n }\n };\n\n displayEl.onscroll = ({ target }) => {\n const { clientHeight, scrollHeight, scrollTop } = target;\n if (clientHeight + scrollTop >= scrollHeight) {\n loadExample();\n }\n };\n loadExample();\n }\n }", "title": "" } ]
[ { "docid": "3fcacfaf7bc64505a9034d5048d54bf6", "score": "0.6841793", "text": "constructor() {\n this.addSet = [];\n this.removeSet = [];\n }", "title": "" }, { "docid": "e75d918bc74597e32fc05699a0e52762", "score": "0.66506875", "text": "function Alfabeto() {\n this.caratteri = new Set();\n}", "title": "" }, { "docid": "497a30d9a465a0d3cba0ab99ade01e10", "score": "0.6343173", "text": "processtagsData(data) {\n let categories = new Set([]);\n let rCategories = [];\n // these must all exist as keys for us to proceed\n for (var i in data) {\n data[i].category = data[i].category ? data[i].category.split(\",\") : [];\n data[i].associatedMaterial = data[i].associatedMaterial\n ? data[i].associatedMaterial.split(\",\")\n : [];\n // trick to dedup the categories using a Set\n data[i].category.forEach((item) => {\n categories.add(item);\n });\n // convert Set to Array for data visualization purposes\n rCategories = [...Array.from(categories)];\n }\n return {\n categories: rCategories,\n data: data,\n };\n }", "title": "" }, { "docid": "f8f3cd713274d0bcfbfb5281a1f5420a", "score": "0.6301963", "text": "function UnionOfSets() {\n\tthis.union_count = {};\n\tthis.sets = {};\n }", "title": "" }, { "docid": "88872ef45a4a1164d24ad239cc2501a7", "score": "0.62852645", "text": "function Set() {\n this.collection = [];\n}", "title": "" }, { "docid": "a0dbf47e20b31df228d4d41a86190082", "score": "0.6178414", "text": "function regenCurrentSet() {\n currentSet = [];\n for (let cat of categories) {\n if (cat.selected) {\n for (let setButton of cat.setButtons) {\n console.log(setButton)\n if (setButton.selected) {\n for (let q of setButton.set) {\n if (!currentSet.includes(q)) {\n currentSet.push(q);\n }\n }\n }\n }\n }\n }\n newQuestion();\n}", "title": "" }, { "docid": "198ba1c75d7ae789ce2f24c4ce4fb77d", "score": "0.6087679", "text": "MagicDictionary() {\n this.set = new Set();\n }", "title": "" }, { "docid": "1ba9b3a86f62c2443a347224658b7d70", "score": "0.60718614", "text": "function Set() {\n this.dataStore = [];\n this.add = add;\n this.remove = remove;\n this.size = size;\n this.display = display;\n this.contains = contains;\n this.union = union;\n this.intersect = intersect;\n this.subset = subset;\n this.difference = difference;\n}", "title": "" }, { "docid": "3833f7fb826b292cb5e88c6e82c54e4b", "score": "0.60442466", "text": "function start(){\n var i;\n for (i = 0; i < puzzles.length; i++){\n categories.push(puzzles[i][1]);\n }\n let unique = [...new Set(categories)];\n var example_set = unique.slice(7, 15);\n document.getElementById(\"category_list\").innerHTML = example_set;\n var start_button = document.getElementById(\"select_button\");\n start_button.onclick = begin_game;\n}", "title": "" }, { "docid": "0916c21557a4fa8600b61a999545cf1a", "score": "0.60361195", "text": "set CustomSet(value) {}", "title": "" }, { "docid": "742ac4abe63e4769ff4e1ab6e849c869", "score": "0.5979247", "text": "get CustomSet() {}", "title": "" }, { "docid": "a7e235db728b724b681bea42fedc3695", "score": "0.5936528", "text": "static initialize(obj, set) { \n obj['set'] = set;\n }", "title": "" }, { "docid": "0e4d0e3081f01f1a276a4e9715f52456", "score": "0.5930824", "text": "function createSet(_ref) {\n var name = _ref.name;\n var pieces = _ref.pieces;\n var upgrades = _ref.upgrades;\n var base_price = _ref.base_price || [];\n var checked = _ref.checked;\n var _ref$individual = _ref.individual;\n var individual = _ref$individual === undefined ? null : _ref$individual;\n\n var itemSet = document.createElement(\"div\");\n var label = document.createElement(\"label\");\n var labelSpan = document.createElement(\"span\");\n var inclusionCheckboxDiv = document.createElement(\"div\");\n var inclusionCheckbox = document.createElement(\"input\");\n var toggleCheckbox = document.createElement(\"input\");\n var tableDiv = document.createElement(\"div\");\n var table = document.createElement(\"table\");\n\n itemSet.setAttribute(\"class\", \"itemSet\");\n label.setAttribute(\"class\", \"setHeader\");\n label.setAttribute(\"for\", name);\n labelSpan.setAttribute(\"class\", \"setFullName\");\n labelSpan.innerHTML = name;\n\n inclusionCheckboxDiv.setAttribute(\"class\", \"setIncluded\");\n inclusionCheckboxDiv.setAttribute(\"title\", 'Include in Item Count\\nRight Click/Long Press to Select/Deselect All');\n inclusionCheckboxDiv.appendChild(inclusionCheckbox);\n inclusionCheckbox.setAttribute(\"type\", \"checkbox\");\n inclusionCheckbox.setAttribute(\"class\", \"inclusionCheckbox\");\n inclusionCheckbox.checked = checked;\n\n toggleCheckbox.setAttribute(\"type\", \"checkbox\");\n toggleCheckbox.setAttribute(\"class\", \"setToggle\");\n toggleCheckbox.setAttribute(\"id\", name);\n toggleCheckbox.checked = true;\n if (name === \"Champion's Tunic\") {\n toggleCheckbox.checked = false;\n }\n\n tableDiv.setAttribute(\"class\", \"setDetails\");\n tableDiv.appendChild(table);\n table.innerHTML = '<tr><th>Base</th><th>Tier 1</th><th>Tier 2</th><th>Tier 3</th><th>Tier 4</th></tr><tr>';\n\n var tr = document.createElement(\"tr\");\n\n // Base Material Cell\n\n var td = document.createElement(\"td\");\n var p = document.createElement(\"p\");\n p.setAttribute(\"class\", \"ingredients\");\n p.setAttribute(\"title\", \"Per Item\");\n p.innerHtml = '';\n for(var i = 0; i < base_price.length; i++) {\n p.innerHTML += base_price[i].name + ' x ' + base_price[i].qty + '<br>'; //Here to 'fix' awkward armor\n }\n td.appendChild(p);\n tr.appendChild(td);\n\n // Upgrade Material Cells\n\n for (var i = 0; i < 4; i++) {\n var td = document.createElement(\"td\");\n var p = document.createElement(\"p\");\n p.setAttribute(\"class\", \"ingredients\");\n if (individual === null || !individual['t' + (i + 1) + 'Head'][1]) {\n p.setAttribute(\"title\", \"Per Item\");\n } else {\n var ingredientString = \"\";\n ingredientString += 'Head - ' + individual['t' + (i + 1) + 'Head'][1].name + '\\n';\n ingredientString += 'Chest - ' + individual['t' + (i + 1) + 'Chest'][1].name + '\\n';\n ingredientString += 'Leg - ' + individual['t' + (i + 1) + 'Leg'][1].name;\n p.setAttribute(\"title\", ingredientString);\n }\n p.innerHTML = upgrades[i][0].name + ' x ' + upgrades[i][0].qty + '<br>'; //Here to 'fix' awkward armor\n p.innerHTML += upgrades[i][1] ? upgrades[i][1].name + ' x ' + upgrades[i][1].qty + '<br>' : '';\n td.appendChild(p);\n tr.appendChild(td);\n }\n\n table.appendChild(tr);\n\n tr = document.createElement(\"tr\");\n \n\n // Base Image Cells\n var td = document.createElement(\"td\");\n for (var j = 0; j < pieces.length; j++) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = 48;\n canvas.height = 48;\n canvas.setAttribute(\"class\", \"item\");\n canvas.setAttribute(\"alt\", pieces[j].type);\n canvas.setAttribute(\"type\", pieces[j].type);\n canvas.setAttribute(\"picX\", pieces[j].x);\n canvas.setAttribute(\"picY\", pieces[j].y);\n canvas[\"desc\"] = name + ' - ' + pieces[j].type;\n canvas[\"set\"] = '' + name;\n canvas[\"ticked\"] = false;\n canvas.setAttribute(\"title\", pieces[j].type);\n canvas.upgrades = base_price;\n\n td.appendChild(canvas);\n }\n\n tr.appendChild(td);\n\n // Upgrade Material Cells\n for (var i = 0; i < 4; i++) {\n var td = document.createElement(\"td\");\n\n for (var j = 0; j < pieces.length; j++) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = 48;\n canvas.height = 48;\n canvas.setAttribute(\"class\", \"item\");\n canvas.setAttribute(\"alt\", pieces[j].type);\n canvas.setAttribute(\"type\", pieces[j].type);\n canvas.setAttribute(\"picX\", pieces[j].x);\n canvas.setAttribute(\"picY\", pieces[j].y);\n canvas[\"desc\"] = name + ' - ' + pieces[j].type;\n canvas[\"set\"] = '' + name;\n canvas[\"ticked\"] = false;\n\n //Allowances for awkward upgrades..\n if (individual === null || !individual['t' + (i + 1) + 'Head'][1]) {\n canvas.setAttribute(\"title\", pieces[j].type);\n canvas.upgrades = upgrades[i];\n } else {\n var ingredientString = '' + individual['t' + (i + 1) + pieces[j].type][1].name;\n canvas.setAttribute(\"title\", ingredientString);\n canvas.upgrades = individual['t' + (i + 1) + pieces[j].type];\n }\n\n td.appendChild(canvas);\n }\n\n tr.appendChild(td);\n }\n\n table.appendChild(tr);\n\n label.appendChild(labelSpan);\n label.appendChild(inclusionCheckboxDiv);\n\n itemSet.appendChild(label);\n itemSet.appendChild(toggleCheckbox);\n itemSet.appendChild(tableDiv);\n\n return itemSet;\n }", "title": "" }, { "docid": "9d9395427f31cf97574589e0a0b9d718", "score": "0.59170437", "text": "function mySet() {\n\t// the var collection will hold the set\n\tvar collection = [];\n\t// this method will check for the presence of an element and return true or false\n\tthis.has = function(element){\n\t\treturn (collection.indexOf(element) !== -1)\n\t};\n\t// this method will return all the values in the set\n\tthis.values = function(){\n\t\treturn collection;\n\t};\n\t// this method will add an element to the set\n\tthis.add = function(element){\n\t\tif (!this.has(element)) {\n\t\t\tcollection.push(element);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\t// this method will remove an element from a set\n\tthis.remove = function(element){\n\t\tif(this.has(element)){\n\t\t\tindex = collection.indexOf(element);\n\t\t\tcollection.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\t// this method will return the size of the set\n\tthis.size = function(){\n\t\treturn collection.length;\n\t};\n\t// this method will return the union of two sets\n\tthis.union = function(otherSet){\n\t\tvar unionSet = new mySet();\n\t\tvar firstSet = this.values();\n\t\tvar secondSet = otherSet.values();\n\t\tfirstSet.forEach(function(e){\n\t\t\tunionSet.add(e)\n\t\t});\n\t\tsecondSet.forEach(function(e){\n\t\t\tunionSet.add(e);\n\t\t});\n\t\treturn unionSet;\n\t};\n\t// this method will return the intersection of two sets\n\tthis.intersection = function(otherSet){\n\t\tvar intersectionsSet = new mySet();\n\t\tvar firstSet = this.values();\n\t\tfirstSet.forEach(function(e){\n\t\t\tif (otherSet.has(e)) {\n\t\t\t\tintersectionsSet.add(e);\n\t\t\t}\n\t\t});\n\t\treturn intersectionsSet;\n\t};\n\t// this method will return the difference of two sets as a new set\n\tthis.difference = function(otherSet){\n\t\tvar differenceSet = new mySet();\n\t\tvar firstSet = this.values();\n\t\tfirstSet.forEach(function(e){\n\t\t\tif(!otherSet.has(e)){\n\t\t\t\tdifferenceSet.add(e);\n\t\t\t}\n\t\t});\n\t\treturn differenceSet;\n\t};\n\t// this method will test if the set is a subset of a different set\n\tthis.subset = function(otherSet){\n\t\tvar firstSet = this.values();\n\t\treturn firstSet.every(function(value){\n\t\t\treturn otherSet.has(value);\n\t\t});\n\t};\n}", "title": "" }, { "docid": "666345d3b33df2f036ed9b2b442c5977", "score": "0.5868058", "text": "function GameObjectSet() {\n this.mSet = [];\n this.mCollisions = [];\n this.mHasCollision = false;\n this.mSelectedObj = 0;\n this.mOutTrash = [0, 0];\n}", "title": "" }, { "docid": "c168c1437cb52900d89aed8490f6aca9", "score": "0.5864932", "text": "function subsets () {\n\n}", "title": "" }, { "docid": "0a8f208499585554fc3010deef66861f", "score": "0.58536196", "text": "function Set(elements) {\n\tthis.bag_ = [];\n\t\n\t//TODO: Maybe extend this class \n\tthis.checkins = 0;\n\tthis.sum = 0.00; \n\tthis.average = 0.00; \n\tthis.max = 0.00; \n\tthis.lat = 0.00; \n\tthis.theLong = 0.00; \n\n\tvar i;\n\n\tif (arguments.length > 0) { // optional args\n\t\tfor (i=0; i < elements.length; i++) {\n\t\t\tthis.add(elements[i]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "babbbad6abf351c3b680c3b55c23c55d", "score": "0.5841097", "text": "function ArraySet(){this._array=[];this._set={};}", "title": "" }, { "docid": "7e3fc5f6cf46db3e1f54c3e38670d36f", "score": "0.5808374", "text": "constructor() {\r\n\t\tthis.builds = new Set();\r\n\t\tthis.buildRanges = new Set();\r\n\t\tthis.layoutHashes = new Set();\r\n\t\tthis.fields = new Set();\r\n\t}", "title": "" }, { "docid": "b352d5a2051bab54acbdd3e8891960c3", "score": "0.5800931", "text": "getSetList(field) {\n let setList = this._entries[field];\n if (setList === undefined) {\n setList = Array.apply(null, Array(this.buckets)).map((x, i) => {\n return new Set()\n });\n this._entries[field] = setList;\n }\n return setList;\n }", "title": "" }, { "docid": "062c5fff28d47506ae693911a8d2e22f", "score": "0.5776306", "text": "extractEntities(set) {\n this._items.forEach(a => set.add(a));\n }", "title": "" }, { "docid": "f33034842b262d8cdb0820d8b33b285d", "score": "0.57513666", "text": "function ArraySet(l){l=l||[];this.o=new Set(l);}", "title": "" }, { "docid": "72328f0185368cfd1224daf226e2b9f0", "score": "0.572616", "text": "function ArraySet(){this._array=[];this._set=Object.create(null);}", "title": "" }, { "docid": "72328f0185368cfd1224daf226e2b9f0", "score": "0.572616", "text": "function ArraySet(){this._array=[];this._set=Object.create(null);}", "title": "" }, { "docid": "72328f0185368cfd1224daf226e2b9f0", "score": "0.572616", "text": "function ArraySet(){this._array=[];this._set=Object.create(null);}", "title": "" }, { "docid": "06f560d5bdef6aed0bca29648bb205c6", "score": "0.5703797", "text": "constructor() {\n\n this.categories = new Categories;\n this.budget = new Budget;\n this.humeur = new Humeur;\n }", "title": "" }, { "docid": "1ab93873b7b70235ed06fbe7601e871c", "score": "0.57012004", "text": "getCommonTagset() {\n const { selectedDatasets, datasets } = this.props;\n\n const rawTagsets = selectedDatasets.map(id => {\n const found = datasets.find(a => Number(a.id) === Number(id));\n const { tags } = found;\n return tags;\n });\n\n //Dedupe\n const tagsets = rawTagsets\n .map(tagset => {\n return Object.entries(tagset).reduce(\n (a, [tag, data]) => (a.push({ [tag]: [...data] }), a),\n []\n );\n })\n .reduce((a, c) => a.concat(c), []);\n\n return Object.values(\n tagsets.reduce(\n (r, c) => ((r[Object.keys(c)[0]] = r[Object.keys(c)[0]] || c), r),\n {}\n )\n );\n }", "title": "" }, { "docid": "c1667935808bcefe4f227e2fab0bd76d", "score": "0.5691071", "text": "constructor() {\n this.active_selection = new Set();\n this.temporary_selection = new Set();\n }", "title": "" }, { "docid": "3c3875e9cad16b874ffae400a8e34db0", "score": "0.56796217", "text": "function mySet(){\n //the collection will hold the set\n var collection = [];\n \n //this method will check for the presence of values and return true or false.\n this.has = function(element){\n return (collection.indexOf(element)!== -1);\n };\n \n //this method will return the values in the set\n this.values = function(){\n return collection;\n };\n\n\n //this method will add an element to the set \n this.add = function(element){\n if(!this.has(element)){\n collection.push(element);\n return true;\n }\n //else condition\n return false;\n };\n\n //this method will remove an element from the list \n this.remove = function(element){\n if(this.has(element)){\n index = collection.indexOf(element)\n collection.splice(index,1);\n return true;\n }\n return false;\n };\n \n //these methods down here are not included in the ES6 implementation of Sets, but are an important aspect of sets. \n \n //this method will return the union of the two sets\n this.union = function(otherSet) {\n var unionSet = new mySet();\n var firstSet = this.values();\n var secondSet = otherSet.values();\n firstSet.forEach(function(e){\n unionSet.add(e);\n });\n \n secondSet.forEach(function(e){\n unionSet.add(e); //.add() does not add any duplicates so we have that problem solved\n })\n \n return unionSet; \n \n };\n //this method will return the intersection of two sets as a new set.\n this.intersection = function(otherSet){\n var intersectionSet = new mySet();\n var firstSet = this.values();\n firstSet.forEach(function(e){\n if(otherSet.has(e)){\n intersectionSet.add(e);\n } \n });\n return intersectionSet;\n };\n \n //this method will return the difference of two sets as a new set. \n this.difference = function(otherSet) {\n var differenceSet = new mySet();\n var firstSet = this.values();\n \n firstSet.for(function(e){\n if(!otherSet.has(e)){\n differenceSet.add(e);\n };\n });\n return differenceSet; \n };\n \n //this method will test if the set is a subset of a different set\n this.subset = function(otherSet){\n var firstSet = this.values();\n return firstSet.every(function(value){\n return otherSet.has(value);\n //the above code will check if the values in the first set are also in the second set\n });\n \n };\n\n} //endset", "title": "" }, { "docid": "7661db9e237a111fb1a0c0582412a394", "score": "0.56779736", "text": "function Set() {\n Set.prototype.constructor.apply(this, arguments);\n}", "title": "" }, { "docid": "d5e962a8dc5d15a24404f0b48b2e8950", "score": "0.5638482", "text": "function populateCategory (){\n var myCategories = [\"Action\", \"Comedy\", \"Documentary\", \"Drama\", \"Educational\", \"Horror\", \"Romance\", \"Television\"];\n var mpaaClasses = [\"(G) Children's\", \"(PG-13) Parental Guidance 13yrs.\",\n \"(R) Restricted\", \"(NC-17) No one under 17yrs.\", \"(NR) Not rated\"]\n \n for (i=0; i < myCategories.length; i++){\n addOption(\"category\",myCategories[i]);\n } // END for i\n \n for (c=0; c < mpaaClasses.length; c++){\n addOption(\"mpaaClassification\",mpaaClasses[c]);\n } // END for c\n \n} // END populateCategory function", "title": "" }, { "docid": "ed6dedf1594f4d20d26f17d0c86fffdc", "score": "0.56279665", "text": "function getDeckList() {\n //const decklist = allCards[WHITE].deckInfo.keys().concat(allCards[BLACK].deckInfo.keys())\n // .map(m => m.replace(\" (white)\", \"\").replace(\" (black)\", \"\")); \n //const uniqueArray = [...new Set(decklist)];\n //return uniqueArray;\n\n const deckDetails = allCards[WHITE].deckInfo.keys().map(function( value, index) {\n return {\n selected:true,\n tags: allCards[WHITE].deckInfo.get(value).tags.split(',').join(', '), \n title:value.replace(\" (white)\", \"\")\n };\n });\n\n return deckDetails;\n}", "title": "" }, { "docid": "3f90be0dd0ab6bd5295b7c773b44f2a7", "score": "0.56233203", "text": "function creatingSetObject(vector) {\n\tlet setNbrs = vector.filter(value => value >= 0 && value <= 15)\n\tsetNbrs.sort((a, b) => a - b);\n\treturn new Set(setNbrs);\n}", "title": "" }, { "docid": "d1119d86e7b3327df11c54cc407e4d80", "score": "0.55957264", "text": "getAllTags() {\n const tags = [];\n \n this.photographerList.forEach((photographer) => {\n photographer.tags.forEach((tag) => {\n tags.push(tag);\n });\n });\n \n return new Set(tags);\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "118cba88f873a647812130cbcaf6fbd1", "score": "0.5581811", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "9cf31e7f02ace7dc0769c38f27494893", "score": "0.55730146", "text": "showSet() {\n // TODO: implement\n }", "title": "" }, { "docid": "6f9689ca384309e97f9b914d089fe946", "score": "0.5561469", "text": "function Set() {\n\t/**\n\t * PRIVATE\n\t * Javascript Array object used to implement the Set object. It is a private attribute\n\t * since it is declared as a var attribute of the Vector object.\n\t */\n\tvar s = new Array();\n\t/**\n\t * PUBLIC\n\t * Ensures that this set contains the specified element (optional operation). Returns\n\t * true if this collection changed as a result of the call. (Returns false if this collection\n\t * does not permit duplicates and already contains the specified element.)\n\t * @param (Object) obj element whose presence in this Set is to be ensured.\n\t * @return (boolean) true if this Set changed as a result of the call.\n\t */\n\tthis.add = function addObjToSet(obj) {\n\t\tvar sz = s.length;\n\t\tif (!this.contains(obj)) {\n\t\t\ts[s.length] = obj;\n\t\t}\n\t\treturn sz != s.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Adds all of the elements in the specified collection to this Set (optional operation).\n\t * @param (Collection) col elements to be inserted into this Set.\n\t * @return (boolean) true if this Set changed as a result of the call\n\t */\n\tthis.addAll = function addAllSet(col) {\n\t\tvar sz = s.length;\n\t\tvar it = col.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tif (!this.contains(obj)) {\n\t\t\t\tthis.add(it.next());\n\t\t\t}\n\t\t}\n\t\treturn sz != s.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Removes all of the elements from this set (optional operation).\n\t */\n\tthis.clear = function clearSet() {\n\t\ts.splice(0, s.length);\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns true if this set contains the specified element.\n\t * @param (Object) obj element whose presence in this set is to be tested.\n\t * @return (boolean) true if this set contains the specified element.\n\t */\n\tthis.contains = function containsObjSet(obj) {\n\t\tvar i;\n\t\tfor (i = 0; i < s.length && s[i] != obj; i++) ;\n\t\treturn i < s.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns true if this set contains all of the elements in the specified collection.\n\t * @param (Collection) col collection to be checked for containment in this set.\n\t * @return (boolean) true if this set contains all of the elements in the specified\n\t * collection.\n\t */\n\tthis.containsAll = function containsAllSet(col) {\n\t\tvar it = col.iterator();\n\t\tvar contained = true;\n\t\twhile (it.hasNext() && contained) {\n\t\t\tcontained = this.contains(it.next());\n\t\t}\n\t\treturn contained;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns true if this set contains no elements.\n\t * @return (boolean) true if this set contains no elements.\n\t */\n\tthis.isEmpty = function isEmptySet() {\n\t\treturn s.length == 0;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns an iterator over the elements in this set.\n\t * @return (Iterator) an Iterator over the elements in this set.\n\t */\n\tthis.iterator = function iteratorSet() {\n\t\tvar it = new Iterator();\n\t\tfor (var i = 0; i < s.length; i++) {\n\t\t\tit.add(s[i]);\n\t\t}\n\t\treturn it;\n\t}\n\t/**\n\t * PUBLIC\n\t * Removes a single instance of the specified element from this set, if it\n\t * is present (optional operation).\n\t * @param (Object) obj element to be removed from this set, if present.\n\t * @return (boolean) true if this set changed as a result of the call.\n\t */\n\tthis.remove = function removeSet(obj) {\n\t\tvar i;\n\t\tfor (i = 0; i < s.length && s[i] != obj; i++) ;\n\t\tif (i < s.length) {\n\t\t\ts.splice(i,1);\n\t\t}\n\t}\n\t/**\n\t * PUBLIC\n\t * Removes all this set's elements that are also contained in the specified\n\t * collection (optional operation). After this call returns, this set will\n\t * contain no elements in common with the specified collection.\n\t * @param (Collection) col elements to be removed from this set.\n\t * @return (boolean) true if this set changed as a result of the call.\n\t */\n\tthis.removeAll = function removeAllSet(col) {\n\t\tvar sz = s.length;\n\t\tvar it = col.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tthis.remove(it.next());\n\t\t}\n\t\treturn sz != s.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Retains only the elements in this set that are contained in the\n\t * specified collection (optional operation). In other words, removes from this\n\t * set all of its elements that are not contained in the specified collection.\n\t * @param (Collection) col elements to be retained in this set.\n\t * @return (boolean) true if this set changed as a result of the call.\n\t */\n\tthis.retainAll = function retainAllSet(col) {\n\t\tvar sz = s.length;\n\t\tfor (var i = s.length - 1; i >= 0; i--) {\n\t\t\tif (!col.contains(s[i])) {\n\t\t\t\ts.splice(i, 1);\n\t\t\t}\n\t\t}\n\t\treturn sz != s.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns the number of elements in this set.\n\t * @return (int) the number of elements in this set.\n\t */\n\tthis.size = function sizeOfSet() {\n\t\treturn s.length;\n\t}\n\t/**\n\t * PUBLIC\n\t * Returns an array containing all of the elements in this set.\n\t * @return (Array) an array containing all of the elements in this set.\n\t */\n\tthis.toArray = function toArraySet() {\n\t\tvar a = new Array();\n\t\tfor (var i = 0; i < s.length; i++) {\n\t\t\ta[i] = s[i];\n\t\t}\n\t\treturn a;\n\t}\n}", "title": "" }, { "docid": "8864790292ac87bfd955f90bc339f8cd", "score": "0.5556892", "text": "function UnionFind() {\n this.count = 0;\n this.sets = [];\n}", "title": "" }, { "docid": "79c3224a1d6c0ba80beb734562464b3d", "score": "0.55517834", "text": "function unique(){const keys=new Set();const tags=new Set();const metaTypes=new Set();const metaCategories={};return h=>{let unique=true;if(h.key&&typeof h.key!=='number'&&h.key.indexOf('$')>0){const key=h.key.slice(h.key.indexOf('$')+1);if(keys.has(key)){unique=false;}else{keys.add(key);}}// eslint-disable-next-line default-case\nswitch(h.type){case'title':case'base':if(tags.has(h.type)){unique=false;}else{tags.add(h.type);}break;case'meta':for(let i=0,len=METATYPES.length;i<len;i++){const metatype=METATYPES[i];if(!h.props.hasOwnProperty(metatype))continue;if(metatype==='charSet'){if(metaTypes.has(metatype)){unique=false;}else{metaTypes.add(metatype);}}else{const category=h.props[metatype];const categories=metaCategories[metatype]||new Set();if(categories.has(category)){unique=false;}else{categories.add(category);metaCategories[metatype]=categories;}}}break;}return unique;};}", "title": "" }, { "docid": "c9ffb9034424e5cfd02a3dfe61d30744", "score": "0.5501511", "text": "function mySet() {\n var collection = [];\n\n this.has = function() {\n return (collection.indexOf() !== -1);\n };\n\n this.values = function() {\n return collection;\n };\n\n this.add = function(ele) {\n if (!this.has) {\n collection.push(ele);\n return true;\n }\n return false;\n };\n\n this.remove = function(ele) {\n if (this.has) {\n var index = collection.indexOf(ele);\n collection.splice(index, 1);\n return true;\n }\n return false;\n };\n\n this.union = function(otherSet) {\n var unionSet = new mySet();\n var firstSet = this.values();\n var secondSet = otherSet.values();\n firstSet.forEach(function(e) {\n unionSet.add(e);\n });\n secondSet.forEach(function(e) {\n unionSet.add(e);\n });\n return unionSet;\n };\n\n this.intersection = function(otherSet) {\n var intersectionSet = new mySet();\n var firstSet = this.values();\n firstSet.forEach(function(e) {\n if (otherSet.has(e)) {\n intersectionSet.add(e);\n }\n });\n return intersectionSet;\n };\n\n this.difference = function(otherSet) {\n var differenceSet = new mySet();\n var firstSet = this.values();\n firstSet.forEach(function(e) {\n if (!otherSet.has(e)) {\n differenceSet.add(e);\n }\n });\n return differenceSet;\n };\n\n this.subset = function(otherSet) {\n var firstSet = this.values();\n return firstSet.every(function(value) {\n return otherSet.has(value);\n });\n };\n}", "title": "" }, { "docid": "4b32c853e41408021fc5b066c3adf050", "score": "0.5492152", "text": "union(set) {\n const newSet = new Set();\n this.values().forEach(value => {\n newSet.add(value);\n })\n set.values().forEach(value => {\n newSet.add(value);\n })\n\n return newSet;\n }", "title": "" }, { "docid": "f43d19eec240ae6fa115b6ee7b903290", "score": "0.5491386", "text": "function mySet() {\r\n var collection = [];\r\n\r\n this.has = function (element) {\r\n return collection.indexOf(element) !== -1;\r\n };\r\n\r\n this.values = function () {\r\n return collection;\r\n };\r\n\r\n this.add = function (element) {\r\n if (!this.has(element)) {\r\n collection.push(element);\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n this.remove = function (element) {\r\n if (this.has(element)) {\r\n var index = collection.indexOf(element);\r\n collection.splice(index, 1);\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n this.size = function () {\r\n return collection.length;\r\n };\r\n\r\n this.union = function (otherSet) {\r\n var unionSet = new mySet();\r\n var firstSet = this.values();\r\n var secondSet = otherSet.values();\r\n firstSet.forEach(function (e) {\r\n unionSet.add(e);\r\n });\r\n secondSet.forEach(function (e) {\r\n secondSet.add(e);\r\n });\r\n return unionSet;\r\n };\r\n\r\n this.intersection = function (otherSet) {\r\n var intersectionSet = new mySet();\r\n var firstSet = this.values();\r\n firstSet.forEach(function (e) {\r\n if (otherSet.has(e)) {\r\n intersectionSet.add(e);\r\n }\r\n });\r\n return intersectionSet;\r\n };\r\n\r\n this.difference = function (otherSet) {\r\n var differenceSet = new mySet();\r\n var firstSet = this.values();\r\n firstSet.forEach(function (e) {\r\n if (!otherSet.has(e)) {\r\n differenceSet.add(e);\r\n }\r\n });\r\n return differenceSet;\r\n };\r\n\r\n // check if this set is subset of other set\r\n this.subset = function (otherSet) {\r\n var firstSet = this.values();\r\n return firstSet.every(function (e) {\r\n return otherSet.has(e);\r\n });\r\n };\r\n}", "title": "" }, { "docid": "25f89b5e0ab42f7e67178f16ded41634", "score": "0.5489363", "text": "function Set(elems){\n\t\tif(typeof elems == \"string\")\n\t\t\tthis.map = stringToMap(elems);\n\t\telse\n\t\t\tthis.map = {};\n\t}", "title": "" }, { "docid": "051dff15c49ef34cc56dca1c335c8ed3", "score": "0.54874486", "text": "parsePermissions() {\n this.permissionSet = {};\n for (let role of Object.keys(this.role.data)) {\n this.permissionSet[role] = new Set(this.permissionArray.data[role]);\n }\n }", "title": "" }, { "docid": "e6a6754d22e32a7bca421d8a21a974b1", "score": "0.5487425", "text": "function SetPolyfill(){\nthis._cache=[];}", "title": "" }, { "docid": "4c8299151dee562154ce46e71cd91d73", "score": "0.548482", "text": "function setCategories (categories) {\n _categories = categories;\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "654def85c027ab0efbdd63850f539f2d", "score": "0.5477646", "text": "function ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}", "title": "" }, { "docid": "223c7d98b78624d5e328d9e115fd3bf3", "score": "0.5472635", "text": "constructor() {\n this.byCode_ = {};\n this.byValue_ = {};\n }", "title": "" }, { "docid": "4ed6774e5240dd4e7c23cb2f5839a1d1", "score": "0.54481906", "text": "function mergeArrays(){\n const arr=[userShows, myShows]\n let jointArray=[]\n arr.forEach(array => {\n jointArray = [ ...jointArray, ...array]\n })\n const newSet= [...new Set([...jointArray])]\n console.log(newSet)\n\n //3. add API request to PUT the selected show to the users API\n usersAPI.postShow(id, {myShows: newSet})\n setAddedResult(true)\n }", "title": "" }, { "docid": "8d82ae86f693f84120f8ab277659ccae", "score": "0.54327106", "text": "constructor(arr) {\n this.set = this._removeDuplicates(arr);\n }", "title": "" }, { "docid": "2c826e5c8542b89b7781affac17e2552", "score": "0.54148793", "text": "function Set(elements) {\n\tthis._values = [];\n\tif (Array.isArray(elements))\n\t\telements.forEach(this.add.bind(this));\n\telse if (elements instanceof Set)\n\t\telements._values.forEach(this.add.bind(this));\n}", "title": "" }, { "docid": "84f8b9c8815e564f1afc5e7ce80fbde0", "score": "0.54115874", "text": "intersection(set) {\n const newSet = new Set();\n\n let largeSet;\n let smallSet;\n if (this.dictionary.length > set.length) {\n largeSet = this;\n smallSet = set;\n } else {\n largeSet = set;\n smallSet = this;\n }\n\n smallSet.values().forEach(value => {\n if (largeSet.dictionary[value]) {\n newSet.add(value);\n }\n })\n\n return newSet;\n }", "title": "" }, { "docid": "e396ae4d557a954b58778bfc9496801c", "score": "0.54106313", "text": "function setIterator(set) {\n // YOUR CODE HERE\n let vals = set.keys();\n return vals;\n\n}", "title": "" }, { "docid": "ccbc8786d011ede42ec0879362f1ccea", "score": "0.5404379", "text": "enterSetType(ctx) {\n\t}", "title": "" }, { "docid": "839d3b7fcab02bb3f9a9533f0a6221d3", "score": "0.5401731", "text": "function Set(initial_items){\n if(initial_items && !_.isObject(initial_items)){\n\tthrow \"the set must be given a list of initial items, or empty arguments\"\n }\n function initialize_items(initial_items){\n\treturn _.chain(initial_items || [])\n\t.map(JSON.stringify) //make hashes\n\t.zip(initial_items) //pair hashes with items\n\t.unique(false,_.first) //not sorted\n\t.reduce(function(list,item_hash_pair){\n\t\t var hash = item_hash_pair[0];\n\t\t var item = item_hash_pair[1];\n\t\t list[hash] = item;\n\t\t return list;\n\t\t},{})\n\t.value();\n }\n\n return (function Trusted_Set(set_items, passed_values){\n\t var items = set_items;\n\t return {\n\t add:function(item){\n\t\t var item_hash = JSON.stringify(item); //only works for sets\n\t\t var new_set = _.clone(items);\n\t\t new_set[item_hash] = item;\n\t\t return Trusted_Set(new_set);\n\t },\n\t remove:function(item){\n\t\t var item_hash = JSON.stringify(item); //only works for sets\n\t\t var new_set = _.clone(items);\n\t\t delete new_set[item_hash];\n\t\t return Trusted_Set(new_set);\n\t },\n\t exists:function(item){\n\t\t var item_hash = JSON.stringify(item); //only works for sets\n\t\t return _.has(items,item_hash);\n\t },\n\t list:function(){\n\t\t return _.values(items);\n\t }\n\t }\n })\n (initialize_items(initial_items || []))\n}", "title": "" }, { "docid": "46ee2a3a8ccbdf32bf9fad3f47754336", "score": "0.53883374", "text": "function ArraySet() {\n this._array = [];\n this._set = {};\n }", "title": "" }, { "docid": "5f191ead039f4491543a16c004cc17a6", "score": "0.53727555", "text": "function createTags(...tags) {\n\treturn [...new Set(flatten(tags))]\n}", "title": "" }, { "docid": "712fd345cb793b5c3587b5322c80714d", "score": "0.537227", "text": "beforeSet(id, size, goal, store) {\n \n }", "title": "" }, { "docid": "4b657aa39aa7923a9f5f710630227d77", "score": "0.5360051", "text": "function SubserviceSet() {\r\n this.set = {\r\n subservice: {},\n psubservice: {},\r\n };\r\n}", "title": "" }, { "docid": "7d07b0de651edd4410ef4532bcb11de2", "score": "0.5345682", "text": "function LightSet(){\n\tthis.mSet = [];\n}", "title": "" }, { "docid": "5f8c162f2282db2c17455deee34dd3c2", "score": "0.5341486", "text": "function introShort(name, age, city) {\n var set = [name, age, city];\n \n console.log('So. Your name is ' + name + '. You are ' +\n + age + ' and your city is ' + city);\n}", "title": "" }, { "docid": "14a927d36f6eedfe06851f31ca8b48ce", "score": "0.53344816", "text": "constructor() {\n this.combinations = [];\n }", "title": "" }, { "docid": "5516353c63ce0b4da39ce0e84ab0a646", "score": "0.53220993", "text": "function ArraySet() {\n\t this._array = [];\n\t this._set = Object.create(null);\n\t}", "title": "" }, { "docid": "5516353c63ce0b4da39ce0e84ab0a646", "score": "0.53220993", "text": "function ArraySet() {\n\t this._array = [];\n\t this._set = Object.create(null);\n\t}", "title": "" }, { "docid": "5516353c63ce0b4da39ce0e84ab0a646", "score": "0.53220993", "text": "function ArraySet() {\n\t this._array = [];\n\t this._set = Object.create(null);\n\t}", "title": "" } ]
a4a9b0d7bff18f7e20d2526fca70e355
Part 1: Fetch data from public JSON API Author: Hartono (Tony) Lim Salim
[ { "docid": "9891eb86881547f1cd1db7ada0f214d4", "score": "0.0", "text": "componentDidMount() {\n // Fetching API and store result as JSON\n fetch(\"https://api.hatchways.io/assessment/students\")\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n isLoaded: true,\n students: result.students,\n studentTags: new Array(result.students.length+1).fill([].fill(null))\n });\n },\n // Catch Errors\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n })\n }", "title": "" } ]
[ { "docid": "904ced19b936a8501cedc7f3748ec867", "score": "0.7204939", "text": "function obtainData () {\n\trequest({\n\t\n\t\t\turl: String(\"http://ratings.food.gov.uk/enhanced-search/^/^/Type/7844/^/\"+ String(pageIndex) +\"/5000/json\"),\n\t\t\tmethod: \"GET\", \n\t\t\theaders: {\"x-api-version\": 2 }\n\t\t\t\n\t\t\t}, function(error, response, body) {\n\t\t\tvar res = {};\n\t\t\tif (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsingleEntry = JSON.parse(body); \n\t\t\t\twriteToJSON (singleEntry, main);\t\n\t\t\t};\n\t\t}\n\t);\n}", "title": "" }, { "docid": "4cbc6cf33a4e29091c27dd9722cbbc1d", "score": "0.70806605", "text": "function getAPIdata() {\n\n var url = \"https://api.openweathermap.org/data/2.5/weather\";\n var apiKey =\"910e837151d5d789f03c6c3cc16cddfb\";\n var city = \"florida\";\n\n // construct request\n var request = url + \"?\" + \"appid=\" + apiKey + \"&\" + \"q=\" + city;\n \n // get current weather\n fetch(request)\n \n // parse to JSON format\n .then(function(response) {\n return response.json();\n })\n \n // render weather per day\n .then(function(response) {\n // render weatherCondition\n onAPISucces(response); \n })\n \n // catch error\n .catch(function (error) {\n onAPIError(error);\n });\n}", "title": "" }, { "docid": "64aa2b200918dc1f10e0bea3b982e34c", "score": "0.70688367", "text": "function fetchAPIData() {\n fetch('https://dog.ceo/api/breeds/list/all')\n .then(function (response) {\n return response.json();\n }).then(function (data) {\n console.log(data);\n\n }).catch(function (error) {\n console.log(error);\n })\n}", "title": "" }, { "docid": "95568c494776cbdd9adc5a7807a21087", "score": "0.7060283", "text": "function apiCall() {\n fetch(\"https://data.nasa.gov/resource/gh4g-9sfh.json\")\n .then(checkStatus)\n .then(res => res.json())\n .then(data => {\n meteorInfo = data;\n populateData(meteorInfo);\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "3f91d3bd0e9aa3e642bc783118f783da", "score": "0.7038835", "text": "function getAPIdata() {\n\tvar url = 'https://api.openweathermap.org/data/2.5/forecast';\n\tvar apiKey ='f31545b9705649d0e5327a3267bd2690';\n\tvar city = 'netherlands';\n\n\t//variabele uitvoering\n\tvar request = url + '?' + 'appid=' + apiKey + '&' + 'q=' + city;\n\n\t//weer aanvragen\n\tfetch(request)\n\n\t.then(function(response) {\n\t\tif(!response.ok) throw Error(response.statusText);\n\t\treturn response.json();\n\t})\n\n\t.then(function(response) {\n\t\tconsole.log(response);\n\t\tonAPISucces(response);\n\t})\n\t\n\t.catch(function (error) {\n\t\tconsole.error('Request failed', error);\n\t});\n}", "title": "" }, { "docid": "a16214ecbf2770843e0bd7c2d9a3608e", "score": "0.7033623", "text": "function getData() {\n var url =\n \"https://www.rijksmuseum.nl/api/nl/collection?key=GJXUiTlF&format=json&type=schilderij&ps=100&f.normalized32Colors.hex=%20%23737C84&imgonly=true\";\n fetch(url)\n .then(response => {\n var response = response.json();\n return response;\n })\n .then(data => {\n var filteredData = getFilteredData(data);\n return filteredData;\n })\n .then(filteredData => {\n var elements = createElements(filteredData);\n })\n .catch(error => {\n console.log(error);\n });\n}", "title": "" }, { "docid": "fea0d20511fa92989356e59d8220da63", "score": "0.69609696", "text": "function getDataFromApi(artist, title) {\n\n console.log(`Getting lyrics for ${title}, by ${artist}`);\n\n const url = `https://api.lyrics.ovh/v1/${artist}/${title}`;\n\n fetch(url)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText); \n })\n .then(responseJson => displaySearchData(responseJson))\n .catch(err => {\n console.log(err);\n });\n}", "title": "" }, { "docid": "ce6f6ff96ff8898a11e949ad2dcc3acb", "score": "0.6957629", "text": "function fetchdata() {\n var n_src = new Array(\"associated-press\", \"bbc-news\", \"the-times-of-india\", \"bloomberg\", \"cnbc\", \"cnn\", \"the-next-web\", \"bbc-sport\", \"national-geographic\", \"reuters\", \"daily-mail\", \"the-hindu\", \"espn-cric-info\", \"\");\n var picker = 0;\n picker = random(12);\n var n = ceil(picker);\n source = n_src[n];\n\n urla = api_a + source + sortBy + sortingValue + api_key_a;\n loadJSON(urla, gotData);\n\n}", "title": "" }, { "docid": "406c84a650c647eab6b5fbe59d6c81d0", "score": "0.69456536", "text": "function dataFetcher (url) {\n fetch(url, {\n headers: {\n 'X-API-Key': 'KTp3E1dke3t7dTkaFLQNEtygiQSg1e9ThL6VBUzQ' } \n })\n .then(response => response.json())\n .then(data => {\n //For more clarity, I create a variable\n var apiResponse = data.results[0].members\n //I call function needed for render the information \n dataSet(apiResponse)\n })\n}", "title": "" }, { "docid": "fd51df9ce7cbd0c7932f7c5e31006408", "score": "0.69416535", "text": "function getAPIdata() {\n \n var country = searchCountry ? searchCountry : 'Netherlands'; //Dit kleine stukje code heb ik van een klasgenoot, omdat ik hier helemaal op vast liep.\n\t// construct request. ${ } gebruik ik op twitch.tv altijd om commands te creëren als er een variabel aangeroepen moet worden (ik bedoel iets dat veranderd) zoals een username.\n\tvar request = `https://restcountries.eu/rest/v2/name/${country}?fullText=true`;\n\n\t// get current country\n\tfetch(request)\t\n\t\n\t// parse response to JSON format\n\t.then(function(response) {\n\t\treturn response.json();\n\t})\n\t\n\t// do something with response\n\t.then(function(response) {\n var country = document.getElementById('country').innerHTML = response[0].name;\n var language = document.getElementById('language').innerHTML = response[0].languages[0].name;\n\t});\n}", "title": "" }, { "docid": "9ff4ab9045632337c6a7d263fa65fc4d", "score": "0.68848854", "text": "async function retrieveData(){\n const url = `https://api.nasa.gov/planetary/apod?api_key=${apiKey}`;\n try {\n // call API \n const response = await fetch(url, reqInit);\n // get JSON data as response from api call\n const json = await response.json();\n\n console.log(json);\n\n displayData(json);\n\n } catch(err){\n console.log(err);\n }\n}", "title": "" }, { "docid": "09a3b67db5cc0c30995c73c650e14c6a", "score": "0.68558824", "text": "function fetchData() {\n const url = `https://www.omdbapi.com/?apikey=6d404629&t=${movie}`;\n\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n console.log(data);\n updateResult(data);\n });\n}", "title": "" }, { "docid": "e708444343372260ba9512a4eacb89b1", "score": "0.6842158", "text": "getData() {\n this.setState({ loaded: false, error: null });\n fetch(api + \"?title=\" + this.state.title + \"&exact=0\", {\n method: \"GET\",\n headers: {\n \"x-rapidapi-host\": \"cheapshark-game-deals.p.rapidapi.com\",\n \"x-rapidapi-key\": \"6745ace80bmsh67331336bd67405p133c83jsnc9bdba53b6a7\",\n },\n })\n .then((response) => response.json())\n .then(this.showData)\n .catch(this.somethingWentWrong);\n }", "title": "" }, { "docid": "97116f977aa61b671aa168a0d6c12bee", "score": "0.6813316", "text": "async function getapi(){\r\n \r\n let response = await fetch('https://opentdb.com/api.php?amount=50&type=multiple'); // fetches data from API and returns a promise\r\n\r\n data = await response.json(); // stores the api data into JSON format\r\n \r\n useData(data)\r\n \r\n \r\n}", "title": "" }, { "docid": "d9a23c9a2507c06254a1df9976b8f1ab", "score": "0.6773608", "text": "function getdata(url) {\r\n fetch(url)\r\n .then((res) => res.json())\r\n .then((res) => {\r\n display(res.results);\r\n });\r\n}", "title": "" }, { "docid": "6ebfaebe8083cc3ca2ed9d46c676f40f", "score": "0.67670536", "text": "function get_data_for_lordoftherings() {\n\tvar xhr = new XMLHttpRequest();\n\tvar url = \"https://www.omdbapi.com/?apikey=ede4d490&s=\";\n\tvar key = \"lord of the rings\";\n\txhr.open(\"GET\", url + key);\n\txhr.send();\n\txhr.onload = function () {\n\t\tif (xhr.status == 200) {\n\t\t\tvar response = JSON.parse(xhr.response).Search;\n\t\t\tfor (i = 0; i < 4; i++) {\n\t\t\t\tvar data = response[i].Poster;\n\t\t\t\tdisplay_data_lordoftherings(data);\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Error code is\" + xhr.sta);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "90d9cc48282c2e5af279a786726c4c98", "score": "0.6745394", "text": "function fetchJSON () {\n // get data from the API AND\n fetch(jsonURL)\n // when it is done, convert response from JSON string to JavaScript data structure AND\n .then(response => response.json())\n // when it is done, display rsults on map\n .then(displayPins)\n // if there is an error, report it\n .catch(error => console.error(error));\n}", "title": "" }, { "docid": "654eaddc4d8eab72c8131f5d00ae3067", "score": "0.6742052", "text": "async function getData(url = '', data = {}) {\n // Default options are marked with *\n const accessToken = await getAccessTokenSilently({\n audience: `fitStat`,\n });\n \n const response = await fetch(url, {\n method: 'GET', // *GET, POST, PUT, DELETE, etc.\n mode: 'cors', // no-cors, *cors, same-origin\n cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n credentials: 'same-origin', // include, *same-origin, omit\n headers: {\n 'Authorization': `Bearer ${accessToken}`\n // 'Content-Type': 'application/x-www-form-urlencoded',\n },\n redirect: 'follow', // manual, *follow, error\n referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url\n });\n return response.json(); // parses JSON response into native JavaScript objects\n }", "title": "" }, { "docid": "445e203c48985bdd1b0c11b4f919847e", "score": "0.6711366", "text": "function getData() {\n fetch(mergedAPI)\n .then(resp => resp.json())\n .then(resp => {\n fetchData(resp);\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "8614c1997c126025e1318c2a5c79c64f", "score": "0.670981", "text": "function fetchAPI() {\n\n\tvar symbol = \"\";\n\tvar args = \"/v2/reference/tickers\" + symbol;\n\tvar params = \"\";\n\n\n\tvar apiKey = \"8twJeoNW9ilnBJw_2GV1pBB1OZnFFU_p\";\n\tvar url = \"https://api.polygon.io\" + args + \"?apiKey=\" + apiKey + params;\n\tconsole.log(url);\n\n\tfetch(url) // fetching the data\n\t.then((resp) => resp.json())\n\t.then(function data(data) {\n\t\tconsole.log(data) // output of data\n\n\t});\n}", "title": "" }, { "docid": "a6c7d50a1d7ff8c530bd5cd3fa1f6d61", "score": "0.6707524", "text": "function personsGetAll() {\n\n fetch('https://pam-2019-a1webapi.herokuapp.com/api/persons')\n .then(response => response.json())\n .then(data => {\n buildTable(data);\n })\n .catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "b21202aafd23eb78939bdb7db6665367", "score": "0.6668314", "text": "function getJson() {\n\n $.when($.get(apiUrl)).then(function(json, textStatus, xhr) {\n\n // In case the data loading takes some time and the server returns a 202 status,\n // (i.e. the json wasn't returned) wait 5 seconds an try again until the server responds with 200.\n if (xhr.status === 202) {\n setTimeout(function () {\n getJson();\n }, 5000);\n\n } else if (json && json.vehicles) {\n var data = (typeof json === 'string') ? JSON.parse(json) : json;\n\n if (data.vehicles.length > 0) {\n getResultSet(data.vehicles, NAOptions);\n } else {\n dispatcher.post('error', 'Error, no json data');\n }\n\n // Hide the overlay that prevents user input and the loading animation.\n enableUserInput();\n\n } else {\n dispatcher.post('error', 'Error loading data');\n enableUserInput();\n }\n }).fail(function() {\n dispatcher.post('error', 'Error loading data');\n enableUserInput();\n });\n }", "title": "" }, { "docid": "e09f13c5516ed6737ba1a99186f44afc", "score": "0.6639999", "text": "async function main() {\n\tconst response = await fetch(\"https://icanhazdadjoke.com\", {\n\t\theaders: {\n\t\t\tAccept: \"application/json\",\n\t\t},\n\t});\n\tconst jokeData = await response.json();\n\tconsole.log(jokeData.joke);\n}", "title": "" }, { "docid": "accea6c18e7d698fb3cc984424e60523", "score": "0.66374224", "text": "function disneyJson()\r\n{\r\n\r\n const api_url = 'https://apidojo-yahoo-finance-v1.p.rapidapi.com/stock/v2/get-summary?symbol=dis&region=US';\r\n async function getStock(){\r\n\r\n const response = await fetch(api_url, {\r\n\t \"method\": \"GET\",\r\n\t \"headers\": {\r\n\t\t \"x-rapidapi-key\": \"e86d445741mshb7b549bb3b24c95p1d6a71jsndd2b8da16354\",\r\n\t\t \"x-rapidapi-host\": \"apidojo-yahoo-finance-v1.p.rapidapi.com\"\r\n\t }\r\n })\r\n const data = await response.json();\r\n\r\n document.getElementById('Disney').textContent = data.price.regularMarketOpen.raw;\r\n console.log(data);\r\n }\r\n getStock();\r\n}", "title": "" }, { "docid": "e31aba79843e9a19c872c3a1ed85a0dc", "score": "0.66245115", "text": "function getWhereToWatch() {\n fetch(\"https://utelly-tv-shows-and-movies-availability-v1.p.rapidapi.com/idlookup?source_id=\" + sourceID + \"&source=tmdb&country=us\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"45e2d343b0mshb21a1f4fd6e6d29p166b41jsnb915ef76a153\",\n \"x-rapidapi-host\": \"utelly-tv-shows-and-movies-availability-v1.p.rapidapi.com\"\n }\n }).then(function(response) {\n response.json().then(function(data) {\n console.log(data);\n });\n });\n}", "title": "" }, { "docid": "d3f880aa042719065de72b390619fc72", "score": "0.6618911", "text": "async function getAPIData(url){\n const res = await fetch(url);\n const wetherJson = await res.json();\n return wetherJson.main.temp;\n}", "title": "" }, { "docid": "afd75b9fdb1236031fd3e730b0af35aa", "score": "0.6613827", "text": "async function get(data) {\n const url = new URL(`https://www.bungie.net/Platform/${data.uri}`);\n // Normalize components as an array.\n if (data.components) {\n data.components = Array.isArray(data.components) ? data.components : [data.components]\n url.searchParams.set('components', data.components.join(','))\n }\n\n const response = await fetch(url, {\n headers: { 'X-API-Key': apiKey }\n }).catch(e => {\n console.error(e);\n });\n return response.json();\n}", "title": "" }, { "docid": "2d0c74f9be1209e9f22a2cd41038ae46", "score": "0.66131324", "text": "getApiData() {\n fetch(`https://www.ifixit.com/api/2.0/wikis/CATEGORY?offset=${this.state.page * 12}&limit=12`)\n .then(res => res.json())\n .then(\n (result) => {\n\n this.setState({\n isLoaded: true,\n data: result\n });\n },\n\n (error) => {\n this.setState({\n isLoaded: true,\n error\n });\n }\n );\n }", "title": "" }, { "docid": "36a37af706bbbea23f8812d4a0b2a48b", "score": "0.66075325", "text": "function getResult(){\r\n fetch(`https://real-time-google-search.p.rapidapi.com/search?q=${mySearch}`, {\r\n\t\"method\": \"GET\",\r\n\t\"headers\": {\r\n\t\t\"x-rapidapi-key\": \"MY_API_KEY\",\r\n\t\t\"x-rapidapi-host\": \"real-time-google-search.p.rapidapi.com\"\r\n\t}\r\n})\r\n.then((response) => {\r\n response.json().then((res)=>{\r\n // console.log(response);\r\n // console.log(res);\r\n setData([res.data])\r\n console.log(data);\r\n \r\n\t\r\n})\r\n})\r\n }", "title": "" }, { "docid": "7a515bbad8ff4235f643629583c3b09f", "score": "0.6603551", "text": "async fetchJSON(url) {\n let ret = await fetch('api/v1/'+url)\n return await ret.json()\n }", "title": "" }, { "docid": "e697f97ed318c6655a5d0f0bd67187c2", "score": "0.65993", "text": "function obtain_data() {\n fetch('/api')\n .then(response => {\n return response.json()\n })\n .then(data => {\n create_table(data);\n suggest_id(data)\n })\n}", "title": "" }, { "docid": "66fa35bfb956e80ce5d02ff650efa1c4", "score": "0.65960735", "text": "function fetchAPI(url) {\n\treturn fetch(url)\n\t\t.then((response) => {\n\t\t\tif (response.ok) {\n\t\t\t\treturn response\n\t\t\t\t\t.json()\n\t\t\t\t\t.then((data) => {\n\t\t\t\t\t\tfor(i=0;i<10;i++){\n\t\t\t\t\t\t\tdata.push(data[i%2])\n\t\t\t\t\t\t }\n\t\t\t\t\t\t// console.log(data);\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t})\n\t\t\t\t\t.catch((err) => {\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn response\n\t\t\t\t\t.text()\n\t\t\t\t\t.then((data) => {\n\t\t\t\t\t\t// console.log(data);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\terror: \"Encountered an error. Please reload\",\n\t\t\t\t\t\t\t\tmessage: data,\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.catch((err) => {\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t});\n\t\t\t\tthrow \"Something went wrong\";\n\t\t\t}\n\t\t})\n\t\t.catch((error) => {\n\t\t\tconsole.log(error);\n\t\t});\n}", "title": "" }, { "docid": "1a8f7d7986db55608d017886eb76b8e2", "score": "0.6587854", "text": "async function api_fetch()\r\n{\r\n //Generating random number \r\n var n = Math.floor(Math.random() * 1330) + 1;\r\n \r\n // appending the generated random number with url to fetch the data\r\n let res = await fetch(`https://api-thirukkural.vercel.app/api?num=${n}`);\r\n let data = await res.json();\r\n console.log(data);\r\n // DOM Manipulation\r\n no.innerHTML = `குறள் எண்: ${n}`;\r\n sect_tam.innerHTML =`பால்: ${data.sect_tam}`;\r\n chapgrp_tam.innerHTML = `இயல்: ${data.chapgrp_tam}`;\r\n chap_tam.innerHTML = `அதிகாரம்: ${data.chap_tam}`;\r\n l1.innerHTML = data.line1;\r\n l2.innerHTML = data.line2;\r\n t_exp.innerHTML = data.tam_exp;\r\n\r\n n1.innerHTML = `Kural No: ${n}`;\r\n sect_eng.innerHTML = `Section: ${data.sect_eng}`;\r\n chapgrp_eng.innerHTML = `Chapter Group: ${data.chapgrp_eng}`;\r\n chap_eng.innerHTML = `Chapter : ${data.chap_eng}`;\r\n kural_eng.innerHTML = data.eng;\r\n eng_exp.innerHTML = data.eng_exp;\r\n}", "title": "" }, { "docid": "46443546b3a8ebb5ea9927709ba5fd03", "score": "0.6586674", "text": "function get(){\n window.fetch(`${BASE_URL}`, {\n method: 'GET',\n headers: {\n Accept: 'application/json'\n },\n })\n .then((response )=> response.json())\n .then((data )=> {\n getReturnedData(data)\n })\n .catch((err) => console.log(err))\n}", "title": "" }, { "docid": "d05560918665ab7006625e251e3f74ed", "score": "0.65843827", "text": "function getFetch(){\n fetch(URL)\n .then(res => res.json())\n .then(json => {\n iterateJson(json)}\n )\n}", "title": "" }, { "docid": "eb015093c1973c53399b612fb0e9a29c", "score": "0.65756726", "text": "function GET (webURL, apiURL, callback) {\n var fullURL = webURL + apiURL\n var results = []\n function loadData () {\n $.ajax({\n url: fullURL,\n type: 'GET',\n headers: { 'Accept': 'application/json;odata=verbose' },\n success: function (data) {\n if (data.d.results) {\n $.merge(results, data.d.results)\n if (data.d.__next) {\n fullURL = data.d.__next\n loadData()\n } else {\n callback(results)\n }\n } else {\n callback(data.d)\n }\n },\n error: function (response) {\n console.log('error: ' + JSON.stringify(response))\n }\n })\n }\n loadData()\n}", "title": "" }, { "docid": "1cfbff26b6ff0e0fb3c9218fe1fb9430", "score": "0.6575561", "text": "function fetchYearlyDetails() {\n const url = api_server;\n fetch(url).then((resp) => resp.json()).then(function(json) {\n buildYearlyDetails(json);\n })\n .catch(function(error) {\n console.log(\"err: \"+error);\n });\n}", "title": "" }, { "docid": "572b3d9fb5f640320bdbdefa4b5498fc", "score": "0.6568113", "text": "async function getData() {\n let url = \"https://web2-course-project-api-fien.herokuapp.com/api/userWeather\";\n let resp = await fetch(url);\n return await resp.json();\n}", "title": "" }, { "docid": "b1df12d426d9bffeede2d1f67616d27e", "score": "0.6563672", "text": "async function getData(url = '') {\n // Default options are marked with *\n const response = await fetch(url, {\n method: 'GET', // *GET, POST, PUT, DELETE, etc.\n cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json' \n },\n redirect: 'follow', // manual, *follow, error\n referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url\n });\n return response.json(); // parses JSON response into native JavaScript objects\n }", "title": "" }, { "docid": "57b14210092862352fbf0d7213d15583", "score": "0.6562421", "text": "function getApiData(url) {\n return fetch(url).then((res) => res.json());\n}", "title": "" }, { "docid": "b1aab7e0f5bc5d0a10c831dda3701a37", "score": "0.65571785", "text": "function news() {\r\n fetch(\"https://spaceflightnewsapi.net/api/v2/articles\") \r\n .then(function(resp) { return resp.json() }) // Convert data to json\r\n .then(function(data) {\r\n getNews(data);\r\n })\r\n .catch(function() {\r\n //catch errors\r\n });\r\n}", "title": "" }, { "docid": "cfc4b957cdb4533668fdef0e0da2651d", "score": "0.65498155", "text": "function getInfoFromApi() {\r\n fetch(`http://api.tvmaze.com/search/shows?q=${searchInput.value}`)\r\n .then((response) => response.json())\r\n .then((data) => {\r\n searchResult = data;\r\n paintResults();\r\n });\r\n}", "title": "" }, { "docid": "9378facef68a433ea9e3e25c2156d92c", "score": "0.6547878", "text": "async function getJSON() {\n\n let myJSON = await fetch(\"https://www.lowson.dk/kea/2Sem/02_sem_eksamen_GR_17/wordpress//wp-json/wp/v2/vaerker?per_page=100\");\n myArt = await myJSON.json();\n\n // console.log(myArt);\n // kalder funktionen visSide direkte\n visSide();\n}", "title": "" }, { "docid": "2a36d84263bb59bff6847d8d08f6edb1", "score": "0.65475756", "text": "async function getData(url = '') {\n if(url != ''){\n const response = await fetch(url, { headers: { 'Authorization': '563492ad6f9170000100000102f36ff4c6454d1f81efc01679d1083d' } });\n return response.json();\n }\n}", "title": "" }, { "docid": "23aec2bb1d9518966055d86e280ccdcd", "score": "0.65445644", "text": "fetchData() {\n\t\tconst urlSearchParams = new URL(document.location).searchParams;\n\t\tconst id = urlSearchParams.get(\"id\");\n\t\tfetch(\"FishEyeData.json\")\n\t\t\t.then((response) => response.json())\n\t\t\t.then((data) => {\n\t\t\t\tthis.photographer = data.photographers.find((photographer) => {\n\t\t\t\t\treturn photographer.id === parseInt(id);\n\t\t\t\t});\n\t\t\t\tthis.displayHeader();\n\t\t\t\tthis.displayPhotographer();\n\t\t\t\tthis.displayForm();\n\t\t\t\tthis.createMedia(data.media, id)\n\t\t\t\tthis.displayMedia(this.sortByPopularity());\n\t\t\t\tthis.displaySort();\n\t\t\t\tthis.sortMedia();\n\t\t\t\tthis.displayTotalLikes();\n\t\t\t\tthis.displayLightBox();\n\t\t\t\tthis.incrementLikes();\n\t\t\t})\n\t\t\t.catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t});\n\t}", "title": "" }, { "docid": "4a9e49b7c97930f5fe8bda2840cdea85", "score": "0.65431947", "text": "async function getData()\n{\n /**\n* Used this API GENERATOR\n* https://opentdb.com/api_config.php\n*/\n showSpinner();\n const response = await fetch('https://opentdb.com/api.php?amount=' + question_length + '&category=9&difficulty=easy&type=multiple');\n const data = await response.json();\n hideSpinner();\n return data;\n}", "title": "" }, { "docid": "7f645d97cbb4c15dfc918f481eecf970", "score": "0.6536961", "text": "function microsoftJson()\r\n{\r\n\r\n const api_url = 'https://apidojo-yahoo-finance-v1.p.rapidapi.com/stock/v2/get-summary?symbol=msft&region=US';\r\n async function getStock(){\r\n\r\n const response = await fetch(api_url, {\r\n\t \"method\": \"GET\",\r\n\t \"headers\": {\r\n\t\t \"x-rapidapi-key\": \"e86d445741mshb7b549bb3b24c95p1d6a71jsndd2b8da16354\",\r\n\t\t \"x-rapidapi-host\": \"apidojo-yahoo-finance-v1.p.rapidapi.com\"\r\n\t }\r\n })\r\n const data = await response.json();\r\n\r\n document.getElementById('Microsoft').textContent = data.price.regularMarketOpen.raw;\r\n console.log(data);\r\n }\r\n getStock();\r\n}", "title": "" }, { "docid": "d9b653f889a530afe2bd753ea7536983", "score": "0.6533276", "text": "getJSON(url, data) {\n let getData = fetch(url, {\n method: 'GET',\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(res => res.json()).then(response => {\n if (response) {\n let res = JSON.stringify(response);\n console.log(res);\n } else {\n throw new Error('Network response was not ok!!');\n }\n })\n }", "title": "" }, { "docid": "41887fb8d8918f00d17cdd783c261386", "score": "0.65311325", "text": "function appleJson()\r\n{\r\n\r\n const api_url = 'https://apidojo-yahoo-finance-v1.p.rapidapi.com/stock/v2/get-summary?symbol=aapl&region=US';\r\n async function getStock(){\r\n\r\n const response = await fetch(api_url, {\r\n\t \"method\": \"GET\",\r\n\t \"headers\": {\r\n\t\t \"x-rapidapi-key\": \"e86d445741mshb7b549bb3b24c95p1d6a71jsndd2b8da16354\",\r\n\t\t \"x-rapidapi-host\": \"apidojo-yahoo-finance-v1.p.rapidapi.com\"\r\n\t }\r\n })\r\n const data = await response.json();\r\n\r\n document.getElementById('Apple').textContent = data.price.regularMarketOpen.raw;\r\n console.log(data);\r\n }\r\n getStock();\r\n}", "title": "" }, { "docid": "4c0fa9150f6b07f042108b20d1ec95a9", "score": "0.6519302", "text": "function getData() {\n fetch(\n \"http://camelsaidwhat.com/T9WP/wp-json/wp/v2/huset-event?per_page=100\"\n )\n .then(response => response.json())\n .then(showPosts);\n}", "title": "" }, { "docid": "0c98dcd9082dfbf6d0e73b5be88c8bbd", "score": "0.6511723", "text": "function getdataAirq(){\r\n //var url = \"https://data.cityofnewyork.us/api/views/c3uy-2p5r/rows.json?accessType=DOWNLOAD\"\r\n var url = \"https://data.cityofnewyork.us/resource/ah89-62h9.json?$where=year_description=%222013%22%20AND%20geo_entity_name=%22Manhattan%22\";\r\n var data = $.get(url, () => {\r\n\t\tconsole.log( url );\r\n\t})\r\n\t.done(function () {\r\n\t\tconsole.log(data);\r\n\t\tvar resp = data.responseJSON;\r\n\t\talert(\"Air Quality in Manhattan:\\n\"+resp[0].name+\": \"+resp[0].data_valuemessage+\" \"+resp[0].measure);\r\n\t})\r\n\t.fail(function (error) {\r\n\t\t//fail\r\n\t\tconsole.error(error);\r\n\t})\r\n}", "title": "" }, { "docid": "efa4c3ceb70c472f8bda2b43e38d050f", "score": "0.6506539", "text": "function fetchData(){\r\n\tfetch('https://restcountries.eu/rest/v2/all')\r\n\t .then(response => response.json())\r\n .then(data => sendData(data));\r\n\t\r\n} //fetchData", "title": "" }, { "docid": "146224ac97676aceca53631b06297d59", "score": "0.65034264", "text": "function loadParseSummary() {\r\n var url3 = \"https://api.covid19api.com/summary\";\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open(\"GET\", url3, true);\r\n xmlhttp.send();\r\n\r\n xmlhttp.onreadystatechange = function () {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n jsonObj = JSON.parse(xmlhttp.responseText);\r\n\r\n console.log(jsonObj);\r\n printJSONTable2(jsonObj);\r\n }\r\n };\r\n}", "title": "" }, { "docid": "7cf8ed9b522457cb879b260ec1bf4d6b", "score": "0.6499034", "text": "function getJeopardyData(){\n fetch('https://jservice.xyz/api/clues?category=18062')//\"CLASSIC CARTOON CHARACTERS\"\n .then( (res) => res.json() )\n .then( (data) => classicCartoonCharactersClues = new Object(data.clues))\n\n fetch('https://jservice.xyz/api/clues?category=188') // \"SCIENCE CLASS\"\n .then( (res) => res.json() )\n .then( (data) => scienceClassClues = new Object(data.clues))\n\n fetch('https://jservice.xyz/api/clues?category=1519') // \"COMPUTERS\"\n .then( res => res.json() )\n .then( (data) => computerClues = new Object(data.clues))\n\n fetch('https://jservice.xyz/api/clues?category=12948') // \"ENGINEERING\"\n .then( res => res.json() )\n .then( (data) => engineeringClues = new Object(data.clues)) \n\n fetch('https://jservice.xyz/api/clues?category=10850') // \"MOTHER POLAND\"\n .then( res => res.json() )\n .then( (data) => motherPolandClues = new Object(data.clues)) \n\n fetch('https://jservice.xyz/api/clues?category=16648') // \"SCIENCE HISTORY\"\n .then( res => res.json() )\n .then( (data) => scienceHistoryClues = new Object(data.clues))\n}", "title": "" }, { "docid": "2aa1cd778cdf872d7cadff6f63b0e8fd", "score": "0.64921176", "text": "function getFromApi(requestURL){\n \n $.ajax( {\n url : requestURL,\n dataType : \"jsonp\",\n success : function(data) { \n \n console.log(data);\n var results = data.hits;\n \n //generating the displayed results\n results.forEach( function (item){\n //declaring variables\n var image = item.recipe.image;\n var title = item.recipe.label;\n var link = item.recipe.url;\n var howMany = item.recipe.ingredientLines.length;\n var calNum = item.recipe.calories;\n var serves = item.recipe.yield;\n var fatNum = item.recipe.totalNutrients.FAT.quantity;\n var fatUnit = item.recipe.totalNutrients.FAT.unit;\n var fatDay = item.recipe.totalDaily.FAT.quantity;\n var sugNum = item.recipe.totalNutrients.SUGAR.quantity;\n var sugUnit = item.recipe.totalNutrients.SUGAR.unit;\n var calClass = '';\n var fatClass = '';\n var sugClass = ''; \n \n //shortening a title that is too long\n if (title.length > 25){\n title = title.substring(0,24) + '...'\n };\n \n //calculating fat per portion\n fatNum = fatNum / serves;\n //making the number into a string so that we may shorten it\n var fat = fatNum.toString();\n //cutting the excess digits from the fat value\n if (fatNum < 100){\n fat = fat.substring(0,4)\n }\n else{\n fat = fat.substring(0,5)\n };\n \n //changing the colour of the fat div based on % of a person's daily recommendation\n if (fatDay > 55) {\n fatClass= 'orange';\n }\n else if (fatDay > 35) {\n fatClass= 'yellow';\n }\n else{fatClass= 'green';\n };\n \n //calculating calories per portion\n calNum = calNum / serves;\n //making the number into a string so that we may shorten it\n var cal = calNum.toString();\n //cutting the excess digits from the calories value\n if (calNum < 1000){\n cal = cal.substring(0,5)\n }\n else{\n cal = cal.substring(0,6)\n };\n \n //changing the colour of the div based on the calorie count \n if (calNum > 800) {\n calClass= 'orange';\n }\n else if (calNum > 400) {\n calClass= 'yellow';\n }\n else{\n calClass= 'green';\n };\n \n //calculating sugar per portion\n sugNum = sugNum / serves;\n //making the number into a string so that we may shorten it\n var sug = sugNum.toString();\n //cutting the excess digits from the fat value\n if (sugNum < 100){\n sug = sug.substring(0,4)\n }\n else{\n sug = sug.substring(0,5)\n };\n \n //changing the colour of the sugar div\n if (sugNum > 55) {\n sugClass= 'orange';\n }\n else if (sugNum > 30) {\n sugClass= 'yellow';\n }\n else{\n sugClass= 'green';\n };\n \n //fixes broken image links\n if( image.indexOf('.jpg')<0){\n if(image.indexOf('.JPG')<0){\n if(image.indexOf('.png')<0){\n if(image.indexOf('.PNG')<0){\n image = 'https://www.edamam.com/web-img/f32/f32bb6d8980d49b54c11e1a3dd51a16d.jpg';\n }\n }\n }\n }\n \n //instructions for displaying the results\n $('.results').append('<div class=\"recipe\"><a target=\"_blank\" href=\"' + link + '\"><h2 class=\"title\">' + title + '</h2></a><div class=\"box\"><a target=\"_blank\" href=\"' + link + '\"><img class=\"pic\" src=\"' + image + '\"></a><div class =\"infoBox\"><div class=\"info\">Serves <b>' + serves + '</b></div><div class=\"calinfo ' + calClass + '\"><b>' + cal + '</b> kcal</div><div class=\"fatinfo '+ fatClass +'\">Fat: <b>' + fat + '</b> ' + fatUnit + '</div><div class=\"suginfo '+ sugClass +'\">Sugar: <b>' + sug + '</b> ' + sugUnit + '</div><div class=\"info\">Uses <b>' + howMany + '</b> ingredients</div></div></div></div>');\n \n });\n },\n error: function(){\n alert('Error getting data from API');\n }\n } );\n \n }", "title": "" }, { "docid": "39de35db1de633027d44bf5bcce795d0", "score": "0.64881206", "text": "function getData(callback) {\n\tvar xobj = new XMLHttpRequest();\n\txobj.overrideMimeType(\"application/json\");\n\txobj.open('GET', 'https://billsgithubacct.github.io/Javascript-HW/dataFull.json', true);\n\t//xobj.open('GET', 'https://billsgithubacct.github.io/Javascript-HW/dataPart.json', true);\n\t\n\txobj.onreadystatechange = function () {\n\t\tif (xobj.readyState == 4 ) {\n\t\t// .open will NOT return a value but simply returns undefined in async mode so use a callback\n\t\t\tcallback(xobj.responseText);\n\t\t}\n }\n\txobj.send(null);\n\t}", "title": "" }, { "docid": "6c1511dfd4b41a7f8d5dedf192bae478", "score": "0.6485149", "text": "function getData() {\n let params = {\n key: APIKEY,\n postal_code: tripData.postCode,\n units: 'I'\n }\n let queryString = formatQuery(params)\n let url = (`${BASE_URL}?${queryString}`);\n\n fetch(url)\n .then(response => {\n if (response.status == 204) {\n throw new Error(response.statusText);\n } else if (response.ok) {\n return response.json();\n } else {\n throw new Error(response.statusText);\n }\n })\n .then(responseJson => checkDates(responseJson))\n .catch(error => {\n $('.js-error-msg').text(`Something went wrong: ${error.message} for postal code. Please try again later.`)\n $('.js-error-msg').removeClass('hidden')\n })\n}", "title": "" }, { "docid": "4a2c0fbd8d30e4e98746cc4da89a66d3", "score": "0.6473676", "text": "async function apiData(mainUrl) {\n try {\n var data = await fetch(mainUrl);\n var data = data.json();\n return data;\n } catch (e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "d4ebf802037eb95f2806d5a1c9e60839", "score": "0.64676076", "text": "async function hentWpData() {\n let wpData = await fetch(\"http://simonepoulsen.dk/kea/2semester/wordpress/wp-json/wp/v2/employees?per_page=100\");\n //vis objekt som Json\n ansatte = await wpData.json();\n visAnsatte();\n}", "title": "" }, { "docid": "ebf47fef2ee1044ea4ea40076f23ff70", "score": "0.64654076", "text": "function fetchjokes(){\n const response = await fetch('https://api.chucknorris.io/jokes/random')\n const data = await response ;\n console.log(data);\n}", "title": "" }, { "docid": "cc08623780a07839a53f96c2a085c3e1", "score": "0.6461784", "text": "function loadList() {\n /* 'fetch' requests the API data,\n a promise with a resolved (.then()) and a rejection case (.catch())\n is returned with the .json() method - here's the asynchronous function\n NO REAL CLUE WHAT IS REALLY GOING ON HERE - I WOULD HAVE TO CHECK\n THIS OUT ON MY OWN, LINE BY LINE, FOR 2 WEEKS AT LEAST*/\n return fetch(apiUrl).then(function (response) {\n return response.json();\n })\n .then(function (json) {\n json.results.forEach(function (item) {\n var pokemon = {\n name: item.name,\n detailsUrl: item.url\n };\n add(pokemon);\n });\n })\n .catch(function (e) {\n console.error(e);\n })\n }", "title": "" }, { "docid": "1a40e7fc239f1ee2fd488c3452b8556b", "score": "0.6460557", "text": "function fetchDummyData() {\n axios.get('https://my-json-server.typicode.com/typicode/demo/posts')\n .then(response => {\n console.log(response);\n }, error => {\n console.log(\"Something went wrong!\")\n });\n}", "title": "" }, { "docid": "94e5ec5233debf6f9f1f956582589cef", "score": "0.64582586", "text": "getData(){\n return Axios.get(\"https://api.open5e.com/monsters/?fields=slug,name,challenge_rating,type,size,hit_points,document__slug,%20document__title&limit=2000&ordering=slug\")\n }", "title": "" }, { "docid": "0af277fdd890dd62a22bf6d41b440b84", "score": "0.6457684", "text": "function getStats() {\n fetch(\n 'https://api.usa.gov/crime/fbi/sapi/api/data/nibrs/homicide-offenses/offense/national/WEAPONS?API_KEY=ZzVVKGxH8p4Fcd0fpa4o5QLBSUnGT0N18jao0Jv1'\n )\n .then(response => response.json())\n .then(result => {\n let allData = result.results;\n // loop through results and only return JSON data that has a data year greater than or equal to 2000\n for (let i = 0; i < allData.length; i++) {\n if (allData[i].data_year >= 2000) {\n dataArr.push(allData[i]);\n }\n }\n console.log(dataArr);\n sortData(dataArr);\n });\n}", "title": "" }, { "docid": "42053071e3e71e192f0f30cc828c509f", "score": "0.6456104", "text": "async function hentAboutJson() {\n console.log(\"starter about\")\n\n const response = await fetch(\"http://jenniferjaque.dk/kea/2-semester/eksamen/sarahwinther_wp/wordpress/wp-json/wp/v2/pages/66\");\n console.log(response);\n side = await response.json();\n console.log(side);\n visAboutJson();\n}", "title": "" }, { "docid": "ca23240af124b5eba26a3f17aecdb27c", "score": "0.64466363", "text": "function getData() {\n let p = document.getElementById(\"para\")\n let title = document.getElementById(\"title\")\n // var xhttp = new XMLHttpRequest();\n // xhttp.onreadystatechange = function () {\n // if (this.readyState == 4 && this.status == 200) {\n // p.innerText =\n // this.responseText;\n // let data =JSON.parse(this.responseText)\n\n // title.innerText = data.title\n // p.innerText = data.body\n // }\n // };\n // xhttp.open(\"GET\", \"https://jsonplaceholder.typicode.com/posts/1\", true);\n // xhttp.send();\n fetch(\"https://jsonplaceholder.typicode.com/posts/1\").then((res) => {\n return res.json()\n }).then((res) => {\n title.innerText = res.title\n p.innerText = res.body\n })\n}", "title": "" }, { "docid": "2d6a19580d09d36710531a3889cd52a8", "score": "0.6444042", "text": "async premaOpisuAPI(data) {\n const podatak = await fetch(\n `https://www.themealdb.com/api/json/v1/1/search.php?s=${data}`\n )\n .then((data) => {\n data = data.json();\n return data;\n })\n .then((data) => {\n return data;\n });\n return podatak;\n }", "title": "" }, { "docid": "fa3e70f9caf5983fc64262eac78c8538", "score": "0.6439662", "text": "async function fetchObjects() {\n const url = `${BASE_URL}/object?${KEY}`; //brings data in from API\n try {\n const response = await fetch(url); //fetches the data\n const data = await response.json(); //waits for data\n console.log(data);\n return data; //returns data\n } catch (error) {\n console.error(error); //console log error\n }\n}", "title": "" }, { "docid": "0f51e1b85149649fc384444766661a81", "score": "0.6437956", "text": "async function loadApiData(searchByFoodName) {\n const response = await fetch(`https://www.themealdb.com/api/json/v1/1/search.php?s=${searchByFoodName}`);\n const data = await response.json();\n return data;\n}", "title": "" }, { "docid": "5d0d3c8b387f43af738d904b051e8d06", "score": "0.64328283", "text": "function getApiData() {\n let apiArr = [];\n \n tickers.forEach(ticker => apiArr.push(fetch(`https://repeated-alpaca.glitch.me/v1/stock/${ticker}/quote`)\n .then(data => data.json())\n .catch(err => console.log(err))\n ));\n \n return Promise.all(apiArr).catch(err => console.log(err));\n }", "title": "" }, { "docid": "d4a88e6f11e4aab1d541fbaea23032fc", "score": "0.6431199", "text": "async getItems(){\n let data = await fetch(`${hostAPI}/api/teddies/`)\n .then(response => {\n return response;\n }).catch(error => console.warn(error));\n let json = await data.json().then(json => { return json });\n return json;\n }", "title": "" }, { "docid": "a776036a5c13019161d25d2cdad5fc2c", "score": "0.64287394", "text": "function fetchData() {\n\n return fetch('https://jsonplaceholder.typicode.com/posts')\n .then(res => res.json())\n .then(posts => posts);\n\n // return axios({\n // method: \"get\",\n // url: \"https://jsonplaceholder.typicode.com/posts\"\n // });\n}", "title": "" }, { "docid": "025e3f11887634838d5185a95ac8c085", "score": "0.6422947", "text": "function getWeatherData(){\n fetch(API)\n .then(data => data.json())\n .then(data => {\n let temp = Math.round(data.main.temp); \n let sunrise = data.sys.sunrise;\n let sunset = data.sys.sunset; \n let weatherIcon = data.weather[0].icon; \n \n displayWeatherImage(weatherIcon); \n displayWeatherText(temp, sunrise, sunset);\n })\n}", "title": "" }, { "docid": "ab4fb81a26756b9c8c5a44fac7aaf419", "score": "0.64209235", "text": "function loadAPIData() {\n\t\t//function to get stats\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.withCredentials = true;\n\t\txhr.open(\"GET\", \"https://covid-19-coronavirus-statistics.p.rapidapi.com/v1/stats?country=Canada\");\n\t\txhr.setRequestHeader(\"x-rapidapi-host\", \"covid-19-coronavirus-statistics.p.rapidapi.com\");\n\t\txhr.setRequestHeader(\"x-rapidapi-key\", \"Your_Key\");\n\t\txhr.onload = function () {\n\t\t\tvar result= JSON.parse(xhr.responseText);\n\t\t\tresultSet= JSON.parse(xhr.responseText).data.covid19Stats;\n\t\t}\n\n\t\txhr.send();\n\t}", "title": "" }, { "docid": "a3ec28ca217fe99111dd8a6efa9750c9", "score": "0.6415871", "text": "function retrieveWeatherDataFromApi() {\n const zipcode = document.getElementById('zip');\n const weatherURL = `http://api.openweathermap.org/data/2.5/weather?`+\n `zip=${zipcode.value},us&appid=${apikey}`;\n // Async send get request to openweatherdata\n return fetch(weatherURL).then(response => response);\n}", "title": "" }, { "docid": "7639720e2ee8b6b592ce232728870b05", "score": "0.6403533", "text": "function fetchData() {\n const url = \"https://api.coinmarketcap.com/v1/ticker/?limit=100\";\n fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(coinsJson) {\n coins = coinsJson;\n displayData(coins);\n });\n}", "title": "" }, { "docid": "f673d60069e4f84d8ed69625ea652627", "score": "0.640179", "text": "function fetchAPI(callback, keywordList) {\n // adding '&filter=withbody' to the end of the search url on stack overflow will include the question body\n // This makes it an even more indepth keyword search\n fetch('https://api.stackexchange.com/2.2/questions?pagesize=100&order=desc&sort=creation&site=stackoverflow&filter=withbody')\n .then(function(res) {\n return res.json();\n }).then(function(json) {\n //we only want the items in the json and not the information about stackoverflow\n var list = json.items;\n // console.log(list);\n sorted = sortThroughJSON(list, keywordList);\n //Call callback to move variable sorted to server\n callback(sorted);\n }).catch(function (err) {\n console.log(\"Promise Rejected\");\n console.log(err);\n});\n}", "title": "" }, { "docid": "5324b7ffd311df0947fb5c0ddf0c47d2", "score": "0.63998246", "text": "function showAPI() {\n let api = \"\";\n req.open(\"GET\", URL.concat(\"/api_s\"), true);\n req.onreadystatechange = () => {\n if (req.readyState == 4) {\n if (req.status == 200) {\n // console.log(req.responseText);\n let resp = JSON.parse(req.responseText);\n api = resp.api;\n if (api.length === 0 || api === \"\") {\n document.getElementById(\"api-body\").innerHTML =\n \"<li> No API Documentation Found\";\n } else {\n document.getElementById(\"api-head\").innerHTML = api.api_name;\n document.getElementById(\"api-sub\").innerHTML = api.subTitle;\n api.calls.forEach((item) => {\n document.getElementById(\"api-body\").innerHTML +=\n \"<b><h3> \" + item.type + \": \\t\\t\" + item.extension + \"</b></h3>\" + \n \"<b> Description: </b>\" + item.description + \"<br/>\" + \n \"<b> Headers: </b>\" + item.headers + \"<br/>\" + \n \"<b> Request: </b>\" + item.request + \"<br/>\" + \n \"<b> Response: </b>\" + item.response + \"<br/><br/>\";\n });\n }\n }\n }\n };\n req.send();\n}", "title": "" }, { "docid": "3936be90208ebd22f1eff74bcf7726d2", "score": "0.6397569", "text": "getLocationData(){\n fetch(\"https://covid-193.p.rapidapi.com/statistics\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"ee1c72e30dmshb0923a36f539943p1c489cjsnbc83887d6b42\",\n \"x-rapidapi-host\": \"covid-193.p.rapidapi.com\"\n }\n })\n .then(res=>res.json())\n .then(res=>{\n // res.resposnse because of json documentation** sorry for any confustion, check documentation for concerns\n res.response.forEach(element => {\n this.checkforMatch(element);\n });\n })\n\n .catch(err => {\n console.error(err);\n });\n\n }", "title": "" }, { "docid": "ed1fdb9b60a0df2872856a9472139ed1", "score": "0.6397281", "text": "function getData(){\n \treturn fetch(\"http://localhost:3001/data\")\n\t\t.then(res => {return res.json()})\n\t\t.then(data =>{ \n\t\t\treturn data;\n\t\t});\n\n}", "title": "" }, { "docid": "fcb54631a6f62576db441af173894940", "score": "0.63946", "text": "function fetchTodos()\r\n{\r\n fetch('https://jsonplaceholder.typicode.com/todos')\r\n .then(function(data){ //Once the data are loaded THEN is executed and data needs to be converted to JSON for further usage\r\n console.log(data);\r\n return data.json(); //Converts the data to JSON\r\n \r\n })\r\n .then(function(json){ //Once JSON data conversion is done, THEN is executed\r\n printTodos(json); //PrintTodos function is called to print the result on screen\r\n })\r\n}", "title": "" }, { "docid": "0ee2f10f59476f945c74833c004d9af3", "score": "0.63939553", "text": "function getJokes()\n{\n\n var data = new XMLHttpRequest();\n data.open( \"GET\", \"https://v2.jokeapi.dev/joke/Programming?type=single\", false ); // false for synchronous request\n data.send( null );\n \n if(data.readyState === XMLHttpRequest.DONE)\n {\n if(data.status != 200)\n {\n return \"\"\n }\n const hel = JSON.parse(data.responseText)\n \n return hel\n }\n \n return \"\"\n \n}", "title": "" }, { "docid": "e126442b087ef0989f9d3529c9ac79d4", "score": "0.6392526", "text": "function getDataWithFetchApi(url, method=\"GET\"){\n\tlet p = fetch(url, {method:method} );\n\treturn p;\n}", "title": "" }, { "docid": "487f284eb8027dc36f007be7ff7c1a31", "score": "0.63884664", "text": "function fetchAlbums() {\n // fetch returns a promise. promise is resolved with an object that represent\n // the underlying request.\n // We need to use callback then to write code, which runs when promise is resolved.\n // This then is called with request received by fetch.\n // res.json again returns a promise which is resolved when json is ready to work with.\n // So we need to append another then to work on this json.\n fetch(\"https://rallycoding.herokuapp.com/api/music_albums\")\n .then(res => res.json())\n .then(json => console.log(json));\n}", "title": "" }, { "docid": "4ac772aada96f9019e8263240a23e038", "score": "0.6385437", "text": "function GetQuoteWithFetch()\n {\n let chuckApiUrl = \"https://api.chucknorris.io/jokes/random\";\n fetch(chuckApiUrl).then((response) => \n {\n return response.json();\n }).then((data) =>\n {\n DisplayQuote(data);\n }).catch((response) =>\n {\n console.log(response);\n });\n }", "title": "" }, { "docid": "56ac82f5cb58bc9fc11586b819fe0fde", "score": "0.638317", "text": "function get() {\n // console.log(baseLink + \"noah-volunteers\");\n fetch(baseLink + \"noah-volunteers\", {\n method: \"get\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"x-apikey\": \"5c7ef096cac6621685acbbb6\",\n \"cache-control\": \"no-cache\"\n }\n })\n .then(e => e.json())\n .then(e => {\n // console.log(e);\n volunteerArr = e;\n // console.log(volunteerArr);\n volunteerArr.forEach(displayVolunteers);\n });\n}", "title": "" }, { "docid": "99413c6660d6d0110bb4dc4d196035ec", "score": "0.638263", "text": "async getMetadata() {\n return new Promise(resolve => {\n fetch(this.URL + \"/main.json\")\n .then(responseJSON => {\n return responseJSON.json();\n })\n .then(json => {\n resolve(json);\n });\n });\n }", "title": "" }, { "docid": "dae6e2b2437c873c6093785a7584dfd9", "score": "0.6379971", "text": "function getData(){\nvar xhr = new XMLHttpRequest();\n\nxhr.addEventListener(\"readystatechange\", function () {\n\tif (this.readyState === this.DONE) {\n\t\tsaveToLocal(this.responseText);\n\t}\n});\n\n //endpoint\nxhr.open(\"GET\", \"https://sv443.net/jokeapi/category/Programming\");\nxhr.setRequestHeader(\"x-rapidapi-host\", \"jokeapi.p.rapidapi.com\");\n //key\nxhr.setRequestHeader(\"x-rapidapi-key\", \"b086763a6fmshd30cfe176b59170p1721d3jsn383d0383abde\");\n\nxhr.send(jokeData);\n}", "title": "" }, { "docid": "b91107381bee81d3b9d69392a354704a", "score": "0.6375125", "text": "fetchData() {\n //https://orsted.dk/-/media/WWW/Assets/DCS/projects/el-tjek/static/media/data\n //data.json\n fetch(\"data.json\", {\n method: \"get\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n }\n })\n .then(response => response.json())\n .then(parsedJSON => this.handleData(parsedJSON))\n .catch(error =>\n console.log(\n \"Vi mangler data for at kunne fortsætte, opdater venligst browseren for at forsøge igen.\"\n )\n );\n }", "title": "" }, { "docid": "6fec2c5a8c607a34c68e109f394be40d", "score": "0.63692707", "text": "function get_data_for_batman() {\n\tvar xhr = new XMLHttpRequest();\n\tvar url = \"https://www.omdbapi.com/?apikey=ede4d490&s=\";\n\tvar key = \"batman\";\n\txhr.open(\"GET\", url + key);\n\txhr.send();\n\txhr.onload = function () {\n\t\tif (xhr.status == 200) {\n\t\t\tvar response = JSON.parse(xhr.response).Search;\n\t\t\tfor (i = 0; i < 4; i++) {\n\t\t\t\tvar data = response[i].Poster;\n\t\t\t\tdisplay_data_batman(data);\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Error code is\" + xhr.status);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "87f4d3eeb6a627a77441b0281b4da50f", "score": "0.636395", "text": "async function hentData() {\n const respons = await fetch(url, options);\n retter = await respons.json();\n visRetter();\n}", "title": "" }, { "docid": "140c077a8233203eba40d2a5adb00cc9", "score": "0.63595366", "text": "fetchData() {\n axios.get('https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest', {\n method: 'GET',\n params: {\n limit: 50\n },\n headers: {\n 'X-CMC_PRO_API_KEY': api.key\n }\n }).then((res) => {\n // Success response for CoinmarketCap API\n let data = res.data\n this.setState({\n loading: false\n });\n this.makeData(data);\n }, () => {\n this.setState({\n loading: false,\n error: true\n })\n });\n }", "title": "" }, { "docid": "6a5088c84061a8a0c45dbc3ae71fde34", "score": "0.6358385", "text": "function fetchNews(alpha2Code) {\n fetch(\n `https://newsapi.org/v2/top-headlines?country=${alpha2Code}&apiKey=b5bd6df47c14464bb42f53a1fa3efa91`\n )\n .then((res) => res.json())\n .then((data) => {\n showNews(data);\n console.log(data);\n })\n .catch((err) => console.log(\"Error\", err));\n}", "title": "" }, { "docid": "9b17fcae8cac3f2f6ca026fc0f41cbd3", "score": "0.6355564", "text": "function get() {\n fetch(\"https://cardatabase-95e9.restdb.io/rest/cars\", {\n method: \"get\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"x-apikey\": \"5c7ceacccac6621685acbac7\",\n \"cache-control\": \"no-cache\"\n }\n })\n .then(res => res.json())\n .then(data => {\n console.log(data);\n data.forEach(showCar);\n document.querySelector(\".fullscreen\").remove();\n });\n}", "title": "" }, { "docid": "10392daae33b15d9cd10183ad02bafcb", "score": "0.63517535", "text": "async data() {\n\n\n // get the data from provide url/file\n const apiResponse = await fetch('product.json');\n return apiResponse\n\n }", "title": "" }, { "docid": "df807437661a57f6b98dff9da1ea66a6", "score": "0.6348625", "text": "async function getArt() {\n // Url for backend\n const url = 'https://squilla-api.herokuapp.com';\n \n // fetching the art from the API\n const artRes = await fetch(`${url}/api/art`)\n const art = await artRes.json();\n /// what is this reponse??\n console.log(art);\n\n\n }", "title": "" }, { "docid": "9aecbde5796982fbdbb9a30525f59c33", "score": "0.634524", "text": "function loadList() {\n return fetch(apiUrl).then(function (response) {\n return response.json();\n })\n .then(function (json) {\n json.results.forEach(function (item) {\n let pokemon = {\n name: item.name,\n detailsUrl: item.url,\n };\n add(pokemon);\n });\n }).catch(function (e) {\n console.error(e);\n })\n }", "title": "" }, { "docid": "acc1f54eaa5a0d0de62ab4ce721420ed", "score": "0.63418883", "text": "async function getHelpwantedData() {\n const response = await fetch('http://localhost:3000/api/v1/helpwanteds');\n const data = await response.json();\n return data;\n}", "title": "" }, { "docid": "cab5ec2664b53a21db705ee0aab6c59d", "score": "0.6340944", "text": "function cityWeather(param){\n var getApiUrl ='https://api.openweathermap.org/data/2.5/forecast?&q=' + param + '&appid=7fe1cc8350b277fdeddb1d18efc3c5c1'\n fetch(getApiUrl).then(function(response) {\n // response comes back correct\n if (response.ok) {\n response.json().then(function(data) {\n console.log(data);\n //Create loop through list array in API \n // for(var i=0; i>data.list.length; i++)\n \n \n });\n\n // Retrieve Data for each day and add to innerHTML card associated\n\n } else {\n alert(\"Issue: our server is unable to process\");\n }\n })\n .catch(function(error) {\n console.log(\"Something Happened!\");\n \n\n})}", "title": "" }, { "docid": "701eb3467760dda4d2fa24a179cde63d", "score": "0.63387346", "text": "function get_data_for_superman() {\n\tvar xhr = new XMLHttpRequest();\n\tvar url = \"https://www.omdbapi.com/?apikey=ede4d490&s=\";\n\tvar key = \"superman\";\n\txhr.open(\"GET\", url + key);\n\txhr.send();\n\txhr.onload = function () {\n\t\tif (xhr.status == 200) {\n\t\t\tvar response = JSON.parse(xhr.response).Search;\n\t\t\tfor (i = 0; i < 4; i++) {\n\t\t\t\tvar data = response[i].Poster;\n\t\t\t\tdisplay_data_superman(data);\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Error code is\" + xhr.sta);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "97522760b3eafe8e30ef3097dfc100bd", "score": "0.6334109", "text": "function fetch_data(url,param){\n\treturn fetch(url,param).then(response=>response.json());\n}", "title": "" } ]
32dd4d0c1885f9cc87540a4d1fad62d7
Function for creating the platforms
[ { "docid": "1d5e04a5fb95c50f2f3ee0e6d750129d", "score": "0.7641668", "text": "function createPlatforms()\n{\n //Push the first platform\n platforms.push(new Platform(120,\n floorPos_y,\n 160));\n \n for (var i = 0; i < 19; i++)\n {\n \n //Push the rest of the platforms\n platforms.push(new Platform(250 + 220*i + round(random(50, 130)),\n floorPos_y - round(random(10, 70)),\n round(random(110, 190))));\n }\n}", "title": "" } ]
[ { "docid": "db849ae887cb4d37cef81f3242f6b0f9", "score": "0.8030059", "text": "function createPlatforms() {\n for (let i = 0; i < platformCount; i++) {\n let platGap = 600 / platformCount;\n let newPlatBottom = 100 + i * platGap;\n let newPlatform = new Platform(newPlatBottom);\n platforms.push(newPlatform);\n }\n }", "title": "" }, { "docid": "f96aa29786e79076e75dcafd19b9d362", "score": "0.74672645", "text": "function createplat(){\n for(i = 0; i < num; i++) {\n platforms.push(\n {\n x: 100 * i,\n y: 200 + (30 * i),\n width: 200,\n height: 15\n }\n );\n }\n }", "title": "" }, { "docid": "a13ff7792b564fa8180d3d82b4cdc22c", "score": "0.71941507", "text": "function createPlatform(x, y, len) {\n var first = createSprite(x, y, 0, 0);\n var last = createSprite(x + ((len - 1) * 128), y, 0, 0);\n first.addToGroup(platforms);\n last.addToGroup(platforms);\n first.addImage(platformImageFirst);\n last.addImage(platformImageLast);\n //first.debug = true;\n //last.debug = true;\n if(len > 2) {\n for(var i = 1; i < len - 1; i++) {\n var middle = createSprite(x + (128 * i), y, 0, 0);\n middle.addToGroup(platforms);\n middle.addImage(platformImageMiddle);\n //middle.debug = true;\n }\n }\n}", "title": "" }, { "docid": "61c2c361ed95e2f371ae5ff1cfff4d66", "score": "0.7170365", "text": "function createPlatforms(gridData, numberOfPlatforms, platforms){\r\n var platformGap = gridData.gridHeight / numberOfPlatforms;\r\n var initialPlatformBottomGap = 0.5*(gridData.gridHeight/numberOfPlatforms);\r\n for(var i=0; i<numberOfPlatforms; i++){\r\n var PlatformBottomGap = initialPlatformBottomGap + i*platformGap;\r\n var newPlatform = new Platform(PlatformBottomGap, gridData);\r\n platforms.push(newPlatform);\r\n }\r\n var platformposition = [platformGap, initialPlatformBottomGap];\r\n return platformposition;\r\n}", "title": "" }, { "docid": "f4acd423a9b08ca0652254721cc805dd", "score": "0.71138453", "text": "function addPlatforms() {\n platforms = game.add.physicsGroup();\n\n platforms.create(0, 565, 'platform1');\n platforms.create(538, 103, 'platform2');\n platforms.create(220, 103, 'platform2');\n //\n platforms.create(747, 510, 'box');\n platforms.create(747, 455, 'box');\n platforms.create(747, 400, 'box');\n platforms.create(692, 510, 'box');\n platforms.create(455, 309, 'box2');\n platforms.create(357, 215, 'box3');\n\n platforms.setAll('body.immovable', true);\n}", "title": "" }, { "docid": "2118602c07f49ee0eb94bcad3c3ee8a6", "score": "0.71038043", "text": "function createPlatforms() {\n for (let i = 0; i < platCount; i++) {\n let platGap = 600 / platCount // 600 is the height of our grid, 600px and we want the gap to be evenly spaced across that height\n let newPlatBottom = 100 + i * platGap\n let newPlatform = new Platform(newPlatBottom) // Platform(newPlatBottom) basically creates a new platform using the formula above it off 100 pixels plus i (the number of the current platform being referred to, 1/2/3/4/5) multiplied by the platform gap, which is 600 px divided by the amount of platforms altogether, being 5.\n platforms.push(newPlatform) // This pushes each new platform into the empty array, so at any given point, there are five objects in the array.\n console.log(platforms)\n\n }\n\n }", "title": "" }, { "docid": "9bf701592309674b5276a5302fade47c", "score": "0.7025966", "text": "function addPlatforms() {\n platforms = game.add.physicsGroup();\n platforms.create(450, 550, 'platform');\n platforms.create(100, 550, 'platform');\n platforms.create(300, 450, 'platform');\n platforms.create(250, 150, 'platform');\n platforms.create(50, 300, 'platform');\n platforms.create(150, 250, 'platform');\n platforms.create(650, 300, 'platform');\n platforms.create(550, 200, 'platform2');\n platforms.create(300, 450, 'platform2');\n platforms.create(400, 350, 'platform2');\n platforms.create(100, 75, 'platform2');\n platforms.setAll('body.immovable', true);\n}", "title": "" }, { "docid": "b836948665e4c8357c1c9c1819e13380", "score": "0.70102024", "text": "createPlatform () {\n\tlet platform = this.game.add.sprite(Math.random()*640, 600, 'platform'); // Criamos uma plataforma em uma posição x aleatória, e fora da tela no eixo y.\n\tthis.platforms.push(platform); // Inserimos ela no vetor de plataformas (para podermos atualiza-la em update()!)\n\tthis.upScore(); // Aumentamos o score!\n\n\tthis.platform_yvel -= 0.1; // Aqui estamos acelerando a velocidade vertical das plataformas a medida que mais plataformas aparecerem.\n }", "title": "" }, { "docid": "8c874195566361f2ee2bb4f81b1f2357", "score": "0.6965232", "text": "function initPlatforms() {\n allPlatforms = [];\n let canvasPixels = config.ctx.getImageData(0, 0, config.maxX, config.maxY);\n\n // loop throug every x value\n for (let x = 0; x < canvasPixels.width; x++) {\n let platforms = [];\n allPlatforms[x] = platforms;\n\n let inAPlatform = false;\n // loop through y value on this X\n for (let y = 0; y < canvasPixels.height; y++) {\n let index = 4 * (y * canvasPixels.width + x);\n\n let r = canvasPixels.data[index];\n let g = canvasPixels.data[index + 1];\n let b = canvasPixels.data[index + 2];\n let a = canvasPixels.data[index + 3];\n\n if (!inAPlatform && a > 50) {\n // non-transparent pixel at position x,y\n\n // add a new platform!\n platforms.push({ x: x, base: y, height: 0 });\n inAPlatform = true;\n } else if (inAPlatform && a < 10) {\n // transparent pixel!\n // no longer in a platform\n inAPlatform = false;\n }\n }\n // push the new platform to the array of platforms\n platforms.push({ x: x, base: config.maxY - 1, height: 0 });\n }\n}", "title": "" }, { "docid": "1ce0362c212259e0dbaf713b4befe28c", "score": "0.689529", "text": "function makePlatform(sound){\n\t\n\t\t//create new platform object\n\t\tvar p = {};\n\t\t\n\t\t//gets variable for previous platform\n\t\tvar length = platformArr.length - 1;\n\t\tvar rand = Math.floor((Math.random() * 50) + 20);\n\t\t\n\t\t//sets new platform up based on location of previous\n\t\tp.x = platformArr[length].x + platformArr[length].length + Math.floor((Math.random() * 5*rand) + rand);\n\t\tp.y = platformArr[length].y + Math.floor((Math.random() * (rand + 30)) + rand + rand/2);\n\t\tp.length = Math.floor((Math.random() * 1000) + 500);\n\t\t\n\t\t//random variable for chance enemy\n\t\trand = Math.floor((Math.random() * 100) + 1);\n\t\t\n\t\t//tries to add enemy\n\t\tif(rand < (30 + (10 * level))){\n\t\t\tp.enemy = createEnemy();\n\t\t}\n\t\t\n\t\t//coins\n\t\tp.coinPt = [];\n\t\t\n\t\t//creates number of coins based off of platform length\n\t\tvar coinNum = Math.floor( (p.length/100) / 3);\n\t\tp.coinNum = coinNum;\n\t\tfor(var i = 0; i < p.coinNum; i ++){\n\t\t\tp.coinPt[i] = createCoin(sound);\n\t\t}\n\t\t\n\t\t//adds platform to array of platforms\n\t\tplatformArr.push(p);\n\t}", "title": "" }, { "docid": "03fc4d9cc2f4e820be362fab440718d0", "score": "0.67911553", "text": "function createPlatform(){\n\t\n\t//chooses a new pattern after the previous pattern has finished\n\tif (waitPattern<=0){ \n\t\tnextPattern = game.rnd.integerInRange(1,7); //Next Pattern Choice\n\t\tconsole.log(nextPattern);\n\t\tstartScroll = scrollSpeed;\n\n\t}\n\t//PLATFORM CREATION (Note the x&y parameters are multiplied by 64 for the size of a block)\n\t//1st platform pattern\n\tif (nextPattern == 1){ \n\t\tnextPattern = 0;\n\t\twaitPattern = (64*8)/scrollSpeed; //length until next pattern (8)\n\t\taddPlatform(0,1,'platform1',true,1);\n\t\taddPlatform(1,1,'platform1',true,1);\n\t\taddPlatform(2,1,'platform1',true,1);\n\t\taddPlatform(3,1,'platform1',true,1);\n\t\taddPlatform(4,1,'platform1',true,1);\n\t\taddPlatform(4,2,'platform1',true,1);\n\t\taddPlatform(4,3,'platform1',true,1);\n\t\taddPlatform(4,4,'platform1',true,1);\n\t\taddPlatform(5,4,'platform1',true,1);\n\t\taddPlatform(6,4,'platform1',true,1);\n\t\taddPlatform(7,4,'platform1',true,1);\n\t\taddPlatform(7,3,'platform1',true,1);\n\t\taddPlatform(7,2,'platform1',true,1);\n\t\taddPlatform(7,1,'platform1',true,1);\t\n\t}else if (nextPattern == 2){ //pattern 2\n\t\tnextPattern = 0;\n\t\twaitPattern = (64*10)/scrollSpeed; //length until next pattern (10)\n\t\taddPlatform(0,0,'platform1',true,3);\n\t\taddPlatform(2,1,'platform1',true,3);\n\t\taddPlatform(4,2,'platform1',true,3);\n\t\taddPlatform(6,3,'platform1',true,3);\n\t\taddPlatform(8,4,'platform1',true,3);\t\t\n\t} else if(nextPattern==3){ //pattern 3\n\t\tnextPattern=0;\n\t\twaitPattern = (64*13)/scrollSpeed; //length until next pattern (13)\n\t\taddPlatform(0,1,'platform1',true,1);\n\t\taddPlatform(1,1,'platform1',true,1);\n\t\taddPlatform(2,1,'platform1',true,1);\n\t\taddPlatform(3,1,'platform1',true,1);\n\t\taddPlatform(4,5,'platform1',false,1);\n\t\taddPlatform(5,5,'platform1',false,1);\n\t\taddPlatform(6,5,'platform1',false,1);\n\t\taddPlatform(7,5,'platform1',false,1);\n\t\taddPlatform(8,5,'platform1',false,1);\n\t\taddPlatform(8,3,'platform1',true,1);\n\t\taddPlatform(9,3,'platform1',true,1);\n\t\taddPlatform(10,3,'platform1',true,1);\n\t\taddPlatform(11,3,'platform1',true,1);\n\t\taddPlatform(12,3,'platform1',true,1);\t\n\t} else if(nextPattern==4){ //pattern 4\n\t\tnextPattern=0;\n\t\twaitPattern = (64*21)/scrollSpeed; //length until next pattern (21)\n\t\taddPlatform(2,5,'platform1',false,4);\n\t\taddPlatform(0,2,'platform1',true,3);\n\t\taddPlatform(6,0,'platform1',false,8);\n\t\taddPlatform(9,6,'platform1',false,4);\n\t\taddPlatform(12,4,'platform1',false,3);\n\t\taddPlatform(15,9,'platform1',false,6);\n\t} else if(nextPattern==5){ //pattern 5\n\t\tnextPattern=0;\n\t\twaitPattern = (64*34)/scrollSpeed; //length until next pattern (34)\n\t\taddPlatform(0,4,'platform1',false,4);\n\t\taddPlatform(4,10,'platform1',false,8);\n\t\taddPlatform(10,8,'platform1',false,3);\n\t\taddPlatform(12,7,'platform1',false,2);\n\t\taddPlatform(13,6,'platform1',false,2);\n\t\taddPlatform(14,5,'platform1',false,2);\n\t\taddPlatform(15,4,'platform1',false,2);\n\t\taddPlatform(16,3,'platform1',false,2);\n\t\taddPlatform(17,2,'platform1',false,2);\n\t\taddPlatform(18,1,'platform1',false,2);\n\t\taddPlatform(19,0,'platform1',false,4);\n\t\taddPlatform(22,2,'platform1',false,2);\n\t\taddPlatform(23,3,'platform1',false,2);\n\t\taddPlatform(24,4,'platform1',false,2);\n\t\taddPlatform(25,5,'platform1',false,2);\n\t\taddPlatform(26,6,'platform1',false,4);\n\t\taddPlatform(29,2,'platform1',false,5);\n\t} else if(nextPattern==6){ //pattern 6\n\t\tnextPattern=0;\n\t\twaitPattern = (64*33)/scrollSpeed; //length until next pattern (33)\n\t\t//addPlatform(1,1,'platform1',true,1);\n\t\taddPlatform(0,2,'platform1',true,6);\n\t\taddPlatform(4,5,'platform1',false,5);\n\t\taddPlatform(8,3,'platform1',false,7);\n\t\taddPlatform(13,5,'platform1',false,5);\n\t\taddPlatform(16,3,'platform1',false,7);\n\t\taddPlatform(22,7,'platform1',false,5);\n\t\taddPlatform(26,5,'platform1',false,2);\n\t\taddPlatform(27,4,'platform1',false,2);\n\t\taddPlatform(28,3,'platform1',false,2);\n\t\taddPlatform(29,2,'platform1',false,4);\n\t} else if(nextPattern==7){ //pattern 7\n\t\tnextPattern=0;\n\t\twaitPattern = (64*31)/scrollSpeed; //length until next pattern (31)\n\t\taddPlatform(0,0,'platform1',true,31);\n\t\taddPlatform(2,9,'platform1',true,3);\n\t\taddPlatform(5,7,'platform1',false,2);\n\t\t\taddPlatform(4,5,'platform1',false,3);\n\t\t\taddPlatform(6,6,'platform1',false,2);\n\t\taddPlatform(11,2,'platform1',false,2);\n\t\t\taddPlatform(12,1,'platform1',false,2);\n\t\taddPlatform(15,5,'platform1',false,2);\n\t\t\taddPlatform(15,3,'platform1',false,2);\n\t\t\taddPlatform(16,4,'platform1',false,2);\n\t\taddPlatform(10,6,'platform1',false,6);\n\t\taddPlatform(12,9,'platform1',false,2);\n\t\taddPlatform(17,0,'platform1',true,2);\n\t\t\taddPlatform(16,1,'platform1',true,2);\n\t\taddPlatform(23,6,'platform1',false,8);\n\t\t\taddPlatform(20,3,'platform1',false,11);\n\t\t\taddPlatform(22,9,'platform1',false,2);\n\t\t\taddPlatform(24,4,'platform1',false,1);\n\t\t\taddPlatform(26,5,'platform1',false,1);\n\t\t\taddPlatform(28,4,'platform1',false,1);\n\t}\n\n\twaitPattern-=game.time.elapsed/1000*(scrollSpeed/startScroll); //calculates when the next pattern should start\n\n\t//deletes platforms off the screen\n\tplatforms.forEach(function(platform){\n\t\tif(platform.x<-64){\n\t\t\tplatform.kill();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1a3c3e80f326790d69067a6978b5c5dd", "score": "0.6663578", "text": "function addPlatforms() {\n platforms = game.add.physicsGroup();\n platforms.create(0,0,'fondo');\n platforms.create(450, 200, 'platform');\n platforms.create(170 , 550, 'platform_2');\n platforms.create(320 , 450, 'platform');\n platforms.create(500, 100, 'platform_2');\n platforms.create(300 , 300, 'platform');\n platforms.create(100 , 200, 'platform_2');\n platforms.create(600, 300, 'platform_2');\n platforms.create(200, 70, 'platform');\n \n\n\n platforms.setAll('body.immovable', true);\n}", "title": "" }, { "docid": "b79c78c62b5e7734206d453048d4a0c0", "score": "0.6639519", "text": "function draw_platforms() {\n context.fillStyle = \"#333333\";\n for (var i = 0; i < platforms.length; i++) {\n context.fillRect(platforms[i].x, platforms[i].y, platforms[i].width, platforms[i].height);\n }\n}", "title": "" }, { "docid": "d8732f8e84d7e0e03ca1aaa44a5d048e", "score": "0.66319853", "text": "makePlatform() {\n\n var i;\n var sx;\n for (i = 0; i < this.platNum; i++) {\n let sx2 = Phaser.Math.RND.between(this.xL, this.xR);\n if(sx == null) sx = sx2;\n else if (sx < sx2-this.platWidth&& sx > sx2-(this.platWidth+this.player.width+10)) sx = sx2 - this.player.width;\n else if(sx > sx2+this.platWidth&& sx < sx2+(this.platWidth+this.player.width+10)) sx = sx2 + this.player.width;\n else sx = sx2;\n this.xL = sx-(game.config.width*.5); //flag (*2/3) in 540p\n if (this.xL < -25)this.xL = 0;\n this.xR = sx+(game.config.width*.5); //flag (*2/3) in 540p\n if (this.xR > game.config.width+25)this.xR = game.config.width;\n //console.log(sx);\n\n let platform = this.platforms.create(sx, game.config.height+150, \"sprites\", \"rampsmall\");\n\n platform.setScale(1);\n platform.body.allowGravity = false;\n platform.body.immovable = true;\n platform.body.velocity.y = this. platMod*this.scroll;\n platform.body.checkCollision.left = false;\n platform.body.checkCollision.right = false;\n platform.body.checkCollision.down = false;\n platform.setFrictionX(1);\n platform.setDepth(this.PLATFORM_DEPTH);\n\n let spawnRoll = Phaser.Math.RND.between(0, 100);\n\n // runs code to determine what object is spawned\n if (spawnRoll <= this.itemDrop) {\n this.spawnObject(sx, game.config.height+150-(platform.height/2));\n }\n }\n }", "title": "" }, { "docid": "76371a7ae00decf36b63a49e32c7fe6f", "score": "0.6517573", "text": "function createPlatform(x, y, siz_x, siz_y, img)\n{\n\tvar e = 0.999;\n\tvar mass = 8;\n\tvar pos = new vector(x, y);\n\tvar size = new vector(siz_x, siz_y);\n\tobjs_static.push(new SpriteStatic(pos, size, mass, e, img));\n}", "title": "" }, { "docid": "1770a9167620975c8dcf695c9b3e38a4", "score": "0.65027726", "text": "function setPlatforms(json)\n{\n for (const platform of json) {\n var option = createPlatformOption(platform['nom']);\n appendTo(option, 'platform');\n }\n}", "title": "" }, { "docid": "bd06e7e863da20117a650e0602ec0f60", "score": "0.6444125", "text": "addPlatform(platformInfo){\n //Generates new platform, sets it to platform being placed by opponent\n const userPlatform = new Platform(this, platformInfo.x, platformInfo.y, platformInfo.spriteKey, this.socket, platformInfo.platformId);\n //Adds platform to both group and table\n this.allPlatforms.add(userPlatform);\n this.input.setDraggable(userPlatform,false);\n this.platformTable[userPlatform.id] = userPlatform\n }", "title": "" }, { "docid": "282862865c405f87f4dce46a95ffa39b", "score": "0.6417598", "text": "function Platform(opts) {\n /** The PlatformFamily we belong to/are part of. */\n this.family = opts.family;\n this.family.platforms.push(this);\n /** The completely specific name like \"linux32-opt\" */\n this.fullName = opts.fullName;\n /** The variation that makes us different from our family, like \"32-opt\" */\n this.shortName = opts.shortName;\n this.info = opts.info;\n}", "title": "" }, { "docid": "92f7b43763870ccd7db7e7c841c87451", "score": "0.6371915", "text": "function initPlatformSprites() {\n widePlatformSprites.push( new Sprite('sprites/stage/Block0002.png', [0, 0], [1920, 1080], 5, [0], 0) );\n widePlatformSprites.push( new Sprite('sprites/stage/Block0003.png', [0, 0], [1920, 1080], 5, [0], 0) );\n\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1000.png', [0, 0], [1539, 867], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1001.png', [0, 0], [727, 753], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1002.png', [0, 0], [1235, 713], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1003.png', [0, 0], [700, 320], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1004.png', [0, 0], [958, 317], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1005.png', [0, 0], [893, 214], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1006.png', [0, 0], [659, 406], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1007.png', [0, 0], [378, 444], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1008.png', [0, 0], [775, 629], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1009.png', [0, 0], [440, 249], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1010.png', [0, 0], [501, 400], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1011.png', [0, 0], [501, 400], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1012.png', [0, 0], [360, 214], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1013.png', [0, 0], [315, 314], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1014.png', [0, 0], [670, 453], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1015.png', [0, 0], [500, 294], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block1016.png', [0, 0], [480, 331], 5, [0], 0) );\n\n smallPlatformSprites.push( new Sprite('sprites/stage/Block2000.png', [0, 0], [698, 43], 5, [0], 0) );\n smallPlatformSprites.push( new Sprite('sprites/stage/Block2001.png', [0, 0], [43, 698], 5, [0], 0) );\n }", "title": "" }, { "docid": "11792394a97e19325d61a75db77da09c", "score": "0.6338226", "text": "function getPlatform(i) {\n\treturn gameObjects[TYPE_PLATFORMS][i];\n}", "title": "" }, { "docid": "363579006f12d644020e2649a1510701", "score": "0.6334133", "text": "function PlatformSpawn() {\n\t// class constructor\n\tthis.spriteID = 0;\n\tthis.platformStyle = 'metal';\n\tthis.platformType = 'wave_horiz';\n\tthis.platformWidth = 1;\n}", "title": "" }, { "docid": "72ee2ce23958510554ce869f665e29fa", "score": "0.63156486", "text": "function setup() {\n createCanvas(1280, 720);\n\n climber = new Climber(500, 500, 500, 500, 2, climbImg, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW);\n\n\n\n // For loop\n //\n // To make array objects for platform\n for (let i = 0; i < numbPlat; i++) {\n\n // random()\n //\n // adding position for the platforms\n let reX = random(0, width);\n let reY = random(0, height);\n\n platformShortPlus = new Platform(reX, reY, 500, 500, platShortImg);\n platformLongPlus = new Platform(reX, reY, 1000, 500, platLongImg);\n\n // push()\n //\n // To add more platform in the screen as an array\n platformShort.push(platformShortPlus);\n platformLong.push(platformLongPlus);\n\n }\n\n}", "title": "" }, { "docid": "8a9d07481ce443cc2a6fb93961c0076a", "score": "0.630753", "text": "function setup() {\r\n\tcreateCanvas(screenWidth, screenHeight);\r\n\tnoSmooth();\r\n\trectMode(CENTER);\r\n\r\n\t// create a field of platforms\r\n\tlet nextY = 1;\r\n\tlet dy = 0;\r\n\r\n\tfor(let i = 0; i < 250; i++) {\r\n\t\tif(i % 10 === 0) dy++;\r\n\t\tconst x = floor(random() * 7);\r\n\t\tconst y = nextY + floor(random() * (i / 10) - (i / 20));\r\n\r\n\t\tplatforms.add(new Platform(x, y));\r\n\t\tif(random() > 0.8) powerups.add(new Powerup(x, y + 1))\r\n\t\tnextY += dy;\r\n\t}\r\n\r\n\tfor(let x = 1; x < 7; x++) {\r\n\t\tplatforms.add(new Platform(x, 0));\r\n\t}\r\n}", "title": "" }, { "docid": "5011326f671724cfa7acd4b53d2a076a", "score": "0.6305474", "text": "function addPlatform(platform_x, platform_y) {\n\n if (sprite_num >= 100) return;\n\n\n sprite[sprite_num].x = platform_x ;\n sprite[sprite_num].y = platform_y ;\n sprite[sprite_num].animate = 0;\n sprite[sprite_num].facingRight = true;\n sprite[sprite_num].active = true;\n sprite[sprite_num].visible = true;\n \n sprite[sprite_num].topBB = 0; \n sprite[sprite_num].bottomBB = 8;\n sprite[sprite_num].leftBB = 0;\n sprite[sprite_num].rightBB = 40;\n \n sprite[sprite_num].type = \"platform\";\n \n sprite_num ++;\n platform_num = sprite_num;\n}", "title": "" }, { "docid": "b2c1ff1357c67aa2e953309e33d5488b", "score": "0.62939304", "text": "platformIcons(platform) {\n let icon = [];\n switch (platform) {\n case 'MacIntel':\n case 'Macintosh':\n case 'MacPPC':\n case 'iPhone':\n case 'iPad':\n icon = ['fab', 'apple'];\n break;\n case 'Linux i686':\n case 'Linux x86_64':\n case 'Linux armv7l':\n icon = ['fab', 'linux'];\n break;\n case 'Win32':\n icon = ['fab', 'windows'];\n break;\n default:\n // fall back to text if we can't detect\n icon = undefined;\n }\n\n return {\n KC_LGUI: icon,\n KC_RGUI: icon\n };\n }", "title": "" }, { "docid": "118d5f8a3b4c4e2e69822038abb6ffb4", "score": "0.62424046", "text": "function PlatformSettings() {}", "title": "" }, { "docid": "5eda8bc41189dad894fb2c39a82b59b6", "score": "0.61808705", "text": "function PlatformFamily(opts) {\n this.name = opts.name;\n this.platforms = [];\n this.jobTypeFamilies = [];\n this._jobTypeFamiliesByName = {};\n}", "title": "" }, { "docid": "6012c84497df665fcb4ee604c75a1d6b", "score": "0.61282635", "text": "function getPlatforms(includeChromeOs) {\n var supportedPlatforms = ['linux64', 'linux32', 'osx64', 'win32', 'win64'];\n var platforms = [];\n var regEx = /--(\\w+)/;\n for (var i = 3; i < process.argv.length; i++) {\n var arg = process.argv[i].match(regEx)[1];\n if (supportedPlatforms.indexOf(arg) > -1) {\n platforms.push(arg);\n } else if (arg === 'chromeos') {\n if (includeChromeOs) {\n platforms.push(arg);\n }\n } else {\n console.log(`Your current platform (${os.platform()}) is not a supported build platform. Please specify platform to build for on the command line.`);\n process.exit();\n }\n }\n if (platforms.length === 0) {\n switch (os.platform()) {\n case 'darwin':\n platforms.push('osx64');\n \n break;\n case 'linux':\n platforms.push('linux64');\n \n break;\n case 'win32':\n platforms.push('win32');\n \n break;\n case 'win64':\n platforms.push('win64');\n \n break;\n default:\n break;\n }\n }\n \n console.log('Building for platform(s): ' + platforms + '.');\n \n return platforms;\n}", "title": "" }, { "docid": "18726be97f612f2b940ac62e3f3878c4", "score": "0.60803723", "text": "function switchPlatform(tags, prevPlat) {\n\n var tagPlatform = \"\";\n\n //go through each tags for known platform labels\n for (var x = 0, found = 0; x < tags.length && found == 0; x++) {\n\n var tag = tags[x].replace(/[^a-zA-Z0-9 ]/g, \"\").toLowerCase();\n\n if (prevPlat == \"mdx_2_0\" && tag == \"mdx2\") {\n\n tagPlatform = \"mdx_2_0\"\n break;\n\n } else if (prevPlat == \"mdx_nxt\" && tag == \"mdxnxt\") {\n\n tagPlatform = \"mdx_nxt\"\n break;\n\n } else {\n\n switch (tag) {\n\n case \"dmp\":\n tagPlatform = \"dmp\";\n found = 0;\n break;\n\n case \"newdsp\":\n tagPlatform = \"newdsp\";\n found = 0;\n break;\n\n case \"dsp\":\n tagPlatform = \"dsp\";\n found = 0;\n break;\n\n case \"mdx2\":\n tagPlatform = \"mdx_2_0\";\n found = 0;\n break;\n\n case \"mdxnxt\":\n tagPlatform = \"mdx_nxt\";\n found = 0;\n break;\n }\n }\n }\n changeSwitchTag(tagPlatform, prevPlat);\n }", "title": "" }, { "docid": "f5dda04b7037bae9d2eba1b0e67752f9", "score": "0.60455203", "text": "function addPlatformToGame() {\n game.ActivePlatforms.enQ(new Platform(true, new THREE.Vector3(0,0,0))); // adds a new platform w/ default pos (0,0,0)\n let dequeuedRes = game.ActivePlatforms.deQ();\n game.InactivePlatforms.enQ(dequeuedRes);\n }", "title": "" }, { "docid": "a90faa0f71a3a368b532a7ff2ec2f27c", "score": "0.6015312", "text": "function shortenPlatformname(platform){\n if(platform === undefined) return platform;\n //get rid of all whitespace\n platform = platform.toLowerCase().replace(/ /g, '').trim();\n \n //wiiu\n var data = {\n 'xbox360':'Xbox-360', \n 'xboxone':'xbox-one', \n 'ps4':'PS4', \n 'playstation4':'PS4', \n 'playstation3':'PS3', \n 'ps3':'ps3',\n 'playstationvita':'PSVita', \n 'psvita':'psvita',\n '3ds':'3DS', \n 'wiiu':'WII U', \n 'wii':'Wii'\n };\n return data[platform];\n}", "title": "" }, { "docid": "3760e48aea7b93e5e2408fef534d5a74", "score": "0.59989005", "text": "get platformName() {\n return platforms.get(this.payload.extra);\n }", "title": "" }, { "docid": "568f0dfefbb22946d839758f878bdcbb", "score": "0.59875864", "text": "function getPlatformsWww(projectRoot) {\n var platforms = process.env.CORDOVA_PLATFORMS.split(\",\");\n return platforms.map(function(platform){\n var platformRoot = path.join(projectRoot, \"platforms\", platform);\n return {\n name: platform,\n path: (function () {\n switch (platform.toLowerCase()) {\n case \"android\":\n return path.join(platformRoot, 'assets', 'www');\n case \"ios\":\n return path.join(platformRoot, 'www');\n case \"browser\":\n return path.join(platformRoot, 'www');\n default:\n throw new Error(\"Unknown platform \" + platform + \". Add it to hooksUtils.js if you need it...\");\n }\n })()\n };\n });\n}", "title": "" }, { "docid": "5dc35803102ead15b022262d5a7ed834", "score": "0.5960013", "text": "function movePlatforms() {\n if(doodlerBottomSpace > 200) {\n platforms.forEach(platform => {\n platform.bottom -=4\n let visual = platform.visual\n visual.style.bottom = platform.bottom + 'px'\n\n if(platform.bottom < 10) {\n let firstPlatform = platforms[0].visual\n firstPlatform.classList.remove('platform') // This is so that we can no longer see that specific platform\n platforms.shift() // Gets rid of the first item in the array, which is the platform that is less than 10px from the bottom\n score++ // This increments the score each time a platform is removed from the array, meaning that the doodler has bypassed that platform\n\n // Now, we want to create a new platform, each time an old platform vanishes\n let newPlatform = new Platform(600) // We passed through 600 so that a new platform can start at 600px which is the top of our grid\n platforms.push(newPlatform) // Pushes the new platform into our array\n\n }\n })\n }\n }", "title": "" }, { "docid": "dde5378425d6ca12777564f2b842e54a", "score": "0.5932263", "text": "createFloor() {\n let h = SPRITE_PLATFORM.height;\n let y = CANVAS.clientHeight - SPRITE_PLATFORM.width / 2 - SPRITE_PLATFORM_TOP.height;\n let n = CANVAS.width / SPRITE_PLATFORM_TOP.width + PLATORM_BUFFER;\n\n for (let i=0; i<n/4; i++) {\n let x = i * SPRITE_PLATFORM.width * 4;\n this.platformFactory.create(this, x, y, n / 4);\n }\n }", "title": "" }, { "docid": "400b2c2ab832383e2d4ecd9dace69f92", "score": "0.5926231", "text": "function getPlatforms(json)\n{\n\tvar platforms = [];\n\tvar data = JSON.parse(json);\n\tvar index = 0;\n\n\tfor (var p in data) {\n\t\tplatforms[index] = p;\n\t\tindex++;\n }\n\n\treturn platforms;\n}", "title": "" }, { "docid": "3a9ca521fd8b6bc6c37a7e0697bb9aa8", "score": "0.59192234", "text": "constructor(){\n this.platform = [];\n }", "title": "" }, { "docid": "51c06e10c72f965955bec5f22bc43ae3", "score": "0.58734953", "text": "function makeWindows() {\n if (writeHTML()) {\n opts = [];\n }\n elements.push('<meta name=\"msapplication-TileColor\" content=\"' + options.background + '\" />');\n if (options.tileBlackWhite) {\n opts.push('-fuzz 100%', '-fill black', '-opaque red', '-fuzz 100%', '-fill black', '-opaque blue', '-fuzz 100%', '-fill white', '-opaque green');\n }\n [70, 144, 150, 310].forEach(function (size) {\n var dimensions = size + 'x' + size,\n name = 'windows-tile-' + dimensions + '.png',\n command = combine(options.source, options.dest, dimensions, name, opts);\n convert(command, name);\n if (size === 144) {\n elements.push('<meta name=\"msapplication-TileImage\" content=\"' + name + '\" />');\n } else {\n elements.push('<meta name=\"msapplication-square' + dimensions + 'logo\" content=\"' + name + '\" />');\n }\n });\n }", "title": "" }, { "docid": "24d3a656c562efe32ca17c2b4f08a3a4", "score": "0.5866371", "text": "function platform () {\n return currentPlatform\n}", "title": "" }, { "docid": "f6dffbdab413001e03cdfbcad8a54225", "score": "0.58390886", "text": "initPlatformDependentInstances() {\n logger.log(\"Creating platform dependent instances (standalone=\", false, \")\");\n\n if (false) {} else {\n this.platformWrapper = new _platform_browser_wrapper__WEBPACK_IMPORTED_MODULE_17__[\"PlatformWrapperImplBrowser\"](this);\n }\n\n // Start with empty ad provider\n this.adProvider = new _platform_ad_providers_no_ad_provider__WEBPACK_IMPORTED_MODULE_13__[\"NoAdProvider\"](this);\n this.sound = new _platform_browser_sound__WEBPACK_IMPORTED_MODULE_16__[\"SoundImplBrowser\"](this);\n this.analytics = new _platform_browser_google_analytics__WEBPACK_IMPORTED_MODULE_15__[\"GoogleAnalyticsImpl\"](this);\n this.gameAnalytics = new _platform_browser_game_analytics__WEBPACK_IMPORTED_MODULE_30__[\"ShapezGameAnalytics\"](this);\n }", "title": "" }, { "docid": "1761c53c6558dd50d2b70ecf09d00e45", "score": "0.5828857", "text": "function addPlatform(x, y, z, rotation, ice) {\n\n //See if this platform is made of ice:\n var is_ice = ice != null ? ice : (4 == Math.floor(Math.random() * 5)); //If ice not specified, then it is\n \n // 3rd dimension to drop the tree\n var xPos = null;\n var yPos = null;\n var zPos = null;\n \n if(x == null){\n\txPos = x + (Math.random() * worldWidth*2) - (worldWidth / 1);\n } else {\n\txPos = x;\n }\n if(y == null){\n\tyPos = y + (Math.random() * worldDepth*2) - (worldDepth / 1);\n } else {\n\tyPos = y;\n }\n\n // If no Z was given, z-lock the position to the terrain + random amount\n if (z == null) {\n\n // Find the top-most intersection with any terrain layer for the given 2d coords\n var c = intersectGroundObjs(xPos, yPos);\n\n // Only allow placing a tree if the location is above terrain and the top-most terrain is not water\n if (c.length == 0 || c[0].object == water) { //Mike broke this :-S - need to include water in the intersection!\n return\n }\n\n zPos = c[0].point.z;\n zPos = zPos + Math.random() * 20; //Now randomise the height above ground a bit\n } else {\n zPos = z;\n }\n\n\n // Create Container and hit box geometries\n \n if(!is_ice){ //Do a normal platform\n\tvar platformGeo = new THREE.CubeGeometry(5,10,1); //We're using an older version of Three.js here!\n\tvar platformMat = Physijs.createMaterial(\n new THREE.MeshPhongMaterial( {\n color: 0x1188AA\n }),\n .5, // moderate friction\n .4 // low restitution\n )\n } else { //ICE platform!\n\tvar platformGeo = new THREE.CubeGeometry(10,10,1); //Bigger ICE platform!\n\tvar platformMat = Physijs.createMaterial(\n new THREE.MeshPhongMaterial( {\n color: 0xAAEEFF,\n transparent: true,\n opacity: 0.6,\n }),\n .1, // v low friction\n .4 // low restitution\n )\n }\n \n \n \n //Check our supermega.platform obj works:\n var platformObj = new SuperMega.Platform({\n\t\"material\":platformMat,\n\t\"geometry\":platformGeo,\n\t\"mass\" : 0,\n\t\"position\" : new THREE.Vector3(xPos, yPos, zPos),\n \t\"orientation\" : \"random\"\n });\n \n\n \n // Add the complete platform to the scene\n level.add(platformObj, \"collidables\");\n \n //Make a note of our platforms in the collision list:\n all_platforms.push(platformObj); //platform, abusing trees for now\n \n return platformObj;\n \n}", "title": "" }, { "docid": "de7c1e070e74603aafd5c58cf306e9b3", "score": "0.5824331", "text": "function create() {\r\n $(\".loading\").remove();\r\n document.getElementById(\"before\").style.display = \"none\";\r\n /**creating background sound scene */\r\n var themeSound = this.sound.add(\"themeSound\", \"loop: true\");\r\n themeSound.play();\r\n /**background */\r\n this.add.image(0, 0, \"background\").setOrigin(0, 0);\r\n /**platforms */\r\n platforms = this.physics.add.staticGroup();\r\n //platforms.create(400, 568, 'ground').setScale(2).refreshBody();\r\n platforms.create(400, 584, \"basePlatform\");\r\n\r\n platforms.create(397, 430, \"platform1\");\r\n\r\n platforms.create(200, 300, \"platform2\");\r\n platforms.create(600, 300, \"platform2\");\r\n\r\n platforms.create(50, 200, \"platform1\");\r\n platforms.create(750, 200, \"platform1\");\r\n\r\n platforms.create(397, 100, \"platform3\");\r\n /**player */\r\n player = this.physics.add.sprite(100, 450, \"dude\");\r\n\r\n player.setBounce(0.3);\r\n player.setCollideWorldBounds(true);\r\n //acceleration\r\n player.setMaxVelocity(320, 320);\r\n\r\n /**player animations */\r\n this.anims.create({\r\n key: \"left\",\r\n frames: this.anims.generateFrameNumbers(\"dude\", { start: 0, end: 5 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\r\n this.anims.create({\r\n key: \"turn\",\r\n frames: this.anims.generateFrameNumbers(\"dude\", { start: 6, end: 9 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\r\n this.anims.create({\r\n key: \"right\",\r\n frames: this.anims.generateFrameNumbers(\"dude\", { start: 10, end: 15 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\r\n this.anims.create({\r\n key: \"death\",\r\n frames: [{ key: \"dude\", frame: 16 }],\r\n frameRate: 20\r\n });\r\n\r\n this.anims.create({\r\n key: \"jumping\",\r\n frames: this.anims.generateFrameNumbers(\"dude\", { start: 17, end: 18 }),\r\n frameRate: 10,\r\n repeat: -1\r\n });\r\n\r\n /**defines controling by keyboard*/\r\n cursors = this.input.keyboard.createCursorKeys();\r\n\r\n /**creating collectable stars */\r\n\r\n stars = this.physics.add.group({\r\n key: \"star\",\r\n repeat: 1,\r\n setXY: { x: 25, y: 0, stepX: 50 }\r\n });\r\n\r\n stars.children.iterate(function(child) {\r\n child.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8));\r\n });\r\n\r\n /**creating bombs */\r\n bombs = this.physics.add.group();\r\n\r\n /**creating score field*/\r\n scoreText = this.add.text(16, 16, \"score: 0\", {\r\n fontSize: \"24px\",\r\n fill: \"#ffffff\",\r\n fontFamily: '\"Press Start 2P\", cursive'\r\n });\r\n /**creating level field */\r\n lvlText = this.add.text(600, 16, \"level: 0\", {\r\n fontSize: \"24px\",\r\n fill: \"#ffffff\",\r\n fontFamily: '\"Press Start 2P\", cursive'\r\n });\r\n /**coliders */\r\n //dynamic objects(player) colidating with static object(platform)\r\n this.physics.add.collider(player, platforms);\r\n //stars wont fall out of scene\r\n this.physics.add.collider(stars, platforms);\r\n\r\n this.physics.add.collider(bombs, platforms);\r\n\r\n this.physics.add.collider(player, bombs, hitBomb, null, this);\r\n //stars wont be in front of our character\r\n this.physics.add.overlap(player, stars, collectStar, null, this);\r\n }", "title": "" }, { "docid": "3a54f3e43c6116d74868a6a8db4445e8", "score": "0.57969", "text": "function adaugaPlatforme() {\n platforme = joc.add.physicsGroup();\n\n platforme.create(450, 150, 'platforma');\n platforme.create(250, 440, 'platforma');\n platforme.create(150, 300, 'platforma' );\n platforme.create(300, 150, 'platforma');\n platforme.create(350, 540, 'platforma');\n platforme.setAll('body.immovable', true);\n}", "title": "" }, { "docid": "a9dfab504c2a7db59996937f1add836d", "score": "0.57910055", "text": "function init(){\n\t\n\t\t//Initialize y movement (none)\n\t\tgravityValue = 0;\n\t\tjumpPressed = false;\n\t\n\t\t//Sets up the platform array\n\t\tplatformArr = [];\n\t\t\n\t\t//Two empty objects for first platforms\n\t\tvar p = {};\n\t\tvar p2 = {};\n\t\t\n\t\t//First platform setup\n\t\tp.x = 25;\n\t\tp.y = 550;\n\t\tp.length = Math.floor((Math.random() * 1000) + 500);\n\t\t\n\t\t//Second platform setup\n\t\tp2.x = p.x + p.length + Math.floor((Math.random() * 200) + 30);\n\t\tp2.y = p.y + Math.floor((Math.random() * 70) + 70);\n\t\tp2.length = Math.floor((Math.random() * 1000) + 500);\n\t\t\n\t\t//State of platform (for movement)\n\t\tplatformState = platformS.GAME_STATE.WALKING;\n\t\t\n\t\t//adds platforms to array\n\t\tplatformArr.push(p);\n\t\tplatformArr.push(p2);\n\t\t\n\t\t//Sets speed of character (all movement contained in this class\n\t\tspeed = 7;\n\t}", "title": "" }, { "docid": "e580f04f838881ec5a3194cfd28c9bc7", "score": "0.5755894", "text": "addPlatform(platformWidth, posX) {\n let platform;\n if (this.platformPool.getLength()) {\n platform = this.platformPool.getFirst();\n platform.x = posX;\n platform.active = true;\n platform.visible = true;\n this.platformPool.remove(platform);\n } else {\n platform = this.physics.add.sprite(\n posX,\n game.config.height * 0.8,\n 'platform'\n );\n platform.setImmovable(true);\n platform.setVelocityX(gameOptions.platformStartSpeed * -1);\n this.platformGroup.add(platform);\n }\n platform.displayWidth = platformWidth;\n this.nextPlatformDistance = Phaser.Math.Between(\n gameOptions.spawnRange[0],\n gameOptions.spawnRange[1]\n );\n }", "title": "" }, { "docid": "d26f61637987edb42133cee9fb372a54", "score": "0.57488775", "text": "function create() {\n\n // Adds platform with physics engine\n platforms = this.physics.add.staticGroup();\n platforms.create(windowWidth/2, 1239, 'ground').setScale(10).refreshBody();\n\n // Adds player sprite\n player = this.physics.add.sprite(30,1040, 'player');\n\n // Player is map-bounded\n player.setCollideWorldBounds(true);\n\n // Takes sprite image and determinte keyframes according to player direction\n this.anims.create({\n key: 'left',\n frames: this.anims.generateFrameNumbers('player', { start: 0, end: 3 }),\n frameRate: 5,\n repeat: -1\n });\n this.anims.create({\n key: 'turn',\n frames: [ { key: 'player', frame: 4 } ],\n frameRate: 10\n });\n this.anims.create({\n key: 'turn-left',\n frames: [ { key: 'player', frame: 9 } ],\n frameRate: 10\n });\n this.anims.create({\n key: 'right',\n frames: this.anims.generateFrameNumbers('player', { start: 5, end: 8 }),\n frameRate: 5,\n repeat: -1\n });\n\n // Create variable holding keyboard input\n cursors = this.input.keyboard.createCursorKeys();\n keys = this.input.keyboard.addKeys({\n up: 'W',\n left: 'A',\n right: 'D',\n slide: 'SPACE'\n });\n\n // Set collision between player and platform\n this.physics.add.collider(player, platforms);\n}", "title": "" }, { "docid": "c7db8ff4d53add109a233f3ea5c6c2ce", "score": "0.5743786", "text": "is_platform() {\n\t\treturn type_platform==this.type;\n\t}", "title": "" }, { "docid": "144f083a70fc7152c464c0e5e483c25f", "score": "0.5724382", "text": "function OS()\n{\n this._name = 'linux';\n this._arch = 'x86_64';\n}", "title": "" }, { "docid": "de48b5114680d27b1f1d039831587de7", "score": "0.5712547", "text": "showPlatformButtons(){\n this.phase = \"build\"\n this.platformMaker.setVisible(true);\n this.platformDestroyer.setVisible(true);\n this.platformMaker.setInteractive()\n this.platformDestroyer.setInteractive();\n }", "title": "" }, { "docid": "f1d56f6f07ca07b7754323d209fc2a49", "score": "0.56961054", "text": "function movePlatforms() {\n if (doodlerBottomSpace > 200) {\n platforms.forEach((platform) => {\n platform.bottom -= 4;\n let visual = platform.visual;\n visual.style.bottom = platform.bottom + 'px';\n // if the platform is lower than 10 px, remove it from the array (shift) and increase the score by 1. Create a new platform, push it to the platform array, passing the constructor a height of 600 px\n if (platform.bottom < 10) {\n let firstPlatform = platforms[0].visual;\n firstPlatform.classList.remove('platform');\n platforms.shift();\n score++;\n let newPlatform = new Platform(600);\n platforms.push(newPlatform);\n }\n });\n }\n }", "title": "" }, { "docid": "a81d2bfb32c3c336b6cfd8069d4fdce9", "score": "0.5658966", "text": "function renderplat(){\n ctx.fillStyle = \"#45597E\";\n ctx.fillRect(platforms[0].x, platforms[0].y, platforms[0].width, platforms[0].height);\n ctx.fillRect(platforms[1].x, platforms[1].y, platforms[1].width,platforms[1]. height);\n\n}", "title": "" }, { "docid": "5ed7024679aeb751c0fe1e0bce764221", "score": "0.5647746", "text": "function getPlatform(){\n if (navigator.platform.indexOf('Win') >= 0){\n if (navigator.userAgent.indexOf(\"WOW64\") === -1 && navigator.userAgent.indexOf(\"Win64\") === -1 ){\n return openrct2.Platform.WINDOWS32;\n } else {\n return openrct2.Platform.WINDOWS64; // 64-bit is the default as it is by far the most common these days\n }\n } else if (navigator.platform.indexOf('Linux') >= 0){\n return openrct2.Platform.LINUX;\n } else if (navigator.platform === 'MacIntel'){\n return openrct2.Platform.MACOS;\n } else {\n return openrct2.Platform.UNKNOWN;\n }\n}", "title": "" }, { "docid": "515c2916e8b61a81206c26a986de614d", "score": "0.5633171", "text": "function _createPlatform(injector) {\n if (_platform && !_platform.destroyed && !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n\n publishDefaultGlobalUtils$1();\n _platform = injector.get(_PlatformRef);\n var inits = injector.get(_PLATFORM_INITIALIZER, null);\n if (inits) inits.forEach(function (init) {\n return init();\n });\n return _platform;\n }", "title": "" }, { "docid": "f9db849bf83fe4961666017e33935291", "score": "0.5587027", "text": "function switchPlatformCat(tags, prevPlat) {\n\n var tagPlatform = \"\";\n var tagsArr = tags.split(\" \");\n\n for (var x = 0, found = 0; x < tagsArr.length && found == 0; x++) {\n\n var tag = tagsArr[x].replace(/[^a-zA-Z0-9 ]/g, \"\").toLowerCase();\n\n if (prevPlat == \"mdx_2_0\" && tag == \"mdx2\") {\n\n tagPlatform = \"mdx_2_0\";\n break;\n\n } else if (prevPlat == \"mdx_nxt\" && tag == \"mdxnxt\") {\n\n tagPlatform = \"mdx_nxt\";\n break;\n\n } else {\n switch (tag) {\n\n case \"dmp\":\n tagPlatform = \"dmp\";\n found = 0;\n break;\n\n case \"newdsp\":\n tagPlatform = \"newdsp\";\n found = 0;\n break;\n\n case \"dsp\":\n tagPlatform = \"dsp\";\n found = 0;\n break;\n\n case \"mdx2\":\n tagPlatform = \"mdx_2_0\";\n found = 0;\n break;\n\n case \"mdxnxt\":\n tagPlatform = \"mdx_nxt\";\n found = 0;\n break;\n }\n }\n }\n\n changeSwitchTag(tagPlatform, prevPlat);\n }", "title": "" }, { "docid": "a06a67595be53455e1c892af73eee85b", "score": "0.5571861", "text": "function addMovingPlatform(options) {\n var final_options = {\n\t \"object\" : options.object || null,\n\t \"position\" : options.position || null,\n\t \"orientation\" : options.orientation || new THREE.Vector3(0,0,0),\n\t \"angular_momentum\" : options.angular_momentum || new THREE.Vector3(0,0,0),\n\t \"translation\" : options.translation || new THREE.Vector3(0,0,0),\n\t \"rotation_mode\" : options.rotation_mode || \"continuous\",\n\t \"translation_mode\" : options.translation_mode || \"reciprocating\",\n\t \"magnitude\" : options.magnitude || 0,\n\t \"size\" : options.size || [10,10,1],\n\t \"color\" : options.color || 0xAA8833,\n\t \"friction\" : options.friction || .5,\n\t \"restitution\" : options.friction || .4\n };\n \n if(!final_options.object){ //Create a default platform out of PhysiJS\n\tvar platformGeo = new THREE.CubeGeometry(final_options.size[0],final_options.size[1],final_options.size[2]); //We're using an older version of Three.js here!\n\tvar platformMat = Physijs.createMaterial(\n new THREE.MeshPhongMaterial( {\n color: final_options.color\n }),\n final_options.friction, // moderate friction\n final_options.restitution // low restitution\n );\n var platformObj = new Physijs.BoxMesh(\n platformGeo,\n platformMat,\n 0 //Massless i.e. not affected by gravity\n );\n } else {\n\tvar platformObj = final_options.object;\n }\n \n if(!final_options.position){ //If no position is given, randomise\n\tvar x = null;\n\tvar y = null;\n\tvar z = null;\n\tvar xPos = null;\n\tvar yPos = null;\n\tvar zPos = null;\n\tif(x == null){\n\t\txPos = x + (Math.random() * worldWidth*2) - (worldWidth / 1);\n\t } else {\n\t\txPos = x;\n\t }\n\t if(y == null){\n\t\tyPos = y + (Math.random() * worldDepth*2) - (worldDepth / 1);\n\t } else {\n\t\tyPos = y;\n\t }\n\n\t // If no Z was given, z-lock the position to the terrain + random amount\n\t if (z == null) {\n\n\t // Find the top-most intersection with any terrain layer for the given 2d coords\n\t var c = intersectGroundObjs(xPos, yPos);\n\n\t // Only allow placing a tree if the location is above terrain and the top-most terrain is not water\n\t if (c.length == 0 || c[0].object == water) { //Mike broke this :-S - need to include water in the intersection!\n\t return\n\t }\n\n\t zPos = c[0].point.z;\n\t zPos = zPos + Math.random() * 20; //Now randomise the height above ground a bit\n\t } else {\n\t zPos = z;\n\t }\n\tplatformObj.position.set(xPos,yPos,zPos);\n } else {\n\tplatformObj.position.copy(final_options.position);\n }\n\n //Set other properties\n platformObj.rotation.setFromVector3(final_options.orientation);\n platformObj.angular_momentum = final_options.angular_momentum;\n platformObj.translation = final_options.translation;\n platformObj.translation_mode = final_options.translation_mode;\n platformObj.rotation_mode = final_options.rotation_mode; //TODO: support oscillating rotations\n platformObj.magnitude = final_options.magnitude;\n \n // Assign physics collision type and masks to both hit boxes so only specific collisions apply (currently the same as trees)\n platformObj._physijs.collision_type = CollisionTypes.TREE;\n platformObj._physijs.collision_masks = CollisionMasks.TREE;\n \n //Create watchers:\n platformObj.amount_moved = new THREE.Vector3(0,0,0);\n platformObj.velocity = new THREE.Vector3(0,0,0); //will be relative to the MAP not to the Player!!\n platformObj.origin = platformObj.position.clone(); //Where we started (or orbit around!)\n platformObj.rotation_matrix = new THREE.Matrix4(); //Necessary to do axis rotations\n \n //Add in shadows\n platformObj.castShadow = true; //Turn off for speed optimisation\n platformObj.receiveShadow = true;\n \n //Now monkey-patch on the animation capabilities:\n /**\n * platformObj.animate - animates the movement of the platform\n * @param delta: The number of seconds between frames\n */\n platformObj.animate = function(delta){\n\t//Fast abort for non-movers!\n\tif(this.magnitude == 0 && this.rotation_mode == null && this.translation_mode == null){\n\t return;\n\t}\n\t\n\t//Save current position:\n\tvar pos_before = this.position.clone();\n\t//Angular_momentum applies to rotation on axis\n\tthis.rotateX(this.angular_momentum.x * delta);\n\tthis.rotateY(this.angular_momentum.y * delta);\n\tthis.rotateZ(this.angular_momentum.z * delta);\n\t\n\t//Translation along path\n\tvar tx = this.translation.x*delta;\n\tvar ty = this.translation.y*delta;\n\tvar tz = this.translation.z*delta;\n\tif(this.translation_mode == \"continuous\" || this.translation_mode == \"reciprocating\"){\n\t //Check if we actually should continue moving (i.e. have we moved up to the limit yet?)\n\t if(this.amount_moved.distanceToSquared(new THREE.Vector3(0,0,0)) < Math.pow(this.magnitude,2)){ //Compare squares (computational efficiency)\n\t\t//This is just going to start moving and carry on until we reach the limit\n\t\tthis.position.x += tx;\n\t\tthis.position.y += ty;\n\t\tthis.position.z += tz;\n\t\tthis.amount_moved.x += Math.abs(tx);\n\t\tthis.amount_moved.y += Math.abs(ty);\n\t\tthis.amount_moved.z += Math.abs(tz);\n\t } else {\n\t\t if(this.translation_mode == \"reciprocating\"){\n\t\t //So we've exceeded the single throw distance, let's flip it all around:\n\t\t this.translation = new THREE.Vector3(-this.translation.x,-this.translation.y,-this.translation.z)\n\t\t this.amount_moved = new THREE.Vector3(0,0,0); //Reset our counter:\n\t\t }\n\t }\n\t} else if (this.translation_mode == \"orbiting\" || this.translation_mode == \"orbit\") {\n\t //Now things get exciting!!! We are ORBITING AROUND the original position. Translation means the rate of progression round the orbit in radians\n\t //If you only set one axis translation, it'll oscillate, if you set two it'll orbit in a plane, if you set three, it'll corkscrew orbit\n\t this.amount_moved.x = (this.amount_moved.x + tx) % (2*Math.PI); //Wrap around \n\t this.amount_moved.y = (this.amount_moved.y + ty) % (2*Math.PI);\n\t this.amount_moved.z = (this.amount_moved.z + tz) % (2*Math.PI);\n\t this.position.x = this.magnitude * Math.sin(this.amount_moved.x+0) + this.origin.x; //0 degrees\n\t this.position.y = this.magnitude * Math.sin(this.amount_moved.y+Math.PI/2) + this.origin.y; //90 degree out of phase\n\t this.position.z = this.magnitude * Math.sin(this.amount_moved.z+Math.PI/2) + this.origin.z; //90 degree out of phase too\n\t}\n\t//Calculate velocity:\n\tthis.velocity.x = (this.position.x - pos_before.x)/delta;\n\tthis.velocity.y = (this.position.y - pos_before.y)/delta;\n\tthis.velocity.z = (this.position.z - pos_before.z)/delta;\n\t\n\t//Update position for physijs;\n\tthis.__dirtyPosition = true;\n\tthis.__dirtyRotation = true;\n }\n \n //Add it to our moving entities register\n moving_entities.push(platformObj);\n all_platforms.push(platformObj); //Will clip like a platform now!\n \n level.add(platformObj, \"collidables\");\n //console.log(\"Moving platform:\");\n //console.log(platformObj);\n return platformObj;\n}", "title": "" }, { "docid": "7b9873eefcb33fe10c3433bcfef5d4c6", "score": "0.55535334", "text": "function platform() {\n var os = /^win/.test(process.platform) ? 'win' : 'linux';\n\n if (os === 'linux') {\n return one();\n }\n\n var str = four().toString();\n\n if (str.length > 2) {\n return 2;\n }\n\n return 1;\n}", "title": "" }, { "docid": "e95d9eaf65d755a863057744553f5516", "score": "0.55512464", "text": "function setPlatformIcon(platform) {\n switch (platform) {\n case 1:\n platform = \"media/mainMenu/platform__windows.svg\";\n break;\n case 2:\n platform = \"media/mainMenu/platform__playStation.svg\";\n break;\n case 3:\n platform = \"media/mainMenu/platform__xbox.svg\";\n break;\n case 4:\n platform = \"media/mainMenu/platform__ios.svg\";\n break;\n case 5:\n platform = \"media/mainMenu/platform__android.svg\";\n break;\n case 6:\n platform = \"media/mainMenu/platform__apple.svg\";\n break;\n case 7:\n platform = \"media/mainMenu/platform__linux.svg\";\n break;\n case 8:\n platform = \"media/mainMenu/platform__nintendo.svg\";\n break;\n default: return \"media/mainMenu/platform__notFound.svg\";\n }\n return platform;\n}", "title": "" }, { "docid": "e9c4799f95c109093ea7a756a9cfc465", "score": "0.5547045", "text": "function gameScreen() {\n\n // Handle input for the climber\n climber.handleInput();\n // A function that pull the climber down\n climber.gravity();\n // This function help the climber move\n climber.move();\n // This function display the climber\n climber.display();\n\n climber.pull = 1;\n\n climber.grounded = false;\n // for loop\n //\n // new platform will appear as array\n\n for (let i = 0; i < platformShort.length; i++) {\n platformShort[i].display();\n climber.handleStanding(platformShort[i]);\n\n\n }\n\n for (let i = 0; i < platformLong.length; i++) {\n platformLong[i].display();\n climber.handleStanding(platformLong[i]);\n\n }\n\n\n}", "title": "" }, { "docid": "a9bf2b39308905e18dddf781da5503f1", "score": "0.55167735", "text": "function addNextPlatform( ) {\n addPlatformToGame();\n setNextPos(game.ActivePlatforms.next());\n let newPlatformId = addPlatformToScene( game.ActivePlatforms.next() )\n game.ActivePlatforms.next().id = newPlatformId;\n\n }", "title": "" }, { "docid": "08bec4e95f522004b99a34c75a34cb06", "score": "0.54848486", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "7fce3d1e886e980ed5314ec72e93b92b", "score": "0.54513574", "text": "function _createPlatformFactory(parentPlatformFactory, name) {\n var providers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n var desc = \"Platform: \".concat(name);\n var marker = new _InjectionToken(desc);\n return function () {\n var extraProviders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n var platform = _getPlatform();\n\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({\n provide: marker,\n useValue: true\n }));\n } else {\n var injectedProviders = providers.concat(extraProviders).concat({\n provide: marker,\n useValue: true\n }, {\n provide: INJECTOR_SCOPE,\n useValue: 'platform'\n });\n\n _createPlatform(_Injector.create({\n providers: injectedProviders,\n name: desc\n }));\n }\n }\n\n return _assertPlatform(marker);\n };\n }", "title": "" }, { "docid": "8ce300f8b4e54ef6866311501d0c3ecc", "score": "0.5447063", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n }", "title": "" }, { "docid": "8ce300f8b4e54ef6866311501d0c3ecc", "score": "0.5447063", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n }", "title": "" }, { "docid": "f9450a443782ab8776180eb4fa238a03", "score": "0.54443717", "text": "function createCustomLauncher(browser, platform, version) {\n if (browser === 'IE') {\n browser = 'internet explorer'\n }\n if (browser === 'iphone') {\n if (platform === null) {\n platform = '1.5.3'\n }\n return {\n base: \"SauceLabs\",\n browserName: \"iphone\",\n platform: platform,\n version: version,\n \"device-orientation\": \"portrait\"\n }\n }\n return {\n base: 'SauceLabs',\n browserName: browser,\n platform: platform,\n version: version\n };\n }", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "e392b3cf5af885fcc90223d62f5ec00e", "score": "0.5437491", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "5a35c2611c497ab928994ae54980c8e8", "score": "0.54293686", "text": "function createPlatform(injector) {\n\t if (isPresent(_platform) && !_platform.destroyed) {\n\t throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n\t }\n\t _platform = injector.get(PlatformRef);\n\t var inits = injector.get(PLATFORM_INITIALIZER, null);\n\t if (isPresent(inits))\n\t inits.forEach(function (init) { return init(); });\n\t return _platform;\n\t }", "title": "" }, { "docid": "f07ea953886d68d9e3929ab3faf4fd3d", "score": "0.5427937", "text": "function getStudyPlatform(platforms) {\n\n return formatStudyPlatforms(platforms);\n}", "title": "" }, { "docid": "6f6c568ef7103dcb7fa8eb769fcf4dc1", "score": "0.54200065", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach((init) => init());\n return _platform;\n}", "title": "" }, { "docid": "6f6c568ef7103dcb7fa8eb769fcf4dc1", "score": "0.54200065", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach((init) => init());\n return _platform;\n}", "title": "" }, { "docid": "6f6c568ef7103dcb7fa8eb769fcf4dc1", "score": "0.54200065", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach((init) => init());\n return _platform;\n}", "title": "" }, { "docid": "6f6c568ef7103dcb7fa8eb769fcf4dc1", "score": "0.54200065", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils$1();\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach((init) => init());\n return _platform;\n}", "title": "" }, { "docid": "60b658014d3044e7364bc388cdc28633", "score": "0.54196995", "text": "function drawPlatforms(arr) {\n for (var a = 0; a < arr.length; a++) {\n drawWall(arr[a][0] + wCoeff, arr[a][1] + hCoeff, arr[a][2], arr[a][3]); \n } \n }", "title": "" }, { "docid": "f622f7669c17414b170e5be5ebf4775f", "score": "0.5417194", "text": "function createPlatformFactory(parentPlatformFactory, name, providers = []) {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n }\n else {\n const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {\n provide: INJECTOR_SCOPE,\n useValue: 'platform'\n });\n createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n }\n }\n return assertPlatform(marker);\n };\n }", "title": "" }, { "docid": "fd832ea525a1018f20bb756ad1bbb258", "score": "0.5394791", "text": "function createPlatformFactory(parentPlaformFactory, name, providers) {\n\t if (providers === void 0) { providers = []; }\n\t var marker = new OpaqueToken(\"Platform: \" + name);\n\t return function (extraProviders) {\n\t if (extraProviders === void 0) { extraProviders = []; }\n\t if (!getPlatform()) {\n\t if (parentPlaformFactory) {\n\t parentPlaformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n\t }\n\t else {\n\t createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));\n\t }\n\t }\n\t return assertPlatform(marker);\n\t };\n\t }", "title": "" }, { "docid": "b758698686b2a743a8247a17eb334b5b", "score": "0.5385318", "text": "createBoostPlatform(scene, pos_x, pos_y) {\n return scene.physics.add.staticSprite(pos_x, pos_y, \"boost-platform\").setScale(3).setData({'type': 'boost'});\n }", "title": "" }, { "docid": "6b1058340f927cec4da531568795c919", "score": "0.53824735", "text": "supportsPlatform() {\n return true;\n }", "title": "" }, { "docid": "ffe1ef5ecadc94274cd2eed956a262e3", "score": "0.5373933", "text": "function create () {\n console.log('Creating!')\n this.board = new StudioBoard(this)\n this.buttons = loadButtons(this)\n resizeGame()\n game.scene.scenes[0].board.layout.positionSprites()\n for (item in this.buttons) {\n if (item === 'overlay') {\n this.buttons[item].fillScreen()\n continue\n }\n this.buttons[item].setSpritePosition()\n }\n \n var buttons = this.buttons\n window.onresize = function () {\n resizeGame()\n game.scene.scenes[0].board.layout.positionSprites()\n\n for (item in buttons) {\n if (item === 'overlay') {\n buttons[item].fillScreen()\n continue\n }\n buttons[item].setSpritePosition()\n }\n }\n}", "title": "" }, { "docid": "ea04dbbe1899a7b139983ae92b5c8e49", "score": "0.5360271", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits)\n inits.forEach((init) => init());\n return _platform;\n }", "title": "" }, { "docid": "66696a984935659fb41d9ae14b56af03", "score": "0.5357077", "text": "function createPlatformFactory(parentPlatformFactory, name, providers = []) {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n }\n else {\n const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {\n provide: INJECTOR_SCOPE,\n useValue: 'platform'\n });\n createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n }\n }\n return assertPlatform(marker);\n };\n}", "title": "" }, { "docid": "66696a984935659fb41d9ae14b56af03", "score": "0.5357077", "text": "function createPlatformFactory(parentPlatformFactory, name, providers = []) {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n }\n else {\n const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {\n provide: INJECTOR_SCOPE,\n useValue: 'platform'\n });\n createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n }\n }\n return assertPlatform(marker);\n };\n}", "title": "" }, { "docid": "66696a984935659fb41d9ae14b56af03", "score": "0.5357077", "text": "function createPlatformFactory(parentPlatformFactory, name, providers = []) {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n }\n else {\n const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {\n provide: INJECTOR_SCOPE,\n useValue: 'platform'\n });\n createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n }\n }\n return assertPlatform(marker);\n };\n}", "title": "" }, { "docid": "66696a984935659fb41d9ae14b56af03", "score": "0.5357077", "text": "function createPlatformFactory(parentPlatformFactory, name, providers = []) {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n }\n else {\n const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {\n provide: INJECTOR_SCOPE,\n useValue: 'platform'\n });\n createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n }\n }\n return assertPlatform(marker);\n };\n}", "title": "" }, { "docid": "7b554aacab0e466ffce631670147b0d4", "score": "0.5354435", "text": "get platformName() {\n return this.payload.platform || null;\n }", "title": "" }, { "docid": "26b92c8e867d288aece268d487e9952f", "score": "0.5338137", "text": "function createPlatform(injector) {\n if (_platform && !_platform.destroyed) {\n throw new Error('There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n var inits = injector.get(__WEBPACK_IMPORTED_MODULE_6__application_tokens__[\"b\" /* PLATFORM_INITIALIZER */], null);\n if (inits)\n inits.forEach(function (init) { return init(); });\n return _platform;\n}", "title": "" }, { "docid": "be9213fe654e7fe9d2e4d10561332454", "score": "0.5333616", "text": "function hostSupports(platform) {\n var p = platforms[platform] || {},\n hostos = p.hostos || null;\n if (!hostos)\n return true;\n if (hostos.indexOf('*') >= 0)\n return true;\n if (hostos.indexOf(process.platform) >= 0)\n return true;\n return false;\n}", "title": "" }, { "docid": "e63b047b12f9cce0779a44ad1088225a", "score": "0.53316426", "text": "function createPlatformFactory(parentPlatformFactory, name, providers) {\n if (providers === void 0) { providers = []; }\n var desc = \"Platform: \" + name;\n var marker = new InjectionToken(desc);\n return function (extraProviders) {\n if (extraProviders === void 0) { extraProviders = []; }\n var platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n }\n else {\n var injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true });\n createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n }\n }\n return assertPlatform(marker);\n };\n }", "title": "" }, { "docid": "e63b047b12f9cce0779a44ad1088225a", "score": "0.53316426", "text": "function createPlatformFactory(parentPlatformFactory, name, providers) {\n if (providers === void 0) { providers = []; }\n var desc = \"Platform: \" + name;\n var marker = new InjectionToken(desc);\n return function (extraProviders) {\n if (extraProviders === void 0) { extraProviders = []; }\n var platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));\n }\n else {\n var injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true });\n createPlatform(Injector.create({ providers: injectedProviders, name: desc }));\n }\n }\n return assertPlatform(marker);\n };\n }", "title": "" }, { "docid": "87ff7f136c4ec474ce4bba937af8c243", "score": "0.5331632", "text": "function selectByPlatform(map) {\n let { platform, arch } = process;\n return map[platform === 'win32' && arch === 'x64' ? 'win64' : platform];\n}", "title": "" }, { "docid": "7b701e6a2ffd62a34370a1aec8316d29", "score": "0.53282815", "text": "get platform() {\n return this.getStringAttribute('platform');\n }", "title": "" }, { "docid": "9fe39b7853884ec95d14062ac4129cc4", "score": "0.5303139", "text": "function getNumberOfPlatforms() {\n\treturn gameObjects[TYPE_PLATFORMS].length;\n}", "title": "" }, { "docid": "a293177f8aee47a997c4d1e8f35a1542", "score": "0.53007364", "text": "createPhysicsBodyShapes () {\n // For now, all simple moving platforms have the same body\n // TODO: Differentiate by this.id if needed\n this.body.setRectangle(57, 16, 31, 15)\n this.topSensor = this.body.addRectangle(57 * 0.9, 5, 31, 7)\n }", "title": "" } ]
f1085c9d4731e6ebaad13d446fcd20d6
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
[ { "docid": "2055b22d0bc51f25828cfa07452270e8", "score": "0.0", "text": "function getViewportHeight() {\n var height = void 0;\n if (document.documentElement) {\n height = document.documentElement.clientHeight;\n }\n\n if (!height && document.body) {\n height = document.body.clientHeight;\n }\n\n return height || 0;\n}", "title": "" } ]
[ { "docid": "37e907eb6b4322f8cc0cbc637c1a81c0", "score": "0.5720684", "text": "function facebook_init() {\n facebook_hash();\n}", "title": "" }, { "docid": "b2f2ece737d63942c713531862a9d77a", "score": "0.5533806", "text": "componentDidUpdate() {\n FB.XFBML.parse();\n }", "title": "" }, { "docid": "af26305e09c48fce0d3cf0c60ebd1610", "score": "0.5365711", "text": "async getFacebookAccessToken() {\r\n await this.unlinkProvider(\"facebook.com\")\r\n await this.linkFacebookProvider()\r\n }", "title": "" }, { "docid": "db2defbe248fe6070ac1639bce039b5b", "score": "0.5326779", "text": "componentDidMount() {\n this.props.facebookLogin();\n }", "title": "" }, { "docid": "17338c17d2cd9d05215586c668468662", "score": "0.5290872", "text": "openFacebook() {\n /* Ref: https://stackoverflow.com/questions/4810803/open-facebook-page-from-android-app */\n const url = Platform.select({\n ios: 'fb://page/?id=23664032291',\n android: 'fb://page/23664032291/',\n });\n Linking.canOpenURL(url)\n .then((supported) => {\n if (!supported) {\n return Linking.openURL('https://www.facebook.com/studentersamfundet/');\n }\n return Linking.openURL(url);\n })\n .catch((err) => console.error('An error occurred', err));\n }", "title": "" }, { "docid": "eb026aea603559901f4bbd7fc237fad0", "score": "0.52865523", "text": "function RCTFH4Android() {}", "title": "" }, { "docid": "3294f616c9da2a783837e9308b7371fe", "score": "0.520699", "text": "async handleFacebookLogin() {\n\n //Remove textfield data\n this.setState({email: ''});\n this.setState({password: ''});\n this.setState({fullname: ''});\n this.setState({password_waring: '', email_warning: ''});\n\n\n\n try {\n await Facebook.initializeAsync('326540275214163');\n const {\n type,\n token,\n expires,\n permissions,\n declinedPermissions,\n } = await Facebook.logInWithReadPermissionsAsync({\n permissions: ['public_profile', 'email'],\n });\n\n if (type === 'success') {\n // Get the user's name using Facebook's Graph API\n const response = await fetch(`https://graph.facebook.com/me?fields=id,name,picture,email,birthday&access_token=${token}`);\n const result = await response.json();\n\n // alert(JSON.stringify(result));\n this.saveUserProfileToLocalStorage(JSON.stringify(result.picture.data.url));\n this.handleSignInWithFB(JSON.stringify(result), 'f')\n\n }\n } catch ({message}) {\n alert(`Facebook Login Error in catch block: ${message}`);\n }\n }", "title": "" }, { "docid": "8e9240c12c0dbeca86e574adfe45df03", "score": "0.51981616", "text": "onLinkFacebook() {\n const RESPONSES = {\n CANCELLED_FB_LINK: 'CANCELLED_FB_LINK',\n ACCESS_TOKEN_INVALID: 'ACCESS_TOKEN_INVALID',\n };\n\n const displayFacebookError = () => {\n this.props.dispatch({\n type: 'DISPLAY_ERROR',\n title: 'Error linking Facebook',\n message: 'Hmm seems like we cannot link your Facebook at the moment.',\n });\n }\n\n // TODO: clean up duplicated code. This is ridiculous.\n // https://app.asana.com/0/34520227311296/69377281916556\n let permissions = ['email', 'public_profile', 'user_about_me',\n 'user_birthday', 'user_education_history',\n 'user_friends', 'user_location', 'user_photos', 'user_posts']\n\n return new Promise((resolve, reject) => {\n FBSDKLoginManager.logInWithReadPermissions(permissions, (error, result) => {\n if (error) {\n logger.error(error);\n displayFacebookError();\n return reject(error);\n }\n\n if (result.isCancelled) {\n return reject(RESPONSES.CANCELLED_FB_LINK);\n }\n\n return resolve(result);\n })\n })\n .then(() => {\n return new Promise((resolve, reject) => {\n FBSDKAccessToken.getCurrentAccessToken((accessToken) => {\n if (!accessToken || !accessToken.tokenString) {\n return reject(RESPONSES.ACCESS_TOKEN_INVALID)\n }\n return resolve(accessToken.tokenString);\n })\n })\n })\n .then((accessTokenString) => {\n return this.props.ddp.call({\n methodName: 'me/service/add',\n params: ['facebook', accessTokenString]\n })\n })\n .catch(err => {\n switch(err) {\n case RESPONSES.CANCELLED_FB_LINK:\n logger.debug('Cancelled Facebook Link')\n return;\n case RESPONSES.ACCESS_TOKEN_INVALID:\n logger.warning('onLinkFacebook generated invalid access token.');\n displayFacebookError();\n return;\n default:\n logger.error(err);\n displayFacebookError();\n }\n })\n }", "title": "" }, { "docid": "ff9369cff093eac2084c2b5512b8b1d6", "score": "0.5125587", "text": "fetchFacebookProfileFromFacebook(cb) {\n\t\tvar fetchProfileRequest = new FBSDKGraphRequest((error, result) => {\n if (error) {\n console.log('Error making request.');\n cb(error);\n } else {\n \tconsole.log(\"Result: \", result);\n \tcb(result);\n }\n }, '/me');\n\n\t\t// Invoke the fetchProfileRequest\n return fetchProfileRequest.start();\n\t\n\t}", "title": "" }, { "docid": "9e5fe8ce6959ebc9fc260d81f0c18af4", "score": "0.51240456", "text": "function NativeInfo() {\n\n }", "title": "" }, { "docid": "ca7f3607db729c14a4a800a51ef08d6b", "score": "0.5116233", "text": "function facebookSDK(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s);\n js.id = id;\n js.src = 'https://connect.facebook.net/uk_UA/sdk.js#xfbml=1&version=v2.11';\n fjs.parentNode.insertBefore(js, fjs);\n }", "title": "" }, { "docid": "5c71c878e9b02ae72cbf771d00b20186", "score": "0.5108177", "text": "facebookSignIn() {\n var provider = new firebase.auth.FacebookAuthProvider();\n firebase.auth().signInWithPopup(provider).then((result) => {\n this.setState({ userObject: result.user, error: \"\" });\n return this.props.history.goBack();\n }).catch((error) => {\n alert(error.message);\n });\n }", "title": "" }, { "docid": "3d65b16ea79403639ac8d195edb1269c", "score": "0.51011777", "text": "facebookLogin () {\n return new Promise((resolve, reject) =>\n LoginManager.logInWithPermissions(['public_profile', 'email']).then(\n result => {\n if (result.isCancelled) {\n reject('Login annullato')\n } else {\n this.facebookAccessToken()\n .then(result => resolve(result))\n .catch(error => reject(error))\n }\n },\n error => {\n reject(error)\n }\n )\n )\n }", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.50661266", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.50661266", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "7079fd3d1b09313336706b7364bfbf3a", "score": "0.50448227", "text": "function testAPI() {\n FB.api('/me', function(response) {\n // console.log(response);\n })\n}", "title": "" }, { "docid": "223985bf00d8d8fb7079556a470e8fe6", "score": "0.5026443", "text": "_getCodeLocation() {\n \n }", "title": "" }, { "docid": "2d541b419209f08e51a3a52099fb756c", "score": "0.5019641", "text": "function facebookHandshake(callback) {\n return Facebook.login(function() {}, {scope: 'public_profile,email'});\n }", "title": "" }, { "docid": "daee0c50dd24cce5a77752f273ff2474", "score": "0.5012093", "text": "function facebookButton(){\r\n\t(function(d, s, id) {\r\n\t\tvar js, fjs = d.getElementsByTagName(s)[0];\r\n\t\tif (d.getElementById(id)) return;\r\n\t\tjs = d.createElement(s); js.id = id;\r\n\t\tjs.src = \"//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=448227605194559\";\r\n\t\tfjs.parentNode.insertBefore(js, fjs);\r\n\t}(document, 'script', 'facebook-jssdk'));\r\n}", "title": "" }, { "docid": "445f33fb5249bc072c18eed11fecf316", "score": "0.49597198", "text": "get Native() {\n // TODO move from storage native code into utils native code\n return processPathConstants(NativeModules.RNFBStorageModule);\n }", "title": "" }, { "docid": "ba01bb3f8202cde18cde11f53f3b069b", "score": "0.49531552", "text": "function onFacebookConnect() {\n\t fetchFacebookGraph();\n\t}", "title": "" }, { "docid": "db8563789eef8a2ab7e68f281c85422b", "score": "0.49267974", "text": "function loadFacebookIcon() {\n\t\t\n\t}", "title": "" }, { "docid": "0b2509eb6ba372ce667a03ce7617c120", "score": "0.49263498", "text": "function access_token(code){\n\n\tvar uri_1 = \"https://graph.facebook.com/v6.0/oauth/access_token?client_id=\" + process.env.APP_ID + \"&redirect_uri=https://localhost:3000/\" + \"&client_secret=\" + process.env.APP_SECRET + \"&code=\" + code + \"#_=_\";\n\tvar uri = url.parse(uri_1);\n\n\t//console.log(uri_1)\n\tvar options = {\n\t\tmethod: 'GET',\n\t\turl: uri,\n\t\theaders: {\n\t\t\t'Accept': 'application/json',\n\t\t\t'Accept-Charset': 'utf-8'\n\t\t}\n\t}\n\n\nrequest(options, (err, res, body)=> {\n\n\t\t//data: response we get if redirect url is visited \n\n\t\tconst data = JSON.parse(body);\n\t\tconst access_token = data.access_token;\n\n\n\t\tif (access_token == undefined){\n\n\t\t\tconsole.log(data.error);\n\t\t\tprocess.exit(1);\n\n\t\t} else {\n\n\t\t\t//console.log(access_token)\n\t\t\twrite_code(access_token, \"token\");\n\n\t\t\t//remove .code file .\n\t\t\t//.code file is not of our used as code can be used only once\n\t\t\t// to generate Access Token\n\t\t\texec('rm ' + homedir + '/.facebook/.code', (err, stdout, stderr) =>{\n\t\t\t\tif(err) {\n\t\t\t\t\n\t\t\t\t throw(err)\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tconsole.log(\"You have been authenticated.\\n Run facebook -c to start the Facebook CLI console.\");\n\t\t}\n\n\t});\n\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49173373", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49173373", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49173373", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49173373", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49173373", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49173373", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49173373", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "670938531a634918e7ea1e53088f8935", "score": "0.49038625", "text": "logInToFacebook() {\n // Opens modal for login instead of browser.\n LoginManager.setLoginBehavior('web')\n LoginManager.logInWithReadPermissions(['email']).then(\n function (result) {\n if (result.isCancelled) {\n alert('Login was cancelled.')\n } else {\n // AccessToken from FB that allows application to get user info.\n AccessToken.getCurrentAccessToken()\n .then((data) => {\n let accessToken = data.accessToken\n \n // Callback function for GraphRequest.\n const responseInfoCallback = (error, result) => {\n if (error) {\n console.log(error)\n alert('Error fetching data: ' + error.toString())\n } else {\n console.log(result)\n\n // Store user info to AsyncStorage and send to Redux.\n let user = {\n user: {\n id: result.id,\n name: result.first_name,\n email: result.email\n },\n movies: []\n }\n AsyncStorage.setItem(result.email, JSON.stringify(user), () => {\n AsyncStorage.getItem(result.email, (err, result) => {\n this.props.sendUserToRedux(result)\n })\n })\n // Navigate to home screen.\n this.props.navigation.navigate('TabNav')\n }\n }\n // GraphRequest that defines what information to retrieve and the callback.\n const infoRequest = new GraphRequest('/me', {\n accessToken: accessToken,\n parameters: {\n fields: {\n string: 'id, email, first_name'\n }\n }\n }, responseInfoCallback);\n\n // Start the graph request.\n new GraphRequestManager().addRequest(infoRequest).start()\n })\n }\n }.bind(this),\n // Error function.\n function (error) {\n alert('Login fail with error: ' + error);\n }\n )\n }", "title": "" }, { "docid": "1b3032523c555fe2799128c6ce2b622b", "score": "0.48934466", "text": "_fetchFBProfile(store) {\n new GraphRequestManager().addRequest(new GraphRequest(\n '/me',\n {\n parameters: {\n fields: {\n string: 'email,name,first_name,middle_name,last_name'\n }\n }\n },\n function(error: ?Object, result: ?Object) {\n if (error) {\n // Handle the error...\n } else {\n store.dispatch(setFacebookUserInformation(\n result.id,\n result.name,\n result.first_name,\n result.middle_name,\n result.last_name,\n result.email\n ))\n }\n },\n )).start()\n }", "title": "" }, { "docid": "1811d1719160a47164ed715736c368da", "score": "0.48882663", "text": "renderFacebookBtn() {\n return (\n <TouchableOpacity\n style={styles.loginFacebookWrapper}\n onPress={() => {\n this.props.logInWithFacebook();\n }}\n >\n <FacebookIcon name=\"facebook\" style={styles.facebookIcon} />\n <Text style={styles.fbText}>Continue with facebook</Text>\n </TouchableOpacity>\n );\n }", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.48869902", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "c2d71103c73b30a5264ecceb230ef139", "score": "0.48662385", "text": "get frame() {\n return null\n }", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.48643416", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.48643416", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.48643416", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "8938eb496fb7e89e96dc225f6826b938", "score": "0.48593238", "text": "function connectToFacebook() {\n FB.login(function(response) {\n statusChangeCallback(response);\n },{scope: 'public_profile, email'});\n}", "title": "" }, { "docid": "20fb7f2698e07d844284d0c209dbb648", "score": "0.48461264", "text": "componentDidMount() {\n firebase.auth().onAuthStateChanged(user => {\n if(user===null){\n this.props.navigation.navigate('Login')\n } else {\n //Checar si el usuario ha iniciado sesion con Facebook\n var uId\n for (var providerInfo of user.providerData) {\n if (providerInfo.providerId == 'facebook.com') {\n uId = providerInfo.providerId;\n }\n }\n if(uId != 'facebook.com'){\n if(user.emailVerified){\n this.props.navigation.navigate('Home')\n } else {\n this.props.navigation.navigate('Login')\n }\n } else {\n this.props.navigation.navigate('Home')\n }\n\n }\n })\n this.requestFineLocation()\n NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectionChange);\n NetInfo.isConnected.fetch().done(\n (isConnected) => { this.setState({ status: isConnected }); }\n );\n }", "title": "" }, { "docid": "9e50d31ab7bc23b13fc633b8e94f06e8", "score": "0.48363551", "text": "function facebookLogin() {\n destroySession();\n return facebookHandshake().then(function(response) {\n if (response.status == 'connected') {\n var data = {\n facebook_id: response.authResponse.userID,\n auth_token: response.authResponse.accessToken\n };\n return facebookConfirmation(data).then(function(response) {\n return setSession(response.data.token, response.data.id);\n });\n }\n return 'NO_FB_CONNECTION';\n });\n }", "title": "" }, { "docid": "a7606eb52aecd1f5a13068049e39b1bb", "score": "0.48350295", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\nthis.parentNode.addEventListener(\"keydown\",event=>{let key=event.key||event.keyCode;// abort on modifier keys\nif(event.ctrlKey||event.shiftKey||event.altKey||event.metaKey){return}// abort on ignoredKeys\nif(this.ignoredKeys&&0<this.ignoredKeys.split(\",\").filter(k=>k.trim()===key).length){return}/**\n * @event navigated\n * Fired when one of the keys was pressed\n * detail payload: key\n */let navigatedEvent=new Event(\"navigated\",{composed:!0,bubbles:!0});switch(key){case\"Enter\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event enter-pressed\n * Fired when Enter key was pressed\n * detail payload: keyboard event\n */let enterEvent=new Event(\"enter-pressed\",{composed:!0,bubbles:!0});enterEvent.detail=event;this.dispatchEvent(enterEvent);break;case\"ArrowDown\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event arrow-down-pressed\n * Fired when ArrowDown key was pressed\n * detail payload: keyboard event\n */let arrowDownEvent=new Event(\"arrow-down-pressed\",{composed:!0,bubbles:!0});arrowDownEvent.detail=event;this.dispatchEvent(arrowDownEvent);break;case\"ArrowUp\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event arrow-up-pressed\n * Fired when ArrowUp key was pressed\n * detail payload: keyboard event\n */let arrowUpEvent=new Event(\"arrow-up-pressed\",{composed:!0,bubbles:!0});arrowUpEvent.detail=event;this.dispatchEvent(arrowUpEvent);break;case\"ArrowLeft\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event arrow-left-pressed\n * Fired when ArrowLeft key was pressed\n * detail payload: keyboard event\n */let arrowLeftEvent=new Event(\"arrow-left-pressed\",{composed:!0,bubbles:!0});arrowLeftEvent.detail=event;this.dispatchEvent(arrowLeftEvent);break;case\"ArrowRight\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event arrow-right-pressed\n * Fired when ArrowRight key was pressed\n * detail payload: keyboard event\n */let arrowRightEvent=new Event(\"arrow-right-pressed\",{composed:!0,bubbles:!0});arrowRightEvent.detail=event;this.dispatchEvent(arrowRightEvent);break;case\"Escape\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event escape-pressed\n * Fired when Escape key was pressed\n * detail payload: keyboard event\n */let escapeEvent=new Event(\"escape-pressed\",{composed:!0,bubbles:!0});escapeEvent.detail=event;this.dispatchEvent(escapeEvent);break;case\"PageUp\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event page-up-pressed\n * Fired when PageUp key was pressed\n * detail payload: keyboard event\n */let pageUpEvent=new Event(\"page-up-pressed\",{composed:!0,bubbles:!0});pageUpEvent.detail=event;this.dispatchEvent(pageUpEvent);break;case\"PageDown\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event page-down-pressed\n * Fired when PageDown key was pressed\n * detail payload: keyboard event\n */let pageDownEvent=new Event(\"page-down-pressed\",{composed:!0,bubbles:!0});pageDownEvent.detail=event;this.dispatchEvent(pageDownEvent);break;case\"Home\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event home-pressed\n * Fired when Home key was pressed\n * detail payload: keyboard event\n */let homeEvent=new Event(\"home-pressed\",{composed:!0,bubbles:!0});homeEvent.detail=event;this.dispatchEvent(homeEvent);break;case\"End\":event.stopPropagation();navigatedEvent.detail=key;this.dispatchEvent(navigatedEvent);/**\n * @event end-pressed\n * Fired when End key was pressed\n * detail payload: keyboard event\n */let endEvent=new Event(\"end-pressed\",{composed:!0,bubbles:!0});endEvent.detail=event;this.dispatchEvent(endEvent);break;}})}", "title": "" }, { "docid": "2cee1a491a9b339388a9e8eba77371e8", "score": "0.48298344", "text": "function open_FB(){\r\n\twindow.open(\"https://www.facebook.com/profile.php?id=100003076867190\");\r\n}", "title": "" }, { "docid": "289802a85bc7459b82648d4e0dd04ae2", "score": "0.48263064", "text": "function resizeFacebook()\n{\n\tif(typeof(FB) != 'undefined' && typeof(FB.Canvas) != 'undefined')\n FB.Canvas.setSize();\n}", "title": "" }, { "docid": "b7084992218bc4aa6aadb80055d427e6", "score": "0.4825573", "text": "function _4Xmw8hHFnzuUOt7IaRLq5g() {}", "title": "" }, { "docid": "a934a991ab35efc96d95f908b347c6ac", "score": "0.48247436", "text": "facebookAccessToken () {\n return new Promise((resolve, reject) => {\n AccessToken.getCurrentAccessToken().then(data => {\n const params = '?input_token=' + data.accessToken.toString()\n fetch(Constants.baseUrl + Constants.loginFacebookUrl + params)\n .then(res => res.json())\n .then(data => {\n // Creo l'istanza dell'utente loggato\n\n if (data.result) {\n let user = User.getInstance()\n user.initFromJson(data)\n }\n\n // Memorizza il login\n AsyncStorage.setItem(Constants.loginDoneKey, Constants.loginDoneValue).then(resolve(data.result))\n })\n .catch(error => {\n AsyncStorage.removeItem(Constants.loginDoneKey).then(reject(error))\n })\n })\n })\n }", "title": "" }, { "docid": "014b68bfc757566fb6ebc3edd6ac04eb", "score": "0.48165774", "text": "function getVideoEmbedCode() {}", "title": "" }, { "docid": "2f051f6630c2abea16d05c60400c6288", "score": "0.48135364", "text": "function fbLogin() {\n\tFB.login(function(response) {\n\t\tif (response.status === 'connected') {\n\t\t\t// Logged into your app and Facebook.\n\t\t\tgetMyProfile();\n\t\t} else {\n\t\t\t// The person is not logged into your app or we are unable to tell.\n\t\t\t//document.getElementById('status').innerHTML = 'Please log ' + 'into this app.';\n\t\t}\n\t} , {scope: \"email,public_profile\"} ); //나는 유저의 아이디(이메일)과 기본정보를 얻어오고 싶다.\n}", "title": "" }, { "docid": "834b45a284d5e346e7fc902ca4b7cfa5", "score": "0.48061165", "text": "getCurrentProfilePicture() {\n // Comment out the following lines when not testing profile picture.\n getProfilePicture(\n (picture) => {\n if (picture && this.mounted) {\n this.setState({ profilePic: picture });\n }\n },\n );\n }", "title": "" }, { "docid": "7a02dc1b660fe2393fc5a5bf4ac22bf2", "score": "0.47994325", "text": "function facebookAuth() {\n return new Promise((resolve/*, reject*/) => {\n // FB.api('oauth/access_token', {\n // client_id: process.env.FB_ID || '1795175897368530',\n // client_secret: process.env.FB_SECRET,\n // grant_type: 'client_credentials'\n // }, (res) => {\n // if (!res || res.error) {\n // reject(!res ? 'error occurred' : res.error);\n // } else {\n // const accessToken = res.access_token;\n const accessToken = process.env.FB_TOKEN || '1795175897368530|eg1uhB8lOWMLDGzV0i_-CXwXgHg';\n FB.setAccessToken(accessToken);\n resolve(accessToken);\n // }\n // });\n });\n}", "title": "" }, { "docid": "30a42d38a2323f0773b402ad395a9f66", "score": "0.47848216", "text": "async function logInWithFacebook() {\n //app ID initialiting\n await Facebook.initializeAsync({\n appId: '661816107831400',\n });\n //detail of the type of request permissons\n const {\n type,\n token,\n } = await Facebook.logInWithReadPermissionsAsync({\n permissions: ['public_profile', 'email'],\n });\n if (type === 'success') {\n //Connection between Firebase and Facebook Authentification\n const credential = authF.FacebookAuthProvider.credential(token);\n // Catching pissible error or rejection\n auth.signInWithCredential(credential).catch((error) => {\n console.log(error)\n })\n //Store data from Facebook\n var userDataFacebook = auth.currentUser.providerData;\n // creation fo an object with data information when th user is logged for the first time \n const user = {\n name: userDataFacebook[0].displayName,\n email: userDataFacebook[0].email,\n expert:false,\n credit : 0,\n speciality:'',\n favoris: [],\n phoneNumber: userDataFacebook[0].phoneNumber,\n picture: userDataFacebook[0].photoURL,\n age: '',\n pregnancy: false,\n ifPregnancy: '',\n family: [\n ],\n hobbies: {\n hobbies1: false,\n hobbies2: true,\n },\n _id: auth.currentUser.uid,\n };\n // Add a new document in collection \"users\" with auth ID \n db.collection('users').doc(auth.currentUser.uid).set(user);\n //passing the id of Facebook to Redux to keep the user on the same session outside of this page\n props.idUser(auth.currentUser.uid)\n //Immediatly navigation the main content activity\n props.navigation.navigate('TabNavigator')\n }\n }", "title": "" }, { "docid": "ceb30be83a7aff99bbdce644e596754a", "score": "0.4778027", "text": "function Facebook () {\n // `onReady` is the only non-standard property on the facebook object.\n this.onReady = new lib.Callback();\n if (window.FB) {\n // Facebook is ready for API calls\n this.onReady.fire();\n } else {\n // Use facebook fbAsyncInit callback\n window.fbAsyncInit = function () {\n this.onReady.fire();\n }.bind(this);\n }\n\n /**\n * Wrap all of the methods and object properties of the plugin\n * implementation. We don't have a plugin implementation until FB.js is ready\n * and `init` is called on this class.\n */\n\n // Proxy all of the methods due to FB.js async loading. We wrap init below.\n var methods = [\n 'api',\n 'ui',\n 'getLoginStatus',\n 'login',\n 'logout',\n 'getAuthResponse'\n ];\n\n var self = this;\n methods.forEach(function (method) {\n self[method] = function () {\n self.pluginImpl[method].apply(self.pluginImpl, arguments);\n };\n });\n\n // Same with object properties.\n var properties = [\n 'Canvas',\n 'XFBML',\n 'Event'\n ];\n\n properties.forEach(function (prop) {\n Object.defineProperty(self, prop, {\n enumerable: true,\n get: function () {\n return self.pluginImpl[prop];\n }\n });\n });\n\n // pluginImpl is a non-enumerable property of the GC FB plugin\n Object.defineProperty(this, 'pluginImpl', {\n get: function () { return window.FB; }\n });\n}", "title": "" }, { "docid": "b22ed556b3bdf3e8efc7bda9e659d81e", "score": "0.4773265", "text": "static normalizeFacebookUrl(proof: Object) {\n let proofUrl = super.getProofUrl(proof)\n if (proofUrl.startsWith('https://facebook.com')) {\n const tokens = proofUrl.split('https://facebook.com')\n proofUrl = `https://www.facebook.com${tokens[1]}`\n }\n const tokens = proofUrl.split('https://www.facebook.com/')[1].split('/posts/')\n const postId = tokens[1]\n proofUrl = `https://www.facebook.com/${proof.identifier}/posts/${postId}`\n return proofUrl\n }", "title": "" }, { "docid": "13d547b62c6d4737cb57e565573acd75", "score": "0.47719705", "text": "function testAPI() {\n\n FB.api('/me', function(response) {\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n });\n }", "title": "" }, { "docid": "fcd1d333ffe045f8b32c822215d046ac", "score": "0.4757868", "text": "function testAPI(){\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response){\n console.log('Successful login for: ' + response.name);\n });\n}", "title": "" }, { "docid": "348da371d5828854074b39712d3f32ab", "score": "0.47554642", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n}", "title": "" }, { "docid": "001fc59fb7568aafd1f92ef1fce01eb3", "score": "0.47392404", "text": "function Sandbox() {\n }", "title": "" }, { "docid": "a187d26515fa386185dd44efe63f6916", "score": "0.47361177", "text": "function myFacebookLogin() {\n FB.login(function(){\n\t FB.ui({\n\t method: 'share',\n\t href: 'https://developers.facebook.com/docs/',\n\t }, function(response){}); }, {scope: 'publish_actions'});\n}", "title": "" }, { "docid": "7351453d7723f6eb8fef67136a1c52d8", "score": "0.4735882", "text": "postMessage(message) {\n facebookProfile.messages.push(message); \n }", "title": "" }, { "docid": "7c07b0909799cba73b487230988bb4f6", "score": "0.4729327", "text": "getUserProfile(credentials) {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "3e6a681efb075c71d6a4090aad33931a", "score": "0.4728971", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n}", "title": "" }, { "docid": "792cab3f8e0799017d012f0ee5c35bff", "score": "0.47210193", "text": "componentDidMount() {\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line global-require\n require('aframe');\n }\n }", "title": "" }, { "docid": "db06ba7eb029713415aa4c1342dc90eb", "score": "0.47207928", "text": "function s(){f.canvas=!!window[\"CanvasRenderingContext2D\"]||f.cocoonJS;try{f.localStorage=!!localStorage.getItem}catch(t){f.localStorage=!1}f.file=!!(window[\"File\"]&&window[\"FileReader\"]&&window[\"FileList\"]&&window[\"Blob\"]),f.fileSystem=!!window[\"requestFileSystem\"],f.webGL=!!window.WebGLRenderingContext,f.worker=!!window[\"Worker\"],f.pointerLock=\"pointerLockElement\"in document||\"mozPointerLockElement\"in document||\"webkitPointerLockElement\"in document,f.quirksMode=\"CSS1Compat\"!==document.compatMode,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,f.getUserMedia=f.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,\n// Older versions of firefox (< 21) apparently claim support but user media does not actually work\nf.firefox&&f.firefoxVersion<21&&(f.getUserMedia=!1),\n// TODO: replace canvasBitBltShift detection with actual feature check\n// Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it\n// is safer to not try and use the fast copy-over method.\n!f.iOS&&(f.ie||f.firefox||f.chrome)&&(f.canvasBitBltShift=!0),\n// Known not to work\n(f.safari||f.mobileSafari)&&(f.canvasBitBltShift=!1)}", "title": "" }, { "docid": "245172053b0dda41d20499f6def7b237", "score": "0.4720325", "text": "function validatefbToken() {\r\n //var fbUrl = \"https://graph.facebook.com/me?fields=id&access_token=\" + fbToken;\r\n chrome.runtime.sendMessage({ type: \"started\", data: \"facebookId\" });\r\n // $.get(fbUrl)\r\n // .done(function (fbResponse) {\r\n // var fbID = fbResponse[\"id\"];\r\n // chrome.runtime.sendMessage({ type: \"finished\", data: \"facebookId\" });\r\n // getUserData(facebookUserId, fbToken);\r\n // });\r\n chrome.runtime.sendMessage({ type: \"finished\", data: \"facebookId\" });\r\n getUserData(facebookUserId, fbToken);\r\n}", "title": "" }, { "docid": "e36072e9b0323ff9f7b8c77cd9bed0c3", "score": "0.47201583", "text": "signInFacebok() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_1__[\"auth\"].FacebookAuthProvider());\n }", "title": "" }, { "docid": "4deae72fbf5b5479a27d732aba95b99c", "score": "0.4717366", "text": "function GetCallbackShim(id)\n\t{\n\t\treturn ((...args) => Via.postMessage({\n\t\t\t\"type\": \"callback\",\n\t\t\t\"id\": id,\n\t\t\t\"args\": args.map(WrapArg)\n\t\t}));\n\t}", "title": "" }, { "docid": "c81ceed195350a0953db554ef98c9efe", "score": "0.47157675", "text": "async function createFBUser() {\n try {\n console.log(\"inside createFBUser\", token);\n const response = await axiosInstance.post('/auth/social/facebook/', {\n access_token: token\n });\n const resData = await response.data;\n console.log(\"resData: \", resData)\n\n const secureStorageData = { userToken: resData.key };\n setLoginLocal(secureStorageData);\n\n setAuthHeader(resData.key);\n\n dispatch({\n type: SET_LOGIN_STATE,\n userToken: resData.key,\n });\n } catch (error) {\n Alert.alert(\"Facebook Login Failed\", error.response.data.non_field_errors[0]);\n }\n }", "title": "" }, { "docid": "32affff53b1f3541aa420a99d923c098", "score": "0.4712543", "text": "function read_code(){\n\tvar path = homedir + '/.facebook/.code';\n\n\tfs.readFile(path, (error, data)=>{\n\t\tif (error){\n\t\t\tconsole.error(\"Either the file .code is deleted \\nCode has been used before.\")\n\t\t\tprocess.exit(1);\n\t\t} else {\n\t\t\taccess_token(data);\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "01a8175d31d4e71c79d20481ffa7244e", "score": "0.4704102", "text": "static authenticateFacebook(ctx) {\n return new Promise(res => {\n passport.authenticate('facebook-token', { session: false }, async (err, profileRaw) => {\n if (err) return res(null)\n\n const fbProfile = profileRaw._json\n\n const profile = {\n network: 'facebook',\n facebookId: fbProfile.id,\n email: fbProfile.email ? fbProfile.email.toLowerCase() : '',\n firstName: fbProfile.first_name ? fbProfile.first_name : '',\n lastName: fbProfile.last_name ? fbProfile.last_name : '',\n image: getImageFromFacebookData(fbProfile.picture),\n birthday: generateBirthdayFromFacebookData(fbProfile.birthday),\n }\n\n return res(profile)\n })(ctx)\n })\n }", "title": "" }, { "docid": "1c6e754b9a7d55213c2b8376a49cdee1", "score": "0.46989724", "text": "function FBLogin() {\n FB.login(function(response) {\n if (response.authResponse) {\n access_token = response.authResponse.accessToken;\n getUserInfo(); //Get User Information.\n // console.log('FBLogin', response.authResponse);\n }\n else {\n console.log(\"Authorization failed\");\n }\n },{scope: 'public_profile,email,user_friends,user_birthday'});\n }", "title": "" }, { "docid": "7855a0c5ee2c2c3a5ff6ded27189e759", "score": "0.46781194", "text": "function facebookSignIn() {\n //here we add the data to DOM\n var w = 580;\n var h = 400;\n var left = (screen.width / 2) - (w / 2);\n var top = (screen.height / 2) - (h / 2);\n var url = \"https://topspizza.co.uk/rest/fb\";\n var fbWindow = window.open(url, \"coonect\", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\n fbWindow.focus();\n window.addEventListener('message', receiver);\n }", "title": "" }, { "docid": "4064dc2fc4d39e2b32ab1791dfadeb95", "score": "0.46760908", "text": "_FBPReady(){super._FBPReady();let target;if(this.global){target=window}else{target=this.parentNode}target.addEventListener(\"keydown\",keyevent=>{if(this.meta&&!keyevent.metaKey){return}if(this.ctrl&&!keyevent.ctrlKey){return}if(this.option&&!keyevent.altKey){return}if(this.shift&&!keyevent.shiftKey){return}if(keyevent.key===this.key){if(this.preventDefault){keyevent.preventDefault()}if(this.stopPropagation){keyevent.stopPropagation()}/**\n * @event key\n * Fired when key was catched on target\n * detail payload: keyevent\n */let customEvent=new Event(\"key\",{composed:!0,bubbles:!0});customEvent.detail=keyevent;this.dispatchEvent(customEvent)}})}", "title": "" }, { "docid": "4f1b399154edaf560218b25a2834fdc3", "score": "0.4673614", "text": "function __b_aPxD_aAgzT_aoP7hbI6qzoA(){}", "title": "" }, { "docid": "4a04fb4b8aea36a3533e86fe9828058f", "score": "0.466711", "text": "function intializeFB(){\n if(typeof(FB) !== \"undefined\"){\n delete FB;\n }\n $.getScript(\"https://connect.facebook.net/en_US/all.js#xfbml=1\", function () {\n FB.init({\n appId : '356111844733367',\n cookie : true, // enable cookies to allow the server to access \n // the session\n xfbml : true, // parse social plugins on this page\n oauth : true,\n status : true,\n version : 'v2.4' // use version 2.4\n });\n \n });\n \n}", "title": "" }, { "docid": "8995d02070df290e0685fa0509aab24c", "score": "0.46629062", "text": "getAuthHeaderComment(headers) {\n if (headers.Authorization || headers.authorization) {\n return `// If you have the auth token saved in offline storage, obtain it in async componentDidMount` + Format.NEXT_LINE +\n `// var authToken = await AsyncStorage.getItem('HASURA_AUTH_TOKEN');` + Format.NEXT_LINE +\n `// And use it in your headers` + Format.NEXT_LINE +\n `// headers = { \"Authorization\" : \"Bearer \" + authToken }` + Format.NEXT_LINE;\n }\n return '';\n }", "title": "" }, { "docid": "b91f2470948948d29167b736075ae714", "score": "0.4660644", "text": "function getFBID() {\r\n var oSnapShot, strText;\r\n var i1, i2;\r\n oSnapShot = getSnapshot('//script[contains(text(),\"Env\")]');\r\n if (oSnapShot.snapshotLength != 0) {\r\n strText = oSnapShot.snapshotItem(0).innerHTML;\r\n i1 = strText.indexOf('{user:') + 6;\r\n if (i1!=-1) {\r\n i2 = strText.indexOf(',',i1);\r\n return strText.slice(i1,i2);\r\n } else {\r\n return strText;\r\n }\r\n } else {\r\n return strText;\r\n }\r\n}", "title": "" }, { "docid": "5758891631a8b0cc649573e3e072efe3", "score": "0.4654309", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\nthis._FBPAddWireHook(\"--massiveLoad\",()=>{// generate events\nfor(let i=0,payload;11>i;i++){payload={action:\"term\"+i};this.dispatchEvent(new CustomEvent(\"action\",{detail:payload,bubbles:!0,composed:!0}));console.log(payload)}})}", "title": "" }, { "docid": "2e73ad2e2b55e9e06012cf0b43dbde38", "score": "0.46473536", "text": "function testAPI() {\n\tFB.api('/me', function(response) {\n\t\tdocument.getElementById('status').innerHTML = 'Thanks for logging in, ' + response.name + '!';\n\t});\n}", "title": "" }, { "docid": "263f36abb071de6849693e1aaa8570e9", "score": "0.46471727", "text": "function testApi() {\r\n FB.api('/me?fields=id,name,email,picture', function(response) {\r\n if (response.email == null) {\r\n // console.log('error');\r\n } else {\r\n var email = response.email;\r\n var name = response.name;\r\n var fid = response.id;\r\n //console.log(email, name, fid);\r\n bmSubscribe(email, fid);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "4e4db6c900c5e8e30aefb9a042e5b8e1", "score": "0.46466497", "text": "componentDidMount() {\n // Handling Deep Linking\n const deepLinkUrl = Linking.getInitialURL().then((url) => {\n\n }).catch(err => console.error('An error occurred', err));\n }", "title": "" }, { "docid": "6b1f40300713bfdbb0631445ce92eed1", "score": "0.4638975", "text": "function cargaFb(d){\n var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];\n if (d.getElementById(id)) {return;}\n\t\tjs = d.createElement('script'); js.id = id; js.async = true;\n\t\tjs.src = \"//connect.facebook.net/es_ES/all.js\";\n\t\tref.parentNode.insertBefore(js, ref);\n\t\t \n}", "title": "" }, { "docid": "d2a790cc0d4fd6153a626f12d129715b", "score": "0.46355855", "text": "function testAPI() {\nconsole.log('Welcome! Fetching your information.... ');\nFB.api('/me?fields=id,name,email', function(response) {\n console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n});\n}", "title": "" }, { "docid": "61ca88693656d589c172066000bfffa2", "score": "0.46332815", "text": "initialize() {\n }", "title": "" }, { "docid": "908aafae0e2dce902fd2061fe592daac", "score": "0.4633095", "text": "function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];e=s.default.apply(void 0,[{zIndex:f.default,isRtl:!1,userAgent:void 0},d.default,e].concat(n));var r=e,i=r.spacing,l=r.fontFamily,u=r.palette,p={spacing:i,fontFamily:l,palette:u};e=(0,s.default)({appBar:{color:u.primary1Color,textColor:u.alternateTextColor,height:i.desktopKeylineIncrement,titleFontWeight:x.default.fontWeightNormal,padding:i.desktopGutter},avatar:{color:u.canvasColor,backgroundColor:(0,c.emphasize)(u.canvasColor,.26)},badge:{color:u.alternateTextColor,textColor:u.textColor,primaryColor:u.primary1Color,primaryTextColor:u.alternateTextColor,secondaryColor:u.accent1Color,secondaryTextColor:u.alternateTextColor,fontWeight:x.default.fontWeightMedium},bottomNavigation:{backgroundColor:u.canvasColor,unselectedColor:(0,c.fade)(u.textColor,.54),selectedColor:u.primary1Color,height:56,unselectedFontSize:12,selectedFontSize:14},button:{height:36,minWidth:88,iconButtonSize:2*i.iconSize},card:{titleColor:(0,c.fade)(u.textColor,.87),subtitleColor:(0,c.fade)(u.textColor,.54),fontWeight:x.default.fontWeightMedium},cardMedia:{color:w.darkWhite,overlayContentBackground:w.lightBlack,titleColor:w.darkWhite,subtitleColor:w.lightWhite},cardText:{textColor:u.textColor},checkbox:{boxColor:u.textColor,checkedColor:u.primary1Color,requiredColor:u.primary1Color,disabledColor:u.disabledColor,labelColor:u.textColor,labelDisabledColor:u.disabledColor},chip:{backgroundColor:(0,c.emphasize)(u.canvasColor,.12),deleteIconColor:(0,c.fade)(u.textColor,.26),textColor:(0,c.fade)(u.textColor,.87),fontSize:14,fontWeight:x.default.fontWeightNormal,shadow:\"0 1px 6px \"+(0,c.fade)(u.shadowColor,.12)+\",\\n 0 1px 4px \"+(0,c.fade)(u.shadowColor,.12)},datePicker:{color:u.primary1Color,textColor:u.alternateTextColor,calendarTextColor:u.textColor,selectColor:u.primary2Color,selectTextColor:u.alternateTextColor,calendarYearBackgroundColor:u.canvasColor,headerColor:u.pickerHeaderColor||u.primary1Color},dialog:{titleFontSize:22,bodyFontSize:16,bodyColor:(0,c.fade)(u.textColor,.6)},dropDownMenu:{accentColor:u.borderColor},enhancedButton:{tapHighlightColor:w.transparent},flatButton:{color:w.transparent,buttonFilterColor:\"#999999\",disabledTextColor:(0,c.fade)(u.textColor,.3),textColor:u.textColor,primaryTextColor:u.primary1Color,secondaryTextColor:u.accent1Color,fontSize:x.default.fontStyleButtonFontSize,fontWeight:x.default.fontWeightMedium},floatingActionButton:{buttonSize:56,miniSize:40,color:u.primary1Color,iconColor:u.alternateTextColor,secondaryColor:u.accent1Color,secondaryIconColor:u.alternateTextColor,disabledTextColor:u.disabledColor,disabledColor:(0,c.emphasize)(u.canvasColor,.12)},gridTile:{textColor:w.white},icon:{color:u.canvasColor,backgroundColor:u.primary1Color},inkBar:{backgroundColor:u.accent1Color},drawer:{width:4*i.desktopKeylineIncrement,color:u.canvasColor},listItem:{nestedLevelDepth:18,secondaryTextColor:u.secondaryTextColor,leftIconColor:w.grey600,rightIconColor:w.grey600},menu:{backgroundColor:u.canvasColor,containerBackgroundColor:u.canvasColor},menuItem:{dataHeight:32,height:48,hoverColor:(0,c.fade)(u.textColor,.1),padding:i.desktopGutter,selectedTextColor:u.accent1Color,rightIconDesktopFill:w.grey600},menuSubheader:{padding:i.desktopGutter,borderColor:u.borderColor,textColor:u.primary1Color},overlay:{backgroundColor:w.lightBlack},paper:{color:u.textColor,backgroundColor:u.canvasColor,zDepthShadows:[[1,6,.12,1,4,.12],[3,10,.16,3,10,.23],[10,30,.19,6,10,.23],[14,45,.25,10,18,.22],[19,60,.3,15,20,.22]].map(function(e){return\"0 \"+e[0]+\"px \"+e[1]+\"px \"+(0,c.fade)(u.shadowColor,e[2])+\",\\n 0 \"+e[3]+\"px \"+e[4]+\"px \"+(0,c.fade)(u.shadowColor,e[5])})},radioButton:{borderColor:u.textColor,backgroundColor:u.alternateTextColor,checkedColor:u.primary1Color,requiredColor:u.primary1Color,disabledColor:u.disabledColor,size:24,labelColor:u.textColor,labelDisabledColor:u.disabledColor},raisedButton:{color:u.alternateTextColor,textColor:u.textColor,primaryColor:u.primary1Color,primaryTextColor:u.alternateTextColor,secondaryColor:u.accent1Color,secondaryTextColor:u.alternateTextColor,disabledColor:(0,c.darken)(u.alternateTextColor,.1),disabledTextColor:(0,c.fade)(u.textColor,.3),fontSize:x.default.fontStyleButtonFontSize,fontWeight:x.default.fontWeightMedium},refreshIndicator:{strokeColor:u.borderColor,loadingStrokeColor:u.primary1Color},ripple:{color:(0,c.fade)(u.textColor,.87)},slider:{trackSize:2,trackColor:u.primary3Color,trackColorSelected:u.accent3Color,handleSize:12,handleSizeDisabled:8,handleSizeActive:18,handleColorZero:u.primary3Color,handleFillColor:u.alternateTextColor,selectionColor:u.primary1Color,rippleColor:u.primary1Color},snackbar:{textColor:u.alternateTextColor,backgroundColor:u.textColor,actionColor:u.accent1Color},subheader:{color:(0,c.fade)(u.textColor,.54),fontWeight:x.default.fontWeightMedium},stepper:{backgroundColor:\"transparent\",hoverBackgroundColor:(0,c.fade)(w.black,.06),iconColor:u.primary1Color,hoveredIconColor:w.grey700,inactiveIconColor:w.grey500,textColor:(0,c.fade)(w.black,.87),disabledTextColor:(0,c.fade)(w.black,.26),connectorLineColor:w.grey400},svgIcon:{color:u.textColor},table:{backgroundColor:u.canvasColor},tableFooter:{borderColor:u.borderColor,textColor:u.accent3Color},tableHeader:{borderColor:u.borderColor},tableHeaderColumn:{textColor:u.accent3Color,height:56,spacing:24},tableRow:{hoverColor:u.accent2Color,stripeColor:(0,c.fade)((0,c.lighten)(u.primary1Color,.5),.4),selectedColor:u.borderColor,textColor:u.textColor,borderColor:u.borderColor,height:48},tableRowColumn:{height:48,spacing:24},tabs:{backgroundColor:u.primary1Color,textColor:(0,c.fade)(u.alternateTextColor,.7),selectedTextColor:u.alternateTextColor},textField:{textColor:u.textColor,hintColor:u.disabledColor,floatingLabelColor:u.disabledColor,disabledTextColor:u.disabledColor,errorColor:w.red500,focusColor:u.primary1Color,backgroundColor:\"transparent\",borderColor:u.borderColor},timePicker:{color:u.alternateTextColor,textColor:u.alternateTextColor,accentColor:u.primary1Color,clockColor:u.textColor,clockCircleColor:u.clockCircleColor,headerColor:u.pickerHeaderColor||u.primary1Color,selectColor:u.primary2Color,selectTextColor:u.alternateTextColor},toggle:{thumbOnColor:u.primary1Color,thumbOffColor:u.accent2Color,thumbDisabledColor:u.borderColor,thumbRequiredColor:u.primary1Color,trackOnColor:(0,c.fade)(u.primary1Color,.5),trackOffColor:u.primary3Color,trackDisabledColor:u.primary3Color,labelColor:u.textColor,labelDisabledColor:u.disabledColor,trackRequiredColor:(0,c.fade)(u.primary1Color,.5)},toolbar:{color:(0,c.fade)(u.textColor,.54),hoverColor:(0,c.fade)(u.textColor,.87),backgroundColor:(0,c.darken)(u.accent2Color,.05),height:56,titleFontSize:20,iconColor:(0,c.fade)(u.textColor,.4),separatorColor:(0,c.fade)(u.textColor,.175),menuHoverColor:(0,c.fade)(u.textColor,.1)},tooltip:{color:w.white,rippleBackgroundColor:w.grey700,opacity:.9}},e,{baseTheme:p,// To provide backward compatibility.\nrawTheme:p});var h=[m.default,y.default,b.default].map(function(t){return t(e)}).filter(function(e){return e});return e.prepareStyles=k.default.apply(void 0,(0,o.default)(h)),e}", "title": "" }, { "docid": "8b4bcc1cba2e85172c9113d6ce3a966d", "score": "0.4632311", "text": "function retrieveFacebookUserID() {\n var params = {\"fields\": \"id, name, first_name, last_name, picture.type(large), email\"};\n FB.api('/me', check, params);\n}", "title": "" }, { "docid": "fe5ee0c915951339deec957adaef892b", "score": "0.4628135", "text": "_fbAuth(){\n let success=0;\n LoginManager.logInWithReadPermissions(['public_profile','email']).then(function(result){\n \n if(result.isCancelled){\n console.log(\"Login was cancelled\");\n \n \n }else{ \n console.warn('Login was a success '+ result.grantedPermissions.toString());\n _part2();\n \n }\n \n },function(error){\n console.log(\"an error occured:\"+error);\n\n })\n\n \n \n }", "title": "" }, { "docid": "d4d435f04769d968cc9df88ee6c72610", "score": "0.4619084", "text": "function fb_login(){\n FB.login(function(response) {\n\n if (response.authResponse) {\n console.log('Welcome! Fetching your information.... ');\n //console.log(response); // dump complete info\n access_token = response.authResponse.accessToken; //get access token\n user_id = response.authResponse.userID; //get FB UID\n loggedInToFb();\n } else {\n //user hit cancel button\n console.log('User cancelled login or did not fully authorize.');\n\n }\n }, {\n scope: 'email,public_profile'\n });\n}", "title": "" }, { "docid": "bdf57a56866342c887b89a248fb7529e", "score": "0.46150604", "text": "async initialize () {\n\n }", "title": "" }, { "docid": "a9586b97446c706a6d35d9f3ce3012a1", "score": "0.46122724", "text": "componentDidMount() {\n this.setState({\n videoSource: window.URL.createObjectURL(this.props.mediaStream)\n });\n }", "title": "" }, { "docid": "8839752469c162b5b6dc8cdad666ed9e", "score": "0.461214", "text": "function get_is_fb(){\n if (String(window.location).indexOf(\"https://www.facebook.com\") != -1 \n || String(window.location).indexOf(\"https://m.facebook.com\") != -1 ){\n return true; \n } else{\n return false;\n }\n }", "title": "" }, { "docid": "df5a5b6c218195ea5602f07518a3af38", "score": "0.4591709", "text": "function fblogin() {\n\t\tFB.login(function(response) {\n\t\t\tfetchFBUserInfo();\n\t\t\tfetchFriendsInfo();\n\t\t}, {scope: 'email,user_likes,read_stream,publish_stream'});\n\t}", "title": "" }, { "docid": "198b95fca98135783d0922c95a6cb3f6", "score": "0.45855397", "text": "function facebookCurrentPage() {\n var link = getUrl();\n\n window.open(\"https://www.facebook.com/sharer/sharer.php?u=\"+escape(link)+\"&t=\"+encodeURIComponent(\"Petition Map (By Unboxed)\"), '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');\n return false;\n }", "title": "" }, { "docid": "069fa12d6ffc4f1cb9ef54cc58fcb53a", "score": "0.45847687", "text": "initialize() {\n\n }", "title": "" }, { "docid": "6745801702c3f1ac021b9fce788fcd7d", "score": "0.45846146", "text": "function getUser()\n{\n FB.api('/me?fields=id,name,email,birthday', function(response) {\n console.log('getUser', response);\n });\n}", "title": "" }, { "docid": "3248a36bafd5f6f4f4261cb16936f129", "score": "0.45812303", "text": "function Widgets() {\n return (\n <div className=\"widgets\">\n <iframe\n src=\"https://www.facebook.com/plugins/page.php?href=https://www.facebook.com/rolex&\n tabs=timeline&\n width=340&\n height=1500&\n small_header=false&\n adapt_container_width=true&\n hide_cover=false&\n show_facepile=true&\n appId\"\n title=\"Adverts\"\n width=\"340\"\n height=\"100%\"\n style={{ border: \"none\", overflow: \"hidden\" }}\n scrolling=\"no\"\n frameBorder=\"0\"\n allowTransparency=\"true\"\n allow=\"encrypted-media\"\n ></iframe>\n </div>\n );\n}", "title": "" }, { "docid": "1e4727f5c3aada55b1b073cca42efd20", "score": "0.45808882", "text": "function initFB(appId){\n FB.init({\n appId:appId, cookie:true,\n status:true, xfbml:true\n });\n}", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45751905", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45751905", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45751905", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45751905", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45751905", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" } ]
08eba71bf0837e5a1cd61ede6c90c63f
another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
[ { "docid": "cdc5c9d98cb7682f1ca1ba3b40f9f149", "score": "0.0", "text": "function emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}", "title": "" } ]
[ { "docid": "467597d993cc765f901f5a4ebdf08448", "score": "0.6279752", "text": "_read(size) {\n //a) push data when asked\n let b = this.push(data);\n //b) while not full \n if (!b) return;\n //c) end of data stream \n this.push(null);\n //d) signal error in reading\n // proces.nextTick(...)\n this.emit('error', err)\n //e) do not call or delay\n // the call to push() \n }", "title": "" }, { "docid": "7e97ce3824cb1971b85843055792cba4", "score": "0.626577", "text": "_read () {}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6200748", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6200748", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6200748", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6200748", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "18427f2d3d1c867c901f2b6538e7ac86", "score": "0.6196876", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "8571ea7a6594c1c07486e8158bf384fa", "score": "0.6192212", "text": "_read() {}", "title": "" }, { "docid": "e299ed99cdeb843e5db863a538ebc7c8", "score": "0.6121495", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore = true;process.nextTick(function(){maybeReadMore_(stream,state);});}}", "title": "" }, { "docid": "e565f8ee7bda70dbfad6d8128ad68d46", "score": "0.61101025", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "e565f8ee7bda70dbfad6d8128ad68d46", "score": "0.61101025", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "e565f8ee7bda70dbfad6d8128ad68d46", "score": "0.61101025", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "babc333db1815c4ae2a9e7dd387b428d", "score": "0.609812", "text": "_read(size) {\n logger.debug(`>>>>> reading from ${this.staticTag}`);\n if (this.goReading) {\n logger.debug(`>>>>> read: this.goReading is F from ${this.staticTag}`);\n this.goReading = false;\n }\n }", "title": "" }, { "docid": "bbf1c0d2458944a706ef46041acbdec0", "score": "0.5995598", "text": "read() {}", "title": "" }, { "docid": "bbf1c0d2458944a706ef46041acbdec0", "score": "0.5995598", "text": "read() {}", "title": "" }, { "docid": "bbf1c0d2458944a706ef46041acbdec0", "score": "0.5995598", "text": "read() {}", "title": "" }, { "docid": "bbf1c0d2458944a706ef46041acbdec0", "score": "0.5995598", "text": "read() {}", "title": "" }, { "docid": "477377001df02c36abe4ca3f0bb0b499", "score": "0.5954219", "text": "_read (_size) {}", "title": "" }, { "docid": "682779b736a84252ee5c76739b2184fa", "score": "0.5907389", "text": "function maybeReadMore(stream, state) {\r\n\t\t\t\tif (!state.readingMore) {\r\n\t\t\t\t\tstate.readingMore = true;\r\n\t\t\t\t\tprocess.nextTick(maybeReadMore_, stream, state);\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "3be2f8f836666e96f5727d974b881fdb", "score": "0.59019727", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t nextTick$1(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "57c6224c7eea5c7fd0503f961d019027", "score": "0.5892477", "text": "_read() {\r\n\r\n }", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.5856945", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "7f23383454434845b3a6c5e490b7979d", "score": "0.584048", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t nextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "6a4ec7e3da1c1b91ecc7dea4367734be", "score": "0.58267957", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n nextTick(maybeReadMore_, stream, state);\n }\n }", "title": "" }, { "docid": "6a4ec7e3da1c1b91ecc7dea4367734be", "score": "0.58267957", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n nextTick(maybeReadMore_, stream, state);\n }\n }", "title": "" }, { "docid": "17a8bb2b27e2fbf5da2a4149978ca2c8", "score": "0.57999575", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n }", "title": "" }, { "docid": "3bb612106536bc70c52b0e1c0a1a4e32", "score": "0.5791415", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n }", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "0c0ad597e5cfb04310fd1c7d222322db", "score": "0.57878166", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "8cf14feb4637d673dccae97e9b24a2e7", "score": "0.5787483", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n nextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "8cf14feb4637d673dccae97e9b24a2e7", "score": "0.5787483", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n nextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "8cf14feb4637d673dccae97e9b24a2e7", "score": "0.5787483", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n nextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "858f4d8305423db982f7de446e5fa763", "score": "0.5779862", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n }", "title": "" }, { "docid": "8b7296a21370dd599a393a77b08b98a7", "score": "0.5772695", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t pna.nextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "8b7296a21370dd599a393a77b08b98a7", "score": "0.5772695", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t pna.nextTick(maybeReadMore_, stream, state);\n\t }\n\t}", "title": "" }, { "docid": "67779ecf4e40aa3fffbd2a69bdff2d9e", "score": "0.5768707", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n }", "title": "" }, { "docid": "93301b557b5240dc1d48197115926b55", "score": "0.5746908", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n }", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" }, { "docid": "b0cc94c95f073375bf24013c6a92b09a", "score": "0.57396674", "text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}", "title": "" } ]
97104aca8705379e799b39d6cafaf5c6
this function takes a string that should be a number, the expected length of the number and the maximum number that number should be, and formats it appropriately
[ { "docid": "a618448df0df16a2f308474044413600", "score": "0.69629174", "text": "function getNumber(num, numLength, maxVal) {\n try {\n if ((num) <= maxVal && num.length <= numLength) { //if it's all normal\n return num;\n }\n //if it's not\n num = num.replace(/[^\\d.]/g, ' ').trim(); //remove all non numeric characters but keep the dot\n if (num.length > numLength) {//if there are too many numbers \n\n if (num.slice(0,numLength) <= maxVal) { //if the first few characters are correct but theres some baggage in there\n return num.slice(0,numLength);\n } else {\n //debug time and manual correction stuff yay\n console.log(\"error with num\");\n console.log(\"The number line is: \" + num + \". The length should be: \" + numLength + \". The max value should be: \" + maxVal);\n return nada;\n }\n }\n else if (num == '' || num > maxVal) {//person didn't provide their gpa\n return nada\n }\n return num;\n } catch (err) {\n console.log(err.message)\n return nada;\n }\n}", "title": "" } ]
[ { "docid": "ab0aebcc9c018e0575d302467c6f2177", "score": "0.7120745", "text": "function formatNumber(number) {\n if (number.toString().length > maxLength) {\n let formatedNr = number;\n while (formatedNr.toString().length > maxLength) {\n // number is a float\n if (formatedNr % 1 !== 0) {\n // prevents a float smaller than 10^(-maxLength) from being rounded to 0\n if (formatedNr < Math.pow(10, -maxLength)) {\n formatNumber = number.toExponential();\n }\n else {\n // represents the minimum number of characters to display a float, i.e at least one digit before the decimal point and a decimal point \n let i = 2;\n while (formatedNr.toString().length > maxLength) {\n formatedNr = parseFloat(formatedNr).toFixed(maxLength - i);\n i++;\n // the number is rounded to an integer but is still has more characters than maxLength\n if (maxLength - i === -1) {\n break;\n }\n }\n }\n }\n // number is an integer\n else {\n // formats the number to exponential form\n formatedNr = number.toExponential();\n }\n\n // if the length of the number formatted to exponential form still exceeds maxLength, the number of digits after the decimal point are specified \n if (formatedNr.length > maxLength) {\n // represents the minimum number of characters to display an exponenet,\n // i.e., a digit before decimal point, decimal point, Euler's number, the sign and power of the Euler's number \n let j = 5;\n // the number of digits after decimal point is decreased until length of the formated number equals that of maxLength\n while (formatedNr.length > maxLength) {\n formatedNr = number.toExponential(maxLength - j);\n j++;\n }\n }\n }\n return formatedNr;\n } else {\n return number;\n }\n}", "title": "" }, { "docid": "147ac594930eb2fa90a8031b8a3e1c3e", "score": "0.7099785", "text": "function format_number_length(num, length) {\r\n var r = \"\" + num;\r\n while (r.length < length) {\r\n r = \"0\" + r;\r\n }\r\n return r;\r\n }", "title": "" }, { "docid": "8d5aee0df6f434ce72df40b298ff8028", "score": "0.7045631", "text": "function FormatNumberLength(num, length) {\n var r = \"\" + num;\n while (r.length < length) {\n r = \"0\" + r;\n }\n return r;\n}", "title": "" }, { "docid": "edb6ea88f5803c1c0fecd6b4c84d4c84", "score": "0.6771451", "text": "function getMaxStringNumber() {\n\n}", "title": "" }, { "docid": "c088fa140fbcc72017665a103bd3dd39", "score": "0.6739457", "text": "function testNumLength(number) {\n if (number.length > 10) {\n $display.text(parseFloat(number).toPrecision(7));\n }\n\t if (number === 'NaN') {\n $display.text('Illegal Input');\n }\n }", "title": "" }, { "docid": "da59f133b27ea7ddbcadf2ed6da3e70a", "score": "0.663166", "text": "function formatNumbers(num){\n if (Number(num) > 100000000000){\n return num.toExponential(3);\n }\n else if (num.toString().length > 14) { \n return num.toPrecision(12); // toPrecision formats as 1.4e+02\n }\n return num; \n}", "title": "" }, { "docid": "52270123164023def1df93851ba971dc", "score": "0.6610308", "text": "function to_numbers(str) {\n var formatted = '';\n for (var i = 0; i < (str.length); i++) {\n var char_ = str.charAt(i);\n if (formatted.length == 0 && char_ == 0) char_ = false;\n\n if (char_ && char_.match(is_number)) {\n if (limit) {\n if (formatted.length < limit) formatted = formatted + char_;\n } else {\n formatted = formatted + char_;\n }\n }\n }\n\n return formatted;\n }", "title": "" }, { "docid": "6e4a92bce91d6bfb5cfedf13b87a4853", "score": "0.6579462", "text": "function format(n){\n return n > 9 ? \"\" + n: \"0\" + n;\n}", "title": "" }, { "docid": "6346056d7bb9e869d3ea7c16066f59ba", "score": "0.65109015", "text": "function limitToScale(numStr , scale , fixedDecimalScale ) {\n var str = '';\n var filler = fixedDecimalScale ? '0' : '';\n for (var i = 0; i <= scale - 1; i++) {\n str += numStr[i] || filler;\n }\n return str;\n}", "title": "" }, { "docid": "497f7b5b01b05a7c9c0f02901c7b3a8c", "score": "0.63764846", "text": "displayNumber(num) {\n\n const numString = num.toString()\n const integerDigits = parseFloat(numString.split('.')[0])\n let decimalDigits = numString.split('.')[1]\n\n let numDisplay = undefined\n\n if (isNaN(integerDigits)) { numDisplay = '' }\n else { numDisplay = integerDigits.toLocaleString('en', { maximumFractionDigits: 0 }) }\n\n if (decimalDigits != null) {\n if (decimalDigits.length >= 40){\n let parsedNumber = parseFloat(integerDigits.toString() + '.' + decimalDigits.toString()).toFixed(10) // Limits the number of decimal digits\n return parsedNumber\n } else { return `${numDisplay}.${decimalDigits}` }\n } else {\n return numDisplay\n }\n }", "title": "" }, { "docid": "01dea7f91260191e5bff2d0c2e7d4a8f", "score": "0.63763005", "text": "function format(n) {\n return (n > 9 ? \"\" + n : \"0\" + n);\n}", "title": "" }, { "docid": "d3d45bbdc3274b84900cbf9b697da79b", "score": "0.63554376", "text": "function fix(num, length) {\r\n\t return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;\r\n\t}", "title": "" }, { "docid": "146a66810dc95bda2f6f5add1cb90384", "score": "0.63404346", "text": "function formatNumber(number: number, n?: number = 0, x?: number = 3, s?: string = ' ', c?: string) {\n const\n re = `\\\\d(?=(\\\\d{${x}})+${n > 0 ? '\\\\D' : '$'})`,\n num = number.toFixed(Math.max(0, ~~n)), // eslint-disable-line no-bitwise\n result = (c ? num.replace('.', c) : num).replace(new RegExp(re, 'g'), `$&${s}`);\n\n if (result !== result) { // eslint-disable-line no-self-compare\n return '';\n }\n return result;\n}", "title": "" }, { "docid": "b9897ce85ab902e13725ec030aea97c1", "score": "0.6336831", "text": "function fmtNum (n) {\n var wholePart = Split(Text(n), '.')[0];\n var digits = Count(wholePart);\n var factor = 1;\n var suffixKey = '0';\n var suffixLookup = {\n '0':'',\n '1':'K',\n '2':'M',\n '3':'B',\n '4':'T'\n };\n if (digits >3 && digits <= 6) {\n factor = 1000;\n suffixKey = 1;\n } else if (digits > 6 && digits <= 9) {\n factor = 1000000;\n suffixKey = 2;\n } else if (digits > 9 && digits <= 12) {\n factor = 1000000000;\n suffixKey = 3\n } else if (digits > 12) {\n factor = 1000000000000;\n suffixKey = 4\n }\n var factored = Round(Number(wholePart) / factor, 1);\n // Handle when \"round up\" pushes us to another scale\n if (factored >= 1000) {\n // Max out at 4\n suffixKey = Min(4, suffixKey + 1);\n factored = Round(factored / 1000, 1);\n }\n // Get the output\n var output = '';\n if (factored < 1) {\n output = '<1';\n } else {\n output = Text(factored) + suffixLookup[Text(suffixKey)];\n }\n return output\n}", "title": "" }, { "docid": "c8200bd78df0f5fb6a9cde752429f164", "score": "0.6333519", "text": "function n(n){ return n > 9 ? \"\" + n: \"0\" + n; }", "title": "" }, { "docid": "104c04492ec18c5424fb5c20310f9e2a", "score": "0.6280702", "text": "fixString(stringOrNum){\n \t\tlet string = stringOrNum.toString();\n \t\tconst lastChar = string.slice(-1);\n \t\tlet endNum;\n\n \t\tswitch(lastChar) {\n\t\t case '/':\n\t\t case '*':\n\t\t endNum = '1';\n\t\t break;\n\t\t case '%':\n\t\t \tstring = string.slice(0, -1);\n\t\t endNum = '/100';\n\t\t break;\n\t\t case '-':\n\t\t case '+':\n\t\t endNum = '0';\n\t\t break;\n\t\t default:\n\t\t \tendNum = '';\n\t\t}\n\n\t\treturn string+endNum;\n \t}", "title": "" }, { "docid": "35e214a080ec5ad7135e1cd305babace", "score": "0.6276735", "text": "function FormatNumber(num)\n{\n if (num < 10)\n return (\"0\" + num);\n return num;\n}", "title": "" }, { "docid": "ac05e192289cbf6eb5981b4d455bedac", "score": "0.6263695", "text": "function fixNumber(number)\n{\n\tif (number < 10)\n\t{\n\t\treturn \"0\" + number;\n\t}\n\telse\n\t{\n\t\treturn number;\n\t}\n}", "title": "" }, { "docid": "3759d2415e1245d02e8098054509c963", "score": "0.6258273", "text": "function numberFormat(value, digits){\n\tvar val = '' + value; //make it a string\n\twhile (val.length < digits)\n\t\tval = '0' + val;\n\treturn val;\n}", "title": "" }, { "docid": "c77d225716bfbe0985aab194ead3c8fe", "score": "0.62538916", "text": "function format(number){\n if(number < 10){\n return \"0\" + number;\n } else {\n return number;\n }\n }", "title": "" }, { "docid": "638700e4bd3aa930514b6e26aa078b9a", "score": "0.62496793", "text": "function checkNum(data) {\n if (data < 10) {\n data = '0' + data;\n }\n return data;\n }", "title": "" }, { "docid": "7e0c56437684f3530ec2f65e0e07f947", "score": "0.6245028", "text": "function format(n){\n \treturn n<10? '0'+n:''+n;\n }", "title": "" }, { "docid": "e170b1688754b2da6b3f4f4a2c3cb4fb", "score": "0.621351", "text": "function format (n,num) {\n // Good luck!\n}", "title": "" }, { "docid": "842b248efa769fa537c45dae20639b4e", "score": "0.6186807", "text": "function formatNumber(n) {\n\n return (n > 9 ? \"\" + n : \"0\" + n);\n}", "title": "" }, { "docid": "3ceda3c0984feafbe77751150d302f2f", "score": "0.6178297", "text": "function formatNum(num){\n if(num <10){\n return \"0\".concat(num);\n } else {\n return num.toString();\n }\n}", "title": "" }, { "docid": "e7358d4dfffe92cf7f35ee90813eebef", "score": "0.6157158", "text": "function n(n) {\n return n > 9 ? \"\" + n : \"0\" + n\n }", "title": "" }, { "docid": "6738217c1e991f426034d33fa767f372", "score": "0.6153331", "text": "function formatNumber(number){\r\n\t\t\tvar sReturn=number;\r\n\t\t\tif (parseInt(number)<10)sReturn = \"0\" + parseInt(number);\r\n\t\t\treturn sReturn;\r\n\t\t}", "title": "" }, { "docid": "5bd4d9b58a04c8758f5d92af255200a8", "score": "0.6151979", "text": "function formatNumber(val) {\n if (val.length <= 4) {\n val = String(\"0000\" + val).slice(-4);\n }\n return val;\n \n}", "title": "" }, { "docid": "e314bceadc20e11aaf1517f05f549f7b", "score": "0.6142398", "text": "function formatNumber(_express, iSize) {\n\t_express = _express - 1 + 1;\n\tiSize = iSize - 1 + 1;\n\n\tif (iSize > 10) {\n\t\tiSize = 10;\n\t}\n\tif (iSize < 0) {\n\t\tiSize = 0;\n\t}\n\tvar iKey1 = Math.pow(10, 12);\n\tvar dTemp = Math.round(_express * iKey1);\n\tvar sTemp = \"\" + dTemp;\n\tvar iEndNum = sTemp.substring(sTemp.length - 1, sTemp.length) - 1 + 1\n\tif (iEndNum = 9) {\n\t\tdTemp = dTemp + 1;\n\t} else {\n\t\tdTemp = dTemp + 2;\n\t}\n\n\tdTemp = dTemp / iKey1;\n\n\tvar iKey = Math.pow(10, iSize);\n\tdTemp = Math.round(dTemp * iKey);\n\n\t_sValue = \"\" + dTemp / iKey;\n\n\tif (iSize > 0) {\n\t\tif (_sValue.indexOf(\".\", 0) == -1) {\n\t\t\t_sValue = _sValue + \".\";\n\t\t\tfor (i = 0; i < iSize; i++) {\n\t\t\t\t_sValue = _sValue + \"0\";\n\t\t\t}\n\t\t} else {\n\t\t\tiPosition = _sValue.indexOf(\".\", 0);\n\t\t\tiLen = _sValue.length;\n\t\t\tfor (i = 0; i < iSize - iLen + iPosition + 1; i++) {\n\t\t\t\t_sValue = _sValue + \"0\";\n\t\t\t}\n\t\t}\n\t}\n\treturn _sValue;\n}", "title": "" }, { "docid": "ce10198fed4ed62e442fc0b7226e1ef8", "score": "0.6125999", "text": "function formatNum(num, digits) {\n var pow = Math.pow(10, digits || 5);\n return Math.round(num * pow) / pow;\n } // @function trim(str: String): String", "title": "" }, { "docid": "346baf0fb1b5d8b1941609f62b61f1d7", "score": "0.6108031", "text": "function formatNumber(number){\n\tnumber = number.toString();\n\tlet decimal_position = number.indexOf('.');\n\tif (decimal_position == -1){\n\t\treturn parseInt(number)\n\t}\n\telse{\n\t\tconst max_decimals = 8;\n\t\tlet decimal_places = Math.min(8, number.length - decimal_position)\n\t\tlet decimal_value = number.substring(decimal_position+1, decimal_position + max_decimals);\n\t\tif (decimal_value == \"0000000\") \n\t\t\treturn parseInt(number);\n\t\t\n\t\tnumber = parseFloat(number).toFixed(decimal_places)\n\t\twhile (number.substr(-1) == 0) {\n\t\t\tnumber = number.substring(0, number.length - 1);\n\t\t}\n\t\treturn number.toString();\n\t}\n}", "title": "" }, { "docid": "16b4aea2fd907b78b32f5359d5740c94", "score": "0.610164", "text": "static checkTwodigitNumber(val, len) {\n let ret = val + '';\n if (len === 2 && ret.length !== 2) {\n return '0' + ret;\n }\n return ret;\n }", "title": "" }, { "docid": "4cb72e3ed8ea2660481571955e9647af", "score": "0.6096557", "text": "function n(n){\n return n > 9 ? \"\" + n: \"0\" + n;\n }", "title": "" }, { "docid": "7aeea9e091169fc576d9820bd4f5b7ca", "score": "0.6092543", "text": "function numFormat(x, shortIgnore) {\n \n shortIgnore = shortIgnore || false;\n\n var xString = x.toString();\n var indexDot = xString.indexOf('.');\n if (x < 0.1 && x.toString().indexOf(\".\") > -1 && xString.substring(indexDot, x.length).length > -1) { //If num has a decimal 3 digits long then indicate that there's a small count.\n if (shortIgnore) {\n return \"0.00(...)\";\n } else {\n return xString.substring(0, xString.length);\n }\n\n }\n if (x > 0.01 && x < 1) {\n \n return xString.substring(0, (indexDot-1) + 5);\n }\n if (Number(x) >= 1000 && Number(x) < Math.pow(10,9)) { // Remove decimals if num is in the thousands/millions\n x = Math.floor(x).toString();\n var pattern = /(-?\\d+)(\\d{3})/;\n while (pattern.test(x))\n x = x.replace(pattern, \"$1,$2\");\n return x;\n }\n if (Number(x) <= Math.pow(10,9) - 1) {\n x = x.toString();\n var pattern = /(-?\\d+)(\\d{3})/;\n while (pattern.test(x))\n x = x.replace(pattern, \"$1,$2\");\n return x;\n } else {\n x = Math.floor(x * 100) / 100;\n var z = Number(x).toExponential().toString();\n\n //z looks something like \"1.234567890e+100\"\n var num = z.substring(0, z.indexOf(\"e\"));\n\n //num should look like \"1.234567890\"\n var num2 = z.substring(z.indexOf(\"e\"), z.length);\n //num2 should look like \"e+100\"\n return num.substring(0, 4).concat(num2);\n //return the combination of \"1.234\" and \"e+100\"\n\n \n\n }\n}", "title": "" }, { "docid": "f6ec808f065d3f91f408e0148bc13af9", "score": "0.6091893", "text": "function checkNumberLength() {\n\n if (number.length >= 8 && number.length < 10 || result.length >= 8 && result.length < 10) {\n currentResult.style.fontSize = 54 + 'px';\n } else if (number.length >= 10 && number.length <= 12 || result.length >= 10 && result.length <= 12) {\n currentResult.style.fontSize = 44 + 'px';\n } else if (number.length >= 13 && number.length <= 19 || result.length >= 13 && result.length <= 19) {\n currentResult.style.fontSize = 27 + 'px';\n } else if (number.length > 19 || result.length > 19) {\n result = 'Err';\n currentResult.innerText = result;\n currentResult.style.fontSize = 64 + 'px';\n } else if (number.length < 8 && number.length >= 0 || result.length < 8 && result.length >= 0) {\n currentResult.style.fontSize = 64 + 'px';\n }\n}", "title": "" }, { "docid": "ff7f402a35be25defe38c984d59cbaff", "score": "0.6084351", "text": "function numberToString(number) {\n\n const DICT = {\n 0: 'zero',\n 1: 'one',\n 2: 'two',\n 3: 'three',\n 4: 'four',\n 5: 'five',\n 6: 'six',\n 7: 'seven',\n 8: 'eight',\n 9: 'nine',\n 10: 'ten',\n 11: 'eleven',\n 12: 'twelve',\n 13: 'thirteen',\n 14: 'fourteen',\n 15: 'fifteen',\n 16: 'sixteen',\n 17: 'seventeen',\n 18: 'eighteen',\n 19: 'nineteen',\n 20: 'twenty',\n 30: 'thirty',\n 40: 'forty',\n 50: 'fifty',\n 60: 'sixty',\n 70: 'seventy',\n 80: 'eighty',\n 90: 'ninety',\n }\n\n const MULTI = {\n 2: 'hundred',\n 3: 'thousand',\n 6: 'million'\n }\n\n let numberToString = '';\n let value;\n\n while (number > 0) {\n\n // get millions/thousands and hundreds\n let multiplier = Math.floor(Math.log10(number));\n\n // handle if multiplier is 4 or 5 instead of 3\n switch (multiplier) {\n case 4:\n case 5:\n multiplier = 3;\n break;\n case 7:\n case 8:\n multiplier = 6;\n break;\n }\n\n if (MULTI[multiplier]) {\n value = Math.floor(number / 10 ** multiplier);\n\n if (value > 100) {\n numberToString += ' ' + DICT[Math.floor(value / 100)] + ' hundred';\n\n let remainder = value - Math.floor(value / 100) * 100;\n if (remainder > 20) {\n if (DICT[remainder]) {\n // (5)60 (five hundred )sixty\n numberToString += ' ' + DICT[remainder];\n } else {\n // (5)67 = (five hundred )sixty-seven or \n numberToString += ' ' + DICT[remainder - remainder % 10] + '-' + DICT[remainder % 10];\n }\n } else {\n // (50)7 = (five hundred )seven\n numberToString += ' ' + DICT[value % 10];\n }\n } else if (value > 20) {\n numberToString += ' ' + DICT[value - value % 10] + '-' + DICT[value % 10];\n } else {\n numberToString += ' ' + DICT[value];\n }\n\n numberToString += ' ' + MULTI[multiplier];\n number -= value * 10 ** multiplier;\n } else {\n // add 'and' to non-blank string\n if (numberToString.length > 0) {\n numberToString += ' and '\n }\n \n // get numbers below 100\n if (number > 20) {\n if (DICT[number]) {\n numberToString += DICT[number];\n } else {\n numberToString += DICT[number - number % 10] + '-' + DICT[number % 10];\n } \n } else {\n numberToString += DICT[number];\n }\n number = 0;\n }\n }\n\n return numberToString.trim();\n}", "title": "" }, { "docid": "b31f573819e605b5eb2aed25cdf68ccd", "score": "0.6084289", "text": "function formatNum(num) {\n\n let newNum = num.toString();\n\n if (newNum.length < 4) {\n return newNum;\n }\n let output = \"\";\n let counter = 0;\n for (let i = 1; i <= newNum.length; i++) {\n output += newNum[newNum.length - i];\n counter++;\n if (counter === 3) {\n output += ',';\n counter = 0;\n }\n }\n return output.split('').reverse().join('');\n\n}", "title": "" }, { "docid": "037cf4fc0000ba7a7cfb21af16162e61", "score": "0.6083732", "text": "function to2Str(n) {return (n > 9 ? n : '0' + n);}", "title": "" }, { "docid": "742ed41485e6042fa2666472838a69fc", "score": "0.607951", "text": "function formatNumber(number) {\r\n\t\t\tvar sReturn = number;\r\n\t\t\tif (parseInt(number) < 10) sReturn = \"0\" + parseInt(number);\r\n\t\t\treturn sReturn;\r\n\t\t}", "title": "" }, { "docid": "c81fe418c0e854cfc5eeaee8cdcc9e51", "score": "0.6068968", "text": "function formatNum(num, length, decimals)\r\n{\r\n var text = \"\" + Math.abs(num).toFixed(decimals);\r\n while(text.length < length + decimals + 1) {\r\n text = \"0\" + text;\r\n }\r\n return (num < 0) ? \"-\" + text : \" \" + text;\r\n}", "title": "" }, { "docid": "da179772fce30d53a1136e002e007462", "score": "0.6038954", "text": "function toShorterVersion(num) {\n\t\n\tif (Object.is(0, num)) {return \"0\"}\n\tif (Object.is(-0, num)) {return \"-0\"}\n\n\tlet str = num.toString()\n\n\tif (str.includes(\"e\")) {\n\t\t//Ideally we would still be able to parse these.\n\t\t//Remove the + if present - plus is inferred.\n\t\treturn str.split(\"+\").join(\"\")\n\t}\n\t\n\t//Has to be greater than or equal to 1000 to be able to save space\n\tif (Math.abs(num) >= 1e3) {\n\t\t//Match trailing zeros\n\t\tlet match = /0+$/.exec(str)\n\n\t\tlet trailingZeros = (match && match[0].length) || 0\n\t\tlet matchIndex = (match && match[\"index\"]) || 0\n\n\t\t//1 trailing zero longer. 2 is even. 3+ smaller.\n\t\tif (trailingZeros > 2) {\n\t\t\tlet beginning = str.slice(0, matchIndex)\n\t\t\treturn beginning + \"e\" + trailingZeros\n\t\t}\n\t}\n\t//Has to be less than or equal to 0.009 to be able to save space. \n\telse if (Math.abs(num) <= 9e-3) {\n\t\t//Match zeros after decimal point.\n\t\tlet match = /.0+/.exec(str)\n\t\tif (match) {\n\t\t\t//Remove the . from the matched string\n\t\t\tmatch[0] = match[0].slice(1)\n\t\t\tmatch[\"index\"]++\n\t\t}\n\t\tlet leadingZeros = (match && match[0].length) || 0\n\t\tlet matchIndex = (match && match[\"index\"]) || 0\n\n\t\t//1 is even, 2+ is smaller. \n\t\tif (leadingZeros > 1) {\n\t\t\tlet ending = str.slice(matchIndex + leadingZeros)\n\t\t\treturn ending + \"e-\" + (leadingZeros + ending.length)\n\t\t}\n\t}\n\treturn str\n}", "title": "" }, { "docid": "eaabb1853ae5fc7abcd917ba29bfa15c", "score": "0.60361624", "text": "function f(n) { // Format integers to have at least two digits.\r\n return n < 10 ? '0' + n : n;\r\n }", "title": "" }, { "docid": "1481b4f8fe41717d6e23d0060b599937", "score": "0.6034706", "text": "function zintstr( num, width )\n{\n var str = num.toString(10);\n var len = str.length;\n var intgr = \" \";\n var i;\n\n // append leading spaces\n for (i = 0; i < width - len; i++)\n intgr += '0';\n\n // append digits\n for (i = 0; i < len; i++)\n intgr += str.charAt(i);\n\n return intgr;\n}", "title": "" }, { "docid": "4a67a6849e17575f53a31a449a95ed8a", "score": "0.60279584", "text": "function formatSSN(value) {\n if (!value) return value;\n const ssnNumber = value.replace(/[^\\d]/g, \"\");\n const ssnNumberLength = ssnNumber.length;\n\n if (ssnNumberLength < 4) return ssnNumber;\n\n if (ssnNumberLength < 7) {\n return `${ssnNumber.slice(0, 3)}-${ssnNumber.slice(3)}`;\n }\n\n return `${ssnNumber.slice(0, 3)}-${ssnNumber.slice(3, 5)}-${ssnNumber.slice(5, 9)}`;\n }", "title": "" }, { "docid": "a0f78e277b2415d6d79dba85715235c9", "score": "0.6021432", "text": "display(number , numberLength = 2) {\r\n return String(parseInt(number)).padStart(numberLength, '0');\r\n }", "title": "" }, { "docid": "65eee39699b524f08eb5bcd6fb8f29d1", "score": "0.60209376", "text": "function formatted_string(str){\n while(str.length < 15)\n str = insert(str, \"0\", str.length);\n return str;\n}", "title": "" }, { "docid": "73e2beadc091d02298be5fe813285120", "score": "0.6020026", "text": "function integerToStringOfFixedWidth(number, width) {\n const numString = number.toString();\n const numberWidth = numString.length;\n\n const zerosToAdd = width - numberWidth;\n const diff = Math.abs(zerosToAdd);\n\n let resString = '';\n\n if (zerosToAdd > 0) {\n for (let i = 0; i < zerosToAdd; i++) {\n resString += '0';\n }\n resString += numString;\n } else {\n for (let i = diff; i < numberWidth; i++) {\n resString += numString[i];\n }\n }\n\n return resString;\n}", "title": "" }, { "docid": "5afeaf809731d7deeaca5a903282e659", "score": "0.60043657", "text": "function formatNumber(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \"'\");\n}", "title": "" }, { "docid": "5afeaf809731d7deeaca5a903282e659", "score": "0.60043657", "text": "function formatNumber(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \"'\");\n}", "title": "" }, { "docid": "466d086ccbd1d0c6f96fba85768bcc2b", "score": "0.6003798", "text": "function isValidTask4(num) {\n const maxLength = 100;\n\n if (!num && num !== null && num !== 0 && !Number.isNaN(num)) {\n return 'missingArgs';\n }\n\n if (typeof num !== 'string') {\n return 'wrongDataType';\n }\n\n if (!Number(num) || num.length > maxLength) {\n return 'invalidValue';\n }\n\n return 'valid';\n}", "title": "" }, { "docid": "cda2d33f4fa3293f6c70f18d0c1ee1dc", "score": "0.600044", "text": "function ensureNumberHasMinLength(d, minLen) {\n minLen = (\n typeof (minLen) === \"undefined\" || minLen === null ? \n minLen = 2 : minLen\n )\n return (d.length === minLen ? \n d.toUpperCase() : ensureNumberHasMinLength('0' + d, minLen))\n}", "title": "" }, { "docid": "b369482b429a5ebd1708390ade5bf882", "score": "0.59835196", "text": "function pad (str, max) {\n str = str.toString();\n return str.length < max ? pad(\"0\" + str, max) : str;\n }", "title": "" }, { "docid": "a96ae7def1ea3baf60e100a9c5400966", "score": "0.598312", "text": "function format_number(num, digits_before_point=6, digits_after_point=3, allow_for_negative=true){\n let result = num.toFixed(digits_after_point)\n let min_chars_before_point = digits_before_point + (allow_for_negative ? 1 : 0)\n let point_pos = result.indexOf(\".\")\n if (point_pos == -1) { point_pos = result.length }\n let needed_spaces_count = min_chars_before_point - point_pos\n if (needed_spaces_count > 0) {\n let needed_spaces = \" \".repeat(needed_spaces_count)\n result = needed_spaces + result\n }\n return result\n}", "title": "" }, { "docid": "0c4f352ba244603e23f436e2a515bec2", "score": "0.5982346", "text": "function numFormat(num){\r\n\tnum = parseInt(num);\r\n\tvar r = num%1000;\r\n\tvar q = Math.floor(num/1000);\r\n\r\n\tvar sR = r + \"\";\r\n\tif( Math.floor(r / 100) < 1 && q != 0){\r\n\t\tif(Math.floor(r / 10) >= 1) sR = \"0\" + r;\r\n\t\telse sR = \"00\" + r;\r\n\t}\r\n\r\n\tvar output = sR + \"\";\r\n\r\n\twhile( q != 0 ){\r\n\t\tr = q%1000;\r\n\t\tsR = r + \"\";\r\n\t\tif( Math.floor(r / 100) < 1 && Math.floor(q / 1000) != 0){\r\n\t\t\tif(Math.floor(r / 10) >= 1) sR = \"0\" + r;\r\n\t\t\telse sR = \"00\" + r;\r\n\t\t}\r\n\t\toutput = sR + \",\" + output;\r\n\t\tq = Math.floor(q/1000);\r\n\t}\r\n\treturn output;\r\n}", "title": "" }, { "docid": "45002fa0d85197617c2bfbf1acf08fd7", "score": "0.5981031", "text": "function fixWidth(number, digits) {\n\t\tif (typeof number !== \"number\") {\n\t\t\tthrow \"not a number: \" + number;\n\t\t} else {\n\t\t\tvar s = number.toString();\n\t\t\tif (number.length > digits) {\n\t\t\t\treturn number.substr(number.length - digits, number.length);\n\t\t\t}\n\t\t\twhile (s.length < digits) {\n\t\t\t\ts = '0' + s;\n\t\t\t}\n\t\t\treturn s;\n\t\t}\n\t}", "title": "" }, { "docid": "bc57f0b04617635ef8c775bde2428977", "score": "0.5979893", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(fullWidthNumberReg, function(chr) {\n var replacement = getOwn(fullWidthNumberMap, chr);\n if (replacement === HALF_WIDTH_PERIOD) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "ee134c3996aace6fed3ac6f655880121", "score": "0.59726477", "text": "function pad (str, max) {\n str = str.toString();\n return str.length < max ? pad(\"0\" + str, max) : str;\n }", "title": "" }, { "docid": "91330bdb128e24b4238249d9e548dab3", "score": "0.5971944", "text": "function tenCharsNum(val) {\n\tif (val === '.') {\n\t\treturn '0.';\n\t}\n\t// '.' is counted as a numberChar\n\tvar numberChars = 10;\n\t// Number() AND toString() called on same line so string/number inputs process equally\n\tvar valString = Number(val).toString();\n\t//console.log(\"original string\", valString);\n\tvar sign;\n\tif (valString.charAt(0) == '-') {\n\t\tsign = '-';\n\t\tnumberChars--;\n\t\tvalString = valString.substring(1);\n\t} else {\n\t\tsign = '';\n\t}\n\t//force scientific notation if number won't fit\n\tif(valString.length > numberChars && valString.indexOf('e') == -1) {\n\t\tvalString = Number(valString).toExponential().toString();\n\t}\n\t\n\t\n\t\n\tvar exponentIndex = valString.indexOf('e');\n\tvar exponent = '';\n\tif (-1 < exponentIndex) {\n\t\texponent = valString.substring(exponentIndex);\n\t\tvalString = valString.substring(0, exponentIndex);\n\t\tnumberChars -= exponent.length;\n\t}\n\tif (numberChars < valString.length) {\n\t\tvar trailingChar = valString.substring(numberChars - 1);\n\t\t//console.log(\"trailing char is\", trailingChar);\n\t\tif (trailingChar.charAt(0) == '.') {\n\t\t\ttrailingChar = '';\n\t\t} else {\n\t\t\t//trailingChar = trailingChar.split('').filter(x => x != '.').join('')\n\t\t\ttrailingChar = trailingChar.split('').filter(function(x) {return x != '.'; }).join('')\n\t\t\t//console.log(\"trailing char is\", trailingChar);\n\t\t\ttrailingChar = Math.round(Number(trailingChar) / Math.pow(10, trailingChar.length - 1).toString());\n\t\t\t//console.log(\"trailing char is now\", trailingChar);\n\t\t}\n\t\t// Number(val).toString() used to remove trailing zeros else 0.1+0.2 gives 0.30000000\n\t\tvalString = Number(valString.substring(0, numberChars - 1) + trailingChar).toString();\n\t}\n\t//console.log(\"number chars\", numberChars);\n\t//console.log(\"sign\", sign);\n\t//console.log(\"val string\", valString);\n\t//console.log(\"exponent\", exponent);\n\treturn sign + valString + exponent;\n}", "title": "" }, { "docid": "db94b994534e359e32e273425cc6c8e9", "score": "0.59675574", "text": "function fmt(str, num) {\n\t\t\t\treturn str.replace('%s', num);\n\t\t\t}", "title": "" }, { "docid": "9f2d9a4c5066b4a37f23a722d7271eb5", "score": "0.5964516", "text": "function pad (str, max) {\n str = str.toString();\n return str.length < max ? pad(\"0\" + str, max) : str;\n}", "title": "" }, { "docid": "dc7d45981859e003231d3846d7826d80", "score": "0.5955432", "text": "function getLastNumber(str) {\n var retval = \"\";\n for (var i = str.length - 1; i >= 0; --i)\n if (str[i] >= \"0\" && str[i] <= \"9\") {\n retval = str[i] + retval;\n }\n if (retval.length == 0) {\n return \"0\";\n }\n return retval;\n }", "title": "" }, { "docid": "95aa6d314c635f0fb05953fc7ec9ec7a", "score": "0.5953829", "text": "function unformatNumeral(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power,\n value;\n\n if (string.indexOf(':') > -1) {\n value = unformatTime(string);\n } else {\n if (string === options.zeroFormat || string === options.nullFormat) {\n value = 0;\n } else {\n if (languages[options.currentLanguage].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(languages[options.currentLanguage].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.thousand + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.million + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.billion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.trillion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power <= byteSuffixes.bytes.length; power++) {\n bytesMultiplier = ((string.indexOf(byteSuffixes.bytes[power]) > -1) || (string.indexOf(byteSuffixes.iec[power]) > -1))? Math.pow(1024, power) : false;\n\n if (bytesMultiplier) {\n break;\n }\n }\n\n // do some math to create our number\n value = bytesMultiplier ? bytesMultiplier : 1;\n value *= stringOriginal.match(thousandRegExp) ? Math.pow(10, 3) : 1;\n value *= stringOriginal.match(millionRegExp) ? Math.pow(10, 6) : 1;\n value *= stringOriginal.match(billionRegExp) ? Math.pow(10, 9) : 1;\n value *= stringOriginal.match(trillionRegExp) ? Math.pow(10, 12) : 1;\n // check for percentage\n value *= string.indexOf('%') > -1 ? 0.01 : 1;\n // check for negative number\n value *= (string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2 ? 1 : -1;\n // remove non numbers\n value *= Number(string.replace(/[^0-9\\.]+/g, ''));\n // round if we are talking about bytes\n value = bytesMultiplier ? Math.ceil(value) : value;\n }\n }\n\n n._value = value;\n\n return n._value;\n }", "title": "" }, { "docid": "c02bb000321de6dec311164e78aa7a42", "score": "0.5952767", "text": "function normNumero(n) {\n return ('0' + n).slice(-2);\n}", "title": "" }, { "docid": "23e651f943573d3afcdf6a2db0a7f0b9", "score": "0.59485036", "text": "function unformatNumeral(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power,\n value;\n\n if (string.indexOf(':') > -1) {\n value = unformatTime(string);\n } else {\n if (string === options.zeroFormat || string === options.nullFormat) {\n value = 0;\n } else {\n if (languages[options.currentLanguage].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(languages[options.currentLanguage].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.thousand + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.million + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.billion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.trillion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power <= byteSuffixes.bytes.length; power++) {\n bytesMultiplier = string.indexOf(byteSuffixes.bytes[power]) > -1 || string.indexOf(byteSuffixes.iec[power]) > -1 ? Math.pow(1024, power) : false;\n\n if (bytesMultiplier) {\n break;\n }\n }\n\n // do some math to create our number\n value = bytesMultiplier ? bytesMultiplier : 1;\n value *= stringOriginal.match(thousandRegExp) ? Math.pow(10, 3) : 1;\n value *= stringOriginal.match(millionRegExp) ? Math.pow(10, 6) : 1;\n value *= stringOriginal.match(billionRegExp) ? Math.pow(10, 9) : 1;\n value *= stringOriginal.match(trillionRegExp) ? Math.pow(10, 12) : 1;\n // check for percentage\n value *= string.indexOf('%') > -1 ? 0.01 : 1;\n // check for negative number\n value *= (string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2 ? 1 : -1;\n // remove non numbers\n value *= Number(string.replace(/[^0-9\\.]+/g, ''));\n // round if we are talking about bytes\n value = bytesMultiplier ? Math.ceil(value) : value;\n }\n }\n\n n._value = value;\n\n return n._value;\n }", "title": "" }, { "docid": "a7ee346eb19317a18af78b8618718758", "score": "0.5946668", "text": "function pad (str, max) {\n str = str.toString();\n return str.length < max ? pad(\"0\" + str, max) : str;\n }", "title": "" }, { "docid": "08d5b6398d6d9457c2c35ccd2330b8ff", "score": "0.59459615", "text": "function formatCost(number) {\n if (number > 1000000) {\n return Math.floor(number / 1000000) + \"M\";\n }\n if (number > 1000) {\n return Math.floor(number / 1000) + \"k\";\n }\n return number;\n}", "title": "" }, { "docid": "046a66a91566d2855affc2c43fda45bb", "score": "0.59437686", "text": "function pad (str, max) {\n \t\t\treturn str.length < max ? pad('0' + str, max) : str;\n\t\t}", "title": "" }, { "docid": "ece6dbb7b71332aa398921c4bb6b356e", "score": "0.5942844", "text": "function humanizeNum(i) {\n var res = (i + 1).toString();\n while (res.length < 3) {\n res = '0' + res;\n }\n return res;\n }", "title": "" }, { "docid": "d4b43c942c8a6d76bd6c25c510ca6aed", "score": "0.5937933", "text": "function numberFormat(numero){\n // Variable que contendra el resultado final\n var resultado = \"\";\n\n // Si el numero empieza por el valor \"-\" (numero negativo)\n if(numero[0]==\"-\")\n {\n // Cogemos el numero eliminando los posibles puntos que tenga, y sin\n // el signo negativo\n nuevoNumero=numero.replace(/\\./g,'').substring(1);\n }else{\n // Cogemos el numero eliminando los posibles puntos que tenga\n nuevoNumero=numero.replace(/\\./g,'');\n }\n\n // Si tiene decimales, se los quitamos al numero\n if(numero.indexOf(\",\")>=0)\n nuevoNumero=nuevoNumero.substring(0,nuevoNumero.indexOf(\",\"));\n\n // Ponemos un punto cada 3 caracteres\n for (var j, i = nuevoNumero.length - 1, j = 0; i >= 0; i--, j++)\n resultado = nuevoNumero.charAt(i) + ((j > 0) && (j % 3 == 0)? \".\": \"\") + resultado;\n\n // Si tiene decimales, se lo añadimos al numero una vez forateado con\n // los separadores de miles\n if(numero.indexOf(\",\")>=0)\n resultado+=numero.substring(numero.indexOf(\",\"));\n\n if(numero[0]==\"-\")\n {\n // Devolvemos el valor añadiendo al inicio el signo negativo\n return \"-\"+resultado;\n }else{\n return resultado;\n }\n}", "title": "" }, { "docid": "433357b2fcf501631347a38eb53ac2d4", "score": "0.5932662", "text": "function formatNumber(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \" \");\n }", "title": "" }, { "docid": "3ee4fa5cb5d9ed5ccfe0e276511552f0", "score": "0.5932169", "text": "function formatResult(number) {\n if (number.toString().length > 6) {\n return number.toPrecision(6);\n } else {\n return number;\n }\n}", "title": "" }, { "docid": "8b5cd4d47e5fbc23b884eaa625001c2a", "score": "0.5926899", "text": "function validateNum(number,length,field) {\n let message = '';\n number = number.trim();\n if (number === '') {\n message = field + \" can't be empty \";\n zipError = true;\n }\n else if (isNaN(number) || (Math.floor(number) != number ) ) {\n message = field +\" should be numeric \";\n }\n else if (number.length != length) {\n message = field + \" should be a \" + length + \" digit number \";\n\n }\n return message;\n\n }", "title": "" }, { "docid": "290ff74ca569b933eb29ff5c66cda5ef", "score": "0.5921164", "text": "function formatNumber(number) {\n if (number === 1) {\n return '1st'\n } else if (number === 2) {\n return '2nd'\n } else if (number === 3) {\n return '3rd'\n } else if (number >= 4 && number < 21) {\n return number + 'th'\n } else if (number > 20) {\n var string = number + ''\n if (string[string.length - 1] === '0') {\n return number + 'th'\n } else if (string[string.length - 1] === '1') {\n return number + 'st'\n } else if (string[string.length - 1] === '2') {\n return number + 'nd'\n } else if (string[string.length - 1] === '3') {\n return number + 'rd'\n } else if (string[string.length - 1] >= '4') {\n return number + 'th'\n }\n }\n}", "title": "" }, { "docid": "040e989791c58af0a8ddc6e05ab98c20", "score": "0.5909458", "text": "function formatNumber(n) {\n n = n.toString()\n return n[1] ? n : '0' + n\n}", "title": "" }, { "docid": "3da615e0f5b0d6e678396055c5d0147c", "score": "0.59087664", "text": "function formatNumber(number) {\n return '(' + number.substr(0, 3) + ')' + number.substr(3, 3) + '-' + number.substr(6, 4);\n }", "title": "" }, { "docid": "83dd0330de54a3605fc6bfa89ffeb89f", "score": "0.59053624", "text": "function pad(value, max) {\n\tvalue += \"\";\n\treturn value.length < max ? pad(\"0\" + value, max) : value;\n}", "title": "" }, { "docid": "870185cf1532845f2ca9bd6bfc81d4d0", "score": "0.5904888", "text": "function FormatNumber(number)\n{\n\twhile (/(\\d+)(\\d{3})/.test(number.toString()))\n\t{\n\t\tnumber = number.toString().replace(/(\\d+)(\\d{3})/, '$1'+','+'$2');\n }\n return number;\n}", "title": "" }, { "docid": "e977a32dcadce5e05fe37624fb4bace9", "score": "0.5904047", "text": "function format(value)\n\t{\n\t\tif (value < 10)\n\t\t\treturn \"0\" + value;\n\t\telse\n\t\t\treturn value;\n\t}", "title": "" }, { "docid": "34ef0783d665ef400e6f2b09ebc7d21a", "score": "0.58962643", "text": "function formatLength(stringData) {\n\tif (stringData.length > 25) {\n\t\treturn stringData.substring(0, 25) + '...';\n\t}\n\treturn stringData;\n}", "title": "" }, { "docid": "a39ab88418a31d4e8780af8fcd1195bc", "score": "0.5892146", "text": "function format(item){\n if(item<10){\n return item = `0${item}`\n }\n return item\n }", "title": "" }, { "docid": "75435272e50e331ca88f2980f8882e47", "score": "0.5888766", "text": "function checkNumber(numberTime) {\n if (numberTime < 10) {\n return \"0\" + numberTime;\n } else {\n return numberTime;\n }\n}", "title": "" }, { "docid": "7069a1dd248ef9190be9bb8451ae9586", "score": "0.5863502", "text": "function checkNumber(i){\n if (i<10){\n i = \"0\" + i;\n }\n return i;\n}", "title": "" }, { "docid": "7069a1dd248ef9190be9bb8451ae9586", "score": "0.5863502", "text": "function checkNumber(i){\n if (i<10){\n i = \"0\" + i;\n }\n return i;\n}", "title": "" }, { "docid": "36f301f575594bda19787cca0f7290f3", "score": "0.58629686", "text": "function fixmindate(a){\n\tif( a <= 9 ) return (\"0\" + a);\n\treturn a;\n}", "title": "" }, { "docid": "0d065d16b1f9c3b0c572c8a04966cf7e", "score": "0.58625406", "text": "__format(value) {\n if (!value && value != 0) return \"<invalid number>\"\n var newValue = value;\n if (value >= 1000) {\n var suffixes = [\"\", \"k\", \"M\", \"B\", \"T\", \"q\", \"Q\", \"s\", \"S\", \"O\", \"N\"];\n var suffixNum = Math.floor( (\"\"+value).length/3 );\n var shortValue = '';\n for (var precision = 2; precision >= 1; precision--) {\n shortValue = parseFloat( (suffixNum != 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision));\n var dotLessShortValue = (shortValue + '').replace(/[^a-zA-Z 0-9]+/g,'');\n if (dotLessShortValue.length <= 2) { break; }\n }\n if (shortValue % 1 != 0) shortValue = shortValue.toFixed(1);\n newValue = shortValue+suffixes[suffixNum];\n }\n\n return newValue;\n }", "title": "" }, { "docid": "b72f7a6147b18838747912d494d18610", "score": "0.5859803", "text": "function numberToString(number) {\n var min = Math.floor(number / 10);\n return min + '' + Math.floor(number % 10);\n }", "title": "" }, { "docid": "52151c6a6d333591d05a51ce67cbe10c", "score": "0.5858128", "text": "function fixNumber(s, aDec, aNeg) {\n if (aDec && aDec !== '.') {\n s = s.replace(aDec, '.');\n }\n if (aNeg && aNeg !== '-') {\n s = s.replace(aNeg, '-');\n }\n if (!s.match(/\\d/)) {\n s += '0';\n }\n return s;\n }", "title": "" }, { "docid": "52151c6a6d333591d05a51ce67cbe10c", "score": "0.5858128", "text": "function fixNumber(s, aDec, aNeg) {\n if (aDec && aDec !== '.') {\n s = s.replace(aDec, '.');\n }\n if (aNeg && aNeg !== '-') {\n s = s.replace(aNeg, '-');\n }\n if (!s.match(/\\d/)) {\n s += '0';\n }\n return s;\n }", "title": "" }, { "docid": "1a668ee78a4c74002a10b39f10c7ca34", "score": "0.585717", "text": "function formatNumber(number) {\n return number < 10 ? '0' + number : number;\n}", "title": "" }, { "docid": "8d314ef0ff32a8e3cdec510d3bebc9ce", "score": "0.58550423", "text": "getDisplayNum(number){\n const stringNum = number.toString()\n const integerNum = parseFloat(stringNum.split('.')[0])\n const decimalNum = stringNum.split('.')[1]\n let integerNumShow \n if(isNaN(integerNum)) {\n integerNumShow = ''\n } else{\n integerNumShow = integerNum.toLocaleString(\"en\", {maximumFractionDigits: 0})\n } if (decimalNum != null) {\n return `${integerNumShow}.${decimalNum}`\n } else {\n return integerNumShow\n }\n }", "title": "" }, { "docid": "ba67b5dad8167bdfb5d5069140c5eb0c", "score": "0.5846961", "text": "function padEndString (someStr, someNumber) {\n var stringOutOfNumber = someNumber.toString();\n \n return someStr.slice(0,1). padEnd(4, stringOutOfNumber);\n \n}", "title": "" }, { "docid": "fd4be418b0add638defabe4884d75542", "score": "0.58366567", "text": "function maxLength(max, str) {\n\t if (str.length <= max)\n\t return str;\n\t return str.substr(0, max - 3) + \"...\";\n\t}", "title": "" }, { "docid": "f4bc719301aa72ced200387a8f9159c7", "score": "0.583588", "text": "function pad (num_str, size)\n{\n while (num_str.length < size) num_str = \"0\" + num_str;\n return num_str;\n}", "title": "" }, { "docid": "a9535a0a463ff98e7decdb664c39c34f", "score": "0.58352715", "text": "function validateInput(num) {\n var newDisplay = display.value + num;\n\n // Restrict input to 10 characters\n if (newDisplay.length > 10) {\n return display.value;\n }\n\n // Allows only a single decimal point\n if (!newDisplay.match(/^([0-9]+.[0-9]*)$/)) {\n return display.value;\n }\n\n // Removes leading zeroes (0543 becomes 543)\n if (newDisplay.match(/^(0\\d+.?\\d*)$/)) {\n newDisplay = newDisplay.substring(1);\n }\n\n return newDisplay;\n}", "title": "" }, { "docid": "89b89a4aa7ef56ff2cbdf1c6de9c04bf", "score": "0.5833912", "text": "function formatNumber(x) {\r\n var a = String(x);\r\n var placeOfPeriod = a.lastIndexOf('.');\r\n \r\n if (placeOfPeriod === -1) {\r\n var b = '';\r\n var c = a;\r\n } else {\r\n var b = a.substring(placeOfPeriod);\r\n if (b.length > 3) {\r\n if (parseFloat(b[3]) > 4) {\r\n b = b.substring(0,2) + String(parseInt(b[2]) + 1);\r\n } else {\r\n b = b.substring(0, 3);\r\n }\r\n }\r\n var c = a.substring(0, placeOfPeriod);\r\n }\r\n var d;\r\n \r\n switch (c.length % 3) {\r\n case 0:\r\n d = c.replace(/(\\d{3})/g, '$1 ');\r\n break;\r\n \r\n case 1:\r\n var e;\r\n var f;\r\n e = c.substring(0,1);\r\n f = c.substring(1);\r\n f = f.replace(/(\\d{3})/g, '$1 ');\r\n d = e + \" \" + f;\r\n break;\r\n \r\n case 2:\r\n var e;\r\n var f;\r\n e = c.substring(0,2);\r\n f = c.substring(2);\r\n f = f.replace(/(\\d{3})/g, '$1 ');\r\n d = e + \" \" + f;\r\n }\r\n \r\n y = d + b;\r\n return y;\r\n}", "title": "" }, { "docid": "81e035fe9446a6282c1ed3b8b969261b", "score": "0.583236", "text": "function cleanFormatNumber(n) {\n n = n.toFixed(0);\n if (n.length <= 3) return n;\n const post = [\"\",\"k\",\"m\",\"b\",\"t\",\"q\"];\n return n.slice(0,3) / ((n.length - 3) % 3 == 0 ? 1: Math.pow(10,3 - n.length % 3)) + post[Math.floor((n.length-1) / 3)]\n}", "title": "" }, { "docid": "cabc90d219304c8c7cb017cc87f7615e", "score": "0.5826482", "text": "function toStringDecimale(numero) {\n var arr_num = numero.toString().split('.');\n var str = \"\";\n if (arr_num[0] < 10) {\n str += \" \" + arr_num[0];\n } else {\n if (arr_num[0] < 100) {\n str += \" \" + arr_num[0];\n } else {\n str += arr_num[0];\n }\n }\n str += \".\";\n if (numero.toString().indexOf(\".\") != (-1)) {\n if (arr_num[1] < 10) {\n str += arr_num[1] + \"0\";\n } else {\n str += arr_num[1];\n }\n } else {\n str += \"00\";\n }\n return str;\n}", "title": "" }, { "docid": "b031eb38aa85ddcad94aa29375e5a69e", "score": "0.58247817", "text": "function fixedNum(num) {\n var str = num.toString();\n return (str.length == 1) ? (\"0\" + str) : str;\n}", "title": "" }, { "docid": "54083a020da029fbddd4cfa86a1407bf", "score": "0.5822082", "text": "convertSizeToHumanSize(num) {\n if (!Number.isFinite(num)) {\n return num\n // throw new TypeError(`Expected a finite number, got ${typeof num}: ${num}`);\n }\n const neg = num < 0;\n \n if (neg) {\n num = -num;\n }\n\n if (num < 1) {\n return (neg ? '-' : '') + num + ' B';\n }\n\n const exponent = Math.min(Math.floor(Math.log10(num) / 3), this.UNITS.length - 1);\n const numStr = Number((num / Math.pow(1000, exponent)).toPrecision(3));\n const unit = this.UNITS[exponent];\n\n return (neg ? '-' : '') + numStr + ' ' + unit;\n }", "title": "" }, { "docid": "c771e386040ac540d809866aed9c2bf1", "score": "0.5819617", "text": "function cleanNum (num, decLength) {\n let numLength = num.toString().length\n let hasDecimal = num.toString().includes('.')\n\n if (!hasDecimal && numLength <= 16) {\n return Number(num)\n }\n\n // if (hasDecimal && numLength <= 17) {\n // return Number(num)\n // }\n\n if (!hasDecimal) {\n return Number(num.toString().slice(0, 15))\n }\n\n if (hasDecimal) {\n // let numArray = num.toString().split('.')\n // let roundFactor = -(16 - numArray[0].length)\n let roundFactor = -(decLength)\n return Math.round10(num, roundFactor)\n }\n}", "title": "" } ]
ae5de32787669a73b8803ec80818033d
Perform the signup action when the user submits the signup form
[ { "docid": "48df0665fb048caa6d9eb32fb1facc2b", "score": "0.0", "text": "doSignup() {\n console.log('Doing signup', this.signupData);\n\n $state.go('app.home', {\n id: this.signupData.username\n })\n\n }", "title": "" } ]
[ { "docid": "2438e1911c441e91b2767e4f980c4f6f", "score": "0.79521793", "text": "function signup() {\n if (!validateUsername())\n return;\n if (!validatePassword())\n return;\n if (!validateEmail())\n return;\n signup_form.submit();\n}", "title": "" }, { "docid": "475c0684807f069377444bfe495df76d", "score": "0.76881486", "text": "function signupPage() {\n\t\tconst btn = document.querySelector('.js-submit-signup');\n\n\t\tbtn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tconst fname = document.querySelector('.js-fName-signup').value;\n\t\t\tconst lname = document.querySelector('.js-lName-signup').value;\n\t\t\tconst email = document.querySelector('.js-email-signup').value;\n\t\t\tconst pw = document.querySelector('.js-password-signup').value;\n\n\t\t\tPOST('/auth/register', {\n\t\t\t\tfirst_name: fname,\n\t\t\t\tlast_name: lname,\n\t\t\t\temail: email,\n\t\t\t\tpassword: pw\n\t\t\t}).then((data) => {\n\t\t\t\t// console.log(data)\n\t\t\t\tif (data.success) {\n\t\t\t\t\twindow.location.href = '/index.html'\n\t\t\t\t}\n\t\t\t});\n\t\t})\n\t} // event listener", "title": "" }, { "docid": "c16dc21eaa304704c93856bef9de4adc", "score": "0.7653088", "text": "function signUp(){\r\n\tgetFormSignUpMsg().children('.alert').remove();\r\n\r\n\tgetSignUpBtn().addClass('active');\r\n\tgetSignUpBtn().attr('disabled', true);\t\r\n\tsignUpPost();\r\n}", "title": "" }, { "docid": "b11fd19b5b37d940c49d92c5c74b413d", "score": "0.75884897", "text": "onUserSignUp() {\n\t\tauth.signup();\n\t}", "title": "" }, { "docid": "cd9a0109de4548681919df33b9937b68", "score": "0.75746757", "text": "onSignUp() {\n // handle the case when disabled attribute for submit button is deleted\n // from html\n if (this.signUpForm.invalid) {\n return;\n }\n this.isBtnClicked = true;\n this.isSigningUp = true;\n this.name = this.signUpForm.get('name').value;\n this.email = this.signUpForm.get('email').value;\n this.password = this.signUpForm.get('password').value;\n this.authService\n .signUp(this.email, this.password)\n .then((result) => {\n this.isSignedUp = true;\n this.isSigningUp = false;\n this.isHideResponseErrors = true;\n this.userDataService.createNewUser(this.name, this.email, result.user.uid);\n setTimeout(() => {\n this.router.navigate(['']);\n }, 1500);\n })\n .catch((error) => {\n this.isSignedUp = false;\n this.isSigningUp = false;\n this.isBtnClicked = false;\n this.isHideResponseErrors = false;\n this.authErrorHandler.handleAuthError(error, 'signUp');\n });\n }", "title": "" }, { "docid": "9009e574821b2235380de2012ede4eac", "score": "0.75603294", "text": "function handleSignUp(e) {\n let $modal = $(\"#sign-up\");\n let $form = $modal.find(\"form\");\n let data = parseForm($form);\n\n let $button = $(\"#submit-btn\");\n $button.addClass(\"loading\");\n\n $form.find(\".error.message\").transition(\"hide\");\n\n fetch(\"/users\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(data)\n })\n .then(res => {\n if (!res.ok) throw res;\n // redirect back to /\n redirectToOrigin();\n })\n .catch(async function(e) {\n console.error(e);\n //display error\n $form.find(\".error.message\").transition(\"show\");\n })\n .then(() => $button.removeClass(\"loading\"));\n }", "title": "" }, { "docid": "2c8cc330a3499f24781275c7d92c39fd", "score": "0.75281", "text": "function signup() {\r\n //recupero i valori del form\r\n getFormValues();\r\n //invio la richiesta al server\r\n window.console.log(\"signup - Sending user => \" + JSON.stringify(json_signup_user));\r\n sendRequest(\"signup\", \"signup\", json_signup_user, signupCallback, false);\r\n}", "title": "" }, { "docid": "f0d8f3e2358e3431534efc0b6ab621ee", "score": "0.7469533", "text": "function signUp(e, form) {\n e.preventDefault();\n accountService.signUp(form);\n}", "title": "" }, { "docid": "36ec93cec14045b4bbe2fcfd664fbecd", "score": "0.7425268", "text": "function signup() { $state.go(\"signup\", {}); }", "title": "" }, { "docid": "9929f89322f598199b683d1a04f57181", "score": "0.73868704", "text": "function addSignUp() {\n let signUpElem = $(\"#signUpForm\");\n signUpElem.submit(signUpHandler);\n}", "title": "" }, { "docid": "6199b7c544794c4027b1cd0ee46452a1", "score": "0.7346194", "text": "function signUp() {\n\n\tlet aptInput = document.getElementById(\"apt-input\").value;\n\tlet fNameInput = document.getElementById(\"fname-input\").value;\n\tlet lNameInput = document.getElementById(\"lname-input\").value;\n\tlet userNameInput = document.getElementById(\"user-name-input\").value;\n\tlet emailInput = document.getElementById(\"email-input\").value;\n\tlet passwordInput = document.getElementById(\"password-input\").value;\n\tlet leasingRepInput = document.getElementById(\"leasing-rep-input\");\n\n\tlet signUpValues = [fNameInput, lNameInput, userNameInput,\n\t\t\t\t\t\temailInput, passwordInput];\n\n\tif (!checkSignUpValues (aptInput, signUpValues)) {\n\t\treturn;\n\t}\n\n\tif (!verifyUniqueAccount (userNameInput)) {\n\t\treturn;\n\t}\n\n\tsaveAccount(aptInput, signUpValues, leasingRepInput);\n\n\tif (leasingRepInput.checked) {\n\n\t\twindow.location.href = \"office/app-turnin.html\";\n\t\n\t} else {\n\n\t\twindow.location.href = \"group.html\";\n\t}\n\n\t\n}", "title": "" }, { "docid": "b0a91b2cf4e32508d7d1cd2a3b30b2d7", "score": "0.72928166", "text": "async function signup(evt) {\n console.debug(\"signup\", evt);\n evt.preventDefault();\n const name = $(\"#signup-name\").val();\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n //--------AWAIT--------\n Context.user = await User.signup(username, password, name);\n if(Context.user){\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n }\n $signupForm.trigger(\"reset\");\n}", "title": "" }, { "docid": "c29ab6318cfdac8d1ed735baa3111129", "score": "0.72577596", "text": "function signUp() {\n\n var postJson = {\n email: $scope.aVars.user.email,\n password: $scope.aVars.user.password,\n preferredLanguage: $scope.aVars.lang.id\n }\n\n $http.post(apis.userSignup(), postJson).then(function (response) {\n ctrlFunc.toast($scope.aVars.lang.signUpSuccess);\n login();\n }, function (error) {\n ctrlFunc.toast($scope.aVars.lang.errSignUpFailure, + errMsg(error));\n });\n }", "title": "" }, { "docid": "0edcc0755a9c81f14e8cb7d7a8a80115", "score": "0.724515", "text": "function setSignUpFormHandler() {\n $('form#sign-up-form').on('submit', function(e){\n e.preventDefault();\n\n var usernameField = $(this).find('input[name=username]');\n var usernameText = usernameField.val();\n usernameField.val('');\n\n var passwordField = $(this).find('input[name=password]');\n var passwordText = passwordField.val();\n passwordField.val('');\n\n var userData = {username: usernameText, password: passwordText};\n\n createUser(userData, function(user){\n var username = user.username;\n renderSignUpSuccess(username);\n });\n });\n}", "title": "" }, { "docid": "92c206275883649c07643c8d01a6d009", "score": "0.72292316", "text": "function signUp() {\n onSignUpPage = true;\n $('#signin-btn').removeClass('disabled');\n $('#signup-btn').addClass('disabled');\n $('#start-btn').html('Get Started!');\n $('#confirm-div').css('display', 'block');\n}", "title": "" }, { "docid": "5b916c57feb3389e51d624821a78dd75", "score": "0.7217554", "text": "function handleSubmit({ name, email, cpf }) {\n dispatch(signUpRequest(name, email, cpf));\n }", "title": "" }, { "docid": "1380469910dd75e670c46ef5681df57f", "score": "0.7199577", "text": "function formSubmit(){\n\n\t\t $auth.signup(rc.user)\n\t\t\t\t.then(function(response){\n\t\t\t\t\tconsole.log(response);\n\t\t\t \t\trc.message = response.data.message;\n\t\t\t \t\t/*$auth.setToken(response.data.token);\n\t\t\t \t\tuserData.setUser(response.data.user);\n\t\t\t \t\t//console.log(userData.getUser());\n\t\t\t\t\t\t\twindow.history.back();*/\n\t\t\t\t\t},function(response){\n\t\t\t\t\t\trc.message = response.data.message;\n\t\t\t\t\t\tconsole.log(response);\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "1380469910dd75e670c46ef5681df57f", "score": "0.7199577", "text": "function formSubmit(){\n\n\t\t $auth.signup(rc.user)\n\t\t\t\t.then(function(response){\n\t\t\t\t\tconsole.log(response);\n\t\t\t \t\trc.message = response.data.message;\n\t\t\t \t\t/*$auth.setToken(response.data.token);\n\t\t\t \t\tuserData.setUser(response.data.user);\n\t\t\t \t\t//console.log(userData.getUser());\n\t\t\t\t\t\t\twindow.history.back();*/\n\t\t\t\t\t},function(response){\n\t\t\t\t\t\trc.message = response.data.message;\n\t\t\t\t\t\tconsole.log(response);\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "a46077047042ecde706f86cede7c2bfb", "score": "0.71572715", "text": "function signUp() {\n props.Close();\n props.signupOpen();\n }", "title": "" }, { "docid": "b1094cf23077dd569cd1c8c50a09a65d", "score": "0.7133516", "text": "async signup(evt) {\n\t\t// Prevent page reload\n\t\tevt.preventDefault();\n\t\tconst { username, password, first, last, email, passwordConfirm } = this.state;\n\t\tconsole.log(username, password, first, last, email, passwordConfirm);\n\t\tconst res = await fetch('/signup', {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify({\n\t\t\t\tusername: username.value,\n\t\t\t\tpassword: password.value,\n\t\t\t\tfirst: first.value,\n\t\t\t\tlast: last.value,\n\t\t\t\temail: email.value,\n\t\t\t\tpasswordConfirm: passwordConfirm.value,\n\t\t\t}),\n\t\t}).catch(err => {\n\t\t\tconsole.log('Error signing up: ', err);\n\t\t\treturn;\n\t\t});\n\t\tconst data = await res.json();\n\t\tconsole.log(data);\n\t\tif (res.status === 200) {\n\t\t\tthis.props.history.push('/login');\n\t\t}\n\t}", "title": "" }, { "docid": "5204b221d752ad2bc09cf3d421f784a6", "score": "0.7109098", "text": "signUp(username, email, password) {\n this.props.dispatch(registerUser({\n username,\n email,\n password\n }));\n sendEvent('signup page', 'signup', 'email');\n }", "title": "" }, { "docid": "ea00449d4a6de7c0f77a02defb6df171", "score": "0.7105184", "text": "async function handleClickButtonSignUp (event) {\n event.preventDefault();\n setError(\"\") ;\n\n try {\n const result = await Auth.signUp({\n 'username': username,\n 'password': password,\n }) ;\n console.log (\"Sign up success: \", result) ;\n\n if (result.userConfirmed === false)\n setSignInType(SignInType.CONFIRM_SIGN_UP) ;\n }\n catch (error) {\n console.log (\"Sign up failure: \", error) ;\n setError (\"Failed - \" + error.message) ;\n }\n }", "title": "" }, { "docid": "ea654bc5702935d4c034fce098048404", "score": "0.7091889", "text": "navigateToSignUp(){\n\t\tresources.signUpButton().click();\n\t}", "title": "" }, { "docid": "a07b97dc378cc51a48a476857964d225", "score": "0.70630646", "text": "function signUpUser(email, password, firstName, lastName, facName, facAddress, facPhone, facID) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n firstName: firstName,\n lastName: lastName,\n facName: facName,\n facAddress: facAddress,\n facPhone: facPhone,\n facID: facID,\n })\n .then(function(data) {\n window.location.replace(\"/dashboard\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "c82fd476b2b1a0ce4b7fee49f12d1fe0", "score": "0.7050316", "text": "function signUp() {\n if ($scope.user.password !== $scope.confirmPassword) {\n $scope.passwordMismatch = true;\n return;\n }\n $scope.signupErrorMsg = null;\n $scope.passwordMismatch = false;\n $rootScope.loadingImage = true;\n\n var postData = {\n username: $scope.user.email,\n password: $scope.user.password,\n fullName : $scope.user.fullName\n };\n AuthService.signupApi(postData).then(function (response) {\n $state.go('home.inner');\n })\n .catch(function (err) {\n $scope.signupErrorMsg = err.data.message;\n })\n .finally(function () {\n $rootScope.loadingImage = false;\n });\n }", "title": "" }, { "docid": "ce611aa851123a3709382dd75240d9d1", "score": "0.7028279", "text": "function signUpUser(userData) {\n $.post(\"/api/signup\", userData)\n .then(function (data) {\n //on success, continue to dashboard\n window.location.replace(\"/dashboard\");\n })\n // If there's an error, handle it by throwing up a bootstrap alert\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "eb30c7836ee7113707426c0843e433a3", "score": "0.7022986", "text": "function signup()\n{\n // Hide all login fields\n hideOrShow('log-in', false);\n hideOrShow('Signup-btn', false);\n hideOrShow('Login-btn', false);\n\n // Show all Sign up fields\n hideOrShow('sign-up', true);\n\n}", "title": "" }, { "docid": "f4e8a008df62659024645f3d195debf7", "score": "0.7009051", "text": "_handleFormSubmit() {\n\t\t// If there are errors, do not Submit\n\t\tlet errors = this._validate();\n\t\tif(errors.email || errors.password || errors.passwordConfirm) {\n\t\t\treturn;\n\t\t}\n\t\t// Call action creator to sign up the user\n\t\tlet email = this.state.inputEmail;\n\t\tlet password = this.state.inputPassword;\n\t\tthis.props.signupUser({ email, password }, (success, userId) => {\n\t\t\tif (success) {\n\t\t\t\tthis.props.closeSignUp();\n\t\t\t\tthis.props.history.push(`/profile/${userId}`);\n\t\t\t\tthis.setState({ inputEmail: '', inputPassword: '', inputConfirmPassword: '',\n\t\t\t\t\tinputErrors: { email: '', password: '', passwordConfirm: '' } });\n\t\t\t\tlocation.reload();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "ca3e241f60449610aa5e79a43d9ff9b0", "score": "0.69929516", "text": "function signUp()\n\t{\n\t\talert(\"Your email was successfully added to our mailing list\");// alert\n\t}// END of signUp function", "title": "" }, { "docid": "42cc22a72f8847338fcd50760196a0cc", "score": "0.69696414", "text": "function handleSignUpBtnClick() {\n console.log(\"signup clicked\");\n navigation.navigate('Signup');\n }", "title": "" }, { "docid": "e09ddf079e5bd4b04208010567d8d1fa", "score": "0.69586885", "text": "function signUp(){\n //check if user inputs are valid\n if(validInputs()){\n \n resetError($(\"#inputs-in-error\")); //reset any previous error on inputs\n \n var user = new User(); //new User object\n \n var newUser={ //user object containing user data\n firstname: firstnameText,\n name: nameText,\n email: emailText,\n password: passwordText,\n repassword: repasswordText,\n nickname: nicknameText,\n age: ageText,\n gender: selGender\n \n };\n \n //request to create accont\n user.signUp(newUser).done(function(response){\n \n if(response.success === true){\n popUp(\"success\",response.message);\n window.location.reload();\n \n }else{\n popUp(\"error\",response.message,response.responseText);\n }\n }); //create account request completed\n \n }else{\n setError($(\"#inputs-in-error\"),\"You have errors on inputs above!\");\n }\n \n}//END signUp function", "title": "" }, { "docid": "7950f5d5bfe35defc6d3d253fd990097", "score": "0.69480234", "text": "function handleSignUp() {\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Create user with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email,password).catch(function (error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n });\n }", "title": "" }, { "docid": "62596f96295a204af90e77b5af013c16", "score": "0.6922869", "text": "function signUp() {\n\t//get text from fields on form\n\tvar username = $('#sign_up_username').val();\n\tvar password = $('#sign_up_password').val();\n\t\n\t$.ajax({\n\t\t\turl: \"signUpRequest\",\n\t\t\ttype: \"put\",\n\t\t\tdata: {\n\t\t\t\tusername: username,\n\t\t\t\tpassword: password\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tif (data == 'User saved.') {\n\t\t\t\t\t//sets the sessions storage to that user\n\t\t\t\t\tsessionStorage.username = username;\n\t\t\t\t\t//loads the previous trips for that user (which should always be none)\n\t\t\t\t\tloadTrips(username);\n\t\t\t\t\t//change to user ui page\n\t\t\t\t\t$.mobile.changePage('#userUi');\n\t\t\t\t\t$('#welcome_header').text('Welcome, ' + username);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//give an error if there is one\n\t\t\t\t\t$('#error_on_sign_up').html(data);\t\n\t\t\t\t}\n\t\t\t}\n\t});\n\treturn false;\n}", "title": "" }, { "docid": "74da7f5a2b5dfeb51a230f7aa0de5f0f", "score": "0.6916741", "text": "function signUpUser(\n email,\n password,\n firstName,\n lastName,\n cityName,\n stateName\n ) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n firstName: firstName,\n lastName: lastName,\n cityName: cityName,\n stateName: stateName\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "d81c8d7e4300d091251236cd5af9ed6a", "score": "0.6900445", "text": "function signupUser(e) {\r\n e.preventDefault();\r\n const form = document.getElementById(\"signup_form\");\r\n let first_name = form.first_name.value;\r\n let last_name = form.last_name.value;\r\n let email = form.email.value;\r\n let mobile = form.mobile.value;\r\n let password = form.password.value;\r\n let bool = true;\r\n Array.from(form).forEach((input) => {\r\n if (\r\n input.value == \"\" &&\r\n input.name != \"last_name\" &&\r\n input.tagName != \"BUTTON\"\r\n ) {\r\n bool = false;\r\n document.querySelector(`#${input.id} ~ .required_field`).style.display =\r\n \"block\";\r\n }\r\n });\r\n if (bool) {\r\n createUserAccount(first_name, last_name, email, mobile, password);\r\n form.first_name.value = \"\";\r\n form.last_name.value = \"\";\r\n form.email.value = \"\";\r\n form.mobile.value = \"\";\r\n form.password.value = \"\";\r\n }\r\n}", "title": "" }, { "docid": "ab1329232e180f639b7280455eef9f48", "score": "0.6897722", "text": "function handleSignUpBtnClick() {\n navigation.navigate('Signup');\n }", "title": "" }, { "docid": "5190548b3ccd6430715bc950c94e44f9", "score": "0.6895576", "text": "async function handleSignUpSubmit(e){\n e.preventDefault();\n let result = await register(formData)\n console.log(result)\n if(result.success){\n history.push('/companies')\n }else{\n setFormErrors(result.errors);\n }\n }", "title": "" }, { "docid": "07cb8cc413ba7d91263d2526ccd0611e", "score": "0.68934494", "text": "function submitSignup(){\n var username = document.querySelector('.signupUsername').value;\n var password = document.querySelector('.signupPassword').value;\n if(document.querySelector('.signupAdminPassword').value){\n var adminPassword = document.querySelector('.signupAdminPassword').value;\n var userCredentials = {username: username, password, adminPassword: adminPassword}\n }\n else {\n var userCredentials = {username: username, password}\n }\n signupUser(userCredentials)\n .then(function(newUser){\n if(newUser.data == 'password issue'){\n alert('Your admin password was incorrect, please try again')\n }\n else if(newUser.data == 'username taken'){\n alert('that username is already taken, could you try another one?')\n }\n else {\n if(newUser.data.admin == true){\n window.localStorage.skateToken = \"admin\";\n self.signedInUser = !self.signedInUser;\n self.admin = true;\n self.signupModalToggle = false;\n }\n else if(newUser.data.admin == false){\n window.localStorage.skateToken = \"user\";\n self.signedInUser = !self.signedInUser;\n self.signupModalToggle = false;\n }\n }\n })\n }", "title": "" }, { "docid": "f60a672910dc15a69bd156138854eddf", "score": "0.68797165", "text": "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "4e8452f462d60656e8a7610cfeb5c20a", "score": "0.68548", "text": "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(function(data) {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "455c1721fe05c5a18a8e73caf9699faf", "score": "0.68450004", "text": "function signUpUser(username, password) {\n $.post(\"/api/signup\", {\n username: username,\n password: password\n })\n // eslint-disable-next-line no-unused-vars\n .then(function(data) {\n window.location.replace(\"/members\");\n })\n // If there's an error, handle it by throwing up a bootstrap alert\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "efc664f49b1d5acc50957f9aad6743ef", "score": "0.68297535", "text": "function handleSignUp() {\n var email = document.getElementById('email').value;\n var password = document.getElementById('password').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and pass.\n // [START createwithemail]\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else if(errorMessage != null){\n alert(errorMessage);\n } else{\n\t\t\tsendEmailVerification();\n\t\t}\n console.log(error);\n // [END_EXCLUDE]\n });\n // [END createwithemail]\n }", "title": "" }, { "docid": "e751f6ebe0ef7d144c2d0715722b39d0", "score": "0.6828172", "text": "function signUpUser(email, username, password) {\n $.post(\"/api/user/signup\", {\n email: email,\n username: username,\n password: password\n })\n .then(function() {\n console.log(\"Created \")\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "4edf086621f88de890419d640d721d84", "score": "0.68221563", "text": "handleFormSubmit(formProps) {\n\t\t//call action creator to sign up the user\n\t\tthis.props.signupUser(formProps);\n\t}", "title": "" }, { "docid": "d79c905254bede0d4183044096c1ad01", "score": "0.6818914", "text": "function signUpUser(userData) {\n $.post(\"/api/user-signup\", userData)\n .then(function (data) {\n window.location.replace(\"/\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "8a32b5d16a6a80b65610443aa5f92460", "score": "0.6818151", "text": "function goSignUp() {\n toggleClasses('index');\n toggleClasses('signup');\n }", "title": "" }, { "docid": "a28090a343980975f9dcb10af0ec37c7", "score": "0.6814468", "text": "function onRegisterOnCheckoutSubmit() {\n var $createAccountCheckbox = $('#createaccount');\n if ($createAccountCheckbox.is(':checked')) {\n onRegisterFormSubmit();\n }\n }", "title": "" }, { "docid": "8f7a54aa196f26da745af37c5a5cca9b", "score": "0.68049306", "text": "function signUpUser(email, username, password) {\n $.post(\"/api/signup\", {\n email: email,\n displayName: username,\n password: password\n })\n .then((req) => {\n const id = req.id\n window.location.replace(`/members/${id}`)\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "a532f9c9aaf27a3848f6f76e01fdf88e", "score": "0.6794867", "text": "function createAccount()\n{\n // Initialize url.\n var url_signup = 'https://cop4331-9.herokuapp.com/signup';\n\n // Initialize userdata\n let userdata = {\n firstname: document.getElementById('firstName').value,\n lastname: document.getElementById('lastName').value,\n email: document.getElementById('email').value,\n username: document.getElementById('user-signup').value,\n\t password: document.getElementById('password-signup').value\n }\n\n $.post(\"/signup\", userdata, function (res, status) {\n console.log(status);\n }).fail(function() {\n alert(\"signup failed\");\n });\n\n // Clear all text fields.\n clearText('firstName');\n clearText('lastName');\n clearText('email');\n clearText('user-signup');\n clearText('password-signup');\n clearText('repassword-signup');\n\n // Hide all Sign up fields\n show('sign-up', false);\n\n // Show all Sign up fields\n show('log-in', true);\n show('Signup-btn', true);\n show('Login-btn', true);\n}", "title": "" }, { "docid": "3e56f01e60d29e8907a33d735322ebdd", "score": "0.67879856", "text": "function signUpUser(email, password) {\n console.log(\"USer info\", email, password);\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/tracking\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "10511a3c4c091b5eaeafa8ab4bdc6115", "score": "0.67878413", "text": "function signUpUser(email, username, password) {\n // console.log(email);\n $.post(\"/api/signup\", {\n email: email,\n username: username,\n password: password\n })\n .then(() => {\n window.location.href = \"/\";\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "2cf7eebf8452466cbc879b49edcef3b9", "score": "0.6786674", "text": "function goSignUp() {\n\n $location.path('/signup');\n showOrHideMenu();\n\n }", "title": "" }, { "docid": "f5e643e7400f20aeb365b48e10a1ca95", "score": "0.67703336", "text": "handleSignUpClick(e) {\n\t\tthis.handleSignUpSend(e).then((data) => {\n\t\t\tif(data == \"success\"){\n\t\t\t\tthis.setState({\n\t\t\t\t\tincorrectSignIn: false //do not show replicated signup message\n\t\t\t\t});\n\t\t\t\tsessionStorage.setItem('loggedIn', this.state.username);\n\t\t\t\twindow.location.href = \"/preferences\"; //if signup accepted, redirect to preferences page\n\t\t\t}else if(data == \"failure\"){\n\t\t\t\tthis.setState({\n\t\t\t\t\tincorrectSignIn: true //show replicated signup message\n\t\t\t\t});\n\t\t\t}\n \t});\n\t}", "title": "" }, { "docid": "c92f7cc158a44552556d23c645f8f338", "score": "0.6769356", "text": "async function onSignup() {\n setLoading(true)\n\n api.post('signup', { name, email, password })\n .then(res => {\n history.push('/')\n })\n .catch(err => {\n var msg = err.response.data.error\n if (err.response.data.error === 'Email is being used') { msg = 'Email já cadastrado' }\n if (err.response.data.error === 'Bad Request') { msg = 'Insira os dados corretamente' }\n alert(msg)\n })\n\n setLoading(false)\n }", "title": "" }, { "docid": "a913eac77521745e16982f5cb0b887d8", "score": "0.6768638", "text": "function signupButton(){\n hideLoginForm();\n showSignupForm();\n}", "title": "" }, { "docid": "deb18d009f918df962cea640826f177d", "score": "0.6749264", "text": "function signUpUser(company, name, address, city, state, zip, telephone, fax, email) {\n $.post(\"/signup\", {\n company: company,\n name: name,\n address: address,\n city: city,\n state: state,\n zip: zip,\n telephone: telephone,\n fax: fax,\n email: email\n //not sure if this is the correct redirect\n }).then(function(data) {\n window.location = data.redirect;\n }).catch(function(err) {\n console.log(err);\n });\n }", "title": "" }, { "docid": "2969bd1aa36206b69222cc3f061cc541", "score": "0.67277247", "text": "submitSignUpForm(e) {\n e.preventDefault()\n\n this.setState({ submitted: true })\n const {fields} = this.state\n if (this.validateForm()) {\n if (fields.firstName && fields.lastName && fields.email && fields.phone && fields.password) {\n this.props.register(fields)\n }\n console.log(\"Account has been created.\")\n // Finishes with a message which lets the user know that the posting of data was successful.\n alert(\"Form submitted\")\n \n }\n }", "title": "" }, { "docid": "18da95a78078310d227d0cdae0e86fd5", "score": "0.67257166", "text": "async function handleClickButtonConfirmSignUp (event) {\n event.preventDefault();\n setError(\"\") ;\n\n try {\n const result = await Auth.confirmSignUp(username, code)\n console.log (\"Confirm sign up success: \", result) ;\n setViewType(ViewType.RACHIO_SIGN_IN) ;\n }\n catch (error) {\n console.log (\"Confirm sign up failure: \", error) ;\n setError (\"Failed - \" + error.message) ;\n }\n\n setCode(\"\") ;\n }", "title": "" }, { "docid": "2bc57f956ba61c6a50ff1fc0fd93e750", "score": "0.6707195", "text": "function submitSignUpForm() {\n return function(browser) {\n browser\n .click('#sign-up-button')\n .wait();\n }\n}", "title": "" }, { "docid": "36b61820ccd8db42781e7d4d93501997", "score": "0.66967183", "text": "signupUserByEmail(){\n\t// Validates and Sign-up New User \n\t$(\".form.signupform .submit\").form({\n\t inline : true,\n\t on: 'blur',\n\t fields: {\n\t\tlastname: {\n\t\t identifier: 'lastname',\n\t\t rules: [{\n\t\t\ttype: 'empty',\n\t\t\tprompt: 'Last name is required'\n\t\t }]\n\t\t},\n\t\tfirstname: {\n\t\t identifier: 'firstname',\n\t\t rules: [{\n\t\t\ttype: 'empty',\n\t\t\tprompt: 'First name is required'\n\t\t }]\n\t\t},\n\t\temail: {\n\t\t identifier: 'email',\n\t\t rules: [{\n\t\t\ttype: 'empty',\n\t\t\tprompt: 'Email is required'\n\t\t },\n\t\t\t {\n\t\t\t\ttype: 'email',\n\t\t\t\tprompt: 'Please enter a valid email'\n\t\t\t }]\n\t\t},\n\t\tday: {\n\t\t identifier: 'day',\n\t\t rules: [{\n\t\t\ttype: 'empty',\n\t\t\tprompt: 'Please enter day'\n\t\t },\n\t\t\t { \n\t\t\t\ttype: 'integer',\n\t\t\t\tprompt: 'number digit only'\n\t\t\t },\n\t\t\t { \n\t\t\t\ttype: 'integer[1..31]',\n\t\t\t\tprompt: 'invalid day'\n\t\t\t }]\n\t\t},\n\t\tmonth: {\n\t\t identifier: 'month',\n\t\t rules: [{\n\t\t\ttype: 'empty',\n\t\t\tprompt: 'Please enter month'\n\t\t }]\n\t\t},\n\t\tyear: {\n\t\t identifier: 'year',\n\t\t rules: [{\n\t\t\ttype: 'empty',\n\t\t\tprompt: 'Please enter year'\n\t\t },\n\t\t\t {\n\t\t\t\ttype: 'exactLength[4]',\n\t\t\t\tprompt: 'should be {ruleValue} characters long'\n\t\t\t },\n\t\t\t { \n\t\t\t\ttype: 'integer',\n\t\t\t\tprompt: 'Number digits only'\n\t\t\t }\n\t\t ]\n\t\t},\n\t\tpassword: {\n\t\t identifier: 'password',\n\t\t rules: [\n\t\t\t{\n\t\t\t type : 'empty',\n\t\t\t prompt : 'Please enter a password'\n\t\t\t},\t\t \n\t\t\t{\n\t\t\t type : 'minLength[6]',\n\t\t\t prompt : 'Your password must be at least {ruleValue} characters'\n\t\t\t}\n\t\t ]\n\t\t},\t \n\t\tterms: {\n\t\t identifier: 'terms',\n\t\t rules: [\n\t\t\t{\n\t\t\t type : 'checked',\n\t\t\t prompt : 'Please Check this box'\n\t\t\t}\n\t\t ]\n\t\t}\n\n\t }\n\t}).api({\n\t action: 'register user',\n\t method: 'POST',\n\t serializeForm: true,\n\t dataType: 'json',\n\t debug: true,\n\t cache: false,\n\t verbose: true,\n\t data: {\n\t },\n\t beforeSend: function(settings) {\n\n\t\tlet capFirstCharacter = (name) => {\n\t\t name = name.split('');\n\t\t firstCharacter = name.shift();\n\t\t name.unshift(firstCharacter.toUpperCase());\n\t\t name = name.join('');\n\t\t return name; \n\t\t}\n\n\t\tlet birthday = () => {\n\t\t let day = (settings.data.day).trim();\n\t\t let month = (settings.data.month).trim();\n\t\t let year = (settings.data.year).trim();\n\t\t if ( day.length == 1 ){ \n\t\t\tday = \"0\".concat(day);\n\t\t\tconsole.log(\"Not Default: \" + year + '-' + month + '-' + day);\n\t\t\treturn (year + '-' + month + '-' + day);\n\t\t }\n\t\t else{\n\t\t\tconsole.log(\"default: \" + year + '-' + month + '-' + day);\n\t\t\treturn (year + '-' + month + '-' + day);\n\t\t }\n\t\t}\t \n\t\tsettings.data.user.birthday = birthday();\n\t\tsettings.data.user.firstname = capFirstCharacter(settings.data.user.firstname).trim();\n\t\tsettings.data.user.lastname = capFirstCharacter(settings.data.user.lastname).trim();\n\t\tsettings.data.user.email = settings.data.user.email.trim();\n\t\tsettings.data.user.password = settings.data.user.password.trim();\n\t\t\n\t\tconsole.log(settings.data.user);\n\t\tconsole.log(settings.data.user.firstname);\n\t\treturn settings;\n\t },\n\t onResponse: function(response) {\n\t\tconsole.log(response.data);\n\t\treturn response;\n\t },\n\t onSuccess: function(json) {\n\t\tconsole.log('Data Available');\n\t\tconsole.log(json);\n\t },\n\t onFailure: function(json, element, xhr) {\n\t\tconsole.log('onFailure');\n\t\tconsole.log(json, 'Failed! Should be an Object.');\n\t\tconsole.log(json.data, 'Data Failed');\n\t\tconsole.log(xhr);\n\t },\n\t});\n\n }", "title": "" }, { "docid": "dca9fdefdf82eb053464662ae5bb2582", "score": "0.66958624", "text": "function signup(e) {\n e.preventDefault();\n if (!validInput(['username', 'password', 'email'])) return;\n $.ajax('/register', {\n method: 'POST',\n data: {\n username: $('[name=\"username\"]').val(),\n email: $('[name=\"email\"]').val(),\n password: $('[name=\"password\"]').val()\n }\n }).then(({ user, authToken }) => {\n if (user && authToken.token) {\n $.cookie('auth_token', authToken.token, { expires: 7 });\n window.location = '/'\n } else {\n throw new Error('something went wrong')\n }\n }).catch((err) => alert(err.responseText))\n}", "title": "" }, { "docid": "d81697e1dab278a2974fa7b6efcec52e", "score": "0.66893667", "text": "function signUpUser(username, password) {\n $.post(\"/api/signup\", {\n username: username,\n password: password\n })\n .then(function(data) {\n window.location.replace(\"/home\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "c259ba30c54bf95a6aa6cdcacbf8ce03", "score": "0.6688994", "text": "function signUp(){\n let email = document.getElementById(\"sign-up-email\");\n let password = document.getElementById(\"sign-up-password\");\n const promise = auth.createUserWithEmailAndPassword(email.value, password.value);\n promise.catch(e => alert(e.message));\n //alert(\"Signed Up\");\n promise.then(user => {\n window.location.href = 'SignIn.html';\n });\n}", "title": "" }, { "docid": "936e91cdc93b3f4d20fd26d6546952e0", "score": "0.6679833", "text": "function signupSubmitHandler(event) {\n event.preventDefault();\n axios.post(`${URL}/signup`,\n {\n username: event.target.username.value,\n password: event.target.password.value,\n role: 'admin'\n })\n .catch(e => alert(\"Failure signing up. This username may already be in the database.\"))\n .then(alert(\"You've signed up!\"));\n}", "title": "" }, { "docid": "72f63b4c9082482acac0faefbdc6fe5a", "score": "0.6678725", "text": "function signUpUser(email, password) {\n $.post(`/api/signup`, {\n email,\n password\n })\n .then(() => {\n window.location.replace(`/members`);\n // error = error\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "02cb069989caf775361230068986d105", "score": "0.6677618", "text": "function signUpUser(\n firstname,\n lastname,\n address1,\n address2,\n city,\n state,\n zip,\n email,\n username,\n password\n ) {\n $.post(\"/api/signup\", {\n firstname: firstname,\n lastname: lastname,\n address1: address1,\n address2: address2,\n city: city,\n state: state,\n zip: zip,\n email: email,\n username: username,\n password: password,\n })\n .then(function (data) {\n window.location.href = \"/thanks\";\n // Handle it by throwing up an alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "0664f6ef4426f91c5396c12728f2d54e", "score": "0.66770726", "text": "function handleSignup(e) {\n e.preventDefault();\n fire\n .auth()\n .createUserWithEmailAndPassword(email, password)\n .then((data) => {\n var actionCodeSettings = {\n url: \"http://localhost:3000/vendor\",\n handleCodeInApp: false,\n // When multiple custom dynamic link domains are defined, specify which\n // one to use.\n };\n setAdmin(false);\n console.log(\"Hi\");\n const user = data.user;\n user\n .sendEmailVerification(actionCodeSettings)\n .then(() => {\n // Email Verification sent!\n alert(\"Email Verification Sent!\");\n })\n .catch(() => {});\n setSuccess(true);\n // setVendor(true);\n\n // console.log(user);\n // console.log(\"+\" , firstname);\n console.log(success, user.uid);\n\n db.collection(\"vendors\")\n .doc(user.uid)\n .set({\n name: firstname + \" \" + lastname,\n email: email,\n shopname: shopname,\n address: \"\",\n isOnline: false,\n isVendor: true,\n url: null,\n status: \"active\",\n });\n\n setEmail(\"\");\n setPassword(\"\");\n setFirstname(\"\");\n setLastname(\"\");\n setShopName(\"\");\n setError(null);\n })\n .catch((error) => {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n setError(errorMessage);\n setSuccess(false);\n });\n\n // const user=fire.auth().currentUser;\n\n // db.collection('users').doc(user.uid).set({\n // name : firstname + \" \" + lastname,\n // email : email,\n // college : college\n // })\n // .catch();\n }", "title": "" }, { "docid": "13891fe00e5ed5a79d6a4737aa14a660", "score": "0.6672672", "text": "function submitSignInForm() {\n return submitSignUpForm();\n}", "title": "" }, { "docid": "810d46271a579ef174602712151fdb6f", "score": "0.667086", "text": "function doSignUp() {\n signService.addMember(vm.object)\n .then(function (result) {\n var alertPopup = $ionicPopup.alert({\n title: 'Welcome!',\n template: 'Thank You for signing up...'\n });\n /*vm.object.name = '';\n vm.object.address = '';\n vm.object.email = '';\n vm.object.password = '';\n vm.object.phoneno = '';\n vm.object.landline = '';*/\n $location.path('#/app/list');\n });\n }", "title": "" }, { "docid": "ad8606439cab78266160e12bbcc2346d", "score": "0.66624874", "text": "function signUpUser(name, sex, age, goal, email, password, dumbbell, barbell, machine, proficiency) {\n $.post(\"/api/signup\", {\n name: name,\n sex: sex,\n age: age,\n goal: goal,\n email: email,\n password: password,\n dumbbell: dumbbell,\n barbell: barbell, \n machine: machine,\n proficiency: proficiency\n })\n .then(function (data) {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "7aefd0f76f85456ae0d1bc96bde24fa7", "score": "0.66608995", "text": "async function confirmSignUp(){\n const {email, authcode} = formState\n const username = email\n try{\n await Auth.confirmSignUp(username, authcode)\n updateFormState(()=> ({...formState, formType:\"signIn\"}))\n \n }catch(e){\n console.log(\"error confirming signup\", e)\n setErrorMessage(e.message)\n }\n \n }", "title": "" }, { "docid": "ede039adb718080fa7f96060d5713176", "score": "0.6658768", "text": "function signUp() {\n\tvar name = $(\"#name\").val();\n\tvar nameID = $(\"#nameID\").val();\n\n\tif (name !== \"\" && nameID !== \"\") {\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"user_log.php\",\n\t\t\tdata: {nameID: nameID, name: name},\n\t\t\tsuccess: function(data) {\n\t\t\t\tconsole.log(\"User sign up\");\n\t\t\t\t$(\"#overlay, #signUpBox\").hide();\n\t\t\t\twindow.location.reload();\n\t\t\t},\n\t\t\terror: function(XMLHttpRequest, textStatus, errorThrown) {\n\t\t\t\tconsole.log(\"Object: \" + XMLHttpRequest);\n\t\t\t\tconsole.log(\"Error: \" + textStatus);\n\t\t\t}\n\t\t});\n\t}\n\n\tif (name == \"\") {\n\t\t$(\"#errorName\").html(\"* Vinsamlegast settu inn nafn\");\n\t} else if (name !== \"\") {\n\t\t$(\"#errorName\").empty();\n\t}\n\n\tif (nameID == \"\") {\n\t\t$(\"#errorNameID\").html(\"* Vinsamlegast settu inn notendanafn\");\n\t} else if (nameID !== \"\") {\n\t\t$(\"#errorNameID\").empty();\n\t}\n}", "title": "" }, { "docid": "ca8d55180b500d122f513a36d9c8011e", "score": "0.6646928", "text": "function signUp(){\n var mail=document.getElementById(\"email\");\n var pass=document.getElementById(\"password\");\n\n const promise=auth.CreateUserWithEmailAndPassword(mail.value,pass.value);\n promise.catch(e=> alert(e.meassage));\n alert(\"Sign UP Succefull\");\n }", "title": "" }, { "docid": "f5957480716c5b7bdd64477e5c28b9d7", "score": "0.6646811", "text": "async signUp(event) {\n if (event) {\n event.preventDefault();\n }\n if (!Auth$1 || typeof Auth$1.signUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n if (this.phoneNumber.phoneNumberValue) {\n try {\n this.signUpAttributes.attributes.phone_number = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n switch (this.usernameAlias) {\n case 'email':\n case 'phone_number':\n this.signUpAttributes.username = this.signUpAttributes.attributes[this.usernameAlias];\n break;\n }\n try {\n if (!this.signUpAttributes.username) {\n throw new Error(Translations.EMPTY_USERNAME);\n }\n if (this.signUpAttributes.username.indexOf(' ') >= 0) {\n throw new Error(Translations.USERNAME_REMOVE_WHITESPACE);\n }\n if (this.signUpAttributes.password !== this.signUpAttributes.password.trim()) {\n throw new Error(Translations.PASSWORD_REMOVE_WHITESPACE);\n }\n const data = await Auth$1.signUp(this.signUpAttributes);\n if (!data) {\n throw new Error(Translations.SIGN_UP_FAILED);\n }\n if (data.userConfirmed) {\n await handleSignIn(this.signUpAttributes.username, this.signUpAttributes.password, this.handleAuthStateChange);\n }\n else {\n const signUpAttrs = Object.assign({}, this.signUpAttributes);\n this.handleAuthStateChange(AuthState.ConfirmSignUp, Object.assign(Object.assign({}, data.user), { signUpAttrs }));\n }\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n finally {\n this.loading = false;\n }\n }", "title": "" }, { "docid": "707fa30875e11a0c054f49bb32bfcf9b", "score": "0.6646", "text": "function signUpUser(name, email, password) {\n $.post(\"/api/signup\", {\n name: name,\n email: email,\n password: password\n })\n .then(function(data) {\n window.location.replace(data);\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(function(err) {\n showErrorModal(\"We had trouble signing you up. Please try again.\");\n // console.log(err);\n });\n }", "title": "" }, { "docid": "9b62f4faf1dfd6b1e383ff23518a89c4", "score": "0.66433465", "text": "async function signUp() {\n const { username, email, password } = this.state\n await Auth.signUp({ username, password, attributes: { email }})\n console.log('user successfully signed up')\n}", "title": "" }, { "docid": "924f9eaba338335a029d6445ecf07779", "score": "0.66316426", "text": "function handleSignUp() {\n var email = document.getElementById('email').value;\n var password = document.getElementById('password').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and pass.\n // [START createwithemail]\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n // [END_EXCLUDE]\n });\n // [END createwithemail]\n }", "title": "" }, { "docid": "dfd1bdf88033c9c630cadc29828a2b59", "score": "0.66222805", "text": "function onSignupRedirect() {\n // Display an alert stating that the registration was successful.\n $(\"main\").prepend(`<div class=\"alert alert-success alert-dismissible fade show\" role=\"alert\">\n <strong>Successfully registered!</strong> Use the form bellow to submit a ticket for processing.\n <button type=\"button\" class=\"btn-close close\" data-dismiss=\"alert\" aria-label=\"Close\"\n onclick=\"$('.alert').alert('close')\">\n </button>\n</div>`);\n // Close the alert after 10 seconds.\n setTimeout((_) => {\n $('.alert').alert(\"close\");\n }, 10000);\n\n // Remove the signup parameter from the URL so refreshing the page\n // doesn't trigger the alert again.\n window.history.replaceState(null, null, window.location.pathname);\n}", "title": "" }, { "docid": "7cbf8f5e27b807a8dd1ec40db93350b5", "score": "0.66193753", "text": "async confirmSignUp(event) {\n if (event) {\n event.preventDefault();\n }\n if (!Auth$1 || typeof Auth$1.confirmSignUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n switch (this.usernameAlias) {\n case 'phone_number':\n try {\n this.userInput = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n try {\n if (!this.userInput)\n throw new Error(Translations.EMPTY_USERNAME);\n this.userInput = this.userInput.trim();\n const confirmSignUpResult = await Auth$1.confirmSignUp(this.userInput, this.code);\n if (!confirmSignUpResult) {\n throw new Error(I18n.get(Translations.CONFIRM_SIGN_UP_FAILED));\n }\n if (this._signUpAttrs && this._signUpAttrs.password && this._signUpAttrs.password !== '') {\n // Auto sign in user if password is available from previous workflow\n await handleSignIn(this.userInput, this._signUpAttrs.password, this.handleAuthStateChange);\n }\n else {\n this.handleAuthStateChange(AuthState.SignIn);\n }\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n finally {\n this.loading = false;\n }\n }", "title": "" }, { "docid": "1854fc70070fcb3745ff473eecbfa1d6", "score": "0.6612016", "text": "function handleSignUp() {\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Create user with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email,password).catch(function (error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n if (errorCode === 'auth/weak-password') {\n message.error('The password is too weak.')\n } else {\n message.error(errorMessage)\n }\n console.log(error);\n return\n }).then(res => {\n let currentUser = firebase.auth().currentUser\n currentUser && currentUser.sendEmailVerification().then(function () {\n // Email Verification sent!\n message.success(\"Email validation sent\")\n }).then((re) => {\n console.log(\"re\", re);\n currentUser.updateProfile({\n displayName: username\n }).then(() => {\n const { uid,displayName,photoURL,email,phoneNumber,emailVerified } = currentUser\n setLoggedIn({ uid,displayName,photoURL,email,phoneNumber,emailVerified })\n message.success(\"sign up successful\")\n console.log(\"curent user\",currentUser);\n // window.location=\"/\"\n })\n })\n\n\n console.log(\"res\",res);\n\n })\n }", "title": "" }, { "docid": "f1efd16583c26a305bcfc6318800b6bf", "score": "0.66091573", "text": "function handleSignUp() {\n var email = document.getElementById('mailNewAccount').value;\n var password = document.getElementById('newnewAccountPW').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and pass.\n // [START createwithemail]\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n // [END_EXCLUDE]\n });\n // [END createwithemail]\n }", "title": "" }, { "docid": "b341ed5987c5e52839b574fa741b90c3", "score": "0.6586365", "text": "function signUp(){\n window.location.href = \"userAddUpdate.html\";\n}", "title": "" }, { "docid": "3ce806e1d49dbb37452b6399fb5cfeea", "score": "0.6585953", "text": "function signup()\n{\n\n\t//make sure to store the users username and password for log in \n\tvar userName = document.getElementById(\"userLogin\").value;\n\tvar password = document.getElementById(\"userPassword\").value\n \n}", "title": "" }, { "docid": "b8c38ca6bfdc98f8a1934b8b716ee56a", "score": "0.658504", "text": "function after_signUp(){\n\t\t\t\n\tconst dpName = txtName.value;\n\tconst email = txtEmail.value;\n\t\n\tfirebase.auth().onAuthStateChanged(function(user) {\n\n\t\tif (user){\n\t\t\tuser.updateProfile({\n\t\t\t displayName: dpName\n\t\t\t}).then(function() {\n//\t\t\t\tconsole.log(\"Update display Name successful.\");\n\t\t\t}).catch(function(error) {\n\t\t\t\tconsole.log(\"Update display Name not successful.\");\n\t\t\t});\n\t\t}\n\t});\t\n\t\n\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\t\n\t\tif (user){\n\t\t\tvar uid = firebase.auth().currentUser.uid;\n//\t\t\tconsole.log(\"User ID\" + uid);\t\t\t\n\t\t\t\tdb.collection(\"Users\").doc(uid).set({\n\t\t\t\temail: email,\n\t\t\t\tdisplayName: dpName,\n\t\t\t\thair: \"hair1\",\n\t\t\t\tbody: \"shirt1\",\n\t\t\t\thairColor: \"0x002aff\",\n\t\t\t\tskin: \"0xdc9556\",\n\t\t\t\tscores: 0\n\t\t\t}).then(function() {\n//\t\t\t\tconsole.log(\"Document successfully written on db !\");\n\t\t\t}).catch(function(error){\n\t\t\t\tconsole.log(\"Document is not successfully written on db !\",error); \n\t\t\t});\t\n\t\t\t\n\t\t\tsetTimeout(function() {\n\t\t\t\twindow.location.href = \"login.html\"}, 200);\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "c7c8b4ef49dd698d41b8b517c71f48ee", "score": "0.65840906", "text": "function onHtmlLoaded(){\n \n var submit = $('#signup_btn'); //get submit button\n \n submit.on('click',signUp); //attach click event to submit button\n \n}//END onHtmlLoaded function", "title": "" }, { "docid": "e6d21748d4a29ba6b6fdd482bfd7105b", "score": "0.6581814", "text": "function handleSignUp() {\n var email = document.getElementById('signup-form-email').value;\n var password = document.getElementById('signup-form-password').value;\n\n if (email.length < 1) {\n alert('Please enter a valid email.');\n return;\n }\n if (password.length < 1) {\n alert('Please enter a stronger password.');\n return;\n }\n firebase.auth().createUserWithEmailAndPassword(email, password)\n .then(function () {\n //success\n window.location.href = 'index.html'\n }).catch(function (error) {\n alert(error.message);\n })\n}", "title": "" }, { "docid": "4d277dd035352efcfce43a9a68de19e6", "score": "0.65817404", "text": "function displaySignup() {\r\n showLogin(false);\r\n }", "title": "" }, { "docid": "d09294864f92127c88b30fb52824da51", "score": "0.6562873", "text": "function Signup(userInfo){\n var user = new Parse.User();\n // set the properties of the user\n user.set(\"username\", \"[email protected]\");\n user.set(\"password\", \"singh\");\n user.set(\"email\", \"[email protected]\");\n user.set(\"usertype\", userType);\n // Create a custom field for the user (there is no limit to the number of custom records)\n user.set(\"score\", 0);\n user.signUp(null, {\n success: function(user) {\n // return the success response\n console.log(\"Success!\");\n $(\"#divLogin\").hide();\n $(\"#divUserType\").hide();\n $(\"#divHome\").show();\n $(\"#divName\").html(userInfo.displayName);\n },\n error: function(user, error) {\n // return the error response\n console.log(\"Error: \" + error.code + \" \" + error.message);\n }\n });\n \n }", "title": "" }, { "docid": "cfefda85e7c57f3fcfb38b37a57fa56d", "score": "0.6562303", "text": "function signUpForm(event) {\r\n if(event){ event.preventDefault(); }\r\n form.style.opacity = \"0\";\r\n setTimeout(function(){\r\n getElById('username').value = \"\";\r\n getElById('password').value = \"\";\r\n signUpDOM = true;\r\n h2.textContent = \"Sign Up\";\r\n message.className = \"hidden\";\r\n btn.textContent = \"Submit\";\r\n getElById('sign-up-text').innerHTML = \"Already have an account?&nbsp;\";\r\n signUp.textContent = \"Log In\";\r\n form.style.opacity = \"1\"; \r\n signUp.id = \"log-in\"; \r\n bindEvents();\r\n }, 500);\r\n }", "title": "" }, { "docid": "260cd2cf1f663e63e1d409c549d32357", "score": "0.6559635", "text": "function signUpUser(email, password, username) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n username: username\n }).then(function (data) {\n window.location.replace(data);\n // If there's an error, handle it by throwing up a bootstrap alert\n }).catch(handleLoginErr);\n }", "title": "" }, { "docid": "c9cdf7d22718565640c0dc6e46f0b04c", "score": "0.6558956", "text": "function signUpUser(first_name, last_name, username, email, password, position, start_date, ind_start_date, school, degree, certifications, photo) {\n $.post(\"/api/signup\", {\n first_name: first_name,\n last_name: last_name,\n username: username,\n email: email,\n password: password,\n position: position,\n start_date: start_date,\n ind_start_date: ind_start_date,\n school: school,\n degree: degree,\n certifications: certifications,\n photo: photo\n }).then(function(data) {\n window.location.replace(data);\n // If there's an error, handle it by throwing up a bootstrap alert\n }).catch(handleLoginErr);\n }", "title": "" }, { "docid": "dd936aebbf2566ddceaa00b1567fb0d6", "score": "0.6558822", "text": "function performRegistration() {\n\tpreloader(1);\n\t// get the user credentials from the UI\n\tvar username = $(\"#signup-username\").val();\n\tvar password = $(\"#signup-password\").val();\n\t// create the user\n\ttry {\n\t\tvar user = KiiUser.userWithUsername(username, password);\n\n\t\t// perform the asynchronous registration, with callbacks defined\n\t\tuser.register({\n\t\t\n\t\t\t// callback for successful registration\n\t\t\tsuccess: function(theAuthedUser) {\n\t\t\t\t\n\t\t\t\t// tell the console\n\t\t\t\tKii.logger(\"User registered: \" + theAuthedUser);\n\t\t\t\t//$(\".responseMessage.signup\").html(\"User registered: \" + theAuthedUser['_uuid']);\n\t\t\t\tconsole.log(theAuthedUser);\n\t\t\t\tUUID = theAuthedUser['_uuid'];\n\t\t\t\tcreateContact(\"\",\"\",\"\"); //telephone,name,email\n\t\t\t\tcreateUserSettings(\"\");//notification\n\t\t\t\tgetUserHouses();\n\t\t\t\t$(\".signupForm, .loginForm\").fadeOut();\n\t\t\t\tpreloader(0);\n\t\t\t\t\n\t\t\t},\n\t\t\t// callback for failed registration\n\t\t\tfailure: function(theUser, anErrorString) {\n\t\t\t\t// tell the user\n\t\t\t\t$(\".responseMessage.signup\").html(\"Unable to register user: \" + anErrorString);\n\t\t\t\t// tell the console\n\t\t\t\tKii.logger(\"Unable to register user: \" + anErrorString);\n\t\t\t\tpreloader(0);\n\t\t\t}\n\t\t});\n\t} catch(e) {\n\t\t// tell the user\n\t\t$(\".responseMessage.signup\").html(\"Unable to register user: \" + e.message);\n\t\t// tell the console\n\t\tKii.logger(\"Unable to register user: \" + e.message);\n\t\tpreloader(0);\n\t}\n}", "title": "" }, { "docid": "a4dc7f2b2a69ef0c32f44b9dcab39d22", "score": "0.6554836", "text": "handleSubmit(event) {\n event.preventDefault();\n if (this.isFormValid()) {\n const { user } = this.state;\n this.props.registerUser(user);\n } else {\n shakeButton('signup-button');\n }\n }", "title": "" }, { "docid": "db91410edc3a4b80031483243db92d2b", "score": "0.6541332", "text": "function handleSignUp() {\n const email = document.getElementById('reg-email').value;\n const password = document.getElementById('reg-pwd').value;\n \n // Confirm pwd and user\n if (email.length < 4) {\n // RAF, style alert msg\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n // RAF, style alert msg\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and password --------------------------\n firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION);\n firebase.auth().createUserWithEmailAndPassword(email, password)\n .then((user) => {\n // Register user for the first time\n var user = firebase.auth().currentUser;\n registerUser(user);\n }, (error) => {\n // Handle Errors here.\n const errorCode = error.code;\n const errorMessage = error.message;\n\n if (errorCode == 'auth/weak-password') {\n // RAF, style alert msg\n alert('The password is too weak.');\n } else if (errorCode == 'auth/invalid-email') {\n // RAF, style alert msg\n alert('Invalid email format.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n });\n}", "title": "" }, { "docid": "cf93fefcaa02e747b55a86e36871be2d", "score": "0.65295416", "text": "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n name: newUser.name,\n email: newUser.email,\n password: newUser.password,\n accessLevel: 1,\n geoLat: newUser.ourLat,\n geoLong: newUser.ourLong\n }).then(function (data) {\n window.location.replace(\"/members\");\n // If there 's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "c099449820a2a5662281d71113a72bcb", "score": "0.65270364", "text": "function switchToSignUp(){\n updateFormState(()=> ({...formState, formType:\"signUp\"}))\n }", "title": "" }, { "docid": "9b7717330605fe4cdad79eb6419a27d3", "score": "0.652582", "text": "function signUpClick(e) {\n var password1 = passwordSignUpInput1.val().trim();\n var password2 = passwordSignUpInput2.val().trim();\n\n var email = emailSignUpInput.val().trim();\n\n // validate the given email address to see if it is a valid email\n if (validateEmail(email)) {\n\n if (password1 === password2 && password1.length > 3) {\n e.preventDefault();\n var password = password1;\n var email = emailSignUpInput.val().trim();\n var password1 = passwordSignUpInput1.val().trim();\n var password2 = passwordSignUpInput2.val().trim();\n\n var signUpObject = {\n email: email,\n password: password\n };\n\n // prepare currentURL string\n var currentURL = window.location.origin;\n //console.log(signUpObject);\n\n //ajax post to database to save users email and pass\n $.ajax({\n type: \"POST\",\n url: currentURL + \"/create\",\n data: signUpObject\n })\n .done(function (data) {\n //console.log(data)\n if (data) {\n\n var name = data.user_name;\n\n // update DOM with current user login status and change this DOM element to perform a signout function\n var logText = $(\"#logText\");\n logText.attr(\"onclick\", \"signOut()\");\n logText.text(\"Logged in as: \" + name);\n\n // Emptied the localStorage\n localStorage.clear();\n // Store all content into localStorage\n localStorage.setItem(\"userID\", data.result);\n localStorage.setItem(\"userName\", data.user_name);\n localStorage.setItem(\"admin\", data.admin);\n\n // close the overlay\n closeNav();\n\n // close any open modals\n $(\".modal\").modal(\"close\");\n }\n });\n\n emailSignUpInput.val(\"\");\n passwordSignUpInput1.val(\"\");\n passwordSignUpInput2.val(\"\");\n } else if (password1.length <= 3) {\n alertify.error(\"Your password must be four characters or longer.\");\n } else {\n alertify.error(\"Your passwords do not match.\");\n }\n }\n }", "title": "" }, { "docid": "cfc8a788c3f89ab18bd7ba5dbb18bd0d", "score": "0.6521281", "text": "function signup() {\n var signupFirstname = document.getElementById(\"signupFirstname\").value;\n var signupLastname = document.getElementById(\"signupLastname\").value;\n var signupUser = document.getElementById(\"signupUser\").value;\n var signupPassword = document.getElementById(\"signupPassword\").value;\n\n var name = signupFirstname + \" \" + signupLastname;\n var username = signupUser.toLowerCase();\n var password = signupPassword;\n\n if (name.length <= 1 || name === undefined || name === null) {\n alert(\"Name too short\");\n return;\n }\n if (username.length <= 1 || username === undefined || username === null) {\n alert(\"Username too short\");\n return;\n } \n if (password.length <= 1 || password === undefined || password === null) {\n alert(\"Password too short\");\n return;\n }\n\n let newUser = CreateAndPushUser(name, username, password);\n\n loginMenu();\n document.getElementById(\"username\").value = username;\n \n}", "title": "" }, { "docid": "91b9595b2087c851ba992cc94ae33e28", "score": "0.65099204", "text": "function sign_up() {\n alert(\"Hi sign_up\");\n \n}", "title": "" }, { "docid": "f07faed6378ae2ba4d1beab3e4ec63f9", "score": "0.65083647", "text": "signup() {\n this.setState({\n // When waiting for the firebase server show the loading indicator.\n loading: true\n });\n\n // Make a call to firebase to create a new user.\n this.props.firebaseApp.auth().createUserWithEmailAndPassword(\n this.state.email,\n this.state.password).then(() => {\n // then and catch are methods that we call on the Promise returned from\n // createUserWithEmailAndPassword\n alert('Your account was created!');\n this.setState({\n // Clear out the fields when the user logs in and hide the progress indicator.\n email: '',\n password: '',\n loading: false\n });\n this.props.navigator.push({\n component: Login\n });\n }).catch((error) => {\n // Leave the fields filled when an error occurs and hide the progress indicator.\n this.setState({\n loading: false\n });\n alert(\"Account creation failed: \" + error.message );\n });\n }", "title": "" }, { "docid": "d208c2502faee867ee8200cf5cd81b63", "score": "0.65080655", "text": "signup() {\n this.setState({\n // When waiting for the firebase server show the loading indicator.\n loading: true\n });\n\n // Make a call to firebase to create a new user.\n this.props.firebaseApp.auth().createUserWithEmailAndPassword(\n this.state.email,\n this.state.password).then(() => {\n // then and catch are methods that we call on the Promise returned from\n // createUserWithEmailAndPassword\n alert('Your account was created!');\n this.setState({\n // Clear out the fields when the user logs in and hide the progress indicator.\n email: '',\n password: '',\n loading: false\n });\n this.props.navigator.push({\n component: Login\n });\n }).catch((error) => {\n // Leave the fields filled when an error occurs and hide the progress indicator.\n this.setState({\n loading: false\n });\n alert(\"Account creation failed: \" + error.message);\n });\n }", "title": "" } ]
43ef3c1bcc531a85b7bffe44402af3d4
Write a function called hasFavoriteEditor which returns a boolean if any of the users have the editor passed in
[ { "docid": "140e20c4ae47ba40c243882e801b6af0", "score": "0.8758118", "text": "function hasFavoriteEditor(editor){\n return users.some(function(el){\n return el.favoriteEditor === editor\n });\n}", "title": "" } ]
[ { "docid": "032fdf211dbcd78182efb73f605bd1cd", "score": "0.63596547", "text": "function LIBERTAS_editor_registered(editor){\n\tvar found = false;\n\tfor(i=0;i<libertas_editors.length;i++){\n\t\tif (libertas_editors[i] == editor){\n\t\t\tfound = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn(found);\n}", "title": "" }, { "docid": "7749a8ca13842c32e9bddb846b01f36b", "score": "0.62584794", "text": "function editorCheck(){\n return new Promise((resolve, reject)=>{\n // First check if user is logged in\n if(!req.isAuthenticated()){\n resolve(false);\n // If user role = Editor || Admin\n // let editAllow = true; \n } else if (req.user.role === \"Administrator\" || req.user.role === \"Editor\"){\n resolve(true);\n // if the user is any other role \n } else {\n resolve(false);\n }\n });\n }", "title": "" }, { "docid": "0483e8d9ccef532023fd37a3385a6399", "score": "0.6211237", "text": "function checkForFavorite(story) {\n let favoritesIDs = currentUser.favorites.map(story => story.storyId);\n if (favoritesIDs.includes(story.storyId)) {\n console.log('checkForFavorite', true);\n return true;\n }\n console.log('checkForFavorite', false)\n return false;\n}", "title": "" }, { "docid": "a8797f172f18869725be253211dd9b9f", "score": "0.59640896", "text": "function isUsersFavorite(storyId) {\n const idList = [];\n\n // First check if user is logged in\n if (currentUser) {\n for (let favorite of currentUser.favorites) {\n idList.push(favorite.storyId);\n }\n }\n return idList.includes(storyId);\n }", "title": "" }, { "docid": "f80551590b0c74c14fd12eb5fde78063", "score": "0.5913369", "text": "isStoryInUserFavorites(targetStoryId) {\n // if user is not defined yet, return false\n if (this.user.name === undefined) {\n return false;\n }\n // finds the index of the storyObj in the favorites array that matches targetStoryId\n const storyObjIndex = this.user.favorites.findIndex(storyObj => {\n return storyObj.storyId === +targetStoryId;\n });\n // if targetStoryId is not found in favoriteStories, return false, otherwise true\n if (storyObjIndex === -1) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "e36de1402b71df9d8afdb0c86b097cef", "score": "0.58305764", "text": "isFavorite(place) {\n const favorites = this.state.favorites;\n for (let i = 0; i < favorites.length; i++) {\n if (favorites[i].place === place) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "fdebcea7d2c9248051ddf202c0f8b279", "score": "0.58257896", "text": "function isFavorite(story) {\n let favStoryIds = new Set();\n if (user) {\n favStoryIds = new Set(user.favorites.map(obj => obj.storyId));\n }\n return favStoryIds.has(story.storyId);\n }", "title": "" }, { "docid": "fdebcea7d2c9248051ddf202c0f8b279", "score": "0.58257896", "text": "function isFavorite(story) {\n let favStoryIds = new Set();\n if (user) {\n favStoryIds = new Set(user.favorites.map(obj => obj.storyId));\n }\n return favStoryIds.has(story.storyId);\n }", "title": "" }, { "docid": "6183006fa4bd33704d86521621d4c6a4", "score": "0.5801286", "text": "function inFavoriteUser(data, id) {\n if(data != null)\n {\n for(var i = 0; i < data.length; i++) {\n if( data[ i].idArticle == id )\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "131dd86f5bff9a3dee68a824d7fc94c1", "score": "0.5694918", "text": "async function isFavorited() {\n const favorites = await getFavorites();\n return favorites.includes(props.pokemonId);\n }", "title": "" }, { "docid": "00b379e9edf67955cd90356f41730248", "score": "0.5636172", "text": "function isMyFavorite(gameTitle) { \n var isFav = false;\n \n favoriteArr = JSON.parse(localStorage.getItem('myFavoriteGames'));\n\n if(!favoriteArr) {return isFav; }\n for (var i = 0; i < favoriteArr.length; i++) { \n if(gameTitle !== favoriteArr[i])\n { // Do nothing \n } else { \n isFav = true;\n }\n }\n\n return isFav;\n}", "title": "" }, { "docid": "0e25344b266ad4c81e884768b26761b3", "score": "0.559519", "text": "userCanRequestReview() {\n return (this.user &&\n (this.user.can_edit_all ||\n this.user.editable_features.includes(this.feature.id)));\n }", "title": "" }, { "docid": "dd2a1ad244cd649ca9918370cd7bda8c", "score": "0.5577696", "text": "function isDownloadble(fileId) {\r\n var editors = DriveApp.getFileById(fileId).getEditors();\r\n var owner = DriveApp.getFileById(fileId).getOwner();\r\n var okDownload = false;\r\n for (var i = 0; i < editors.length; i++) {\r\n if (editors[i].getEmail() == Session.getActiveUser().getEmail()) okDownload = true;\r\n }\r\n if (owner.getEmail() == Session.getActiveUser().getEmail()) okDownload = true;\r\n return okDownload;\r\n}", "title": "" }, { "docid": "c8127c610032c8af50a1fcffca5dcfde", "score": "0.5506972", "text": "function findAuthor() {\n let userFavoriteAuthor = inputFavoriteAuthor.value;\n let bError = true;\n for (let i = 0; i < authorArray.length; i++) {\n if (userFavoriteAuthor == authorArray[i]) {\n bError = false;\n break;\n }\n }\n return bError\n}", "title": "" }, { "docid": "e4f7ba2cc06379827b9c0adc8dba9b46", "score": "0.55061305", "text": "function isItemFavorite(item){\n for (var i=0; i < self.favorites.length; i++) {\n if (self.favorites[i].name === item.name) {\n return true;\n }\n }\n }", "title": "" }, { "docid": "f8538fe4854aedfc205ebf5b5e624256", "score": "0.5492452", "text": "function check(fav) {\n return fav.equals(user._id);\n }", "title": "" }, { "docid": "9a174fa81199a634ed67d1547e0ec349", "score": "0.54870605", "text": "function checkFavorites() {\n var currentFavorites = JSON.parse(localStorage.getItem(favoritesLocalStorageName));\n\n if (currentFavorites) {\n currentFavorites.forEach(function (articleId) {\n changeFavoriteIcon(articleId, true);\n }); \n }\n }", "title": "" }, { "docid": "c884346fd545ba5061b557234c88bc0a", "score": "0.54778135", "text": "inFavorites(toCheck) {\n\n\t\tvar favorites = this.state.favorites;\n\n\t\tfor (var i = 0; i < favorites.length; i++) {\n\t if (favorites[i].address == toCheck) {\n\t return true;\n\t }\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "bfb2b3f89019a9ce4d9dac7ad24fdc72", "score": "0.54753315", "text": "function isEditor(req, res, next) {\n const us = db.get('editors').find({email: req.email}).value();\n console.log(us);\n if (us) {\n console.log('isEditor');\n req.isEditor = true;\n return next();\n } else {\n console.log('notEditor');\n req.isEditor = false;\n return next(new Error('forbidden'));\n }\n}", "title": "" }, { "docid": "1e50fab05df44d418abec794b8ac5ef2", "score": "0.5419644", "text": "function checkIfStoryIsFavorited(evt){\n console.log(\"$allStoriesList is\", $allStoriesList, evt.target)\n // (evt.target.classList.contains(\"far\")) ? {addStoryToFavorites(evt) : deleteStoryFromFavorites(evt);\n}", "title": "" }, { "docid": "b61d42847f251f4c6e027e48dd2b366e", "score": "0.540593", "text": "function recommendationSelected(recommendations) {\n if (!recommendations) {\n return false;\n }\n return recommendations.some((recommendation) => recommendation.selected);\n}", "title": "" }, { "docid": "9ddb70388bbd2647d429c2baca7c24b8", "score": "0.5402291", "text": "starred() {\n const user = Profiles.findOne({ username: Meteor.user().profile.name });\n if (user) {\n return user.saved.includes(Session.get('clickedEventId'));\n }\n return null;\n }", "title": "" }, { "docid": "f0a6712ef63d69e2a8996fb9fca4026d", "score": "0.5391376", "text": "function _isFavorite(id) {\n _favGifs = localStorage.getItem(\"favorites\") ? JSON.parse(localStorage.getItem(\"favorites\")) : [];\n\n return _favGifs.includes(id) ? true : false;\n }", "title": "" }, { "docid": "83d9cee734ee63e7c0a7e34414710066", "score": "0.53580505", "text": "function isInEditMode() {\n return $(\".uudcc-bricks-toolbar\").length > 0;\n }", "title": "" }, { "docid": "6eaaa8c0f622604490bb6ac50f22bb78", "score": "0.5351934", "text": "fireEditorChanged() {\n var editor = atom.workspace.getActiveTextEditor();\n if (editor) {\n var yourPath = editor[\"getPath\"]();\n let projects = atom.project['getPaths']();\n if (projects == undefined || projects.length == 0) {\n return false;\n }\n let i = 0;\n let currentProjectPath;\n for (i = 0; i < projects.length; i++) {\n if (yourPath && yourPath.indexOf(projects[i]) == 0) {\n currentProjectPath = projects[i];\n if (!this.currentProjectPath || currentProjectPath != this.currentProjectPath) {\n this.fireProjectChanged(currentProjectPath);\n }\n break;\n }\n }\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "4c51698d9ff679d304fd85f5598fdf22", "score": "0.5350019", "text": "function is_yellow_pencil() {\n\n if ($(\"body\").hasClass(\"yp-yellow-pencil\")) {\n\n return true;\n\n } else {\n\n if ($(document).find(\".yp-select-bar\").length > 0) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n\n }\n\n }", "title": "" }, { "docid": "668c5b547ad43b5155b6ba19632c4385", "score": "0.532475", "text": "function checkDraft() {\n if (typeof (Storage) !== 'undefined' && localStorage.getItem('ufdraft') != null) {\n thisEditorDraft.addClass('show');\n return true;\n } else {\n thisEditorDraft.removeClass('show');\n return false;\n }\n }", "title": "" }, { "docid": "68ecd9b970200591786b4d2740d1744d", "score": "0.52827364", "text": "function getMarked(postid) {\n const allfaves = getFaves();\n const marked = allfaves.some(f => f.id == postid); // some function returns a boolean. If id is in localStorage it is true else it is false\n if (marked) { // if marked is true\n $(\"#favourite\").hide();\n $(\"#favourited\").show();\n } else { // if it is false\n $(\"#favourite\").show();\n $(\"#favourited\").hide();\n }\n }", "title": "" }, { "docid": "5a476e5519881542107ded73466cd99f", "score": "0.526566", "text": "get isFavorited() {\n if (!this.$filled) {\n return null;\n }\n return Boolean(this.payload.is_favorite);\n }", "title": "" }, { "docid": "5a476e5519881542107ded73466cd99f", "score": "0.526566", "text": "get isFavorited() {\n if (!this.$filled) {\n return null;\n }\n return Boolean(this.payload.is_favorite);\n }", "title": "" }, { "docid": "5a476e5519881542107ded73466cd99f", "score": "0.526566", "text": "get isFavorited() {\n if (!this.$filled) {\n return null;\n }\n return Boolean(this.payload.is_favorite);\n }", "title": "" }, { "docid": "831ab69af8c3273b7a4540066f663f57", "score": "0.5250386", "text": "function moreEditors() {\n\tvar editors = document.getElementById('editorlist').getElementsByClassName(\"editor\");\n\tvar count =0;\n\tfor(var i=0;i<3;i++)\n\t{\n\t\tif(editors[i].dataset.chosen == \"false\")\n\t\t\tcount++;\n\t}\t\n\tgetEditors(count);\n}", "title": "" }, { "docid": "6a783cd3be76356424b97edb117a850d", "score": "0.5243004", "text": "static isEditable(stores, feature) {\n if (!feature.metadata) return false;\n if (!feature.metadata.storeId) return false;\n const store = find(stores, s => s.storeId === feature.metadata.storeId);\n return store.type === 'gpkg';\n }", "title": "" }, { "docid": "5ef3d3cec0fc86752abf83e2ec230d1f", "score": "0.5240474", "text": "function isSavedFood(){\n var favoriteID=currentFood.idMeal;\n\n for(var i=0; i<favoriteFoods.length; i++){\n if(favoriteFoods[i][0]==favoriteID){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "2ba8e1399bf57109b24cb381e76f1cd9", "score": "0.52382046", "text": "function showEditor(){\n return $scope.isEditing && !$scope.isCreating;\n }", "title": "" }, { "docid": "75512faa03f8086ac301c2aecd21dfa6", "score": "0.51746845", "text": "function isOwnInvite (args, done) {\n var seneca = this;\n var plugin = args.role;\n var userId = args.user.id;\n var inviteId = args.params.data.inviteToken;\n //Srsly, nice token system, you can\"t query by user, WTF.\n var dojoId = args.params.data.dojoId;\n var isOwn = {};\n\n seneca.make$('cd/dojos').load$(dojoId, function (err, dojo) {\n if (err) {\n seneca.log.error(seneca.customValidatorLogFormatter('cd-dojos', 'isOwnInvite', err, {userId: userId, inviteId: inviteId, dojoId: dojoId}));\n return done(null, {'allowed': false});\n }\n if (dojo.userInvites) {\n const invites = dojo.userInvites.map((invite) => ({\n id: invite.id,\n // Due to dojo saving overwriting invites, the email may be null\n email: invite.email ? invite.email.toLowerCase() : '',\n }));\n isOwn = _.find(invites, { id: inviteId, email: args.user.email.toLowerCase() });\n }\n isOwn = !_.isEmpty(isOwn)? true: false;\n return done(null, {'allowed': isOwn});\n });\n}", "title": "" }, { "docid": "6b5a1a38b13befd70e7f3030e8596787", "score": "0.5138901", "text": "function hasFavorites() {\n if (favsLength > 0) {\n return (<h1>Your Favorites! Don't wait too long to decide!</h1>);\n }\n else {\n return (<h1>You don't have any favorites yet.</h1>);\n }\n }", "title": "" }, { "docid": "1a6423343c4dd3ed6fac84f68c067cb4", "score": "0.51377976", "text": "function isBeingEdited(path, fileName){\n\tfor(i = 0; i < 20; i++){\n\t\tif(rooms[fileName][i] != \"*\" && rooms[fileName][i].type == \"EDITOR\"){\n\t\t\tprocess.stdout.write(fileName + \" is being edited by \" + rooms[fileName][i].sckt.id + \"\\n\");\n\t\t\treturn true;\n\t\t}\n\t}\n\tprocess.stdout.write(\"\\n\" +fileName + \" available for edit.\\n\");\n\treturn false;\n}", "title": "" }, { "docid": "30fdbe6a7c35e029012fc5ed46f2070a", "score": "0.5135045", "text": "function wasEdited() {\n return JSON.stringify({user: props.curUser, id: curId, filename: filename, title: title, intro: intro, program: xml}) !== lastSaved;\n }", "title": "" }, { "docid": "057158dc50ad8a8561f87016920307a4", "score": "0.5127955", "text": "function checkEdits() {\r\n\r\n //find out if the user has previously saved edits\r\n if(localStorage.userEdits!=null)\r\n document.getElementById(\"aboutM\").innerHTML = localStorage.userEdits;\r\n }", "title": "" }, { "docid": "9b68f2b9b37342eef31312c93d6da2ae", "score": "0.5114968", "text": "function userExists(users, observers) {\n return (\n users.map((user) => user[0]).includes(gameState.userName) ||\n observers.includes(gameState.userName)\n );\n}", "title": "" }, { "docid": "df76dd8e5db064a6df99687b0fa39b06", "score": "0.5103159", "text": "checkFav(newFav){\n for(fav of this.favorites){\n if(fav===newFav)return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "cca13bd5e227c6fdae6b74f6acc2c298", "score": "0.50939125", "text": "shouldPromptToSave({ windowCloseRequested, projectHasPaths } = {}) {\n if (\n windowCloseRequested &&\n projectHasPaths &&\n atom.stateStore.isConnected()\n ) {\n return this.buffer.isInConflict();\n } else {\n return this.isModified() && !this.buffer.hasMultipleEditors();\n }\n }", "title": "" }, { "docid": "923029e15d839c6f9b3051ae18098a7d", "score": "0.5071977", "text": "function saveFavoriteEnabled() {\n var unique = true;\n if(favorites) {\n favorites.forEach(function (f, i) {\n if (f.county == $('#__county').val() && f.lake == $('#__lake').val() && f.beach == $('#__beach').val() && f.site == $('#__site').val()) {\n unique = false;\n }\n });\n }\n $('#__addFavorite').prop('disabled',\n !unique ||\n $('#__county').val() === '' ||\n $('#__lake').val() === '' ||\n $('#__beach').val() === '' ||\n $('#__site').val() === '' ||\n submitted\n )\n}", "title": "" }, { "docid": "fae4dee3c1003d70a195ce3dd60ef214", "score": "0.5062245", "text": "function isMemeberOfAdmin(){\n\talert(inline_editing.currentUserIsMemberOf(\"admins\") ? \"yes\" : \"no\");\n\treturn false;\n}", "title": "" }, { "docid": "7805c98f50f44cf63efb5c48dc1a1a68", "score": "0.5057783", "text": "function canEdit(user) {\n\treturn privs.hasPriv(user.privs, privs.POST_NEWS);\n}", "title": "" }, { "docid": "5b80f8176dd768b04e40caf31b25b521", "score": "0.50248396", "text": "static async isFav(word, session) {\n let isFavourited = false;\n\n try {\n if(session && session.get('authenticated') && \n session.get('user') && session.get('user').uid &&\n session.get('user').uid.length > 0) {\n\n let snapShot = await firestore()\n .collection('FavWord')\n .where('userId', '==', session.get('user').uid) // only get the FavWord record belong to the user\n .where('word', '==', word.toLowerCase())\n .get();\n\n isFavourited = snapShot.docs && snapShot.docs.length > 0;\n }\n } catch(error) {\n isFavourited = false;\n }\n return isFavourited;\n }", "title": "" }, { "docid": "b713ec492f743eb30ef76b9599b2e366", "score": "0.5010754", "text": "hasPreviewProperty(name) {\n const { preview } = this;\n if (preview === null) {\n return false;\n }\n return name in preview;\n }", "title": "" }, { "docid": "f499a635f3d302d811eee55993a0b868", "score": "0.49868697", "text": "function checkFavoriteStatus() {\n\n}", "title": "" }, { "docid": "b25cbcbe1c95625152b3eadccc934898", "score": "0.4985382", "text": "shouldFormatTextEditor(editor) {\n return (\n this.hasElixirGrammar(editor) &&\n settings.shouldFormatOnSave() &&\n settings.isPackageEnabled()\n );\n }", "title": "" }, { "docid": "8ddacecd746928d74adb6c4c77b76ced", "score": "0.49791628", "text": "function recommendEnterprise() {\n return selected.length === 6 && !jQuery(\".enterprise-recommend\").length;\n}", "title": "" }, { "docid": "0c14366d9eeb162426bfbc2a6a4bc278", "score": "0.4974782", "text": "function isInFavourites(name) {\n\n\tvar result = false;\n\tif (name != null && name != \"\" & favouritesArray != null) {\n\n\t\tfor (var i = 0; i < favouritesArray.length; i++ ) {\n\t\t\tif (favouritesArray[i] == name) {\n\t\t\t\tresult = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "ef78884e305c63908dbb5c4e1554f45a", "score": "0.49473968", "text": "static isRestaurantFavorite(favoriteVal) {\r\n if (favoriteVal) {\r\n return String(favoriteVal) === 'true' ? true : false;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "ceb9df77b67f55ebc5628ce41b706ba0", "score": "0.4929107", "text": "function isUserAnOrganizer() {\n if (sessionStorage.getItem(\"organizerKey\") === sessionStorage.getItem(\"userkey\") && sessionStorage.getItem(\"userkey\") != null) {\n console.log(\"An Organizer is logged in\");\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "a3560c86f62d5c84a73833dffb7cd7c8", "score": "0.4912448", "text": "function isAthlete() {\n return getUserEmail().endsWith('@mit.edu');\n}", "title": "" }, { "docid": "cdf2f54bb4ee703630abdcc2508465a2", "score": "0.49123698", "text": "starred(id) {\n const user = Profiles.findOne({ username: Meteor.user().profile.name });\n if (user) {\n return user.saved.includes(id);\n }\n return null;\n }", "title": "" }, { "docid": "128a445339c329b3beadcad74cb08fca", "score": "0.49010247", "text": "async isEmployer(userId) {\n const manageIds = await this.api.query(\"manage\", {\"manager\": userId});\n return manageIds.length > 0;\n }", "title": "" }, { "docid": "2d67f9a7967f37636dbb97b17215b931", "score": "0.48993105", "text": "containsLearningWithUser(learnings, user) {\n var containsLearningCreatedByUser = false;\n _.forEach(learnings, learning => {\n if (learning._creator === user) {\n containsLearningCreatedByUser = true;\n }\n if (_.includes(learning.usersTagged, user)) {\n containsLearningCreatedByUser = true;\n }\n });\n return containsLearningCreatedByUser;\n }", "title": "" }, { "docid": "a3c54b3eefa94fb45d577fc76841fe64", "score": "0.48869544", "text": "function checkIsCurrentUserVerifier(verifiers) {\n return verifiers\n .filter(function (verifier) {\n return verifier.email === GGRC.current_user.email;\n }).length;\n }", "title": "" }, { "docid": "6486ab6ba1024d5f5978ca5237186aa4", "score": "0.4861933", "text": "function checkcanEdit(filePath) {\n var ext = path.extname(filePath),\n keepers = ['.html', '.xml'];\n return keepers.includes(ext);\n}", "title": "" }, { "docid": "feff278ff73ab894db5ad5d0451139d4", "score": "0.48596087", "text": "isOwner() {\n const user = Meteor.user();\n const event = Events.findOne({ _id: Session.get('clickedEventId') });\n if (user && event) {\n return user.profile.name === event.organizer;\n }\n return false;\n }", "title": "" }, { "docid": "3db5ecf0d12bf012d7158f47bde095ac", "score": "0.48585925", "text": "function checkAvailability(){\n return !allUsers.some(user => user.username == document.getElementById(\"username\").value);\n}", "title": "" }, { "docid": "62d7067f58d7dfaa3c834dfcfa96a52b", "score": "0.4847712", "text": "function getEditors(){\n return _editors;\n }", "title": "" }, { "docid": "62d7067f58d7dfaa3c834dfcfa96a52b", "score": "0.4847712", "text": "function getEditors(){\n return _editors;\n }", "title": "" }, { "docid": "0258328727d51dfa110931ded4009c55", "score": "0.48359394", "text": "function favouriteToggle() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n //Reads from the database to find out what the current pages are\n db.collection(\"users\").doc(user.uid).collection(\"current\")\n .doc(\"currentPages\")\n .get()\n .then(function (doc) {\n let currentPostID = doc.data().currentPost;\n //Checks if the item is already in the favorites\n db.collection(\"users\").doc(user.uid).collection(\"favorites\")\n .doc(`${currentPostID}`)\n .get()\n .then(function (doc) {\n if (doc.exists) {\n var fav = document.getElementById(\"favorite\");\n $(fav).children(\"i\").css({\n \"color\": \"#0F222D\"\n });\n $(fav).css({\n \"background-color\": \"#FFF5D0\"\n });\n } else {\n var fav = document.getElementById(\"favorite\");\n $(fav).children(\"i\").css({\n \"color\": \"#FFF5D0\"\n });\n $(fav).css({\n \"background-color\": \"#0F222D\"\n });\n }\n })\n });\n } else {}\n });\n}", "title": "" }, { "docid": "e2408154cbc6bc20ce46a056a5fefda0", "score": "0.4814708", "text": "function reacted(reaction) {\n //not found in reated means it didn't react to emote\n if (!props.currentUserInfo) return;\n if (post.reacted === undefined || post.reacted[props.currentUserInfo.username] === undefined) {\n return false;\n } else {\n //reacted if current is same as reacted emote\n return (post.reacted[props.currentUserInfo.username] === reaction);\n }\n }", "title": "" }, { "docid": "48947b553dd524bb73f952294ca24637", "score": "0.48050126", "text": "hasUserScopes() {\n if (!this.scopes) {\n return false;\n }\n return this.scopes.length > 0;\n }", "title": "" }, { "docid": "dbcfea1c440ea26158b8587de9cc4f91", "score": "0.47990063", "text": "function hasFeatured(issuers) {\n for (var i in issuers) {\n if (issuers[i].featured) return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "8df5d55cd5b107fe733ca964c4901b6c", "score": "0.47860986", "text": "function isWritable(comp){\n if(!user) return false;\n if(user.isAdmin) return true;\n var compModerators = _.pluck(comp.moderators, 'id');\n return !!~compModerators.indexOf(user.id);\n }", "title": "" }, { "docid": "7dc3fc567fae62990e88b578789aa962", "score": "0.47811955", "text": "function checkPreferences() {\n for (var i = 0; i < prefCounter; ++i) {\n var text = $(\"#pref_\" + i).text();\n if (text == \"Add Preference\" || text == '') {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "05a24142dba1a169ac401ba0274b863e", "score": "0.47781977", "text": "function makeBook(editor){\n $(\"#message\").html(\"\");\n if(editor === \"novel_editor\") {\n return novelValidate();\n } else if(editor === \"anthologie_editor\") {\n return anthologieValidate();\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "af52949f6981704e741d53477a2283e4", "score": "0.47776252", "text": "mentionsUser (user) {\n\t\tconst mentionedUserIds = this.get('mentionedUserIds') || [];\n\t\treturn mentionedUserIds.includes(user.id);\n\t}", "title": "" }, { "docid": "9b93bf0830ec518d3d5d5e41819c9a56", "score": "0.47712737", "text": "function z_engine_tweet_mentioned(entities)\n{\n\tvar mentioned = false;\n\tif (entities.user_mentions.length > 0)\n\t{\n\t\tfor (var mention = entities.user_mentions.length; mention--;)\n\t\t{\n\t\t\tif (entities.user_mentions[mention].screen_name === screen_name)\n\t\t\t{\n\t\t\t\tmentioned = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn mentioned;\n}", "title": "" }, { "docid": "73536a38125f321419735d559e02aa38", "score": "0.47709635", "text": "function z_engine_tweet_mentioned(entities)\n{\n\tvar mentioned = false;\n\tentities.user_mentions.uniq().each(function(item)\n\t{\n\t\tif (item.screen_name == screen_name)\n\t\t{\n\t\t\tmentioned = true;\n\t\t\t$break;\n\t\t}\n\t});\n\treturn mentioned;\n}", "title": "" }, { "docid": "917f3c99d09bbbda984ea7ccd7a0b479", "score": "0.47555235", "text": "function isAuthorized(id) {\n var user_list = SpreadsheetApp.openByUrl(GOOGLE_SHEET_URL).getSheetByName('users_list');\n var user_list_last = user_list.getLastRow();\n var user_ids = user_list.getRange(\"C2:C\" + user_list_last).getValues();\n if (+id == owner){\n return true\n }\n else {\n for (var i = 0; i < user_ids.length; i++) {\n if (+id == user_ids[i][0]){\n return true\n }\n }\n return false\n }\n}", "title": "" }, { "docid": "cbf5313bb2d01008ac20806b134d22bb", "score": "0.4722926", "text": "function userCanEdit(user, doc) {\n if (!tipe.isObject(user)) return false\n if (!tipe.isObject(doc)) return false\n return (user._id === doc._owner || util.adminId === user._id)\n}", "title": "" }, { "docid": "3b7bf08b389bd68138d0c954ac52ed11", "score": "0.47157922", "text": "function checkFavorites() {\n for (i=0; i<breweryFavorites.length; i++) {\n if(breweryId === breweryFavorites[i]) { //if the brewery is already in local storage, the button will say 'Favorite'\n console.log(\"running\")\n breweryFavBtn.textContent = \"Favorite\";\n var hearticon = document.createElement(\"img\");\n hearticon.setAttribute(\"id\",\"heart-icon\");\n hearticon.setAttribute(\"src\",\"../Images/heart-icon.png\")\n breweryFavBtn.appendChild(hearticon);\n var isFavorite = true\n } else {\n console.log(\"Id not in local storage\")\n isFavorite = false\n }\n }\n return isFavorite; //tells the function for the event listener that the brewery is a favorite\n}", "title": "" }, { "docid": "63448a33caf175cca4b638f65ffc1424", "score": "0.47111103", "text": "function isMentor() {\n return $localStorage.userData.id === $scope.training.trainer.id;\n }", "title": "" }, { "docid": "c4e2a923816967379d602398a2e6cb1d", "score": "0.46986046", "text": "get isDirty()\n {\n if (this._markedDirty === true) {\n return true;\n }\n return this.editors.some((editor) => {\n return editor.sourceEditor && editor.sourceEditor.dirty;\n });\n }", "title": "" }, { "docid": "9b4be810a6a4ae9da52264fd032dca4b", "score": "0.46954733", "text": "function hasPermissionUser(writeFlag, user, userId, cb) {\n\t\tcb((!writeFlag) || (user.id == userId)); // An User can read info about any other user, but can only edit its own.\n\t}", "title": "" }, { "docid": "9ad85a9f57a7432cd192015d85516cca", "score": "0.4689726", "text": "function inEditMode () {\n var url = document.URL;\n var components = url.split('?');\n if (components.length > 1) {\n var args = components[1].split('&');\n for (var i=0; i<args.length; i++) {\n var arg = args[i];\n var name = arg.split('=')[0];\n var value = \"\";\n if (arg.split('=').length > 1) {\n value = arg.split('=')[1];\n }\n if (name == 'o' && value == 'edit') {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "db70c74b4c8c3ea5533fb80644239644", "score": "0.4676426", "text": "function isUser(userList, username) {\n return username in userList;\n }", "title": "" }, { "docid": "d96a338886237de78a4fcd884d06c768", "score": "0.46736455", "text": "static get initializedEditors() {\n return new Set(this.editorData.keys())\n }", "title": "" }, { "docid": "d4c2e810e54d913ddd5bc8a22497150f", "score": "0.46728992", "text": "function isDialogueVisible(){\n\treturn minecordApp.addDialogContainer.classList.contains('visible') || minecordApp.setttingsDialogContainer.classList.contains('visible');\n}", "title": "" }, { "docid": "29c06ffb6087e9de64fbcc86683c6dd2", "score": "0.46723488", "text": "isFavorite (){\n return Gifs.isFavorite(this.currentGif.id).then(function(isFav){\n $('section.main').toggleClass('favorite', isFav);\n });\n }", "title": "" }, { "docid": "0ffbb8126f302bd62260d424462af830", "score": "0.46644616", "text": "function isEveryoneHere(obj) {\n let users = ['Ryan', 'Sarah', 'Jeff', 'Alan']\n for (let i = 0; i < users.length; i++){\n if(obj.hasOwnProperty(users[i])){\n return true\n } else {\n return false\n }\n }\n}", "title": "" }, { "docid": "97c5bfa038d0cdb06dce71a9a6d96bb0", "score": "0.46608174", "text": "function isStoredHistorySearch(){\n return Boolean(JSON.parse(window.localStorage.getItem('tweets')));\n }", "title": "" }, { "docid": "442cc70849c714cbc28b4a9488c08adf", "score": "0.46574336", "text": "has(id) {\n return this.active_selection.has(id) || this.temporary_selection.has(id);\n }", "title": "" }, { "docid": "6321c9634e63dd0a792be854a78c3bbd", "score": "0.4656438", "text": "function userIsEnrolled() {\n var enrolled = false\n $scope.users = $localStorage.users\n for(var i = 0; i < $scope.users.length; i++) {\n if(($scope.users[i].email === $scope.user.email) &&\n ($scope.users[i].password === $scope.user.password)){\n enrolled = true\n $scope.user = $scope.users[i]\n break;\n }\n }\n return enrolled\n }", "title": "" }, { "docid": "7f6d28c2e52bf570ece1f3a5093928c1", "score": "0.46540216", "text": "function obtainFavorites(product_id){\n\n for(var i = 0; i < favorites.length; i++)\n if(favorites[i].product_id === product_id && favorites[i].user_id === userIn)\n return true;\n return false;\n }", "title": "" }, { "docid": "bfc8116ebc32e71af5ad7d139b5866f5", "score": "0.46420398", "text": "isPreview() {\n return this.element.classList.contains('preview')\n }", "title": "" }, { "docid": "0ecf2b71e106c5acb566dadb2c75088b", "score": "0.46312007", "text": "function hasReview(location, reviews) {\n\tfor (var i = 0; i < reviews.length; i++) {\n\t\tvar review = reviews[i];\n\t\tif (review.name == location.name) {\n\t\t\treturn review\n\t\t}\n\t};\n\treturn false;\n}", "title": "" }, { "docid": "ca4a15966545f912739166bf872cbc9e", "score": "0.4619479", "text": "function highlightFavorites(user) {\n\t\tconst favoritesArray = user.favorites;\n\t\tif (favoritesArray.length != 0) {\n\t\t\tfor (let story of favoritesArray) {\n\t\t\t\tconst storyId = story.storyId;\n\t\t\t\t$(`#all-articles-list #${storyId} i`).removeClass('far').addClass('fas');\n\t\t\t\t$(`#favorited-articles #${storyId} i`).removeClass('far').addClass('fas');\n\t\t\t\t$(`#my-articles #${storyId} i`).removeClass('far').addClass('fas');\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7041608c89e77f6a3d42c370e7683204", "score": "0.46156445", "text": "findUserLike(likes){\n const {auth} = this.props;\n\n if(likes.filter(like => like.user === auth.user.id).length > 0){\n return true;\n } else {\n return false;\n }\n \n }", "title": "" }, { "docid": "305b4b629b513cc748a493c1a5909ba5", "score": "0.46154338", "text": "function favoriteBtn() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n //Reads from the database to find out what the current pages are\n db.collection(\"users\").doc(user.uid).collection(\"current\")\n .doc(\"currentPages\")\n .get()\n .then(function (doc) {\n let currentPostID = doc.data().currentPost;\n\n //Checks if the item is already in the favorites\n db.collection(\"users\").doc(user.uid).collection(\"favorites\")\n .doc(`${currentPostID}`)\n .get()\n .then(function (doc) {\n\n //changes the styling based on if the item is already favorited\n if (doc.exists) {\n var fav = document.getElementById(\"favorite\");\n $(fav).children(\"i\").css({\n \"color\": \"#FFF5D0\"\n });\n $(fav).css({\n \"background-color\": \"#0F222D\"\n });\n } else {\n var fav = document.getElementById(\"favorite\");\n $(fav).children(\"i\").css({\n \"color\": \"#0F222D\"\n });\n $(fav).css({\n \"background-color\": \"#FFF5D0\"\n });\n }\n })\n });\n } else {}\n });\n}", "title": "" }, { "docid": "b8207858aeceff502f70a61c23616125", "score": "0.46110246", "text": "function exists(name) {\r\n return name in users;\r\n}", "title": "" }, { "docid": "29067a1fecd4a38b3f91da0085e461f7", "score": "0.46103367", "text": "function checkCurrentUserGTA(userId, gtaSessions) {\n\t\tvar found = false;\n\n\t\t$.each(gtaSessions, function (idx, gta) {\n\t\t\tif (gta.value == userId) found = true;\n\t\t});\n\n\t\treturn found;\n\t}", "title": "" }, { "docid": "c80078aec4f0b5c316fa24046b064794", "score": "0.460469", "text": "function containsEditedFields(o) {\n var _a;\n return ((_a = o[symbols_1.editedProps]) === null || _a === void 0 ? void 0 : _a.length) > 0 ||\n Object.entries(o)\n .filter(([_, v]) => !isTerminalType(v) && v != null).some(([_, v]) => containsEditedFields(v));\n}", "title": "" }, { "docid": "747280b1c0e691ab3044517db8228931", "score": "0.4603343", "text": "userLiked(likes) {\r\n const { auth } = this.props;\r\n if (likes.filter(like => like.user === auth.user.id).length > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "b04d2675937c14f1cb7f8962cfd40963", "score": "0.45960948", "text": "userExists(user) {\n let index = this.users.indexOf(user);\n return index !== -1;\n }", "title": "" } ]
d7011bb68ed586cf2f1da29f917dd33f
It will remove resize/scroll events and won't recalculate popper position when they are triggered. It also won't trigger onUpdate callback anymore, unless you call `update` method manually.
[ { "docid": "9c9a4b6195c5120b0ed677be5f22b441", "score": "0.0", "text": "function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}", "title": "" } ]
[ { "docid": "03655f679df9523cfbd7e662f5bdb919", "score": "0.74321955", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var popperStyles = this.popper.style;\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[getSupportedPropertyName('transform')] = '';\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "2e75e25103b48b9d41036efc1cba8ef4", "score": "0.7408225", "text": "function update(){// if popper is destroyed, don't perform any further update\nif(this.state.isDestroyed){return;}var data={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:false,offsets:{}};// compute reference element offsets\ndata.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference,this.options.positionFixed);// compute auto placement, store placement inside the data object,\n// modifiers will be able to edit `placement` if needed\n// and refer to originalPlacement to know the original value\ndata.placement=computeAutoPlacement(this.options.placement,data.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);// store the computed placement inside `originalPlacement`\ndata.originalPlacement=data.placement;data.positionFixed=this.options.positionFixed;// compute the popper offsets\ndata.offsets.popper=getPopperOffsets(this.popper,data.offsets.reference,data.placement);data.offsets.popper.position=this.options.positionFixed?'fixed':'absolute';// run the modifiers\ndata=runModifiers(this.modifiers,data);// the first `update` will call `onCreate` callback\n// the other ones will call `onUpdate` callback\nif(!this.state.isCreated){this.state.isCreated=true;this.options.onCreate(data);}else{this.options.onUpdate(data);}}", "title": "" }, { "docid": "2e75e25103b48b9d41036efc1cba8ef4", "score": "0.7408225", "text": "function update(){// if popper is destroyed, don't perform any further update\nif(this.state.isDestroyed){return;}var data={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:false,offsets:{}};// compute reference element offsets\ndata.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference,this.options.positionFixed);// compute auto placement, store placement inside the data object,\n// modifiers will be able to edit `placement` if needed\n// and refer to originalPlacement to know the original value\ndata.placement=computeAutoPlacement(this.options.placement,data.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);// store the computed placement inside `originalPlacement`\ndata.originalPlacement=data.placement;data.positionFixed=this.options.positionFixed;// compute the popper offsets\ndata.offsets.popper=getPopperOffsets(this.popper,data.offsets.reference,data.placement);data.offsets.popper.position=this.options.positionFixed?'fixed':'absolute';// run the modifiers\ndata=runModifiers(this.modifiers,data);// the first `update` will call `onCreate` callback\n// the other ones will call `onUpdate` callback\nif(!this.state.isCreated){this.state.isCreated=true;this.options.onCreate(data);}else{this.options.onUpdate(data);}}", "title": "" }, { "docid": "2e75e25103b48b9d41036efc1cba8ef4", "score": "0.7408225", "text": "function update(){// if popper is destroyed, don't perform any further update\nif(this.state.isDestroyed){return;}var data={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:false,offsets:{}};// compute reference element offsets\ndata.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference,this.options.positionFixed);// compute auto placement, store placement inside the data object,\n// modifiers will be able to edit `placement` if needed\n// and refer to originalPlacement to know the original value\ndata.placement=computeAutoPlacement(this.options.placement,data.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);// store the computed placement inside `originalPlacement`\ndata.originalPlacement=data.placement;data.positionFixed=this.options.positionFixed;// compute the popper offsets\ndata.offsets.popper=getPopperOffsets(this.popper,data.offsets.reference,data.placement);data.offsets.popper.position=this.options.positionFixed?'fixed':'absolute';// run the modifiers\ndata=runModifiers(this.modifiers,data);// the first `update` will call `onCreate` callback\n// the other ones will call `onUpdate` callback\nif(!this.state.isCreated){this.state.isCreated=true;this.options.onCreate(data);}else{this.options.onUpdate(data);}}", "title": "" }, { "docid": "2e75e25103b48b9d41036efc1cba8ef4", "score": "0.7408225", "text": "function update(){// if popper is destroyed, don't perform any further update\nif(this.state.isDestroyed){return;}var data={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:false,offsets:{}};// compute reference element offsets\ndata.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference,this.options.positionFixed);// compute auto placement, store placement inside the data object,\n// modifiers will be able to edit `placement` if needed\n// and refer to originalPlacement to know the original value\ndata.placement=computeAutoPlacement(this.options.placement,data.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);// store the computed placement inside `originalPlacement`\ndata.originalPlacement=data.placement;data.positionFixed=this.options.positionFixed;// compute the popper offsets\ndata.offsets.popper=getPopperOffsets(this.popper,data.offsets.reference,data.placement);data.offsets.popper.position=this.options.positionFixed?'fixed':'absolute';// run the modifiers\ndata=runModifiers(this.modifiers,data);// the first `update` will call `onCreate` callback\n// the other ones will call `onUpdate` callback\nif(!this.state.isCreated){this.state.isCreated=true;this.options.onCreate(data);}else{this.options.onUpdate(data);}}", "title": "" }, { "docid": "0725a9ba604bc20e1b2586da25ff89b2", "score": "0.7321369", "text": "function update(){// if popper is destroyed, don't perform any further update\nif(this.state.isDestroyed){return}var data={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};// compute reference element offsets\ndata.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference);// compute auto placement, store placement inside the data object,\n// modifiers will be able to edit `placement` if needed\n// and refer to originalPlacement to know the original value\ndata.placement=computeAutoPlacement(this.options.placement,data.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);// store the computed placement inside `originalPlacement`\ndata.originalPlacement=data.placement;// compute the popper offsets\ndata.offsets.popper=getPopperOffsets(this.popper,data.offsets.reference,data.placement);data.offsets.popper.position=\"absolute\";// run the modifiers\ndata=runModifiers(this.modifiers,data);// the first `update` will call `onCreate` callback\n// the other ones will call `onUpdate` callback\nif(!this.state.isCreated){this.state.isCreated=!0;this.options.onCreate(data)}else{this.options.onUpdate(data)}}", "title": "" }, { "docid": "88a950261b7d2de151baebb5f02181bd", "score": "0.7304693", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n }", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" }, { "docid": "e1cae458a2a2cb8d8f8eda6f85315259", "score": "0.725189", "text": "function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}", "title": "" } ]
490e13258b6c9bd17809e44fa3b4d4ea
Handler to edit place
[ { "docid": "66a44f5206a957b59819f8ef93256ec3", "score": "0.7826944", "text": "function handleEditPlace() {\n\t$('main').on('click','.edit-place-button', function(event) {\n\t\tconst placeId = $(this).data('id');\n\t\tconst tripId = $(this).data('trip');\n\t\tshowPlaceDetailsToEdit(tripId, placeId);\n\t})\n}", "title": "" } ]
[ { "docid": "00d0690bc980312ddb12f3027a1b4b66", "score": "0.70760125", "text": "function edit() {\n // Code here ...\n // View Edit\n // if(OK){update() };\n }", "title": "" }, { "docid": "7019bf5748b98b4c9b104ecfc64589dd", "score": "0.70576733", "text": "edit() {\n \n }", "title": "" }, { "docid": "536c605db2ac37bb1320e0c906718f08", "score": "0.68914735", "text": "function edit(e){\n\t\tvar field_selector, map = e.target.dataset, id = 0;\n\t\t\n\t\tsidebar.addClass( \"update\" );\n\t\t\n field.body = form.body[map.row][map.index];\n \n field_selector = $(\"#\" + field.body.field)\n \n activeTab('#update-tab');\n\t\tactiveAction(field_selector);\n\t\t\t\n \n\t\t\tif(field.body.field != 'description'){\n\t\t\t\tfor (var prop in field.body) {\n \n\t\t\t\t\tif (field.body.hasOwnProperty(prop) && prop !== 'field'){\n\t\t\t\t\t\n\t\t\t\t\t\tif(typeof field.body[prop] === 'string'){\n\t\t\t\t\t\t\tfield_selector.find('#' + prop).val(field.body[prop]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(typeof field.body[prop] === 'boolean'){\n\t\t\t\t\t\t\tfield_selector.find('#' + prop).prop('checked', field.body[prop]);\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\tdocument.getElementById('textdescription').firstChild.innerHTML = field.body.textdescription\n\t\t\t\t//field_selector.find(\"#textdescription\").first().html(field.body.textdescription)\n\t\t\t\t//editor.content = \n\t\t\t}\n\t\t\t\n\t\th.renderSelectUpdateItem(field)\t\n\t\t\t// $('#update span').find('input, textarea, select').on('keyup change', function (){});\n \n\t}", "title": "" }, { "docid": "7b69c8cbac9e85fdc460243d2da77032", "score": "0.68848306", "text": "function onEdit(e) {\n HandlingApp.onEdit(e);\n}", "title": "" }, { "docid": "5b1b31480ef7d1519c478b849c5f43f3", "score": "0.6882115", "text": "function editRoute() {}", "title": "" }, { "docid": "230fa9a4dd886fb888db93ba0d8129dc", "score": "0.68328387", "text": "onEdit (event) {\n this.sendEvent(\"edit\");\n }", "title": "" }, { "docid": "bb501ba20161e0ef75255d76fcceb199", "score": "0.6828211", "text": "function handleUpdatePlace() {\n\t$('main').on('submit','.edit-place-form', function(event) {\n\t\tevent.preventDefault();\n\t\tconst placeId = $(this).data('id');\n\t\tconst tripId = $(this).data('trip');\n\t\tconst toUpdateData = {\n\t\t\tid: placeId,\n\t\t\tname: $('.place-name-entry').val(),\n\t\t\tdate: $('.form-place-date').val(),\n\t\t\tdescription: $('#place-desc').val()\n\t\t}\n\t\tupdatePlace(tripId, toUpdateData);\n\t})\n}", "title": "" }, { "docid": "ad2a5524fc6d5a06afc523f0a94ef038", "score": "0.6759781", "text": "async edit ({ params, request, response, view }) {\n\t}", "title": "" }, { "docid": "ac33a2b2c5d2743754ee3c835c16f1d0", "score": "0.67532337", "text": "async edit({ params, request, response, view }) {\n }", "title": "" }, { "docid": "9e04ab6b4e3991bb548821d03a30075f", "score": "0.6736118", "text": "async edit({ params, request, response, view }) {\n }", "title": "" }, { "docid": "9e04ab6b4e3991bb548821d03a30075f", "score": "0.6736118", "text": "async edit({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.6703676", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "7e2db899810f63ca44eb7d9485cec6b7", "score": "0.6683022", "text": "edit(request, response) { }", "title": "" }, { "docid": "896c46801d141ecc1891cbe1a547986e", "score": "0.66828877", "text": "function edit(e) {\n $cc.fadeToggle(1400);\n e.preventDefault();\n $('#ca-null-edit').html('<img id=\"null-edit-throbber\" src=\"' + mw.config.get('stylepath') + '/common/images/ajax.gif\" /> Editing...');\n new mw.Api().post({\n format: 'json',\n action: 'edit',\n title: mw.config.get('wgPageName'),\n token: mw.user.tokens.get('editToken'),\n prependtext: ''\n })\n .done(function() {\n getPage();\n })\n .fail(function() {\n onError();\n });\n }", "title": "" }, { "docid": "19fdf884c7a12ae0e9ae0c9fe443bf2d", "score": "0.665375", "text": "async edit({ params, request, response, view }) {}", "title": "" }, { "docid": "370833839d5bef6dc782cb836345b0dc", "score": "0.65667135", "text": "function saveEdit() {\n if (location != null){\n api.getJSON({\n 'id': url.getParameter('id')\n }, function(data) {\n var artwork = data[\"body\"][0];\n var hasCoords = helpFunctions.hasCoordinates(artwork);\n artwork.lat = location.lat;\n artwork.lon = location.lng;\n if(loggedIn) {\n oauth.post(url.getParameter('id'), artwork.title, artwork.list, location.lat, location.lng);\n if(hasCoords) {\n artworkHistory.setChanged(artwork, function(){\n redirect();\n });\n } else {\n artworkHistory.setAdded(artwork, function(){\n redirect();\n });\n }\n } else {\n api.post(artwork.list, artwork.title, artwork.artist, artwork.year, location.lat, location.lng, function() {\n if(hasCoords) {\n artworkHistory.setChanged(artwork, function(){\n showConfirm();\n });\n } else {\n artworkHistory.setAdded(artwork, function(){\n showConfirm();\n });\n }\n });\n }\n\n function showConfirm() {\n var confirm = $('<button/>', {\n id: 'buttonConfirm',\n class: 'base-full-button base-button base-button-highlight',\n text: i18next.t('base.ok')\n });\n gui.showPopup(i18next.t('edit-position.process'), i18next.t('edit-position.thank'), confirm);\n confirm.click(redirect);\n }\n\n function redirect() {\n window.location.href = \"artwork.html?id=\" + url.getParameter('id');\n }\n });\n }\n }", "title": "" }, { "docid": "dc5e864753e33950af126e88f8834ac9", "score": "0.65642613", "text": "takeAction() {\n if (this.editMode)\n this.save();\n else\n this.edit();\n }", "title": "" }, { "docid": "5a59bcc659a46d802dc5423456dc120a", "score": "0.65572304", "text": "function Edit (view, clb) {\n\n view.on('edit', function () {\n\n var editNode = document.createElement('div');\n editNode.setAttribute('x-context', 'edit');\n\n ContentElement(\n {\n el: editNode,\n id: view.getId(),\n storage: view.storage,\n templates: view.templates\n },\n function () {\n dialog(editNode).overlay().show();\n }\n );\n\n });\n\n clb();\n}", "title": "" }, { "docid": "12a6f6009d565e772fc884172dda1e3d", "score": "0.65446746", "text": "function handleEdit() {\n $('.js-shopping-list').on('click', '.js-edit', function(event){\n const toBeEdited = $(event.target).closest('li').find('.js-shopping-item');\n const itemIndex = getItemIndexFromElement(toBeEdited);\n $(this).addClass('hidden');\n showEditor(itemIndex, toBeEdited);\n }); \n}", "title": "" }, { "docid": "9e90a0c3a92b3024f2899e4a1a42d797", "score": "0.6540009", "text": "function editCurb(event) {\n event.preventDefault();\n // Create the ajax request for the edit form\n var uri = event.currentTarget.href + \"/edit\";\n var id = event.currentTarget.id;\n var marker = filterMarker(id);\n var data = \"\"; \n // Store the current content in case the user cancels the update\n var oldContent = handler.currentInfowindow().getContent();\n var ajaxRequest = $.ajax({\n url: uri,\n type: 'get',\n data: data\n });\n ajaxRequest.done(function(serverResponse, status, jqXHR)\n {\n // set the currently open infowindow to the edit form \n handler.currentInfowindow().setContent(serverResponse);\n // If the user clicks the close button on the info window, revert to the old data\n google.maps.event.addListener(handler.currentInfowindow(),'closeclick', function(){\n handler.currentInfowindow().setContent(oldContent);\n });\n });\n}", "title": "" }, { "docid": "0e33a3ecd9a13255539dea80dae567af", "score": "0.64976543", "text": "changeInPlace() {\n const place = this.autocomplete.getPlace();\n this.props.onPlaceChanged(place);\n }", "title": "" }, { "docid": "7368b2ee7a312c7bcf99d754fa08911e", "score": "0.6463557", "text": "function handleEditTrip() {\n\t$('main').on('click','.edit-trip-button', function(event) {\n\t\tconst tripId = $(this).data('id');\n\t\tshowTripDetailsToEdit(tripId);\n\t})\n}", "title": "" }, { "docid": "548adbbdbf7affdbb9df47365d9d5da3", "score": "0.644682", "text": "function editButtonHandler() {\n\t\t// Viene modificato il valore all'interno dell'oggetto che indica se si sta modificando il valore\n\t\tprops.value.editing = true;\n\t\t// Viene utilizzata la funzione del parent che permette di applicare le modifiche\n\t\tprops.changeValue(props.value.ID, props.value, undefined);\n\t\tconsole.log(props.value);\n\t}", "title": "" }, { "docid": "8b37ce7b59ca0f71e5e466ebbd4c25a9", "score": "0.64447916", "text": "editEntry(editorState, id, e){\n\t\tconst editorStateConverted = JSON.stringify(convertToRaw(editorState.getCurrentContent()));\n\t\tconst data = {id: id, editorStateConverted: editorStateConverted};\n\n\t let that=this;\n\t request\n\t\t.put(process.env.REACT_APP_URL_HOME)\n\t\t.set('Content-Type', 'application/json')\n\t\t.set('Accept', 'application/json')\n\t\t.set('authorization', 'bearer ' + localStorage.getItem('token'))\n\t\t.send( data )\n\t\t.end(function(err, res){\n\t\t\tthat.setState({visible: false});\n\t\t\tif(res.status === 200){\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "723621856797c843095cd77de3facf6a", "score": "0.6442625", "text": "function edit() {\n // Click event handling\n pointer.press = function () { editStateClick(); };\n pointer.tap = function () { editTap(); };\n pointer.release = function () { glbPointerDown = false; };\n // Click and drag event handling\n if (glbPointerDown === true) {\n if ((pointer.x) < (renderer.width - 200)) {\n editHold([pointer.x, pointer.y]);\n }\n }\n // Hover event handling\n if (pointer.x < (renderer.width - 200)) {\n hoverTile([pointer.x, pointer.y]);\n }\n else {\n glbSideBar.hoverOverBar();\n }\n}", "title": "" }, { "docid": "7033d4ed8e7c4c90a87b8f56b19c352a", "score": "0.6394391", "text": "function editSave() {\n if (!inputValid()) return;\n if (vm.editId != -2) {\n server.updateCommandType(vm.editObj).then(function(res) {\n queryCommandTypes();\n gui.alertSuccess('Command type updated.');\n }, function(res) {\n gui.alertBadResponse(res);\n });\n } else {\n vm.editObj.id = -3;\n server.addCommandType(vm.editObj).then(function(res) {\n queryCommandTypes();\n gui.alertSuccess('Command type added.');\n }, function(res) {\n gui.alertBadResponse(res);\n vm.commandTypes.splice(vm.commandTypes.length - 1, 1);\n });\n }\n vm.editId = -1;\n }", "title": "" }, { "docid": "3af84d3a569a4dfd944755ff929058c7", "score": "0.63908434", "text": "function onEditClick(e) {\n e.preventDefault();\n\n var id = $(this).closest(\".widget-list-item\").data(\"widget-id\");\n\n if (WidgetEditor) {\n $.get(\"/widgets/\" + id + \".json\", function(data) {\n WidgetEditor.open(data);\n });\n } else {\n console.warn('Widget Editor is not loaded yet');\n }\n }", "title": "" }, { "docid": "a14193878b87be6ce75292ebb0f02b3d", "score": "0.6390384", "text": "function viewEditItem(inType, inID) {\n\n // Record the item being viewed/edited.\n updateID = inID;\n\n // Populate data.\n var itemData = JSON.parse(window.localStorage.getItem(inType + \"_\" + inID));\n for (fld in itemData) {\n if (fld != \"_id\" && fld != \"__v\") {\n $(\"#\" + inType + \"EntryForm [name=\" + fld + \"]\").val(itemData[fld]);\n }\n }\n\n // Flip to entry view and ensure menu is closed.\n $(\"#\" + inType + \"Entry\").show();\n $(\"#\" + inType + \"List\").hide();\n $(\"#\" + inType + \"Menu\" ).popup(\"close\");\n\n // Enable that delete button too!\n $(\"#\" + inType + \"DeleteButton\").button(\"enable\");\n\n}", "title": "" }, { "docid": "2ff100ac560a2cddfe6a3764557db193", "score": "0.6360141", "text": "function editmode(){}", "title": "" }, { "docid": "5c1091c05dc6c4f2f53758fa37685e0a", "score": "0.6357972", "text": "function EditPlace() {\n //declares useHistory hook \n const history = useHistory();\n // declares states useState hook \n const [name, setName] = useState(\"\");\n const [location, setLocation] = useState(\"\");\n const [type, setType] = useState(\"\");\n const [notes, setNotes] = useState([]);\n const [deletePlace, setDeletePlace] = useState(false);\n //declares useParams hook \n const { id } = useParams();\n\n // on load gets the id for the specified place and returns placeholder info Name, Location, Type, Notes to be edited\n useEffect(() => {\n API.getPlace(id)\n .then((res) => {\n setName(res.data.name);\n setLocation(res.data.location);\n setType(res.data.type);\n setNotes(res.data.notes);\n })\n .catch((err) => {\n throw err;\n });\n }, [id]);\n\n // onClick of save button updates place info\n const handleSave = (e) => {\n e.preventDefault();\n\n //api call to update place information \n API.updatePlace(id, {\n name: name,\n location: location,\n type: type,\n notes: notes,\n })\n .then((res) => {\n // sends to myplaces page \n history.push(\"/myplaces\");\n })\n .catch((err) => {\n throw err;\n });\n };\n\n // onClick of Delete button. Deletes place from db \n const handleDelete = (e) => {\n //api call to delete place by id \n API.deletePlace(id)\n .then((res) => {\n history.push(\"/myplaces\");\n })\n .catch((err) => {\n throw err;\n });\n };\n\n // on change of input fields sets Place info values Name, Location,Notes, type \n const onChangeInfo = (e) => {\n let value = e.target.value;\n\n if (e.target.name === \"name\") {\n setName(value);\n } else if (e.target.name === \"location\") {\n setLocation(value);\n } else if (e.target.name === \"notes\") {\n setNotes(value);\n } else if (e.target.name === \"type\") {\n setType(value);\n }\n };\n\n return (\n <>\n <div className=\"body-wrapper\">\n <div className=\"content-wrapper\">\n <h2>Edit Place:</h2>\n <br />\n <h1>{name}</h1>\n <br />\n <br />\n <div id=\"edit-form\">\n <label for=\"name\">Name</label>\n <TextInput name=\"name\" placeholder={name} onChange={onChangeInfo} />\n <label for=\"location\">Location</label>\n <TextInput\n name=\"location\"\n placeholder={location}\n onChange={onChangeInfo}\n />\n <label for=\"notes\">Notes</label>\n <TextInput\n name=\"notes\"\n placeholder={notes}\n onChange={onChangeInfo}\n />\n <label for=\"type\">Skate Place Type</label>\n <Select name=\"type\" onChange={onChangeInfo} value={type} />\n <br />\n <br />\n <Link to=\"/viewmyplaces\" className=\"no-link-style\">\n <Button\n type=\"submit\"\n size=\"large\"\n variant=\"contained\"\n onClick={handleSave}\n >\n Save Changes\n </Button>\n </Link>\n <br />\n <br />\n {deletePlace ? (\n <Button\n className=\"delete-btn\"\n size=\"large\"\n variant=\"contained\"\n onClick={() => {\n setDeletePlace(false);\n handleDelete();\n }}\n >\n CLICK AGAIN TO CONFIRM\n </Button>\n ) : (\n <Button\n className=\"delete-btn\"\n size=\"large\"\n variant=\"contained\"\n onClick={() => {\n setDeletePlace(true);\n }}\n >\n DELETE THIS PLACE\n </Button>\n )}\n </div>\n </div>\n </div>\n </>\n );\n}", "title": "" }, { "docid": "0fbc068c38b430d657888a1a0ab02259", "score": "0.6347747", "text": "handleEdit(event) {\n console.log('inside handleEdit');\n this.displayMode = 'Edit';\n }", "title": "" }, { "docid": "0a9280a0ec6cdbc2320c1efd76d62822", "score": "0.6347303", "text": "function editQuestionTypeDetail() {\n \n}", "title": "" }, { "docid": "58dd9059a30196f8da4c1667d599dee4", "score": "0.6342013", "text": "function handleEventEdit() {\n const currentEvent = $(this)\n .parent()\n .parent()\n .data(\"event\");\n window.location.href = \"/cms?event_id=\" + currentEvent.id;\n }", "title": "" }, { "docid": "7edde9bae3b6f90327afbfa872b2aec1", "score": "0.63351274", "text": "function showPlaceDetailsToEdit(tripId, placeId) {\n\t$.ajax({\n\t\tmethod: 'GET',\n\t\turl: `/trips/${tripId}/places/${placeId}`,\n\t\theaders: {\n\t\t\tAuthorization: `Bearer ${authToken}`\n\t\t},\n\t\tcontentType: 'application/json',\n\t\tsuccess: function(place) {\n\t\t\tconst content = `\n\t\t\t<div class=\"edit-place-box\">\n\t\t\t\t<form data-id=\"${placeId}\" data-trip=\"${tripId}\" class=\"edit-place-form\">\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>Edit Place</legend>\n\t\t\t\t\t\t<label for=\"placename\">Place Name</label>\n\t\t\t\t\t\t<input type=\"text\" name=\"placename\" class=\"place-name-entry\" value=\"${place.name}\"><br>\n\t\t\t\t\t\t<label for=\"date\">Visited Date</label>\n\t\t\t\t\t\t<input type=\"date\" name=\"date\" value=\"${formatDate(place.date)}\" class=\"form-place-date\"><br>\n\t\t\t\t\t\t<p class=\"place-description\">\n\t\t\t\t\t\t\t<label for='place-desc'>Description</label>\n\t\t\t\t\t\t\t<textarea id=\"place-desc\" rows=\"9\" cols=\"50\">${place.description}</textarea>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<input type=\"submit\" class=\"update-button form-button\" value=\"Update\">\n\t\t\t\t\t\t<input type=\"button\" data-trip=\"${tripId}\" class=\"cancel-edit-place form-button\" value=\"Cancel\">\n\t\t\t \t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t`\n\t\t$('main').html(content);\n\t\t},\n\t\terror: function(err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "e80d6ecd4c0b01a15449d7b2e32b4c34", "score": "0.6334596", "text": "function handleWidgetEdit(){\n confirmIfDirty(function(){\n if(WidgetBuilderApp.isValidationError)\n {\n WidgetBuilderApp.dirtyController.setDirty(true,\"Widget\",WidgetBuilderApp.saveOnDirty);\n return;\n }\n var wdgDefFull = $.PercWidgetBuilderService.loadWidgetDefFull(WidgetBuilderApp.selectedModel, renderWidget);\n });\n }", "title": "" }, { "docid": "2f041631d0525cdb11bd0087d9f967e7", "score": "0.6331144", "text": "function edit(event, typeCR) {\n console.log(event.target.id)\n if(typeCR == \"proj\") {\n var project = gkanban.getProject(event.target.id)\n var id = document.getElementById(\"idProj\")\n id.value = project.id\n var proj = document.getElementById(\"prjEdit\")\n proj.value = project.name\n var ord = document.getElementById(\"ordEdit\")\n ord.value = project.ord\n var contr = document.getElementById(\"contrEdit\")\n contr.value = project.contr\n makeVisi('projEM')\n } else if (typeCR == \"col\") {\n console.log(event.target.parentNode.id);\n var column = gkanban.getColumn(event.target.parentNode.id)\n var id = document.getElementById(\"idCol\")\n id.value = column.id\n var inputCol = document.getElementById(\"inputCol\")\n inputCol.value = column.name\n makeVisi('colEM')\n }\n}", "title": "" }, { "docid": "278f094ccfe7b898493c4fa1a0a6c2fa", "score": "0.63193494", "text": "function editEntry(event){\n event.stopPropagation();\n // get target form\n var form = $( this ).closest(\"form\");\n \n // update content editable fields\n // Title\n var title = form.find(\".static > .title\").html();\n title = title.replace(/&gt;/g, '>')\n .replace(/&lt;/g, '<')\n .replace(/&/g, '&amp;');\n form.find(\".dynamic > .title\").val(title);\n \n // Content\n var content = form.find(\".static > .entry\").html();\n content = content.replace(/&gt;/g, '>')\n .replace(/&lt;/g, '<')\n .replace(/&/g, '&amp;');\n form.find(\".dynamic > .entry\").val(content);\n \n // Location\n var location = form.find(\".static > .location\").html();\n form.find(\".dynamic > .location\").html(location);\n \n // Time\n var time = form.find(\".static > .more > .time\").html();\n form.find(\".dynamic > .more > .time\").html(time);\n \n // adjust size of entry to new content\n var article = $( this ).closest(\"article\");\n article.toggleClass(\"editing\");\n updateHeight( article );\n\n // set focus on entry field\n article.find(\".dynamic > .entry\").focus();\n }", "title": "" }, { "docid": "46f86c2456ad5d303f747c6f0afd8d53", "score": "0.6308525", "text": "function updateStoryToEdit() {\n\t\tstoryBeingEditted.author = $editAuthorInput.val();\n\t\tstoryBeingEditted.title = $editTitleInput.val();\n\t\tstoryBeingEditted.url = $editUrlInput.val();\n\t}", "title": "" }, { "docid": "6f6c1e60f11883ed797c44e511caeb87", "score": "0.63070875", "text": "function editer(e){\n e.preventDefault()\n if(type){\n editPost(postOrQuestion._id, edits)\n }else{\n console.log(postOrQuestion, edits)\n editQuestion(postOrQuestion._id, edits)\n }\n setEdit(false)\n }", "title": "" }, { "docid": "e72c19844cde75395ea240c0046ed301", "score": "0.630686", "text": "function editBlock(event) {\n\tevent && event.stop();// 停止默认的放大行为的执行\n\tvar poly = this;\n\tvar elementIndex = getCurrentRegionElenemtzIndex(jsonObj,currentRegionOrder,poly);\n\n\tpoly.setEditable(true);\n\t\n\tdocument.getElementById('item_name').value = jsonObj.regions[currentRegionOrder].elements[elementIndex].name;\n\tdocument.getElementById('item_meta').value = jsonObj.regions[currentRegionOrder].elements[elementIndex].info;\n\t$(\"#info\").show();\n\t\n\tgoogle.maps.event.addDomListenerOnce(document.getElementById('item_acceptBtn'), 'click', function (){\n\t\tif(!document.getElementById('item_name').value){\n\t\t\talert('请输入名称。');\n\t\t\treturn false;\n\t\t};\n\t\t\n\t\t// 删除指定的原图\n\t\tvar oldID = jsonObj.regions[currentRegionOrder].elements[elementIndex].ID;\n\t\tdeleBlockJson(map, jsonObj, currentRegionOrder,elementIndex);\n\t\t// 将图存入 jsonObj,并重画\n\t\taddSubmit(currentRegionOrder,poly);\n\t\telementIndex = jsonObj.regions[currentRegionOrder].elements.length -1;\n\t\tcheckChildID(jsonObj, oldID, currentRegionOrder, elementIndex, true);\n\n\t\tdocument.getElementById(\"info\").style.display=\"none\";\n\t\t$(\"#map_shantou\").contextMenu(true);\n\t\treturn false;\n\t});\n\t// 删除改变的图,重画原图。\n\tgoogle.maps.event.addDomListenerOnce(document.getElementById('item_cancelBtn'), 'click', function (){\n\t\tpoly.setMap(null);\n\t\tgoogle.maps.event.clearInstanceListeners(poly);\n\t\tPoly = null;\n\n\t\tdrawBlockJson(map, jsonObj, currentRegionOrder,elementIndex,false);\n\t\t$(\"#info\").hide();\n\t\t$(\"#map_shantou\").contextMenu(true);\n\t\treturn false;\n\t});\n\n\tgoogle.maps.event.addDomListenerOnce(document.getElementById('item_deleteBtn'), 'click', function (){\n\t\tvar oldID = jsonObj.regions[currentRegionOrder].elements[elementIndex].ID;\n\t\tcheckChildID(jsonObj, oldID, currentRegionOrder, elementIndex, false);//BUG***\n\t\tdeleBlockJson(map, jsonObj, currentRegionOrder,elementIndex);\n\t\tdocument.getElementById(\"info\").style.display=\"none\";\n\t\t$(\"#map_shantou\").contextMenu(true);\n\t\treturn false;\n\t});\n\n\n\tdocument.getElementById('item_name').focus();\n}", "title": "" }, { "docid": "6aa0b9816cdaf8bd618b213859e44aeb", "score": "0.63005155", "text": "function evEditZone (event) {\n\tvar $button = $(event.target);\n\tvar $line = $button.parents('tr');\n\tvar zoneid = parseInt($line.attr('zoneid'));\n\tconsole.log('evEditZone : '+zoneid.toString());\n\t$line.empty().append(zoneParamForm(zoneid));\n}", "title": "" }, { "docid": "7652ef81fa5c0016fda5b527d5fdc23f", "score": "0.62651795", "text": "function editdetails(item) {\n onclickadd();\n\n setdetails({\n name: item.name,\n phone: item.phone,\n address: item.address,\n email: item.email,\n imgSrc: item.imgSrc,\n text: item.text,\n });\n }", "title": "" }, { "docid": "a0bc0cf0a14263489e5a0d6c89001900", "score": "0.62632555", "text": "function onEntryAction(evt) {\n if ($(this).hasClass(\"edit\")) {\n zdPage.navigate(\"edit/existing/\" + $(this).data(\"entry-id\"));\n //window.open(\"/\" + zdPage.getLang() + \"/edit/existing/\" + $(this).data(\"entry-id\"));\n }\n }", "title": "" }, { "docid": "e4575b01603cf6bbfd1e028a34c39ab0", "score": "0.62481505", "text": "function onEditPerson(e) {\n\t\tvar name = e.target.name\n\t\tvar rankings = e.target.value.split(\",\")\n\t\tsetPersonToEdit(name)\n\t\tsetRoomsToEdit(rankings)\n\t\tsetShowEditPerson(true)\n\t}", "title": "" }, { "docid": "c2242f7aa2f082e4866af9b46e539361", "score": "0.62436974", "text": "function show_edit_location_details (detail_type, detail_id) {\n\t\t$(\"#modal_title_location_details\").html(\"Edit \" + detail_type);\n\t\t$(\"#location_detail_name_label\").html( \"Location \" + detail_type + \" name\");\n\t\t$(\"#location_detail_type\").val(detail_type);\n\t\t$(\"#location_detail_id\").val(detail_id);\n\t\t$(\"#location_detail_name\").val($(\"#\" + detail_type + \"_name_\" + detail_id).html());\n\t\t$(\"#active_ld\").val($(\"#\" + detail_type + \"_active_\" + detail_id).val());\n\t\t$(\"#action_ld\").val(\"edit_location_details\");\n\t\t$(\"select\").trigger(\"chosen:updated\");\n\t\t$(\"#modal_dialog_location_details\").modal(\"show\");\n\t}", "title": "" }, { "docid": "e97e80904013426d66bf15623839485f", "score": "0.62295836", "text": "function editItemVolunteer(obj) {\n\t\tobj.parents(\".row\").children(\".col-5\").attr(\"contentEditable\", true).css({\"border\": \"1px solid #ccc\"});\n\t\tobj.unbind(\"click\");\n\t\tobj.text(\"保存\").removeClass(\"edit\").addClass(\"save\").bind(\"click\", function() {\n\t\t\tsaveItemVolunteer($(this));\n\t\t});\n\t}", "title": "" }, { "docid": "0af9eafc8f707774247e9e3544ac893f", "score": "0.6221577", "text": "handleClick() {\n let self = this;\n self.goToEditEvent(self.event);\n }", "title": "" }, { "docid": "7f19906202b99fa1f8d6446f2e8eebc1", "score": "0.6207797", "text": "editCallback(event) {\n this.router.navigateToRoute(\"edit\", { Id: this.data.Id });\n }", "title": "" }, { "docid": "fef74097894b5942fccefe78d8e705ed", "score": "0.6207641", "text": "handleEditButtonClick() {\n BusinessRulesFunctions.viewBusinessRuleForm(true, this.state.uuid)\n }", "title": "" }, { "docid": "05eb49619ee8fe608f8bdf6f98c3d89d", "score": "0.620448", "text": "acceptEdit(editID) {\n this.i.pj(editID);\n }", "title": "" }, { "docid": "cf23a34e67980e0b260a696de93fac3d", "score": "0.62028426", "text": "function goToEdit() {\n\thideCardContainer();\n\thideArrows();\n\thideFlashcard();\n\thideInput();\n\thideScoreboard();\n\n\tdisplayEditContainer();\n\tdisplayEditControls();\n\tupdateEditTable();\n\tupdateDeckName();\n}", "title": "" }, { "docid": "a68fa29ba323805f2a8d1be8a9cc31e2", "score": "0.61996675", "text": "onEdit (event) {\n this._outgoing.onEdit(event);\n }", "title": "" }, { "docid": "3605a08d667c4008aa5b47ebe5930b96", "score": "0.6198665", "text": "afterEditMethod() {}", "title": "" }, { "docid": "15b27aa5546df596fa76f86e92be150c", "score": "0.6187588", "text": "function editSave() {\n if (!inputValid()) return;\n vm.editObj.id = -3;\n server.addBuoy(vm.editObj).then(function(res) {\n queryBuoys();\n queryBuoyInstances();\n gui.alertSuccess('Buoy added.');\n }, function(res) {\n gui.alertBadResponse(res);\n vm.buoys.splice(vm.buoys.length - 1, 1);\n });\n vm.editId = -1;\n }", "title": "" }, { "docid": "5f53ea0d316297cc0cf55aade4e0a38b", "score": "0.6185034", "text": "function template_edit()\n{\n}", "title": "" }, { "docid": "c23cb400abd5f3c198b1c42025cd5817", "score": "0.6183187", "text": "function editToDo() {}", "title": "" }, { "docid": "5b453e51df559334bb42e967f48cdfda", "score": "0.6182317", "text": "function handleResourceEdit() {\n var currentResource = $(this)\n .parent()\n .parent()\n .data(\"resource\");\n window.location.href = \"/cms?resource_id=\" + currentResource.id;\n }", "title": "" }, { "docid": "5b684ea4971b19f2dfa62aa1bbb9f3fa", "score": "0.61611694", "text": "function on_edit_button_click(){\n\t\tif ($(this).text()=='Edit'){\n\t\t\t$(\"#middle\").find(\"button.edit\").text('Edit')\n\t\t\t\t.siblings('span').hide()\n\t\t\t\t.siblings('span.value').show();\n\n\t\t\t$(this).siblings('span').show()\n\t\t \t\t\t .siblings('span.value').hide();\n\t\t\t$(this).text('Cancel');\n\t\t} else {\n\t\t\t$(this).siblings('span').hide().siblings('span.value').show();\n\t\t\t$(this).text('Edit');\n\t\t}\n}", "title": "" }, { "docid": "a70a266b5b83d0004a3ee972b0644c1f", "score": "0.61513835", "text": "function editPlaceSuccess(data){\n $('#editPlaceForm input').val('');\n\n allNeighborhoods.forEach(function(neighborhood){\n if(neighborhood._id === neighborhoodId){\n neighborhood.places.forEach(function (place, i){\n if(place._id === placeToUpdateId){\n neighborhood.places.splice(i,1,data);\n }\n });\n }\n });\n\n renderSpecificNeighborhood();\n }", "title": "" }, { "docid": "550b2ccb5bd2d626d2617fc56e3ef19e", "score": "0.61430484", "text": "function handleRecipeEdit() {\n var currentRecipe = $(this)\n .parent()\n .parent()\n .data(\"recipe\");\n window.location.href = \"/recipe?userId=\" + data.userId + \"&recipeId=\" + recipe.id;\n }", "title": "" }, { "docid": "c88a321710029bb58379641dd1e2e340", "score": "0.61355853", "text": "function editEvent() {\n var currentEdit = $(this).text();\n $(this).children(\"input.editEvent\").val(currentEdit);\n } // end editEvent", "title": "" }, { "docid": "f02744533b243fb43bd9be1b270df920", "score": "0.61337936", "text": "function editCard(id) {\n editId = id\n openEditor()\n }", "title": "" }, { "docid": "8e307944058ba4f182546df13cd0e76b", "score": "0.6125961", "text": "function makeEditable(elementType, op, parameter) {\n $(elementType).each(function(index, value) {\n $(this).editable({\n url: function(params) {\n var inode_name = $(this).closest('tr').attr('inode-path');\n var absolute_file_path = append_path(current_directory, inode_name);\n var url = '/webhdfs/v1' + encode_path(absolute_file_path) + '?op=' +\n op + '&' + parameter + '=' + encodeURIComponent(params.value);\n\n return $.ajax(url, { type: 'PUT', })\n .fail(network_error_handler(url))\n .done(function() {\n browse_directory(current_directory);\n });\n },\n error: function(response, newValue) {return \"\";}\n });\n });\n }", "title": "" }, { "docid": "d60ea6aa8839ae888b5ac26822ffb9c8", "score": "0.6124553", "text": "function show_edit_location (location_id) {\n\t\t$(\"#modal_title_location\").html(\"Edit location\");\n\t\t$(\"#location_id\").val(location_id);\n\t\t$(\"#location_name\").val($(\"#location_name_\"+location_id).html());\n\t\t$(\"#location_place\").val($(\"#location_place_\"+location_id).val());\n\t\t$(\"#location_building\").val($(\"#location_building_\"+location_id).val());\n\t\t$(\"#location_floor\").val($(\"#location_floor_\"+location_id).val());\n\t\t$(\"#active\").val($(\"#lactive_\"+location_id).val());\n\t\t$(\"#action\").val(\"edit_location\");\n\t\t$(\"select\").trigger(\"chosen:updated\");\n\t\t$(\"#modal_dialog_location\").modal(\"show\");\n\t}", "title": "" }, { "docid": "f6f1ffdfc1fb34fc5ea3dd784f6eabe9", "score": "0.6123613", "text": "handleEditClick(e) {\n let id = parseInt(e.target.dataset.id);\n let product = Product.findById(id);\n document.querySelector('#update').innerHTML = product.renderEditForm();\n }", "title": "" }, { "docid": "c93d3acbeb4c9236ac25ce33128087c3", "score": "0.61163884", "text": "function editItemSubmit(e) {\n if (e.target.classList.contains(\"edit-item\")) {\n //get item ID\n const itemID = e.target.parentNode.parentNode.id;\n // split id\n const IDarr = itemID.split('-');\n const ID = parseInt(IDarr[1]);\n const editedItem = ItemCtrl.getItemByID(ID);\n\n //set current item \n ItemCtrl.setCurrentItem(editedItem);\n //show edit item in input field\n UICtrl.showEditItem();\n\n }\n e.preventDefault();\n }", "title": "" }, { "docid": "8c989635921b5b36982da524c2548ef9", "score": "0.6110995", "text": "function processEdit(req, res) {\n\t\treq.checkBody('title', 'Title is required.' ).notEmpty();\n\t\treq.checkBody('description', 'Description is required.').notEmpty();\n// if errors, redirect and save errors to flash\n\t\tconst errors = req.validationErrors();\n\t\tif (errors) {\n\t\treq.flash('errors', errors.map(err => err.msg));\n\t\treturn res.redirect('/theories/${req.params.id}/edit');\n\t\t}\n//finding the theory that is being edited\n\t\tTheory.findOne({ _id: req.params.id }, function(err, theory) {\n//updating that theory\n\t\ttheory.title = req.body.title;\n\t\ttheory.description = req.body.description;\n\t\ttheory.save(function(err) {\n\t\tif (err) {\n\t\treturn console.log(\"save error: \" + err);\n\t\t}\n// flash message\n\t\treq.flash('success', \"Successfully updated theory.\");\n// redirect the user back tot he theories page\n\t\tres.redirect('/theories');\n\t\t});\n\t});\n\t}", "title": "" }, { "docid": "508dad8cb0ac66f4166b3e3bbff04ce9", "score": "0.6104706", "text": "function editElement(event){\n\t\t\t\t\tclickedItem.innerHTML = textBox.value;\n\t\t\t\t}", "title": "" }, { "docid": "c0513d3d42f714ef3beee1196d4f829d", "score": "0.6100366", "text": "function edit(val) {\n try {\n var data = JSON.parse(val[1]);\n cancel();\n if (val[0] != \"0\") {\n fillControlsFromJson(data[0]);\n fillImages(val[2]);\n showSuccessMessage(\"Record Selected\");\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#cmdUpdate\").removeAttr('disabled');\n $(\"#cmdDelete\").removeAttr('disabled');\n get_featuresForEdit(data[0].id);\n\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "title": "" }, { "docid": "6b4e43a35b7558d522f7e1239ef8df17", "score": "0.6095151", "text": "function handleNoteEdit() {\n var currentNote = $(this)\n .parent()\n .parent()\n .data(\"note\");\n window.location.href = \"/cms?note_id=\" + currentNote.id;\n }", "title": "" }, { "docid": "328f0896657cb8b94b35e80dd4cab88e", "score": "0.6086171", "text": "function handleEdit(event) {\n event.preventDefault()\n history.push(`/posts/edit/${post._id}`)\n }", "title": "" }, { "docid": "b6412b60c67b285fb89360ee5b4e391d", "score": "0.608337", "text": "function editBtnClicked()\n{\n\t$(\"#tc_content_popup\").show();\n\n\t\n\tif( selectedTab == 'RFQ' )\n\t{\n\t\t$(\"#content_txtarea\").val( rfqText );\n\t}\n\telse if( selectedTab == 'Quote' )\n\t{\n\t\t$(\"#content_txtarea\").val( quoteText );\n\t}\n\telse if( selectedTab == 'PO' )\n\t{\n\t\t$(\"#content_txtarea\").val( poText );\n\t}\n\telse if( selectedTab == 'Invoice' )\n\t{\n\t\t$(\"#content_txtarea\").val( invoiceText );\n\t}\n\t\n\t$(\"#content_txtarea\").focus();\n\ttmpStr = $(\"#content_txtarea\").val();\n\t$(\"#content_txtarea\").val('');\n\t$(\"#content_txtarea\").val(tmpStr);\n}", "title": "" }, { "docid": "5a131fc65fafac66e71dc1d59c44a756", "score": "0.60742307", "text": "editMarker(){\n //pass message to the parent to edit the marker\n this.ea.publish('admin-marker-edit', this.item);\n }", "title": "" }, { "docid": "98f14de7d42594f8df4b9391aeef2aba", "score": "0.60735554", "text": "_onEdit(type) {\n this.refs.game.updateValues(type);\n this.refs.hud.updateValues(type);\n this.refs.crosshair.updateValues(type);\n this.refs.team.updateValues(type);\n this.refs.spectator.updateValues(type);\n this.refs.items.updateValues(type);\n this.refs.radar.updateValues(type);\n }", "title": "" }, { "docid": "c34971d12cf222261b53ff001d18edc8", "score": "0.6072239", "text": "function setModalEdit() {\n\n }", "title": "" }, { "docid": "9e7d39b11d87559ea6072355eade630f", "score": "0.6071703", "text": "function handleEdit(event,ele){\n event.preventDefault();\n setEditing(true);\n setCurrentBlog(ele);\n\n }", "title": "" }, { "docid": "d778dd9358f8944b5f7315b0ac458a3f", "score": "0.60535616", "text": "function editPopup(id) {\r\n document.getElementById('modal-title').innerHTML = 'Edit Page';\r\n\r\n var valueArr = {author:gloabl_array_item[global_item_index_Count][\"author\"],\r\n title:gloabl_array_item[global_item_index_Count][\"title\"],\r\n link:gloabl_array_item[global_item_index_Count][\"link\"],\r\n upload:gloabl_array_item[global_item_index_Count][\"upload\"],\r\n detail:gloabl_array_item[global_item_index_Count][\"detail\"],\r\n search:gloabl_array_item[global_item_index_Count][\"search\"]\r\n }\r\n document.getElementById('modal-content-main').innerHTML = getEditPopupContent(valueArr);\r\n\r\n openPopup(id);\r\n }", "title": "" }, { "docid": "b9c61348ede12db732d48288e44642b5", "score": "0.6048432", "text": "function onEdit() {\n setValues();\n}", "title": "" }, { "docid": "7de70cb87b5483538fb5ed7458dff7cc", "score": "0.6044547", "text": "async function edit(c) {\n const p = await api.get('/phone/' + c.cli_id);\n const a = await api.get('/address/' + c.cli_id);\n\n setAction('edit');\n setInfo({\n id: c.cli_id,\n nome: c.cli_nome,\n sobrenome: c.cli_sobrenome,\n dataNasc: c.cli_dataNasc?.split('T')[0],\n cpf: c.cli_cpf,\n rg: c.cli_rg,\n facebook: c.cli_facebook,\n instagram: c.cli_instagram,\n linkedin: c.cli_linkedin,\n twitter: c.cli_twitter\n });\n\n setAddress(a.data);\n setPhone(p.data);\n history.push('./cadastro');\n }", "title": "" }, { "docid": "4f2e816e8a5fdfde57908a16c2a20204", "score": "0.6039469", "text": "function onEdit(id) {\n announcmentPage.hideAnnouncements();\n annoncementEditor.showEditor();\n announcementSession.setCurrentId(id)\n annoncementApi.getAnnoncementById(id)\n .done(onEditSuccess)\n .fail(onEditFail);\n }", "title": "" }, { "docid": "85cc9cc3b19d94cf9370b4029781d4f4", "score": "0.6030719", "text": "function onclickToStoreLocEditImg(){\n\tvar form=View.panels.get('abBldgopsAdjustInvForm');\n\tvar toStoreLoc=form.getFieldValue('pt.toStoreLocation');\n\tvar partCode=form.getFieldValue('pt.part_id');\n\t//Clear validation result\n\tform.clearValidationResult();\n\t\n\tif(!valueExistsNotEmpty(partCode)){\n\t\tform.fields.get('pt.part_id').setInvalid(getMessage('InvalidPartCodeMsg'));\n\t}\n\tif(!valueExistsNotEmpty(toStoreLoc)){\n\t\tform.fields.get('pt.toStoreLocation').setInvalid(getMessage('ToStoreLocationMustBeEnteredMsg'));\n\t}\n\t\n\tif((!valueExistsNotEmpty(toStoreLoc))||(!valueExistsNotEmpty(partCode))){\n\t\tform.displayValidationResult();\n\t}else{\n\t\tvar isExist=checkIfPartExistInStorage(toStoreLoc,partCode);\n\t\tvar actionType=\"edit\";\n\t\tif(!isExist){\n\t\t\tactionType=\"addnew-byAdjust\";\n\t\t}\n\t\t\n\t\tView.openDialog('ab-bldgops-report-edit-part-in-storage-location-dialog.axvw', null, false, {\n width: 800,\n height: 600,\n partStoreLocId: toStoreLoc,\n partId: partCode,\n actionType:actionType,\n closeButton: true\n });\n\t}\n}", "title": "" }, { "docid": "19be036574568ae2c1154305dee5de40", "score": "0.6025383", "text": "function editFieldOffice(){\t\t\n\t\tfomController.resetInfoTabMode(\"edit\");\n\t}", "title": "" }, { "docid": "892e262ca7612fce89345b1253f3d48e", "score": "0.60227436", "text": "function editEntry(ENTRY){\n // making entry the variable that represents the entry id which includes amount, name,type\n let entry = ENTRY_LIST[ENTRY.id];\n // if the entry type is an input, we are going to update the item name and cost in the input section\n if (entry.type == \"inputs\"){\n itemName.value = entry.title;\n itemCost.value = entry.amount;\n }\n // run the delete entry function again so you can delete the previous entry before you add a new edited entry\n deleteEntry(ENTRY);\n }", "title": "" }, { "docid": "50deb489a8c9c5c27644ec22591b511f", "score": "0.60212976", "text": "function handleDivClick() {\n if (!editing || editing[field] === undefined) {\n setEditing(Object.assign({}, editing, {[`${field}`]: value}));\n }\n setRef(localRef);\n }", "title": "" }, { "docid": "6edbc1fdf2aa010ba90db1ebdb50c406", "score": "0.60178703", "text": "onEditComplete() {\n\n }", "title": "" }, { "docid": "a6fa33710b76ee7ca2387c7269510d3c", "score": "0.60093236", "text": "handleEdit(){\n //hadle onClick\n ReactDOM.render(<Edit current={this.props.current} sugest={this.props.sugest} userInfo={this.props.userInfo} email={this.props.userInfo.email} H_id={this.props.userInfo.hasura_id} name={this.props.userInfo.name} id={this.props.userInfo.profile_file_id} />,document.getElementById('desktop'))\n }", "title": "" }, { "docid": "73a368ec14d4a6e04fb4e5979b6d1faa", "score": "0.6004592", "text": "function handleEdit(e) {\n let cardBody = e.target.parentElement.parentElement;\n let card = cardBody.parentElement;\n console.log(card);\n\n let oldName = cardBody.children[0];\n let oldLocation = cardBody.children[1];\n let oldImage = card.children[0];\n\n let newName = prompt(\"Enter a new destination name\");\n let newLocation = prompt(\"Where is it located?\");\n let newImageURL = prompt(\"Enter a new image URL\");\n\n if (newName.length > 0) {\n oldName.innerHTML = newName;\n }\n\n if (newLocation.length > 0) {\n oldLocation.innerHTML = newLocation;\n }\n\n if (newImageURL.length > 0) {\n oldImage.setAttribute(\"src\", newImageURL);\n }\n}", "title": "" }, { "docid": "494b5e8ab26f16d412f628588a5b64c5", "score": "0.6001678", "text": "function openForEdit($origin){\n var $box = null\n\n // annotations overlay their sub box - not their own box //\n if ($origin.is(\".annotation-inline-box\")) {\n $box = $(\"*[x-annotation-box]\", $origin);\n }\n else {\n $box = $origin;\n }\n var x = $box[0].offsetLeft;\n var y = $box[0].offsetTop; \n \n var w = $box.outerWidth();\n var h = $box.innerHeight();\n\n if ($origin.is(\".annotation-inline-box\")) {\n w = Math.max(w, 400);\n h = Math.max(h, 60);\n if($('.htmlview div').offset().left + $('.htmlview div').width() > ($('.vsplitbar').offset().left - 480)){\n x = -(Math.max($origin.offset().left, $origin.width())); \n } else {\n x = 100;\n }\n }\n\n // start edition on this node\n var $overlay = $('<div class=\"html-editarea\"><button class=\"accept-button\">Zapisz</button><button class=\"delete-button\">Usuń</button><button class=\"tytul-button akap-edit-button\">tytuł dzieła</button><button class=\"wyroznienie-button akap-edit-button\">wyróżnienie</button><button class=\"slowo-button akap-edit-button\">słowo obce</button><button class=\"znak-button akap-edit-button\">znak spec.</button><textarea></textarea></div>').css({\n position: 'absolute',\n height: h,\n left: x,\n top: y,\n width: w\n }).appendTo($box[0].offsetParent || $box.parent()).show();\n \n\n if ($origin.is('.motyw')) {\n\t $('.akap-edit-button').remove();\n withThemes(function(canonThemes){\n $('textarea', $overlay).autocomplete(canonThemes, {\n autoFill: true,\n multiple: true,\n selectFirst: true,\n highlight: false\n });\n })\n }\n\n if ($origin.is('.motyw')){\n $('.delete-button', $overlay).click(function(){\n if (window.confirm(\"Czy jesteś pewien, że chcesz usunąć ten motyw ?\")) {\n $('[theme-class=' + $origin.attr('theme-class') + ']').remove();\n $overlay.remove();\n $(document).unbind('click.blur-overlay');\n return false;\n };\n });\n }\n else if($box.is('*[x-annotation-box]')) {\n $('.delete-button', $overlay).click(function(){\n if (window.confirm(\"Czy jesteś pewien, że chcesz usunąć ten przypis?\")) {\n $origin.remove();\n $overlay.remove();\n $(document).unbind('click.blur-overlay');\n return false;\n };\n });\n }\n else {\n $('.delete-button', $overlay).html(\"Anuluj\");\n $('.delete-button', $overlay).click(function(){\n if (window.confirm(\"Czy jesteś pewien, że chcesz anulować zmiany?\")) {\n $overlay.remove();\n $(document).unbind('click.blur-overlay');\n return false;\n };\n });\n }\n\n\n var serializer = new XMLSerializer();\n\n html2text({\n element: $box[0],\n stripOuter: true,\n success: function(text){\n $('textarea', $overlay).val($.trim(text));\n\n setTimeout(function(){\n $('textarea', $overlay).elastic().focus();\n }, 50);\n\n function save(argument){\n var nodeName = $box.attr('x-node') || 'pe';\n var insertedText = $('textarea', $overlay).val();\n\n if ($origin.is('.motyw')) {\n insertedText = insertedText.replace(/,\\s*$/, '');\n }\n\n xml2html({\n xml: '<' + nodeName + '>' + insertedText + '</' + nodeName + '>',\n success: function(element){\n if (nodeName == 'out-of-flow-text') {\n $(element).children().insertAfter($origin);\n $origin.remove()\n }\n else {\n $origin.html($(element).html());\n }\n $overlay.remove();\n },\n error: function(text){\n alert('Błąd! ' + text);\n }\n })\n \n var msg = $(\"<div class='saveNotify'><p>Pamiętaj, żeby zapisać swoje zmiany.</p></div>\");\n $(\"#base\").prepend(msg);\n $('#base .saveNotify').fadeOut(3000, function(){\n $(this).remove(); \n });\n }\n\n\t\t$('.akap-edit-button', $overlay).click(function(){\n\t\t\tvar textAreaOpened = $('textarea', $overlay)[0];\n\t\t\tvar startTag = \"\";\n\t\t\tvar endTag = \"\";\n\t\t\tvar buttonName = this.innerHTML;\n\n\t\t\tif(buttonName == \"słowo obce\") {\n\t\t\t\tstartTag = \"<slowo_obce>\";\n\t\t\t\tendTag = \"</slowo_obce>\";\n\t\t\t} else if (buttonName == \"wyróżnienie\") {\n\t\t\t\tstartTag = \"<wyroznienie>\";\n\t\t\t\tendTag = \"</wyroznienie>\";\n\t\t\t} else if (buttonName == \"tytuł dzieła\") {\n\t\t\t\tstartTag = \"<tytul_dziela>\";\n\t\t\t\tendTag = \"</tytul_dziela>\";\n\t\t\t} else if(buttonName == \"znak spec.\"){\n\t\t\t addSymbol();\n\t\t\t return false;\n\t\t\t}\n\t\t\t\n\t\t\tvar myField = textAreaOpened;\t\t\t\n \n\t\t\t//IE support\n\t\t if (document.selection) {\n\t\t textAreaOpened.focus();\n\t\t sel = document.selection.createRange();\n\t\t sel.text = startTag + sel.text + endTag;\n\t\t }\n\t\t //MOZILLA/NETSCAPE support\n\t\t else if (textAreaOpened.selectionStart || textAreaOpened.selectionStart == '0') {\n\t\t var startPos = textAreaOpened.selectionStart;\n\t\t var endPos = textAreaOpened.selectionEnd;\n\t\t textAreaOpened.value = textAreaOpened.value.substring(0, startPos)\n\t\t\t\t + startTag + textAreaOpened.value.substring(startPos, endPos) + endTag + textAreaOpened.value.substring(endPos, textAreaOpened.value.length);\n\t\t }\n\t\t});\n\n $('.accept-button', $overlay).click(function(){\n save();\n $(document).unbind('click.blur-overlay');\n });\n\n $(document).bind('click.blur-overlay', function(event){\n if ($(event.target).closest('.html-editarea, #specialCharsContainer').length > 0) {\n return;\n }\n save();\n $(document).unbind('click.blur-overlay');\n });\n\n },\n error: function(text){\n alert('Błąd! ' + text);\n }\n });\n }", "title": "" }, { "docid": "0dd2724bebda08e2e946909e98c895b3", "score": "0.5998385", "text": "function field_edit(title, set, opt = {}) {\n return function(ev) {\n let floor = api.prefs.map.space.floor !== false;\n let value = ev.target.innerText;\n let onclick = (ev) => {\n let tempval = parseFloat($('tempval').value);\n api.modal.hide(modal.info.cancelled);\n if (modal.info.cancelled) {\n return;\n }\n for (let g of api.selection.groups()) {\n set(g, tempval, value);\n if (floor && opt.floor !== false) {\n g.floor(mesh.group);\n }\n defer_selection(); // update ui\n }\n };\n let onkeydown = (ev) => {\n if (ev.key === 'Enter') {\n estop(ev);\n onclick();\n }\n };\n let { tempval } = api.modal.show(title, h.div({ class: \"tempedit\" }, [\n h.input({ id: 'tempval', value, size: 10, onkeydown }),\n h.button({ _: 'set', onclick })\n ]));\n tempval.setSelectionRange(0, tempval.value.length);\n tempval.focus();\n }\n }", "title": "" }, { "docid": "ff086ff57815ffaca8e43cdf74156226", "score": "0.5996577", "text": "function handleActivityEdit() {\n var currentActivity = $(this)\n .parent()\n .parent()\n .data(\"activity\");\n // window.location.href = \"/addevent?activity_id=\" + currentActivity.id;\n }", "title": "" }, { "docid": "1015ee6e58b38165e48e7135e7c87e63", "score": "0.59937716", "text": "function editDetails(event) {\r\n setEditMode(true);\r\n console.log(details)\r\n event.preventDefault();\r\n }", "title": "" }, { "docid": "1fa7034004bb5029e652d2631c312ca1", "score": "0.5991067", "text": "handleEdit(submission, submissionId) {\n window.scrollTo(0, 0);\n this.setState({\n edit: true,\n female: submission.facilities.female,\n male: submission.facilities.male,\n handicapped: submission.facilities.handicapped,\n separateHandicapped: submission.facilities.separateHandicapped,\n showerHeads: submission.facilities.showerHeads,\n waterCooler: submission.facilities.waterCooler,\n hose: submission.facilities.hose,\n lat: submission.lat,\n lon: submission.lon,\n name: submission.name,\n panorama: submission.panorama,\n editDocId: submissionId\n });\n }", "title": "" }, { "docid": "4567c8028a3ea7a522d3ac27e85b38aa", "score": "0.5985243", "text": "function editBtn() {\n const element = $(this).closest(\".newPost\");\n const myPost = element.data(\"post\");\n editPost(myPost);\n }", "title": "" } ]
80e90928baaa2d87963df0a7be48f9e4
Functions to compute tiles from lat/lon for bottom line
[ { "docid": "ac976a596e3e53a34d88d40f60bd71cf", "score": "0.6231989", "text": "function long2tile(lon,zoom) {\n return (Math.floor((lon+180)/360*Math.pow(2,zoom)));\n}", "title": "" } ]
[ { "docid": "8119c716642095615205ebe8cb808c35", "score": "0.7427697", "text": "function calcTileExtents() {\n\n\tvar section = map.getView().calculateExtent(map.getSize())\n\tvar s1 = proj4('EPSG:21781', 'EPSG:4326', [section[0], section[1]])\n\tvar s2 = proj4('EPSG:21781', 'EPSG:4326', [section[2], section[3]])\n\tsection = [s1[0],s1[1],s2[0],s2[1]]\n\tconsole.log(section)\n\n\t\n\n\tsection.forEach(function(point, i) {\n\t\tsection[i] = point - point % state.tileSize\n\t})\n\n\tvar lons = [section[0], section[2]]\n\n\tif (!(lons[1] - lons[0]) / state.tileSize) {\n\t\tlons = [lons[0]]\n\t} else {\n\t\tfor (var i = 1; i < (lons[1] - lons[0]) / state.tileSize; i++) {\n\t\t\tlons.push(lons[0] + state.tileSize * i)\n\t\t}\n\t}\n\n\tvar lats = [section[1], section[3]]\n\tif (!(lats[1] - lats[0]) / state.tileSize) {\n\t\tlats = [lats[0]]\n\t} else {\n\t\tfor (var i = 1; i < (lats[1] - lats[0]) / state.tileSize; i++) {\n\t\t\tlats.push(lats[0] + state.tileSize * i)\n\t\t}\n\t}\n\n\tvar tiles = []\n\tvar tiles2 = []\n\n\tconsole.log(lons)\n\tconsole.log(lats)\n\tlons.forEach(function(lon) {\n\t\tlats.forEach(function(lat) {\n\t\t\tvar coord1 = [lon, lat]\n\t\t\tvar coord2 = [lon + state.tileSize, lat + state.tileSize]\n\t\t\ttiles.push([coord1[0], coord1[1], coord2[0], coord2[1]])\n\t\t\ttiles2.push([lon, lat, lon + state.tileSize, lat + state.tileSize])\n\t\t})\n\t})\n\tconsole.log(JSON.stringify(tiles))\n\tconsole.log(JSON.stringify(tiles2))\n\n\treturn tiles\n}", "title": "" }, { "docid": "a10b999710c4b8435e5b8e48d86c7734", "score": "0.672869", "text": "function loadVisibleTiles(){\n var scale = [200, 400, 800][zoomLevel - 1], \n latCeil = Math.ceil(lat), lngCeil = (Math.ceil(lng)) * -1,\n spreadX = Math.ceil(window.innerWidth / scale) + 4, spreadY = Math.ceil(window.innerHeight / scale) + 4;\n for (var x = lngCeil; x <= lngCeil + spreadX; ++ x){\n for (var y = latCeil; y <= lat + spreadY; ++ y){\n \n // Do these checks for zero so we don't make two copies of tiles with zeros in them,\n // because the inverse of zero is zero.\n makeTile(lat + x, lng + y);\n if (x !== 0) $tl = makeTile(lat - x, lng + y);\n if (y !== 0) $br = makeTile(lat + x, lng - y);\n if (x !== 0 && y !== 0) $bl = makeTile(lat - x, lng - y);\n };\n };\n }", "title": "" }, { "docid": "35834c87267779a2d69b98746c08a3c1", "score": "0.66853076", "text": "function getTileCoords(){\n minRow = lat2tile(TOP_LAT, MAP_ZOOM);\n maxRow = lat2tile(BOTTOM_LAT, MAP_ZOOM)+1;\n minCol = long2tile(LEFT_LON, MAP_ZOOM);\n maxCol = long2tile(RIGHT_LON, MAP_ZOOM)+1;\n}", "title": "" }, { "docid": "a6870c0c6b50b806a206d6185ff7f0c0", "score": "0.65994394", "text": "function calculateTileOffset(lat, lon, numTiles) {\n var tileX, tileY;\n \n tileX = (lon+180) / 360 * numTiles;\n tileY = ((1-Math.log(Math.tan(lat*DEGREES_TO_RADIANS) + 1/Math.cos(lat*DEGREES_TO_RADIANS))/Math.PI)/2 * numTiles) % numTiles;\n \n return new GeoXY(tileX | 0, tileY | 0);\n } // calculateTileOffset", "title": "" }, { "docid": "f8d474fc70e2374952e14ff3fe1ddba1", "score": "0.6506881", "text": "getLineTiles(center, secondPoint, distance, bothDirections){\n let xDiff = secondPoint.x - center.x;\n let zDiff = secondPoint.z - center.z;\n\n let ret = [];\n ret.push(this.getTile(center).position);\n let neighborTile = null;\n for(let d = 1; d <= distance; d++){\n let toCheck = [\n center.addXYZ(xDiff * d, 0, zDiff * d)\n ];\n if(bothDirections){\n toCheck.push(center.addXYZ(-xDiff * d, 0, -zDiff * d));\n }\n\n for(let currentDirection of toCheck)\n {\n //check it's not off the map\n neighborTile = this.getTile(currentDirection);\n if (neighborTile != null)\n {\n ret.push(neighborTile.position);\n }\n }\n }\n return ret;\n }", "title": "" }, { "docid": "46d3c6fcb89e326216fccc68bc0d17ca", "score": "0.64677685", "text": "function long2tile(lon,zoom) { return (Math.floor((lon+180)/360*Math.pow(2,zoom))); }", "title": "" }, { "docid": "46d3c6fcb89e326216fccc68bc0d17ca", "score": "0.64677685", "text": "function long2tile(lon,zoom) { return (Math.floor((lon+180)/360*Math.pow(2,zoom))); }", "title": "" }, { "docid": "46d3c6fcb89e326216fccc68bc0d17ca", "score": "0.64677685", "text": "function long2tile(lon,zoom) { return (Math.floor((lon+180)/360*Math.pow(2,zoom))); }", "title": "" }, { "docid": "3ae391f7250e2103f34d77937a26259a", "score": "0.6456907", "text": "function calculateTileOffset(lat, lon, numTiles) {\n var tileX, tileY;\n \n tileX = (lon+180) / 360 * numTiles;\n tileY = ((1-Math.log(Math.tan(lat*DEGREES_TO_RADIANS) + 1/Math.cos(lat*DEGREES_TO_RADIANS))/Math.PI)/2 * numTiles) % numTiles;\n \n return new GeoXY(tileX | 0, tileY | 0);\n } // calculateTileOffset", "title": "" }, { "docid": "8e5da9885bd809f43f557482f05d3dea", "score": "0.6440068", "text": "drawWallTile(c, x, y) {\n\n let ts = this.tileset;\n\n let tl = this.map.getTile(1, x-1, y-1, true);\n let tr = this.map.getTile(1, x+1, y-1, true);\n let bl = this.map.getTile(1, x-1, y+1, true);\n let br = this.map.getTile(1, x+1, y+1, true);\n \n let l = this.map.getTile(1, x-1, y, true);\n let t = this.map.getTile(1, x, y-1, true);\n let r = this.map.getTile(1, x+1, y, true);\n let b = this.map.getTile(1, x, y+1, true);\n\n let corners = [l, t, r, b];\n let diagonal = [tl, tr, br, bl];\n \n const PX = [0, 1, 1, 0];\n const PY = [0, 0, 1, 1];\n\n // If empty everywhere, just draw the background\n // and stop here\n let empty = true;\n for (let i = 0; i < 4; ++ i) {\n\n if (corners[i] != 1 || diagonal[i] != 1) {\n\n empty = false;\n break;\n }\n }\n if(empty) {\n\n c.drawBitmapRegion(ts, \n 0, 0, 16, 16,\n x*16, y*16);\n return;\n }\n\n // Draw corners\n let sx, sy;\n for (let i = 0; i < 4; ++ i) {\n\n // No tiles in any direction\n if (corners[i] != 1 && corners[(i+1)%4] != 1) {\n\n sx = 16 + PX[i] * 8;\n sy = 0 + PY[i] * 8;\n\n c.drawBitmapRegion(ts, sx, sy, 8, 8,\n x*16 + PX[i]*8, y*16 + PY[i]*8);\n }\n // Tiles in \"all\" the directions\n else if (corners[i] == 1 && \n corners[(i+1)%4] == 1 &&\n diagonal[i] != 1) {\n\n sx = 32 + PX[i] * 8;\n sy = 0 + PY[i] * 8;\n\n c.drawBitmapRegion(ts, \n sx, sy, 8, 8,\n x*16 + PX[i]*8, \n y*16 + PY[i]*8);\n }\n\n // No tile in the facing direction,\n // but tile in the next position\n if (corners[i] != 1 &&\n corners[(i+1)%4] == 1) {\n\n sx = 48 + PX[i] * 8;\n sy = 0 + PY[i] * 8;\n \n c.drawBitmapRegion(ts, \n sx, sy, 8, 8,\n x*16 + PX[i]*8, \n y*16 + PY[i]*8); \n }\n\n // No tile in the facing direction,\n // but tile in the previous position\n if (corners[(i+1)%4] != 1 &&\n corners[i] == 1) {\n\n sx = 64 + PX[i] * 8;\n sy = 0 + PY[i] * 8;\n \n c.drawBitmapRegion(ts, \n sx, sy, 8, 8,\n x*16 + PX[i]*8, \n y*16 + PY[i]*8); \n }\n\n // \"Pure wall\" tiles\n if (corners[i] == 1 &&\n corners[(i+1)%4] == 1 &&\n diagonal[i] == 1) {\n\n sx = PX[i] * 8;\n sy = PY[i] * 8;\n\n c.drawBitmapRegion(ts, \n sx, sy, 8, 8,\n x*16 + PX[i]*8, \n y*16 + PY[i]*8); \n }\n }\n\n }", "title": "" }, { "docid": "c9352bfd6ad00f09e7a1fc565d376abe", "score": "0.6417665", "text": "function lat2tile(lat,zoom) { return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom))); }", "title": "" }, { "docid": "4441f8d29fe33756513956358a737778", "score": "0.6310945", "text": "calculateVisibleTiles() {\n // if we don't know anything about this dataset, no point\n // in trying to get tiles\n if (!this.tilesetInfo) return;\n\n this.zoomLevel = this.calculateZoomLevel();\n\n this.xTiles = tileProxy.calculateTiles(\n this.zoomLevel,\n this._xScale,\n this.minPos[0],\n this.maxPos[0],\n this.maxZoom,\n this.maxDim\n );\n\n this.yTiles = tileProxy.calculateTiles(\n this.zoomLevel,\n this._yScale,\n this.minPos[1],\n this.maxPos[1],\n this.maxZoom,\n this.maxDim\n );\n\n const rows = this.yTiles;\n const cols = this.xTiles;\n const zoomLevel = this.zoomLevel;\n\n // if we're mirroring tiles, then we only need tiles along the diagonal\n const tiles = [];\n\n // calculate the ids of the tiles that should be visible\n for (let i = 0; i < rows.length; i++) {\n for (let j = 0; j < cols.length; j++) {\n const newTile = [zoomLevel, rows[i], cols[j]];\n\n tiles.push(newTile);\n }\n }\n\n this.setVisibleTiles(tiles);\n }", "title": "" }, { "docid": "98631738a525ffe79e6f9c0a3d9988d9", "score": "0.6275162", "text": "tile(zoom, lng, lat) {\n return getTiles([lng, lat], zoom, zoom)\n }", "title": "" }, { "docid": "b28f381454d67ee501ba2b9592171415", "score": "0.62527514", "text": "function TileMap(ctx, tiles)\n{\n var hspace;\n var vspace;\n}", "title": "" }, { "docid": "e87bf194a01758a4dd58e6fa6db8fd9a", "score": "0.6149768", "text": "function long2tile(lon,zoom) {\n return (Math.floor((lon+180)/360*Math.pow(2,zoom)));\n}", "title": "" }, { "docid": "261d93d4db2fd25fd53aadfcf8b55f5a", "score": "0.61115336", "text": "drawTiles(c, sx, sy, w, h) {\n\n let t;\n for (let y = sy; y < sy + h; ++ y) {\n\n for (let x = sx; x < sx + w; ++ x) {\n\n t = this.map.getTile(1, x, y, true);\n switch(t) {\n\n // Wall\n case 1:\n\n this.drawWallTile(c, x, y);\n break; \n\n // Ladder\n case 2:\n\n this.drawLadder(c, x, y);\n break;\n \n // Spikes\n case 3:\n case 4:\n case 5:\n case 6:\n\n this.drawSpikes(c, t-3, x, y);\n break;\n\n // Water\n case 7:\n case 8:\n\n this.drawWater(c, x, y, t-7);\n break;\n\n // Breaking tile\n case 9:\n case 10:\n \n this.drawBreakingWall(c, x, y, t-9);\n break;\n\n // Propeller\n case 13:\n\n this.propSpr.draw(c, c.bitmaps.propeller,\n x*16 - 32, y*16 - 4);\n break;\n\n // Keyhole\n case 14:\n\n c.drawBitmapRegion(this.tileset, \n 128, 16, 16, 16, x*16, y*16);\n break;\n\n default:\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "c8b9af9e9bd3d2f075f7dbe28ed5f14a", "score": "0.6104939", "text": "function lng2tile(lng,zoom) { return (Math.floor((lng+180)/360*Math.pow(2,zoom))); }", "title": "" }, { "docid": "c8b9af9e9bd3d2f075f7dbe28ed5f14a", "score": "0.6104939", "text": "function lng2tile(lng,zoom) { return (Math.floor((lng+180)/360*Math.pow(2,zoom))); }", "title": "" }, { "docid": "aed2494898cd7f0118dd5f2018cf9b3b", "score": "0.6080546", "text": "function getCoordinates(tile) {\n return {\n x: (tile) % 12 \n ,\n y: Math.floor((tile) / 12 )\n }\n \n}", "title": "" }, { "docid": "056bba6a861f25ce55ac7671886f38c3", "score": "0.6080234", "text": "function draw2(directions,tiles_info){\n var tiles = [];\n for(let tile of tiles_info){\n let bounds = [];\n for(let a of [[0,0],[0,1],[1,1],[1,0]]){\n let q = JSON.parse(JSON.stringify(tile[1]));\n q[tile[0][0]] = q[tile[0][0]]+a[0];\n q[tile[0][1]] = q[tile[0][1]]+a[1];\n let coord = vector_mult_matrix(q,directions);\n bounds.push(coord[0]);\n bounds.push(coord[1]);\n }\n tiles.push(new Tile([id2key(tile[0]),tile[1]],[],bounds,4));\n }\n return tiles;\n}", "title": "" }, { "docid": "7d3512545301a3f953e781846ed66145", "score": "0.60287243", "text": "function degree2tile(lat, lng, zoom) {\n // See http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames\n var latRad = lat * Math.PI / 180;\n var n = Math.pow(2, zoom);\n var x = (lng + 180) / 360 * n;\n var y = (1 - Math.log(Math.tan(latRad) + 1 / Math.cos(latRad)) / Math.PI) / 2 * n;\n return {\n x: x,\n y: y\n };\n } // Given a range [from,to) and either one or two numbers, returns true if", "title": "" }, { "docid": "0e2688ef6d592df8f276c9136653de50", "score": "0.6006648", "text": "function buildmap() {\n for (var r = 0; r <= map.tiles.length; r++) {\n if (map.tiles[r] !== undefined) {\n for (var b = 0; b <= map.tiles[r].length; b++) {\n if (map.tiles[r][b] !== undefined) {\n map.tiles[r][b].image.x = r * map.tileSize;\n map.tiles[r][b].image.y = b * map.tileSize;\n map.container.addChild(map.tiles[r][b].image);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "202ac3b264ac0c0c2887b5d8e99d1ff8", "score": "0.599649", "text": "getSurroundingTiles(x, y, data) {\n\n const tile = []; \n \n //up\n if (x > 0) {\n tile.push(data[x - 1][y]);\n } \n //down\n if (x < boardSize - 1) {\n tile.push(data[x + 1][y]);\n } \n //left\n if (y > 0) {\n tile.push(data[x][y - 1]);\n } \n //right\n if (y < boardSize - 1) {\n tile.push(data[x][y + 1]);\n } \n // top left\n if (x > 0 && y > 0) {\n tile.push(data[x - 1][y - 1]);\n } \n // top right\n if (x > 0 && y < boardSize - 1) {\n tile.push(data[x - 1][y + 1]);\n } \n // bottom right\n if (x < boardSize - 1 && y < boardSize - 1) {\n tile.push(data[x + 1][y + 1]);\n } \n // bottom left\n if (x < boardSize - 1 && y > 0) {\n tile.push(data[x + 1][y - 1]);\n } \n \n return tile;\n }", "title": "" }, { "docid": "3314daed328d4423da16cdd9de557151", "score": "0.59533685", "text": "drawMap() {\n // Check to see if there are any tiles to render currently\n if (this.state === undefined || this.state.tiles.length <= 0) {\n this.setState({\n overviewVisible: true,\n mapVisible: false,\n mapControlsVisible: false,\n });\n return;\n } else {\n this.setState({\n overviewVisible: false,\n mapVisible: true,\n mapControlsVisible: true,\n });\n }\n\n // Set the map height based on which tiles are being used\n let mapNumberTilesHeight = 1;\n let mapNumberTilesWidth = 1;\n if (this.getTileNumber(this.state.tiles[37], true) >= 0 || this.getTileNumber(this.state.tiles[38], true) >= 0 || this.getTileNumber(this.state.tiles[60], true) >= 0\n || this.getTileNumber(this.state.tiles[48], true) >= 0 || this.getTileNumber(this.state.tiles[49], true) >= 0 || this.getTileNumber(this.state.tiles[50], true) >= 0) {\n mapNumberTilesHeight = 9;\n mapNumberTilesWidth = 7;\n } else if (this.getTileNumber(this.state.tiles[19], true) >= 0 || this.getTileNumber(this.state.tiles[20], true) >= 0 || this.getTileNumber(this.state.tiles[36], true) >= 0\n || this.getTileNumber(this.state.tiles[27], true) >= 0 || this.getTileNumber(this.state.tiles[28], true) >= 0 || this.getTileNumber(this.state.tiles[29], true) >= 0) {\n mapNumberTilesHeight = 7;\n mapNumberTilesWidth = 5.5;\n } else if (this.getTileNumber(this.state.tiles[7], true) >= 0 || this.getTileNumber(this.state.tiles[8], true) >= 0 || this.getTileNumber(this.state.tiles[18], true) >= 0\n || this.getTileNumber(this.state.tiles[12], true) >= 0 || this.getTileNumber(this.state.tiles[13], true) >= 0 || this.getTileNumber(this.state.tiles[14], true) >= 0) {\n mapNumberTilesHeight = 5;\n mapNumberTilesWidth = 4;\n } else if (this.getTileNumber(this.state.tiles[1], true) >= 0 || this.getTileNumber(this.state.tiles[2], true) >= 0 || this.getTileNumber(this.state.tiles[6], true) >= 0\n || this.getTileNumber(this.state.tiles[3], true) >= 0 || this.getTileNumber(this.state.tiles[4], true) >= 0 || this.getTileNumber(this.state.tiles[5], true) >= 0) {\n mapNumberTilesHeight = 3;\n mapNumberTilesWidth = 2.5;\n }\n\n // Configuration options for magic numbers\n let mapPadding = 0; // The amount of pad spacing to apply to the map edges\n let mapTileWidth = 364; // The width of every tile in the static folder\n let mapTileHeight = 317;\n\n // Get extra information about the map\n let mapWidth = this.$mapContainer.width() - (2 * mapPadding); // Put padding on top/bottom of map\n let mapHeight = this.$mapContainer.height() - (2 * mapPadding); // Put padding on either side of map\n let tileWidth = Math.floor(mapWidth / mapNumberTilesWidth)\n let tileHeight = Math.floor(mapHeight / mapNumberTilesHeight)\n\n // Determine which will be our constraining factor, width or height?\n let constraintWidth = Math.min(this.state.zoom * Math.min(tileWidth, Math.floor((mapTileWidth / mapTileHeight) * tileHeight)), mapTileWidth) // Prohibit over-zooming\n let constraintHeight = Math.floor((mapTileHeight / mapTileWidth) * constraintWidth)\n\n // Configure the map container to be this size\n this.$tiMap.css(\"width\", constraintWidth * mapNumberTilesWidth)\n .css(\"height\", constraintHeight * mapNumberTilesHeight);\n\n // Calculate the offset values for margin left and margin top per tile\n let offsets = calculateOffsets(constraintWidth, constraintHeight)\n\n // Loop over tiles to assign various values to them\n let currentPlayerNumber = 0;\n for (let tileNumber = 0; tileNumber < offsets.length; tileNumber++) {\n // Create the selectors\n let tile = $(\"#tile-\" + tileNumber);\n let tileWrapper = $(\"#tile-wrapper-\" + tileNumber);\n let numOverlay = $(\"#number-\" + tileNumber);\n let underlay = $(\"#underlay-\" + tileNumber);\n \n // Decide if we should be displaying this tile\n if (this.state.tiles[tileNumber] >= 0 || typeof this.state.tiles[tileNumber] === \"string\" || this.state.customMapBuilding) {\n tile\n .css(\"left\", 0)\n .css(\"top\", 0)\n .css({'transform' : 'rotate(0)'}) // Reset any rotations from other hyperlanes\n .show();\n\n tileWrapper\n .css(\"width\", constraintWidth)\n .css(\"height\", constraintHeight)\n .css(\"margin-left\", offsets[tileNumber][0])\n .css(\"margin-top\", offsets[tileNumber][1])\n .css(\"left\", (mapNumberTilesWidth / 2) * constraintWidth)\n .css(\"top\", (mapNumberTilesHeight / 2) * constraintHeight)\n .show()\n\n if (typeof this.state.tiles[tileNumber] === \"string\") {\n // Hyperlane, so remove the last section and check if it needs to be rotated\n if (this.state.tiles[tileNumber].split(\"-\")[1] !== \"0\") {\n let degrees = 60 * Number(this.state.tiles[tileNumber].split(\"-\")[1]);\n tile.css({'transform' : 'rotate('+ degrees +'deg)'});\n }\n }\n } else {\n tile.hide();\n }\n\n // Create the number overlay and the hover underlay for the tile\n numOverlay\n .css(\"margin-left\", \"-10px\")\n .css(\"top\", constraintHeight/2 - 10)\n .html(this.getTileNumber(this.state.tiles[tileNumber]))\n\n underlay.css(\"width\", constraintWidth + 6)\n .css(\"height\", constraintHeight + 6)\n .css(\"margin-left\", \"-3px\")\n .css(\"margin-top\", \"-3px\")\n \n // Set the names on the player home worlds to not be 0\n if (this.state.tiles[tileNumber] === 0) { // TODO should this override on selected races too?\n // Show the player name\n let name = this.state.currentPlayerNames[currentPlayerNumber];\n numOverlay.html(name === \"\" ? \"P\" + (currentPlayerNumber + 1) : name);\n currentPlayerNumber += 1;\n }\n }\n\n // Clear any css classes on the map\n this.$tiMap.removeClass(\"center-map\");\n this.$tiMap.removeClass(\"center-map-vertical\");\n this.$tiMap.removeClass(\"center-map-horizontal\");\n\n // Check to see if we are zoomed, or map is always screen size.\n if (this.state.zoom > 1.0) {\n // Check to see if we should still be horizontally or vertically centered\n if ((constraintWidth * mapNumberTilesWidth) < mapWidth) {\n this.$tiMap.addClass(\"center-map-horizontal\");\n } else if ((constraintHeight * mapNumberTilesHeight) < mapHeight) {\n this.$tiMap.addClass(\"center-map-vertical\");\n } else {\n // Use default map values\n }\n\n // TODO find what the mouse is hovering nearest to, or over. Get that element, and zoom in. Something like\n // this? https://stackoverflow.com/questions/6519043/get-mouse-position-on-scroll\n\n // Center Mecatol Rex on the screen\n $(\"#tile-0\").get(0).scrollIntoView({behavior: \"smooth\", block:\"center\", inline: \"center\"});\n } else {\n // No need to move the map around, just center it on the screen\n this.$tiMap.addClass(\"center-map\");\n }\n }", "title": "" }, { "docid": "2ebf8ae44b598c9877315b2e2d88f12e", "score": "0.59331864", "text": "findMapSize(tiles) {\r\n const yAxis = tiles.length; // This is the longest y can be\r\n let xAxis = 0;\r\n for(var i = 0; i < yAxis;i++) {\r\n if(tiles[i].length < xAxis) xAxis = tiles[i].length;\r\n }\r\n if(yAxis > xAxis) return yAxis\r\n return xAxis\r\n }", "title": "" }, { "docid": "48bbda61d26c3b672748759884796f8d", "score": "0.5928169", "text": "function getMask(tileRatio, topTab, rightTab, bottomTab, leftTab) {\n var curvyCoords = [0, 0, 35, 15, 37, 5, 37, 5, 40, 0, 38, -5, 38, -5,\n 20, -20, 50, -20, 50, -20, 80, -20, 62, -5, 62, -5, 60, 0, 63,\n 5, 63, 5, 65, 15, 100, 0];\n var tileWidth = 100;\n var tileHeight = 100;\n var mask = \"\";\n var leftx = -4;\n var topy = 0;\n var rightx = leftx + tileWidth;\n var bottomy = topy + tileHeight;\n mask += \"M\" + leftx + \",\" + topy;\n //Top\n for (var i = 0; i < curvyCoords.length / 6; i++) {\n mask += \"C\";\n mask += leftx + curvyCoords[i * 6 + 0] * tileRatio;\n mask += \",\";\n mask += topy + topTab * curvyCoords[i * 6 + 1] * tileRatio;\n mask += \",\";\n mask += leftx + curvyCoords[i * 6 + 2] * tileRatio;\n mask += \",\";\n mask += topy + topTab * curvyCoords[i * 6 + 3] * tileRatio;\n mask += \",\";\n mask += leftx + curvyCoords[i * 6 + 4] * tileRatio;\n mask += \",\";\n mask += topy + topTab * curvyCoords[i * 6 + 5] * tileRatio;\n }\n //Right\n for (var i = 0; i < curvyCoords.length / 6; i++) {\n mask += \"C\";\n mask += rightx - rightTab * curvyCoords[i * 6 + 1] * tileRatio;\n mask += \",\";\n mask += topy + curvyCoords[i * 6 + 0] * tileRatio;\n mask += \",\";\n mask += rightx - rightTab * curvyCoords[i * 6 + 3] * tileRatio;\n mask += \",\";\n mask += topy + curvyCoords[i * 6 + 2] * tileRatio;\n mask += \",\";\n mask += rightx - rightTab * curvyCoords[i * 6 + 5] * tileRatio;\n mask += \",\";\n mask += topy + curvyCoords[i * 6 + 4] * tileRatio;\n }\n //Bottom\n for (var i = 0; i < curvyCoords.length / 6; i++) {\n mask += \"C\";\n mask += rightx - curvyCoords[i * 6 + 0] * tileRatio;\n mask += \",\";\n mask += bottomy - bottomTab * curvyCoords[i * 6 + 1] * tileRatio;\n mask += \",\";\n mask += rightx - curvyCoords[i * 6 + 2] * tileRatio;\n mask += \",\";\n mask += bottomy - bottomTab * curvyCoords[i * 6 + 3] * tileRatio;\n mask += \",\";\n mask += rightx - curvyCoords[i * 6 + 4] * tileRatio;\n mask += \",\";\n mask += bottomy - bottomTab * curvyCoords[i * 6 + 5] * tileRatio;\n }\n //Left\n for (var i = 0; i < curvyCoords.length / 6; i++) {\n mask += \"C\";\n mask += leftx + leftTab * curvyCoords[i * 6 + 1] * tileRatio;\n mask += \",\";\n mask += bottomy - curvyCoords[i * 6 + 0] * tileRatio;\n mask += \",\";\n mask += leftx + leftTab * curvyCoords[i * 6 + 3] * tileRatio;\n mask += \",\";\n mask += bottomy - curvyCoords[i * 6 + 2] * tileRatio;\n mask += \",\";\n mask += leftx + leftTab * curvyCoords[i * 6 + 5] * tileRatio;\n mask += \",\";\n mask += bottomy - curvyCoords[i * 6 + 4] * tileRatio;\n }\n return mask;\n}", "title": "" }, { "docid": "6728ad079af46864f39b9ee207882af4", "score": "0.58972716", "text": "drawMap() {\n let posx = 0;\n let posy = 0;\n let tileSize = 32;\n let mapIndex = 0;\n for ( let c = 0; c < this.map.length; c++ ) {\n for ( let r = 0; r < this.map[ 0 ].length; r++ ) {\n let tile = this.map[ c ][ r ]\n if ( tile == 1 ) {\n imageLoad.draw( \"wall_brick\", r * tileSize, c * tileSize, tileSize, tileSize );\n\n } else if ( tile == 2 ) {\n imageLoad.draw( \"wall_steel\", r * tileSize, c * tileSize, tileSize, tileSize );\n } else if ( tile == 3 ) {\n imageLoad.draw( \"trees\", r * tileSize, c * tileSize, tileSize, tileSize );\n } else if ( tile == 4 ) {\n imageLoad.draw( \"water_1\", r * tileSize, c * tileSize, tileSize, tileSize );\n } else if ( tile == 5 ) {\n imageLoad.draw( \"base\", r * tileSize, c * tileSize, tileSize, tileSize )\n }\n }\n }\n }", "title": "" }, { "docid": "e48b5f1741adcb2d106d9bf2a448e220", "score": "0.58583814", "text": "function latLongTrimmer(allLines) {\n\tconst NUM_OF_DECIMALS = 7; \t\n\tconst THE_KEYWORD_MAP = new KeyWordValues; \n\t\n\t//Grid of Buckets of Manhattan \n\tvar latPosMap = new Map; //HashMap of {Latitudes, ListOfKeys}\n\tvar longPosMap = new Map; //HashMap of {Longitudes, ListOfKeys}\n\tvar numOfLatLongPairs = 0; //used as Key\n\n\tvar latLongPairMap = new Map; //HashMap of {Lat-Long-Pair, KeyWords}\n\t// alert(\"pre for loop\");\n\t// alert(\"length: \" + allLines.length); \n\n\tfor(var i=0; i<allLines.length; i++) {\n\t\t// alert(\"entered for loop\"); \n\t\t//TODO: Need to look at the format of the line. Might need to use more accurate split function like: .split(\"\\\".*\\\",\");\n\t\tvar aLine = allLines[i];\n\t\t\n\t\tvar theLat = aLine[\"lat\"].toFixed(NUM_OF_DECIMALS);\n\t\tvar theLong = aLine[\"long\"].toFixed(NUM_OF_DECIMALS);\n\n\t\tif(!isNaN(theLat) && !isNaN(theLong)) {\n\t\t\tvar latList = latPosMap.get(theLat); //returns the list of latLongs corresponding to a specific lat\n\t\t\tvar longList = longPosMap.get(theLong); //returns the list of latLongs\n\n\t\t\tvar latExists = false; \n\t\t\tvar longExists= false; 3\n\t\t\t\n\t\t\tif(latList!=null) {\n\t\t\t\tlatExists = true; \t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//create new row in latPosMap\n\t\t\t\tlatPosMap.put(theLat, new Set());\n\t\t\t}\n\t\t\tif(longList!=null) {\n\t\t\t\tlongExists = true; \n\t\t\t}\n\t\t\telse {\n\t\t\t\t//create new row in longPosMap\n\t\t\t\tlongPosMap.put(theLong, new Set());\n\t\t\t}\n\n\t\t\tvar keyWordSet = new Set(); //adds all keywords to this set\n\t\t\tvar kwArray = aLine[\"keywords\"].split(\",\"); \n\t\t\t\n\t\t\tfor(var x=0; x<kwArray.length; x++) {\n\t\t\t\tkeyWordSet.add(kwArray[x]);\n\t\t\t}\n\n\t\t\t//if both lat & long exist, then check keywords \n\t\t\tif(longExists&&latExists) {\n\t\t\t\tvar thePosition = latList.intersection(longList);\n\t\t\t\tvar thisPosition = thePosition.getElements()[0]; \n\t\t\t\t\n\t\t\t\t//add keywords to Lat-Long\n\t\t\t\tvar updateLatLong = latLongPairMap.get(thisPosition);\n\t\t\t\tvar theResult = updateLatLong.union(keyWordSet);\n\t\t\t\ttheResult.incrementCheckin();\n\t\t\t\ttheResult.setLatAndLong(theLat, theLong); \n\t\t\t\t// alert(\"the result's size is: \" + theResult.size()); \n\n\t\t\t\tvar tmpLatLongList = theResult; \n\t\t\t\tlatLongPairMap.remove(thisPosition); \n\t\t\t\tlatLongPairMap.put(thisPosition, tmpLatLongList); \n\t\t\t}\n\t\t\t\n\t\t\t//create new lat-Long, Pair\n\t\t\telse {\n\t\t\t\tkeyWordSet.setLatAndLong(theLat, theLong); \n\t\t\t\tlatLongPairMap.put(numOfLatLongPairs, keyWordSet); \n\t\t \n\t\t \t//then add the lat-long ID value\n\t\t\t\tif(latExists) {\n\t\t\t\t\t//creates a set\n\t\t\t\t\tvar tmp = latPosMap.get(theLat); \n\t\t\t\t\tlatPosMap.remove(theLat); \n\t\t\t\t\ttmp.add(numOfLatLongPairs);\n\t\t\t\t\t// latPosMap.put(theLat,tmp); \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar latSet = new Set(); \n\t\t\t\t\tlatSet.add(numOfLatLongPairs); \n\t\t\t\t\tlatPosMap.put(theLat,latSet);\n\t\t\t\t}\n\t\t\t\tif(longExists) {\n\t\t\t\t\t// longList.append(numOfLatLongPairs);\t\n\t\t\t\t\tvar longTmp = longPosMap.get(theLong); \n\t\t\t\t\tlongPosMap.remove(theLong); \n\t\t\t\t\tlongPosMap.put(theLong, longTmp.add(numOfLatLongPairs)); \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar longSet = new Set(); \n\t\t\t\t\tlongSet.add(numOfLatLongPairs); \n\t\t\t\t\tlongPosMap.put(theLong,longSet);\n\t\t\t\t}\t\t\t\t\n\t\t\t\tnumOfLatLongPairs+=1; //Lat-Long Pair Identifier, used as key\n\t\t\t}\n\t\t\n\t\t}\t\t\t\n\t}\t\n\t//Now recalibrate all items within Map, & plot each dot!\n\tfor(var i=0; i<latLongPairMap.size; i++) {\n\t\t\tlatLongPairMap.next();\n\t\t\t//finds max, avg, & sum of each set\n\t\t\tvar theSet = latLongPairMap.value(); \n\t\t\t// for (int z=0; z<theSet.size(); z++) {\n\t\t\t// \talert(theSet.getElements()[z]); \n\t\t\t// }\n\t\t\ttheSet.recalibrate(THE_KEYWORD_MAP); \n\t}\n\tconsole.log(latLongPairMap); \n\tconsole.log(JSON.stringify(latLongPairMap.listValues())); \n\treturn latLongPairMap.listValues(); \n\n}", "title": "" }, { "docid": "68ccb951282c222b5707591631b16687", "score": "0.585389", "text": "function walkTiles(tiles,offsetX,offsetY){\n tiles.forEach(tile=>{\n tile.ranges.forEach(([x1,xlen,y1,ylen])=>{\n // for of loop\n for(const {x,y} of expandSpan(x1,xlen,y1,ylen)){\n const derivedX = x + offsetX;\n const derivedY = y + offsetY;\n if(tile.pattern){ \n const background_tile = patterns[tile.pattern].tiles;\n\n walkTiles(background_tile,x,y);\n }else{\n //key names\n expandedTiles.push({\n \"tile\":tile,\n \"colIndex\":derivedX,\n \"rowIndex\":derivedY\n });\n \n // level.tiles_matrix.set(derivedX,derivedY,{\n // name: tile.name,\n // type: tile.type\n // });\n }\n }\n });\n \n });\n\n }", "title": "" }, { "docid": "d965cd813321c6a28decd8a8a3e6346e", "score": "0.5851993", "text": "function setTilesNeighbors(tObjMap) {\n\tfor (let i = 0; i < mapSize; i++)\n\t{\n\t\tfor (let j = 0; j < mapSize; j++)\n\t\t{\n\t\t\ttObjMap.gCells[i][j][Symbol.iterator] = function* () {\n\t\t\t\tif(this.x > 0) {\n\t\t\t\t\tif(this.y > 0)\n\t\t\t\t\t\tyield tObjMap.gCells[this.x-1][this.y-1];\n\t\t\t\t\tyield tObjMap.gCells[this.x-1][this.y];\n\t\t\t\t\tif(this.y < (mapSize -1))\n\t\t\t\t\t\tyield tObjMap.gCells[this.x-1][this.y+1];\n\t\t\t\t}\n\t\t\t\tif(this.y > 0)\n\t\t\t\t\tyield tObjMap.gCells[this.x][this.y-1];\n\t\t\t\tif(this.y < (mapSize -1))\n\t\t\t\t\tyield tObjMap.gCells[this.x][this.y+1];\n\t\t\t\tif(this.x < (mapSize - 1)) {\n\t\t\t\t\tif(this.y > 0)\n\t\t\t\t\t\tyield tObjMap.gCells[this.x+1][this.y-1];\n\t\t\t\t\tyield tObjMap.gCells[this.x+1][this.y];\n\t\t\t\t\tif(this.y < (mapSize -1))\n\t\t\t\t\t\tyield tObjMap.gCells[this.x+1][this.y+1];\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0ddd8fbbc6904fceb92920fffef9f76b", "score": "0.58494294", "text": "function _get00Tile (positions, colors, normals, x, y, func) {\n var f = func;\n var dx = (_grid.xmax - _grid.xmin) / _grid.xsize;\n var dy = (_grid.ymax - _grid.ymin) / _grid.ysize;\n\n // Central point\n positions.push(x);\n positions.push(y);\n positions.push(f(x, y));\n // Left point\n positions.push(x-dx/2);\n positions.push(y-dy);\n positions.push(f(x-dx/2, y-dy));\n // Right point\n positions.push(x+dx/2);\n positions.push(y-dy);\n positions.push(f(x+dx/2, y-dy));\n\n // Central point\n colors.push(1);\n colors.push(1);\n colors.push(1);\n colors.push(1);\n // Left point\n colors.push(1);\n colors.push(1);\n colors.push(1);\n colors.push(1);\n // Right point\n colors.push(1);\n colors.push(1);\n colors.push(1);\n colors.push(1);\n\n // Compute normal\n var a = [ -dx/2, -dy , f(x-dx/2, y-dy) - f(x, y) ];\n var b = [ dx/2, -dy , f(x+dx/2, y-dy) - f(x, y) ];\n var n = vec3.cross(a, b);\n vec3.normalize(n[0]);\n vec3.normalize(n[1]);\n vec3.normalize(n[2]);\n\n // Central\n normals.push(n[0]);\n normals.push(n[1]);\n normals.push(n[2]);\n // Left point\n normals.push(n[0]);\n normals.push(n[1]);\n normals.push(n[2]);\n // Right point\n normals.push(n[0]);\n normals.push(n[1]);\n normals.push(n[2]);\n }", "title": "" }, { "docid": "adf19976629cd5a8c338f97a6e5463b3", "score": "0.58492917", "text": "function renderMinimapGravityGrid(ctx, cameraPos, w, h, scale, planets) {\n ctx.save();\n\n let start = {\n x: -(MINIMAP_POINT_SPREAD * MINIMAP_GRID_BUFFER + cameraPos.x) % MINIMAP_POINT_SPREAD,\n y: -(MINIMAP_POINT_SPREAD * MINIMAP_GRID_BUFFER + cameraPos.y) % MINIMAP_POINT_SPREAD\n };\n\n ctx.fillStyle = '#ffffff';\n ctx.strokeStyle = '#0C3613';\n ctx.lineWidth = scale; // To make the lines about 1 pixel in width.\n\n let colsAmount = ((w * scale) / MINIMAP_POINT_SPREAD) + MINIMAP_GRID_BUFFER;\n let rowsAmount = ((h * scale) / MINIMAP_POINT_SPREAD) + MINIMAP_GRID_BUFFER;\n\n let columns = [];\n\n for (let i = 0; i < colsAmount; i++) {\n if (!columns[i]) {\n columns.push([]);\n }\n\n for (let j = 0; j < rowsAmount; j++) {\n let pointVisual = {\n x: start.x + i * MINIMAP_POINT_SPREAD,\n y: start.y + j * MINIMAP_POINT_SPREAD\n };\n\n let pointWorld = makeWorldPoint(pointVisual, w, h, scale, cameraPos);\n let finalWorldPoint = applyMinimapGravity(pointWorld, pointVisual, planets, w, h, scale, cameraPos);\n let finalVisual = makeVisualPoint(finalWorldPoint, w, h, scale, cameraPos);\n\n columns[i].push(finalVisual);\n\n // look for the point next to this point\n if (columns[i - 1] && columns[i - 1][j]) {\n renderLine(ctx, columns[i - 1][j], finalVisual);\n }\n\n // look for the point above this point\n if (columns[i] && columns[i][j - 1]) {\n renderLine(ctx, columns[i][j - 1], finalVisual);\n }\n }\n }\n ctx.restore();\n}", "title": "" }, { "docid": "9c5aaa697aa796824c03924edf7c0a4e", "score": "0.5842905", "text": "function drawMap(){\n\tif(tilesReady && level_loaded){\n\t\tfor(var y = 0; y < rows; y++){\n\t\t\tfor(var x = 0; x < cols; x++){\n\t\t\t\tif(withinBounds(x,y)){\n\t\t\t\t\t//ctx.drawImage(tiles, size * map[y][x], 0, size, size, (x * size), (y * size), size, size);\n\t\t\t\t\tctx.drawImage(tiles, \n\t\t\t\t\tsize * Math.floor(map[y][x] % tpr), size * Math.floor(map[y][x] / tpr), \n\t\t\t\t\tsize, size, \n\t\t\t\t\t(x * size), (y * size), \n\t\t\t\t\tsize, size);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2428c2aeea8fe4222998e891f6d8883d", "score": "0.5813301", "text": "drawAllTileData()\n {\n for (let x = this.size.x; x--;)\n for (let y = this.size.y; y--;)\n this.drawTileData(vec2(x,y));\n }", "title": "" }, { "docid": "a62e709d0358e38a8ebdfabae20fce4e", "score": "0.5804906", "text": "function addTiles(co,jo,jn,dp,dn,dq,dk,dj,dl,dh,dg,di){xc_eh(co,\"jr\",\"jr\",{\"width\":jo,\"height\":jn,\"jr\":[dp||\"\",dn||\"\",dq||\"\",dk||\"\",dj||\"\",dl||\"\",dh||\"\",dg||\"\",di||\"\"],\"ca\":0,\"bs\":0,\"id\":\"\"},0)}", "title": "" }, { "docid": "a2949493d9f54f3f87a8d4db9972285f", "score": "0.5792312", "text": "_tileLnglatBounds(tile) {\n const e = this._tile2lng(tile[0] + 1, tile[2]);\n const w = this._tile2lng(tile[0], tile[2]);\n const s = this._tile2lat(tile[1] + 1, tile[2]);\n const n = this._tile2lat(tile[1], tile[2]);\n return toLngLatBounds([ w, n ], [ e, s ]);\n }", "title": "" }, { "docid": "7292443bdb5acd8d2db5381a9a7739bc", "score": "0.5791834", "text": "_interpolateMissing(sourcePixels) {\n const infRadLat = this.inferenceRadiusLat;\n let interGrid = [];\n\n for (let i=0; i<sourcePixels.length; i++) {\n let lat = this.latStart + this.latPxWidth * sourcePixels[i][0];\n\n let infRadLng = this.config.inferenceRadius /\n (Math.PI/180 * EARTH_MERID_RADIUS * Math.cos(this._toRad(lat))); // in long degrees\n\n // grab all within \"radius\" given by infRadLat and infRadLng\n //console.debug(\"src pixel: \", sourcePixels[i]);\n for (\n let latKey=Math.max(0, Math.floor((lat-infRadLat-this.latStart)/this.latPxWidth));\n latKey*this.latPxWidth+this.latStart<lat+infRadLat;\n latKey++\n ) {\n let toCheckLat = latKey*this.latPxWidth+this.latStart;\n if (toCheckLat+this.latPxWidth/2>this.latEnd) {\n continue; // outside bounds\n }\n\n if (typeof interGrid[latKey] == \"undefined\") {\n interGrid[latKey] = [];\n }\n\n let lng = this.lngStart + this.lngPxWidth * sourcePixels[i][1];\n //console.debug(\"interpolating at geo coord: \", lat, lng);\n for (\n let lngKey=Math.max(0, Math.floor((lng-infRadLng-this.lngStart)/this.lngPxWidth));\n lngKey*this.lngPxWidth+this.lngStart<lng+infRadLng;\n lngKey++\n ) {\n //console.debug(\"pixel:\", latKey, lngKey);\n let toCheckLng = lngKey*this.lngPxWidth+this.lngStart;\n if (toCheckLng+this.lngPxWidth/2>this.lngEnd) {\n continue; // outside bounds\n }\n\n if (\n typeof this.grid[latKey] != \"undefined\"\n && typeof this.grid[latKey][lngKey]!=\"undefined\"\n ) {\n continue; // this exists in the main grid\n }\n\n if (typeof interGrid[latKey][lngKey] == \"undefined\") {\n interGrid[latKey][lngKey] = {\n proximity: 0\n };\n }\n\n let dist = this._haversineDist(\n {lat: lat+this.latPxWidth/2, lng: lng+this.lngPxWidth/2},\n {lat: toCheckLat+this.latPxWidth/2, lng: toCheckLng+this.lngPxWidth/2}\n );\n if (dist>this.config.inferenceRadius) {\n continue;\n }\n let proximity = 1 - (dist / this.config.inferenceRadius);\n interGrid[latKey][lngKey].proximity = Math.max(proximity, interGrid[latKey][lngKey].proximity);\n\n if (typeof interGrid[latKey][lngKey].average != \"undefined\") {\n continue; // this pixel has actual sources or has already been computed\n }\n\n // finally, now get an average form nearby \"towers\"\n let aver = this._getWghtAverave(latKey, lngKey, infRadLng);\n\n if (typeof aver != \"undefined\") {\n //console.debug(\"getting aver for \", latKey, lngKey, aver);\n interGrid[latKey][lngKey].average = aver;\n // register ratio: distance to nearest source / inferenceRadius\n interGrid[latKey][lngKey].average = aver;\n } else {\n //console.debug(\"undefined WA for: \", latKey, lngKey);\n }\n }\n }\n }\n\n return interGrid;\n }", "title": "" }, { "docid": "5dac88b4e1ded66b03ec1a0fd0348840", "score": "0.5784239", "text": "static getNeighbourTiles(tile) {\n var areasize = AreaMap.getCurrent().getSize();\n var tilesize = AreaMap.getCurrent().getTileSize();\n var ret = [];\n if (tile == null) {\n return [];\n }\n var possibleNeighbours = [\n //// {x: tile.x-1, y: tile.y-1},\n { x: tile.x - 1, y: tile.y },\n //// {x: tile.x-1, y: tile.y+1},\n { x: tile.x, y: tile.y - 1 },\n { x: tile.x, y: tile.y + 1 },\n //// {x: tile.x+1, y: tile.y-1},\n { x: tile.x + 1, y: tile.y },\n ];\n // Antes de consultar si hay una colisión en el tile, hay que comprobar que\n // esté dentro de la sala\n for (let possibility of possibleNeighbours) {\n if (possibility.x >= 0 && possibility.x < areasize.width\n && possibility.y >= 0 && possibility.y < areasize.height) {\n ret.push({ x: possibility.x, y: possibility.y });\n }\n }\n return ret;\n }", "title": "" }, { "docid": "265b947e640ca9562c1578c701c6e7e2", "score": "0.577786", "text": "function computeHoldingsLayout() {\n holdingData.forEach(d => {\n const p = bgMap.latLngToLayerPoint(new L.LatLng(lat(d), lng(d)));\n d.x = p.x;\n d.y = p.y;\n });\n }", "title": "" }, { "docid": "b937690b7686c0415fc256f1e5797db4", "score": "0.577063", "text": "function recalcTile(tile) {\n\tlet i = tile.x;\n\tlet j = tile.y;\n\ttile.alt = (g_Map.height[i][j] + g_Map.height[i+1][j] + g_Map.height[i][j+1] + g_Map.height[i+1][j+1]) / 4;\n\tlet s1 = Math.abs(g_Map.height[i+1][j+1] - g_Map.height[i][j]);\n\tlet s2 = Math.abs(g_Map.height[i+1][j] - g_Map.height[i][j+1]);\n\ttile.slope = (s1 > s2) ? s1 : s2;\n}", "title": "" }, { "docid": "372dde48c5239f73e9a19c3519c9c76b", "score": "0.5762541", "text": "function positionTiles(size_of_matrix){\n\tfor(var i=0;i<size_of_matrix;i++){\n\t\tfor(var j=0;j<size_of_matrix;j++){\n\t\tvar calculatedCoord = getFreeLocation(i,j);\n\t\tMATRIX[get1D(i,j)].coord.setCoord(calculatedCoord);\n\t\tconsole.log(i.toString()+ \" , \"+ j.toString()+ \" at \"+calculatedCoord.leftCoord.toString()+\" , \"+calculatedCoord.topCoord.toString());\n\t\t}\n\t}\n}", "title": "" }, { "docid": "054507526fc08f40067ad890efab5a99", "score": "0.5747562", "text": "function makeCorridor(startx,starty,endx,endy){\n var r;\n\n if(startx < endx){\n for(r = startx; r <= endx; r++){\n map.tiles[r][starty] = new tileProtos.Floor();\n if(map.tiles[r+1][starty+1] === undefined)\n map.tiles[r+1][starty+1] = new tileProtos.Wall();\n if(map.tiles[r+1][starty-1] === undefined)\n map.tiles[r+1][starty-1] = new tileProtos.Wall();\n }\n }else {\n for(r = endx; r <= startx; r++){\n map.tiles[r][starty] = new tileProtos.Floor();\n if(map.tiles[r-1][starty+1] === undefined)\n map.tiles[r-1][starty+1] = new tileProtos.Wall();\n if(map.tiles[r-1][starty-1] === undefined)\n map.tiles[r-1][starty-1] = new tileProtos.Wall();\n } \n }\n if(starty < endy){\n for(r = starty; r <= endy; r++){\n map.tiles[endx][r] = new tileProtos.Floor();\n if(map.tiles[endx+1][r-1] === undefined)\n map.tiles[endx+1][r-1] = new tileProtos.Wall();\n if(map.tiles[endx-1][r-1] === undefined)\n map.tiles[endx-1][r-1] = new tileProtos.Wall();\n }\n }else {\n for(r = endy; r <= starty; r++){\n map.tiles[endx][r] = new tileProtos.Floor();\n if(map.tiles[endx+1][r+1] === undefined)\n map.tiles[endx+1][r+1] = new tileProtos.Wall();\n if(map.tiles[endx-1][r+1] === undefined)\n map.tiles[endx-1][r+1] = new tileProtos.Wall();\n } \n }\n\n }", "title": "" }, { "docid": "a422e274127bf73f0874828f8947257a", "score": "0.5746389", "text": "function initMap() {\n for (var y = 0; y < MAP_SIZE; y++) {\n var tr = c('tr');\n t.appendChild(tr);\n var row = [];\n for (var x = 0; x < MAP_SIZE; x++) {\n var td = c('td');\n td.onmouseover=onHover;\n td.onclick=onClick;\n td.x=x;\n td.y=y;\n td.fog=true;\n\n // Map Strategy #2\n // Scattered 2x2 blocks\n var blockX = Math.floor((x + 1) / 2);\n var blockY = Math.floor((y + 1) / 2);\n if ((x + y) > 8 &&\n ((MAP_SIZE-1 - x) + (MAP_SIZE-1 - y)) > 8 &&\n (blockX % 2 == 1 && blockY % 2 == 1)) {\n td.wall=true;\n }\n\n tr.appendChild(td);\n row.push(td);\n }\n map.push(row);\n }\n}", "title": "" }, { "docid": "5c8f9992cf26e94484ca700fd53897cf", "score": "0.57454526", "text": "function standardTileURLFunction(url,xThenY,fileExtension,token){\n if(xThenY === null || xThenY === undefined ){xThenY = false;};\n if(token === null || token === undefined ){token = '';}\n else{token = '?token='+token};\n if(fileExtension === null || fileExtension === undefined ){fileExtension = '.png';}\n \n return function(coord, zoom) {\n \n // \"Wrap\" x (logitude) at 180th meridian properly\n // NB: Don't touch coord.x because coord param is by reference, and changing its x property breakes something in Google's lib \n var tilesPerGlobe = 1 << zoom;\n var x = coord.x % tilesPerGlobe;\n console.log(coord,zoom,x)\n if (x < 0) {\n x = tilesPerGlobe+x;\n }\n // Wrap y (latitude) in a like manner if you want to enable vertical infinite scroll\n // return \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/\" + zoom + \"/\" + x + \"/\" + coord.y + \"?access_token=pk.eyJ1IjoiaWhvdXNtYW4iLCJhIjoiY2ltcXQ0cnljMDBwNHZsbTQwYXRtb3FhYiJ9.Sql6G9QR_TQ-OaT5wT6f5Q\"\n if(xThenY ){\n return url+ zoom + \"/\" + x + \"/\" + coord.y +fileExtension+token;\n }\n else{return url+ zoom + \"/\" + coord.y + \"/\" +x +fileExtension+token;}//+ (new Date()).getTime();\n \n }\n }", "title": "" }, { "docid": "691301573f24001148848768bb4e4555", "score": "0.57224673", "text": "generatePoints() {\n // Si la entidad no tiene collider, no puede bscar una ruta\n if (!this.entity.getCollider()) {\n return;\n }\n var colliders = AreaMap.getCurrent().getColliders();\n var entityCollider = this.entity.getCollider();\n // Obtenemos el tile en el que empezamos y el tile al que vamos\n var destTile = pixelToTilePosition(this.destination.x, this.destination.y);\n var startTile = pixelToTilePosition(entityCollider.centerX, entityCollider.centerY);\n // Puede ser que el tile al que vamos sea sólido, en cuyo caso la ruta es imposible\n if (colliders.nondynamicCollisionAtPosition(this.destination.x, this.destination.y)) {\n console.warn(\"Atención, Ruta Imposible: \"\n + \"Una entidad ha intentado generar una ruta hacia el tile sólido situado en (%d, %d)\", destTile.x, destTile.y);\n // ¿Para qué perder el tiempo intentando crear la ruta si ya sabemos que es imposible?\n return;\n }\n var astarmap = new Map();\n // También tenemos una cola donde añadiremos los tiles que hay que procesar. La\n // inicializamos con el tile inicial, que es por el que vamos a empezar.\n var tileQueue = [startTile];\n // También es buena idea añadir el tile inicial al mapa para que se pueda empezar\n // el procesamiento sin problemas.\n astarmap.set(this.toString(startTile), { value: 0, neighbours: [] });\n // Estaremos procesando tiles hasta que ya no queden más por procesar\n while (tileQueue.length > 0) {\n // Reordenamos la cola de tiles para que los que estén probablemente más cerca tengan prioridad para salir\n let that = this;\n tileQueue.sort((t1, t2) => that.getManhattanDistance(t1, destTile) - that.getManhattanDistance(t2, destTile));\n // Obtenemos los vecinos y los datos en el mapa del tile que estamos procesando\n // actualmente (el que está al frente de la cola)\n let neighbours = AIPath.getNeighbourTiles(tileQueue[0]);\n let currentTileData = astarmap.get(this.toString(tileQueue[0]));\n for (let neighbour of neighbours) {\n // Si el vecino no es sólido ni está todavía en el mapa\n var neighbourPixelCoords = tileToPixelPosition(neighbour.x, neighbour.y);\n if (!astarmap.has(this.toString(neighbour)) && !colliders.nondynamicCollisionAtPosition(neighbourPixelCoords.x, neighbourPixelCoords.y)) {\n // Hay que añadirlo al mapa. Además, la relación de vecindad\n // es recíproca y hay que indicarlo también.\n astarmap.set(this.toString(neighbour), {\n value: currentTileData.value + 1,\n neighbours: [tileQueue[0]]\n });\n // El tile recién añadido al mapa no se ha procesado todavía. Lo\n // procesaremos más tarde en el bucle.\n tileQueue.push(neighbour);\n // El mapa también tiene que tener constancia de los vecinos de este tile.\n // La diferencia entre los vecinos obtenidos con Path.getNeighbourTiles()\n // y los que estamos añadiendo ahora es que ahora estamos distinguiendo\n // los que son sólidos de los que no.\n currentTileData.neighbours.push(neighbour);\n }\n }\n // ¿El tile que acabamos de procesar es el tile al que teníamos que llegar?\n if (this.tilesAreEqual(tileQueue[0], destTile)) {\n // Si es así entonces esta etapa de la generación de la ruta ha terminado\n break;\n }\n else {\n // Si no, sacamos de la cola al tile que acabamos de procesar para que\n // pase el siguiente\n tileQueue.shift();\n }\n }\n // A lo mejor hemos salido del bucle anterior por haber vaciado la cola y no por haber\n // encontrado el tile de destino. Esto se debe a que la estancia donde está la entidad\n // y la estancia donde está el tile de destino están completamente separadas y aisladas\n // por tiles sólidos. En este caso, la ruta también es imposible.\n if (!this.tilesAreEqual(tileQueue[0], destTile)) {\n console.warn(\"Atención, Ruta Imposible: \"\n + \"Una entidad ha intentado generar una ruta hacia el tile (%d, %d) pero es inalcanzable \"\n + \"desde su posición actual\", destTile.x, destTile.y);\n // No podemos hacer nada más\n return;\n }\n // Ahora que ya está el mapa trazado, tenemos que hacer el recorrido inverso: Desde el\n // tile de destino hasta la posición inicial. Lo haremos utilizando los valores que\n // hemos asignado previamente en el mapa. Esta es la etapa que genera los puntos realmente.\n var currentTile = destTile;\n var lastTile = destTile;\n var lastTileAux = destTile;\n // Vamos a estar generando puntos hasta que hayamos vuelto a la posición original,\n // aunque haremos al menos una iteración para que, si no es una ruta imposible,\n // haya al menos un punto en la misma para evitar errores.\n while (!this.tilesAreEqual(currentTile, startTile) || this.points.length == 0) {\n // Hay que añadir el punto de este tile. La lista de puntos está en píxeles, así\n // que hay que pasar el tile a píxeles antes de añadirlo. El punto de destino\n // está en píxeles también así que no hay que pasarlo a nada.\n let add;\n if (currentTile == destTile) {\n add = this.destination;\n }\n else {\n add = tileToPixelPosition(currentTile.x, currentTile.y);\n }\n // Metemos el nuevo punto al principio de la lista de puntos\n this.points.unshift(add);\n // Ahora vamos a consultar los datos de este tile para determinar cuál será el siguiente\n let currentTileData = astarmap.get(this.toString(currentTile));\n for (let neighbour of currentTileData.neighbours) {\n let neighbourData = astarmap.get(this.toString(neighbour));\n // Si el vecino que estamos mirando existe y su valor es menor que el tile actual,\n // es porque está más cerca del tile inicial que el actual\n if (neighbourData && neighbourData.value < currentTileData.value) {\n // Y si además es adyacente al tile que miramos en la iteración anterior...\n if (this.areDiagonallyAdjacent(lastTile, neighbour) && this.tilesAreEqual(currentTile, destTile)) {\n // ... entonces no necesitamos tener el tile actual en la lista de puntos\n // (salvo si es el tile de destino, por muy adyacente que sea)\n this.points.shift();\n // Pasamos a este vecino para la siguiente iteración\n currentTile = neighbour;\n break;\n }\n else {\n // Ponemos a este vecino como posible tile de la siguiente iteración,\n // pero seguimos mirando por si hay otro vecino que sí es adyacente\n currentTile = neighbour;\n }\n }\n }\n // Pero hay que guardar el tile que miramos en la iteración anterior para futuras\n // referencias relacionadas con la adyacencia\n lastTile = lastTileAux;\n lastTileAux = currentTile;\n }\n }", "title": "" }, { "docid": "8fbcdf517fe20706b041c61a53bc791d", "score": "0.5696184", "text": "createMap(ySize, xSize) {\r\n this.map = [];\r\n let holeCount=0;\r\n let rowPlaceholder = [];\r\n const clearRowPlaceholder = () => rowPlaceholder=[];\r\n this.loseHat(ySize, xSize);\r\n this.startPosition(ySize, xSize);\r\n\r\n for(let i=0; i<ySize; i++) {\r\n \r\n for(let j=0; j<xSize; j++) {\r\n const randomTile = randomNumber(100);\r\n if(\r\n i===this.position.y \r\n && \r\n j===this.position.x\r\n ) {\r\n rowPlaceholder.push(this.playerTile);\r\n }\r\n else if(\r\n i===this.hat.y\r\n &&\r\n j===this.hat.x\r\n ) {\r\n rowPlaceholder.push(this.hatTile);\r\n }\r\n else if(\r\n randomTile>=0\r\n &&\r\n randomTile<=19\r\n &&\r\n holeCount<(xSize*ySize/3)+(4*ySize/10)\r\n ) {\r\n rowPlaceholder.push(this.holeTile);\r\n holeCount++;\r\n }\r\n else {\r\n rowPlaceholder.push(this.fieldTile);\r\n }\r\n }\r\n this.map.push(rowPlaceholder);\r\n clearRowPlaceholder()\r\n }\r\n }", "title": "" }, { "docid": "973b456bc8ee6097712bb0898abada45", "score": "0.5691597", "text": "function getDataBounds(tileBuffer) {\n\n var bounds = map.getBounds();\n\n var zoom = map.getZoom();\n\n var north = bounds.getNorth();\n var south = bounds.getSouth();\n var east = bounds.getEast();\n var west = bounds.getWest();\n\n var pixelXYTopLeft = LatLongToPixelXY(north, west, zoom);\n var pixelXYBottomRight = LatLongToPixelXY(south, east, zoom);\n\n var tileXTopLeft = Math.floor(pixelXYTopLeft.x / 256) - tileBuffer;\n var tileYTopLeft = Math.floor(pixelXYTopLeft.y / 256) - tileBuffer;\n\n var tileXBottomRight = Math.floor(pixelXYBottomRight.x / 256) + 1 + tileBuffer;\n var tileYBottomRight = Math.floor(pixelXYBottomRight.y / 256) + 1 + tileBuffer;\n\n pixelXYTopLeft.x = tileXTopLeft * 256;\n pixelXYTopLeft.y = tileYTopLeft * 256;\n\n pixelXYBottomRight.x = tileXBottomRight * 256;\n pixelXYBottomRight.y = tileYBottomRight * 256;\n\n var latLongTopLeft = PixelXYToLatLong(pixelXYTopLeft.x, pixelXYTopLeft.y, zoom);\n var latLongBottomRight = PixelXYToLatLong(pixelXYBottomRight.x, pixelXYBottomRight.y, zoom);\n\n return {\n north: latLongTopLeft.latitude,\n west: latLongTopLeft.longitude,\n south: latLongBottomRight.latitude,\n east: latLongBottomRight.longitude\n };\n }", "title": "" }, { "docid": "e58591c469820832847dce4f871f2126", "score": "0.5682801", "text": "function getTileIndex(x, y) {\n return y * 12 + x;\n}", "title": "" }, { "docid": "093f7e90437a4fba3d7abaa1427ceced", "score": "0.56805235", "text": "function degree2tile(lat, lng, zoom) {\n // See http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames\n var latRad = lat * Math.PI / 180;\n var n = Math.pow(2, zoom);\n var x = (lng + 180) / 360 * n\n var y = (1 - Math.log(Math.tan(latRad) + (1 / Math.cos(latRad))) / Math.PI) / 2 * n\n return {x: x, y: y};\n }", "title": "" }, { "docid": "0dfeb1cf20dbebbc010252f999866dda", "score": "0.56781673", "text": "function scaledScreen(lat1, lon1,mult){\n if(typeof screenmap !== 'undefined'){\n screenmap.setMap(null);\n }\n lat1 = lat1*Math.PI/180; \t// lat\n lon1 = lon1*Math.PI/180; \t// lon\n var d2 = 0.80 * mult; \t// half x-axis d\n var d1 = 0.45 * mult; \t// half y-axis d\n var brng = 0; \t\t// direction in degrees (clockwise from north)\n var R = 6371;\t\t\t// radius of the earth in km\n\t\t\n var boundingbox = new Array();\t\t\n\t\t\t\n for(i=0;i<4;i++) {\n if(i%2 == 0){\n var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d1/R) + Math.cos(lat1)*Math.sin(d1/R)*Math.cos(brng) );\n var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d1/R)*Math.cos(lat1), Math.cos(d1/R)-Math.sin(lat1)*Math.sin(lat2));\n\n boundingbox.push([lat2*180/Math.PI,lon2*180/Math.PI]);\n }\n else {\n var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d2/R) + Math.cos(lat1)*Math.sin(d2/R)*Math.cos(brng) );\n var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d2/R)*Math.cos(lat1), Math.cos(d2/R)-Math.sin(lat1)*Math.sin(lat2));\n\n boundingbox.push([lat2*180/Math.PI,lon2*180/Math.PI]);\n }\t\n brng += (i+1*90)*Math.PI/180 ;\n }\n var screencoords = [\n new google.maps.LatLng(boundingbox[0][0],boundingbox[3][1]),\n new google.maps.LatLng(boundingbox[0][0],boundingbox[1][1]),\n new google.maps.LatLng(boundingbox[2][0],boundingbox[1][1]),\n new google.maps.LatLng(boundingbox[2][0],boundingbox[3][1])\n ];\n screenmap = new google.maps.Polygon({\n paths: screencoords,\n strokeColor: colorTheme,\n strokeOpacity: 0.8,\n strokeWeight: 1,\n fillColor: colorTheme,\n fillOpacity: 0.35,\n draggable:true,\n zIndex: 50\n });\n //Disabled the ScreenMap polygon Interaction untill finding out how to get the current zoom level that is modified every geoposition_message\n //screenmap.setMap(map); \n\n addListenerOnPolygon(screenmap);\n\n}", "title": "" }, { "docid": "900fea137685a20548b954ab81c4932f", "score": "0.5674657", "text": "buildPointMap() {\n // initial position of arrow is \"up\"\n let result = {};\n\n // *****************************\n // * initial sizing and points *\n // *****************************\n\n // y calculations\n // calculated from top of square\n let topOffset = this.squareSize * .9;\n let bottomOffset = this.squareSize * .1\n // calculated from top of arrow\n let innerTipOffset = .333 * (topOffset - bottomOffset);\n\n let topY = this.y - topOffset;\n let bottomY = this.y - bottomOffset;\n let innerTipY = this.y - bottomOffset - innerTipOffset;\n\n // x calculation\n let sideOffset = this.squareSize * .4;\n\n let leftSideX = this.x - sideOffset;\n let rightSideX = this.x + sideOffset;\n\n // points for extremes. drawing lines between these makes all arrow edges sharp\n let p1 = {x: this.x, y: topY};\n let p2 = {x: leftSideX, y: bottomY};\n let p3 = {x: this.x, y: innerTipY};\n let p4 = {x: rightSideX, y: bottomY};\n let p5 = {x: this.x, y: topY};\n\n // *******************\n // * shrink for arcs *\n // *******************\n // shrink the line segments between the extreme points. keep extremes as \"tangent\"\n // points to guide arc\n result['p1'] = this.findPointOnLineForPercentage(p1, p2, .1);\n result['p2'] = this.findPointOnLineForPercentage(p1, p2, .8);\n result['p3'] = this.findPointOnLineForPercentage(p2, p3, .2);\n result['p4'] = p3;\n result['p5'] = this.findPointOnLineForPercentage(p3, p4, .8);\n result['p6'] = this.findPointOnLineForPercentage(p4, p1, .2);\n result['p7'] = this.findPointOnLineForPercentage(p4, p1, .9);\n\n // guiding tangets and associated radii\n const arcAngle = (45 * Math.PI) / 180;\n result['t1'] = p2;\n // result['r1'] = this.findRadiusForPointsAndAngle(result['p2'], result['p3'], arcAngle);\n\n result['t2'] = p4;\n // result['r2'] = this.findRadiusForPointsAndAngle(result['p5'], result['p6'], arcAngle);\n\n result['t3'] = p1;\n // result['r3'] = this.findRadiusForPointsAndAngle(result['p7'], result['p1'], arcAngle);\n\n return result;\n }", "title": "" }, { "docid": "a7868d26a2d81885be42c598427d69aa", "score": "0.5669378", "text": "function get2dFromTileCoordinates(pt, tileHeight) {\n var tempPt = {};\n tempPt.x = pt.x * tileHeight;\n tempPt.y = pt.y * tileHeight;\n\n return tempPt;\n}", "title": "" }, { "docid": "22859a699c01e8f0dae5fb2acc001ab8", "score": "0.56672287", "text": "generatePoints() {\r\n // Empezamos con un acceso más conveniente a la sala en la que se encuentra la entidad\r\n var room = this.entity.scene.room;\r\n // Obtenemos el tile en el que empezamos y el tile al que vamos\r\n var destTilePosition = pixelToTilePosition(this.destination);\r\n var startTilePosition = pixelToTilePosition({\r\n x: this.entity.sprite.body.center.x,\r\n y: this.entity.sprite.body.center.y\r\n });\r\n var destTile = room.getColliderTileAt(destTilePosition);\r\n var startTile = room.getColliderTileAt(startTilePosition);\r\n // Puede ser que el tile al que vamos sea sólido, en cuyo caso la ruta es imposible\r\n if (destTile.properties.Solid) {\r\n console.warn(\"Atención, Ruta Imposible: \"\r\n + \"%s ha intentado generar una ruta hacia el tile sólido situado en (%d, %d)\", this.entity.name, destTilePosition.x, destTilePosition.y);\r\n // ¿Para qué perder el tiempo intentando crear la ruta si ya sabemos que es imposible?\r\n return;\r\n }\r\n // Todos los posibles tiles que vayamos a recorrer se guardan en este mapa, que le\r\n // asigna a cada tile un valor y referencias a sus tiles colindantes\r\n var astarmap = new Map();\r\n // También tenemos una cola donde añadiremos los tiles que hay que procesar. La\r\n // inicializamos con el tile inicial, que es por el que vamos a empezar.\r\n var tileQueue = [startTile];\r\n // También es buena idea añadir el tile inicial al mapa para que se pueda empezar\r\n // el procesamiento sin problemas.\r\n astarmap.set(startTile, { value: 0, neighbours: [] });\r\n // Estaremos procesando tiles hasta que ya no queden más por procesar\r\n while (tileQueue.length > 0) {\r\n // Obtenemos los vecinos y los datos en el mapa del tile que estamos procesando\r\n // actualmente (el que está al frente de la cola)\r\n let neighbours = Path.getNeighbourTiles(room, tileQueue[0]);\r\n let currentTileData = astarmap.get(tileQueue[0]);\r\n for (let neighbour of neighbours) {\r\n // Si el vecino no es sólido ni está todavía en el mapa\r\n if (!astarmap.has(neighbour) && !neighbour.properties.Solid) {\r\n // Hay que añadirlo al mapa. Además, la relación de vecindad\r\n // es recíproca y hay que indicarlo también.\r\n astarmap.set(neighbour, {\r\n value: currentTileData.value + 1,\r\n neighbours: [tileQueue[0]]\r\n });\r\n // El tile recién añadido al mapa no se ha procesado todavía. Lo\r\n // procesaremos más tarde en el bucle.\r\n tileQueue.push(neighbour);\r\n // El mapa también tiene que tener constancia de los vecinos de este tile.\r\n // La diferencia entre los vecinos obtenidos con Path.getNeighbourTiles()\r\n // y los que estamos añadiendo ahora es que ahora estamos distinguiendo\r\n // los que son sólidos de los que no.\r\n currentTileData.neighbours.push(neighbour);\r\n }\r\n }\r\n // ¿El tile que acabamos de procesar es el tile al que teníamos que llegar?\r\n if (tileQueue[0] == destTile) {\r\n // Si es así entonces esta etapa de la generación de la ruta ha terminado\r\n break;\r\n }\r\n else {\r\n // Si no, sacamos de la cola al tile que acabamos de procesar para que\r\n // pase el siguiente\r\n tileQueue.shift();\r\n }\r\n }\r\n // A lo mejor hemos salido del bucle anterior por haber vaciado la cola y no por haber\r\n // encontrado el tile de destino. Esto se debe a que la estancia donde está la entidad\r\n // y la estancia donde está el tile de destino están completamente separadas y aisladas\r\n // por tiles sólidos. En este caso, la ruta también es imposible.\r\n if (tileQueue[0] != destTile) {\r\n console.warn(\"Atención, Ruta Imposible: \"\r\n + \"%s ha intentado generar una ruta hacia el tile (%d, %d) pero es inalcanzable \"\r\n + \"desde su posición actual\", this.entity.name, destTilePosition.x, destTilePosition.y);\r\n // No podemos hacer nada más\r\n return;\r\n }\r\n // Ahora que ya está el mapa trazado, tenemos que hacer el recorrido inverso: Desde el\r\n // tile de destino hasta la posición inicial. Lo haremos utilizando los valores que\r\n // hemos asignado previamente en el mapa. Esta es la etapa que genera los puntos realmente.\r\n var currentTile = destTile;\r\n var lastTile = destTile;\r\n var lastTileAux = destTile;\r\n // Vamos a estar generando puntos hasta que hayamos vuelto a la posición original,\r\n // aunque haremos al menos una iteración para que, si no es una ruta imposible,\r\n // haya al menos un punto en la misma para evitar errores.\r\n while (currentTile != startTile || this.points.length == 0) {\r\n // Hay que añadir el punto de este tile. La lista de puntos está en píxeles, así\r\n // que hay que pasar el tile a píxeles antes de añadirlo. El punto de destino\r\n // está en píxeles también así que no hay que pasarlo a nada.\r\n let add;\r\n if (currentTile == destTile) {\r\n add = this.destination;\r\n }\r\n else {\r\n add = tileToPixelPosition(currentTile);\r\n }\r\n // Metemos el nuevo punto al principio de la lista de puntos\r\n this.points.unshift(add);\r\n // Ahora vamos a consultar los datos de este tile para determinar cuál será el siguiente\r\n let currentTileData = astarmap.get(currentTile);\r\n for (let neighbour of currentTileData.neighbours) {\r\n let neighbourData = astarmap.get(neighbour);\r\n // Si el vecino que estamos mirando existe y su valor es menor que el tile actual,\r\n // es porque está más cerca del tile inicial que el actual\r\n if (neighbourData && neighbourData.value < currentTileData.value) {\r\n // Y si además es adyacente al tile que miramos en la iteración anterior...\r\n if (this.areDiagonallyAdjacent(lastTile, neighbour) && currentTile != destTile) {\r\n // ... entonces no necesitamos tener el tile actual en la lista de puntos\r\n // (salvo si es el tile de destino, por muy adyacente que sea)\r\n this.points.shift();\r\n // Pasamos a este vecino para la siguiente iteración\r\n currentTile = neighbour;\r\n break;\r\n }\r\n else {\r\n // Ponemos a este vecino como posible tile de la siguiente iteración,\r\n // pero seguimos mirando por si hay otro vecino que sí es adyacente\r\n currentTile = neighbour;\r\n }\r\n }\r\n }\r\n // Pero hay que guardar el tile que miramos en la iteración anterior para futuras\r\n // referencias relacionadas con la adyacencia\r\n lastTile = lastTileAux;\r\n lastTileAux = currentTile;\r\n }\r\n }", "title": "" }, { "docid": "eb3c97c96d01897f653e77f6ea8484c7", "score": "0.56660986", "text": "function displayTerrain(grid) {\n for (let i = 0; i < cols; i++) {\n for (let j = 0; j < rows; j++) {\n if (grid[i][j] < 0.3) {\n fill(10, 40, 115);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n\n else if (grid[i][j] < 0.5) {\n fill(22, 55, 138);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n\n else if (grid[i][j] < 0.7) {\n fill(56, 83, 150);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n\n else if (grid[i][j] !== \"x\") {\n fill(4, 21, 64);\n rect(i * mapUnitWidth, j * mapUnitHeight, mapUnitWidth + 1, mapUnitHeight + 1);\n }\n }\n }\n}", "title": "" }, { "docid": "b8ce966ef0369f1948bfc420a6f7d58a", "score": "0.5657645", "text": "function overlayHMap(jason){\n/*\n var ghm = \"../ufloScripts/gmaps-heatmap.js\";\n mapo = document.getElementById('map');\n var fileref=document.createElement('script')\n fileref.setAttribute(\"type\",\"text/javascript\")\n fileref.setAttribute(\"src\", ghm)\n document.getElementsByTagName(\"head\")[0].appendChild(fileref)\n n = 100000;\n var x;\n for (i = 0; i < n; i++){\n x = i* 1.1;\n }\n */\n\n caps = toObject(jason);\n console.info(\"Overlaying HeatMap for \" + caps.quantity);\n nmrkrs = theMarkers.length;\n /*\n myMarkers = theMarkers;\n */\n console.info(\"N markers: \"+ nmrkrs);\n var fullLot = [];\n for(var km = 0 ; km < nmrkrs; km++){\n mrkr = theMarkers[km];\n mpos = mrkr.getPosition();\n mlat = mpos.lat();\n mlon = mpos.lng();\n site_id = mrkr.label + \"_\" + caps.quantity;\n rmap = new google.maps.LatLng(mlat, mlon);\n dd = data[site_id];\n value = dd[ dd.length-1];\n console.info(\"Marker \" + site_id + \" Pos: \" + mrkr.getPosition());\n console.dir(mpos);\n console.dir(rmap);\n console.info(\"Marker Lat: \" + mlat + \" Marker lon: \" + mlon);\n console.info(\"Qty: \" + caps.quantity + \" = \" + value);\n var dobj = {};\n /*\n dobj[\"lat\"] = mlat;\n dobj[\"lng\"] = mlon;\n */\n dobj[\"location\"] = rmap;\n dobj[\"weight\"] = value;\n fullLot.push(dobj);\n console.dir(dobj);\n /*\n combo = mrkr.label + \"_\" + qtty;\n if(map.getBounds().contains(mrkr.getPosition()) ){\n if( hamlet[combo] == 1){\n inside.push(combo);\n }\n }\n */\n }\n console.info(\"Full-lot has \" + fullLot.length);\n var mcon = {\n // radius should be small ONLY if scaleRadius is true (or small radius is intended)\n \"radius\": 2,\n \"maxOpacity\": 1,\n // scales the radius based on map zoom\n \"scaleRadius\": true,\n // if set to false the heatmap uses the global maximum for colorization\n // if activated: uses the data maximum within the current map boundaries\n // (there will always be a red spot with useLocalExtremas true)\n \"useLocalExtrema\": true,\n // which field name in your data represents the latitude - default \"lat\"\n latField: 'lat',\n // which field name in your data represents the longitude - default \"lng\"\n lngField: 'lng',\n // which field name in your data represents the data value - default \"value\"\n valueField: 'value'\n }\n console.dir(fullLot);\n for (i = 0; i < nmrkrs; i++){\n console.info(\"lat/lon/weight: \" + fullLot[i].location.lat() + \", \", fullLot[i].location.lng() + \", \" + fullLot[i].weight);\n }\n var heatmap = new google.maps.visualization.HeatmapLayer({\n data: fullLot\n });\n /*\n heatmap = new HeatmapOverlay(map, mcon);\n var testData = {};\n testData[\"max\"] = 40;\n testData[\"data\"] = fullLot;\n\n console.dir(heatmap);\n console.dir(testData);\n */\n heatmap.setMap(map);\n /*\n */\n}", "title": "" }, { "docid": "d010f4d569e929a619fbf9e96e2e8f15", "score": "0.5649746", "text": "function subsampleHeightmap(heightmap, coordinates) {\n const { x, y } = coordinates.toObject();\n const [dimX, dimY] = heightmap.shape;\n\n const xLow = Math.min(dimX, Math.max(0, Math.floor(x)));\n const xHigh = Math.min(dimX, Math.max(0, Math.ceil(x)));\n const yLow = Math.min(dimY, Math.max(0, Math.floor(y)));\n const yHigh = Math.min(dimY, Math.max(0, Math.ceil(y)));\n\n if (\n xLow < 0 ||\n xLow >= dimX ||\n yLow < 0 ||\n yLow >= dimY ||\n xHigh < 0 ||\n xHigh >= dimX ||\n yHigh < 0 ||\n yHigh >= dimY\n ) {\n return null; // Point outside of map\n }\n\n const distanceTopLeft = vectorDistance(new Vector(xLow, yLow), coordinates);\n const distanceBotLeft = vectorDistance(new Vector(xLow, yHigh), coordinates);\n const distanceTopRight = vectorDistance(new Vector(xHigh, yLow), coordinates);\n const distanceBotRight = vectorDistance(new Vector(xHigh, yHigh), coordinates);\n\n const heightTopLeft = heightmap.get(xLow, yLow);\n const heightBotLeft = heightmap.get(xLow, yHigh);\n const heightTopRight = heightmap.get(xHigh, yLow);\n const heightBotRight = heightmap.get(xHigh, yHigh);\n\n // The quads on the heightmap are turned into in-game geomtery by\n // triangulating in the direction of SE.\n // The actual height will be a distance weighed average of the\n // points definind the triangle the target falls within.\n\n // prettier-ignore\n let interpDistance = (distanceTopLeft * heightTopLeft) + (distanceBotRight * heightBotRight);\n let norm = distanceTopLeft + distanceBotRight;\n\n if (distanceBotLeft < distanceTopRight) {\n interpDistance += distanceBotLeft * heightBotLeft;\n norm += distanceBotLeft;\n } else {\n interpDistance += distanceTopRight * heightTopRight;\n norm += distanceTopRight;\n }\n interpDistance /= norm;\n\n return interpDistance;\n}", "title": "" }, { "docid": "b80b6e5b9b4a09dd70ab22e7b0a6e075", "score": "0.56423706", "text": "addTile(Tile, startX, startY, width, height, cutoff) {\n for (let y = 0; y < height; y++) {\n if (startY + y < 0 || startY + y >= this.numTilesY) continue;\n if (!this.grid[startY + y]) this.grid[startY + y] = [];\n if (!this.gridRefs[startY + y]) this.gridRefs[startY + y] = [];\n var ypos = Math.min(y, Tile.height-1);\n ypos = this.getPositionLabel(Tile.height, height, y);\n // handle 'cutting off' the vertical ends of paths\n if (cutoff && (height > width) && (y === 0 || y === height-1)) {\n ypos = 1;\n }\n\n for (let x = 0; x < width; x++) {\n if (startX + x < 0 || startX + x >= this.numTilesX) continue;\n var xpos = x;\n xpos = this.getPositionLabel(Tile.width, width, x);\n // handle 'cutting off' the horizontal ends of paths\n if (cutoff && (height < width) && (x === 0 || x === width-1)) {\n xpos = 1;\n }\n var position = this.combinePositions(Tile, ypos, xpos, startY, y, startX, x, height, width);\n this.grid[startY + y][startX + x].push(\n <Tile\n position={position}\n hd={this.props.hd}\n ref={ (inst) => this.tileCreatedCallback(startY + y, startX + x, inst) }\n />\n );\n }\n }\n }", "title": "" }, { "docid": "cfd93c212b28d47f31b49cb4eac417ca", "score": "0.5638622", "text": "get tileOffset() {}", "title": "" }, { "docid": "c766dc1f4bbf25b3595f3f834fc043ee", "score": "0.5636349", "text": "static drawGrid() {\n const COLOR_RED4 = new BABYLON.Color4(1,0,0,1);\n const COLOR_GREEN4 = new BABYLON.Color4(0,1,0,1);\n const COLOR_BLUE4 = new BABYLON.Color4(0,0,1,1);\n \n const MAINLENGTH = MISCSETTINGS.FLOOR_WIDTH/2;\n \n var xLinePts = [new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(MAINLENGTH, 0, 0)];\n var xColors = [COLOR_RED4, COLOR_RED4];\n var xLine = BABYLON.MeshBuilder.CreateLines(\"xLine\", {points: xLinePts, colors: xColors}, scene);\n xLine.isPickable = false;\n \n var yLinePts = [new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(0, MAINLENGTH, 0)];\n var yColors = [COLOR_GREEN4, COLOR_GREEN4];\n var yLine = BABYLON.MeshBuilder.CreateLines(\"yLine\", {points: yLinePts, colors: yColors}, scene);\n yLine.isPickable = false;\n \n var zLinePts = [new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(0, 0, MAINLENGTH)];\n var zColors = [COLOR_BLUE4, COLOR_BLUE4];\n var zLine = BABYLON.MeshBuilder.CreateLines(\"zLine\", {points: zLinePts, colors: zColors}, scene);\n zLine.isPickable = false;\n \n var generalLineColor = [new BABYLON.Color4(1,1,1,1), new BABYLON.Color4(1,1,1,1)];\n // x\n for (let i = -1 * MAINLENGTH; i < MAINLENGTH + 1; i++) {\n if (i == 0) {\n let linePts = [new BABYLON.Vector3(-1 * MAINLENGTH, 0, i), new BABYLON.Vector3(0, 0, i)]\n let line = BABYLON.MeshBuilder.CreateLines(\"xline\" + i, {points: linePts, colors: generalLineColor}, scene);\n line.isPickable = false;\n }\n else {\n let linePts = [new BABYLON.Vector3(-1 * MAINLENGTH, 0, i), new BABYLON.Vector3(MAINLENGTH, 0, i)]\n let line = BABYLON.MeshBuilder.CreateLines(\"xline\" + i, {points: linePts, colors: generalLineColor}, scene);\n line.isPickable = false;\n }\n }\n // z\n for (let j = -1 * MAINLENGTH; j < MAINLENGTH + 1; j++) {\n if (j == 0) {\n let linePts = [new BABYLON.Vector3(j, 0, -1 * MAINLENGTH), new BABYLON.Vector3(j, 0, 0)]\n let line = BABYLON.MeshBuilder.CreateLines(\"xline\" + j, {points: linePts, colors: generalLineColor}, scene);\n line.isPickable = false;\n }\n else {\n let linePts = [new BABYLON.Vector3(j, 0, -1 * MAINLENGTH), new BABYLON.Vector3(j, 0, MAINLENGTH)]\n let line = BABYLON.MeshBuilder.CreateLines(\"xline\" + j, {points: linePts, colors: generalLineColor}, scene);\n line.isPickable = false;\n }\n }\n }", "title": "" }, { "docid": "5f85f6c98e34bc71f39063b48bb6a6ae", "score": "0.5636079", "text": "function getTileIndex(x, y) {\n return y * 10 + x;\n}", "title": "" }, { "docid": "d0025528d9ee2b1e326a64c690da7d61", "score": "0.56313425", "text": "onViewportLoad(tiles) {\n if (!tiles) {\n return;\n }\n\n const {zRange} = this.state;\n const ranges = tiles\n .map(tile => tile.content)\n .filter(Boolean)\n .map(arr => {\n const bounds = arr[0].header.boundingBox;\n return bounds.map(bound => bound[2]);\n });\n if (ranges.length === 0) {\n return;\n }\n const minZ = Math.min(...ranges.map(x => x[0]));\n const maxZ = Math.max(...ranges.map(x => x[1]));\n\n if (!zRange || minZ < zRange[0] || maxZ > zRange[1]) {\n this.setState({zRange: [minZ, maxZ]});\n }\n }", "title": "" }, { "docid": "977fc262dccb3b2377eeb34ea1150aa6", "score": "0.5631328", "text": "gatherConnectedTiles(tile) {\r\n\r\n // A list of array indices that are connected to the tile\r\n // and furthermore to other tiles with the same value/number.\r\n let connected = []; \r\n\r\n // Searches through all neighbours to find all connected tiles.\r\n let crawl = (rootTile, crawled, ignoreRoot) => {\r\n if (rootTile === null) {\r\n console.warn(\"rootTile not set\");\r\n return null;\r\n }\r\n\r\n let num = rootTile.number;\r\n crawled.push(rootTile);\r\n\r\n let neighbours = this.findNeighboursForTile(rootTile),\r\n counted = neighbours.length;\r\n\r\n for (let i = 0; i < counted; i++) {\r\n let t = neighbours[i],\r\n idxOf = crawled.indexOf(t);\r\n if (idxOf === -1) {\r\n crawl(t, crawled);\r\n }\r\n }\r\n }.bind(this);\r\n\r\n crawl(tile, connected, true);\r\n // we don't want to have our initial tile in the result set\r\n return connected.filter((t) => !(t.r === tile.r && t.c === tile.c));\r\n }", "title": "" }, { "docid": "aa975b6d7e774eb57fc78aef127d57fd", "score": "0.561908", "text": "function calculateViewportData(){\n var traditional;\n\n if(!map){\n return;\n }\n\n traditional = (map.height || map.width) ? true : false;\n\n stageXpx = (map.viewport[0] * map.palette.tileWidth) - (stageWidth / 2);\n stageYpx = (map.viewport[1] * map.palette.tileHeight) - (stageHeight / 2);\n\n if(traditional){\n tileSliceW = Math.ceil(Math.min(stageWidth / map.palette.tileWidth, map.width));\n tileSliceH = Math.ceil(Math.min(stageHeight / map.palette.tileHeight, map.height));\n tileSliceX = Math.floor(Math.min(stageXpx / map.palette.tileWidth, map.width - tileSliceW));\n tileSliceY = Math.floor(Math.min(stageYpx / map.palette.tileHeight, map.height - tileSliceH));\n\n if(tileSliceX < 0){\n tileSliceX = 0;\n }\n if(tileSliceY < 0){\n tileSliceY = 0;\n }\n }\n else {\n tileSliceW = Math.ceil(stageWidth / map.palette.tileWidth);\n tileSliceH = Math.ceil(stageHeight / map.palette.tileHeight);\n tileSliceX = Math.floor(stageXpx / map.palette.tileWidth);\n tileSliceY = Math.floor(stageYpx / map.palette.tileHeight);\n }\n\n tileSliceWpx = tileSliceW * map.palette.tileWidth;\n tileSliceHpx = tileSliceH * map.palette.tileHeight;\n\n renderOffsetX = -((tileSliceWpx - stageWidth) / 2);\n renderOffsetY = -((tileSliceHpx - stageHeight) / 2);\n }", "title": "" }, { "docid": "25c79913b0c110489c1610a8ddfb541b", "score": "0.56166357", "text": "function _mapTileSet() {\n if (this.tileSet) {\n var tileSet_ = {};\n for (var i = 0; i < this.rowCount; i++) {\n\n if (!tileSet_[i]) {\n tileSet_[i] = {};\n }\n for (var j = 0; j < this.columnCount; j++) {\n\n tileSet_[i][j] = {};\n\n if (this.tileSet[i][j]) {\n tileSet_[i][j].x = (j <= this.midX) ? this.x - (this.midX - j) * this.height : this.x + (j - this.midX) * this.height;\n tileSet_[i][j].y = (i <= this.midY) ? this.y - (this.midY - i) * this.height : this.y + (i - this.midY) * this.height;\n } else {\n tileSet_[i][j] = 0;\n }\n }\n }\n this.mappedTileSet = tileSet_;\n\n }\n }", "title": "" }, { "docid": "0f414c837c934af0f7f88a18934c15d7", "score": "0.5615452", "text": "function draw_map_mountain(points){\n\tfor (var k=0; k<points.length; k++) {\n\t\tfor (var l=0; l<points[k].length; l++) {\n\t\t\ttri_1(points, k, l);\n\t\t\ttri_2(points, k, l);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "76c2225ec9f5f17b62917d36cf2155a1", "score": "0.5615433", "text": "_createTile(quadcode, layer) {}", "title": "" }, { "docid": "921d8cbdca0f5356392db0211df1a43c", "score": "0.5615352", "text": "function getTileCoordinates(pt, tileHeight) {\n var tempPt = {};\n tempPt.x = Math.floor(pt.x / tileHeight);\n tempPt.y = Math.floor(pt.y / tileHeight);\n\n return tempPt;\n}", "title": "" }, { "docid": "9968a62e2c459fa7595333f0170e5b48", "score": "0.5607398", "text": "function getGeneratedTile(x, y) {\r\nvar gain = 0.5;\r\nvar hgrid = 130;\r\nvar lacunarity = 2;\r\nvar octaves = 5;\r\n\r\n\tvar result = 0;\r\n\tvar frequency = 1/hgrid;\r\n\tvar amplitude = gain;\r\n\r\n\tfor (i = 0; i < octaves; ++i)\r\n\t{\r\n\t\tresult += PerlinSimplex.noise(x * frequency, y * frequency) * amplitude;\r\n\t\tfrequency *= lacunarity;\r\n\t\tamplitude *= gain;\r\n\t}\r\n\r\n\tvar tile = new Tile(x, y);\r\n\tif(result <= 0.25) {\r\n\t\ttile.type = TILE_TYPES.DEEP_WATER;\r\n\t} else if(result <= 0.35) {\r\n\t\ttile.type = TILE_TYPES.WATER;\r\n\t} else if(result < 0.375) {\r\n\t\ttile.type = TILE_TYPES.WET_SAND;\r\n\t} else if(result <= 0.4) {\r\n\t\ttile.type = TILE_TYPES.SAND;\r\n\t} else if(result <= 0.5) {\r\n\t\ttile.type = TILE_TYPES.DIRT;\r\n\t} else if(result <= 0.6) {\r\n\t\ttile.type = TILE_TYPES.GRASS;\r\n\t} else if(result <= 0.68) {\r\n\t\ttile.type = TILE_TYPES.TALL_GRASS;\r\n\t}else if(result <= 0.72) {\r\n\t\ttile.type = TILE_TYPES.FOREST;\r\n\t} else if(result <= 0.8) {\r\n\t\ttile.type = TILE_TYPES.DARK_FOREST;\r\n\t} else if(result <= 0.85) {\r\n\t\ttile.type = TILE_TYPES.ROCK;\r\n\t} else if(result <= 0.88) {\r\n\t\ttile.type = TILE_TYPES.LAVA;\r\n\t} else {\r\n\t\ttile.type = TILE_TYPES.SNOW;\r\n\t}\r\n\treturn tile;\r\n}", "title": "" }, { "docid": "984762f100e63373ded548f25d2bbab4", "score": "0.5588697", "text": "getLayerDataFromMaps(elevation_map, moisture_map) {\n var data = [];\n for (var y = 0; y < config.MAP_HEIGHT_TILES; y++) {\n data.push([]);\n for (var x = 0; x < config.MAP_WIDTH_TILES; x++) {\n let e = elevation_map[y][x];\n let m = moisture_map[y][x];\n let tex = this.getBiome(e, m);\n\n let tileindex = this.tile_texture_ids[tex];\n if (tileindex == undefined) {\n console.log(\"No tile for given e and m:\");\n console.log(e, m);\n }\n data[y].push(tileindex);\n }\n }\n return data;\n }", "title": "" }, { "docid": "205eaa916060ca2c8a7f8485be3cef85", "score": "0.55811745", "text": "function Generate_Lat_Long_Grid_Spatially_Like_Map(polygon_extent, grid_length) {\n\n //xmax == Top - right X - coordinate of an extent envelope.\n //xmin == Bottom - left X - coordinate of an extent envelope.\n //ymax == Top - right Y - coordinate of an extent envelope.\n //ymin == Bottom - left Y - coordinate of an extent envelope.\n\n //var grid_length = 11;\n var grid = [];\n\n var xmax = polygon_extent.xmax;\n var xmin = polygon_extent.xmin;\n var ymax = polygon_extent.ymax;\n var ymin = polygon_extent.ymin;\n\n var x_distance = xmax - xmin;\n var y_distance = ymax - ymin;\n var x_interval = (xmax - xmin) / (grid_length - 1);\n var y_interval = (ymax - ymin) / (grid_length - 1);\n\n\n for (var i = grid_length - 1; i >= 0; i--) {\n\n var grid_row = [];\n\n for (var j = 0; j < grid_length; j++) {\n\n var grid_point = [];\n\n grid_point[0] = xmin + (j * x_interval);\n grid_point[1] = ymin + (i * y_interval);\n\n grid_row[j] = grid_point;\n }\n\n grid[i] = grid_row;\n\n }\n\n //console.log((\"xmax \" + xmax));\n //console.log((\"ymax \" + ymax));\n //console.log((\"xmin \" + xmin));\n //console.log((\"ymin \" + ymin));\n //console.log((\"x_distance\" + x_distance));\n //console.log((\"y_distance\" + y_distance));\n //console.log((\"x_interval\" + x_interval));\n //console.log((\"y_interval\" + y_interval));\n\n return grid;\n}", "title": "" }, { "docid": "9a37debf4855f72c4932373234a99169", "score": "0.5566175", "text": "function create_map() {\n let render_location_x\n let render_location_y\n\n\n // Iterate through map matrix and draw map.\n for (var x = 0; x < map_x; x++) {\n for (var y = 0; y < map_y; y++) {\n\n\n // Get location of where square should be rendered.\n render_location_x = (canvas_scale * x)\n render_location_y = (canvas_scale * y)\n\n // If empty.\n if(!map_matrix[y][x])\n {\n empty_location.push([render_location_x, render_location_y]);\n }\n\n }\n }\n current_in_floor_portals = []\n current_out_floor_portals = []\n for (let i = 0; i < portals_list.length; i++) {\n\n // Separate portals into \"in\" portals and \"out\" portals.\n // Collect all \"in\" portals corresponding to current floor.\n if (portals_list[i][\"In\"][\"World\"] === floor_number) {\n current_in_floor_portals.push(portals_list[i][\"In\"])\n }\n\n // Collect all \"out\" portals corresponding to current floor.\n if (portals_list[i][\"Out\"][\"World\"] === floor_number) {\n current_out_floor_portals.push(portals_list[i][\"Out\"])\n }\n }\n\n}", "title": "" }, { "docid": "b373d1c4221a1f56f0368a6572d97c52", "score": "0.55628943", "text": "function tile2long(x,z) {\n return (x/Math.pow(2,z)*360-180);\n }", "title": "" }, { "docid": "f2ca6038e19cefa3ca5d92a5572330b2", "score": "0.55516547", "text": "getNeighbors(col, row){\n var res = [];\n //left border\n if(col > 0){\n this.agentController.ocean.lattice[col-1][row].forEach( (agent) =>{\n res.push(agent);\n });\n }\n //right border\n if(col < (100/ocean.latticeSize)-1){\n this.agentController.ocean.lattice[col+1][row].forEach( (agent) =>{\n res.push(agent);\n });\n }\n //upper border\n if(row > 0){\n this.agentController.ocean.lattice[col][row-1].forEach( (agent) => {\n res.push(agent);\n });\n }\n //lower border\n if(row < (100/ocean.latticeSize)-1){\n this.agentController.ocean.lattice[col][row+1].forEach( (agent) =>{\n res.push(agent);\n });\n }\n //upper left corner\n if(row > 0 && col > 0){\n this.agentController.ocean.lattice[col-1][row-1].forEach( (agent) => {\n res.push(agent);\n });\n }\n //upper right corner\n if(row > 0 && col < (100/ocean.latticeSize)-1){\n this.agentController.ocean.lattice[col+1][row-1].forEach( (agent) => {\n res.push(agent);\n });\n }\n //lower left corner\n if(row < (100/ocean.latticeSize)-1 && col > 0){\n this.agentController.ocean.lattice[col-1][row+1].forEach( (agent) => {\n res.push(agent);\n });\n }\n //lower right corner\n if(row < (100/ocean.latticeSize)-1 && col < (100/ocean.latticeSize)-1){\n this.agentController.ocean.lattice[col+1][row+1].forEach( (agent) => {\n res.push(agent);\n });\n }\n //own cell\n this.agentController.ocean.lattice[col][row].forEach( (agent) => {\n res.push(agent);\n });\n return res;\n }", "title": "" }, { "docid": "c905e26018971eb43886d349f5b45703", "score": "0.5550104", "text": "mapTerritories() {\n const allTerritories = Object.values(this.board);\n\n allTerritories.forEach((territory) => {\n\n //draws the hexagon for each tile\n const hexagon = this.generateHexagon(territory);\n territory.setHexagon(hexagon);\n this.mapStage.addChild(hexagon);\n\n //draws the number representing the unit count\n const text = this.generateText(territory);\n this.mapStage.addChild(text);\n\n //draws all the starting sprites on the tiles\n const spriteArr = [];\n let i = territory.units;\n while (i > 0) {\n const sprite = this.generateSprite(territory);\n\n spriteArr.push(sprite);\n this.mapStage.addChild(sprite);\n i--;\n }\n\n territory.spriteArr = spriteArr;\n });\n }", "title": "" }, { "docid": "ce2a34bb684d8f4c8af72e418d8b9f06", "score": "0.55476326", "text": "function displayFloor(){\n var countTilesX;\n var countTilesY;\n\n // initialize variables\n countTilesX = 0;\n countTilesY = 0;\n numberOfTilesX = floor_length / tile_length; // stores number of tiles in a row\n numberOfTilesY = floor_width / tile_width; // stores number of tiles in a column\n\n strokeWeight(2);\n rect(0, 0, floor_length, floor_width); // output the background\n\n // generate tiles\n while (countTilesY < numberOfTilesY){ // prevents drawing over in a column\n if (countTilesX < numberOfTilesX){ // prevents drawing over in a row\n rect((0 + countTilesX) * tile_width, (0 + countTilesY) * tile_length, tile_width, tile_length);\n countTilesX = countTilesX + 1;\n } else {\n countTilesY = countTilesY + 1;\n countTilesX = 0;\n }\n }\n}", "title": "" }, { "docid": "c1c72dd7802ac6787400ffaf0a86c3f7", "score": "0.5545133", "text": "function build(tileMap, rgb, includeLocs) {\n\n}", "title": "" }, { "docid": "ff0e4c7d6ea429bfea587db515cf4876", "score": "0.5543812", "text": "function tile() {\n let s = 100;\n if (tiling.maxGen === 0) {\n s /= 1 + rt2;\n }\n const x = s * (1 + rt2 - 0.5 / rt2);\n const y = s * 0.5 * (1 + 1 / rt2);\n switch (tiling.initial) {\n case 'rhombR':\n rhombR(0, -x, -y, x, y);\n break;\n case 'rhombL':\n rhombL(0, -x, -y, x, y);\n break;\n case 'triangleR':\n s *= 1 + rt2;\n triangleR(0, -s / 2, -s / 4, s / 2, -s / 4);\n break;\n case 'triangleL':\n s *= 1 + rt2;\n triangleL(0, -s / 2, -s / 4, s / 2, -s / 4);\n break;\n }\n}", "title": "" }, { "docid": "8f6fcd4e04164529a8d2765e7d370bf8", "score": "0.5531609", "text": "tilesAroundFigure(figure){\n\t\tlet x = new Array();\n\t\tlet operators = {\n\t\t\t'+': function(a, b){return a + b},\n\t\t\t'-': function(a, b){return a - b},\n\t\t\t'=': function(a, b){return a}\n\t\t}\n\t\tfor(let i = 0; i < 8; i++){\n\t\t\tlet firstOperator;\n\t\t\tlet secondOperator;\n\t\t\tif(i === 0 || i === 4){\n\t\t\t\tfirstOperator = operators['='];\n\t\t\t\tif(i === 0) secondOperator = operators['-'];\n\t\t\t\telse if(i === 4) secondOperator = operators['+'];\n\t\t\t}\n\t\t\telse if(i <= 3) {\n\t\t\t\tfirstOperator = operators['+'];\n\t\t\t\tif(i === 1) secondOperator = operators['-'];\n\t\t\t\telse if(i === 2) secondOperator = operators['='];\n\t\t\t\telse if(i === 3) secondOperator = operators['+'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfirstOperator = operators['-'];\n\t\t\t\tif(i === 5) secondOperator = operators['+'];\n\t\t\t\telse if(i === 6) secondOperator = operators['='];\n\t\t\t\telse if(i === 7) secondOperator = operators['-'];\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\tlet tile = this.boardMatrix[firstOperator(figure.positionY, 1)][secondOperator(figure.positionX, 1)];\n\t\t\t\tif(tile !== undefined) x.push(tile);\n\t\t\t}\n\t\t\tcatch(err){}\n\t\t}\n\t\treturn x;\n\t}", "title": "" }, { "docid": "a0bda78582d9e0beb60fa35cbe3b2276", "score": "0.55311155", "text": "function renderTile(args,cb){\n args.pool.acquire(function(err, map) {\n if(err || !map) return cb(err);\n\n var bbox = mercator.bbox(args.x, args.y, args.z);\n \n map.aspect_fix_mode = mapnik.Map.ASPECT_RESPECT;\n\n map.zoomToBox(bbox);\n \n map.resize(SIZE, SIZE)\n var im = new mapnik.Image(SIZE, SIZE);\n map.render(im, {buffer_size: 128}, function(err,im) {\n setImmediate(function() { args.pool.release(map); });\n\n if (err) return cb(err);\n\n var dir = outputDir\n if (!fs.existsSync(dir)){ fs.mkdirSync(dir); }\n dir = dir + '/' + args.city;\n if (!fs.existsSync(dir)){ fs.mkdirSync(dir); }\n dir = dir+'/'+args.z;\n if (!fs.existsSync(dir)){ fs.mkdirSync(dir); }\n dir = dir + '/'+args.x;\n if (!fs.existsSync(dir)){ fs.mkdirSync(dir); }\n\n im.encode('png', function(err,buffer) {\n if (err) return cb(err);\n\n var filePng = dir + '/' + args.y+'.png';\n \n fs.writeFile(filePng, buffer, function(err){\n if (err) return cb(err);\n args.progress.current++;\n console.log(\"(\"+args.progress.current+\"/\"+args.progress.total+\")[\"+args.city+\"/\"+args.z+\"/\"+args.x+\"/\"+args.y+\"] : ✓\");\n cb(null,filePng);\n \n });\n });\n });\n });\n}", "title": "" }, { "docid": "1d33de8c2e4ae8f33da9b8bb09dd3b41", "score": "0.55300653", "text": "function drawMap() {\n \n for (let screenX = 0; screenX < 19; screenX++) {\n for (let screenY = 0; screenY < 13; screenY++) {\n let mapY = (baseMap.width + mainPlayer.y - 6 + screenY) % baseMap.width;\n let mapX = (baseMap.width + mainPlayer.x - 9 + screenX) % baseMap.width;\n for (let layer = 0; layer < 2; layer++) {\n let tile = baseMap.map[layer][mapY * baseMap.width + mapX];\n if (tile) mainTiles.drawTile(myCTX, tile, screenX * mainTiles.tileSize, screenY * mainTiles.tileSize);\n }\n \n }\n }\n mainTiles.drawTile(myCTX, mainPlayer.tile, 9*mainTiles.tileSize, 6*mainTiles.tileSize);\n}", "title": "" }, { "docid": "c7c57c8e8cf9fb7ce044fe14088daa0f", "score": "0.55261666", "text": "function filterByMiles(radius, gps_coords) {\n var starray = [];\n var ctrlat = gps_coords.lat;\n var ctrlng = gps_coords.lng;\n CL.forEach(function (clobj) {\n var clhikes = clobj.hikes;\n clhikes.forEach(function (hobj) {\n var hlat = hobj.loc.lat;\n var hlng = hobj.loc.lng;\n var distance = distFromCtr(hlat, hlng, ctrlat, ctrlng, 'M');\n if (distance <= radius) {\n starray.push(hobj);\n }\n });\n });\n NM.forEach(function (nmobj) {\n var hikeset = nmobj.loc;\n var hikelat = hikeset.lat;\n var hikelng = hikeset.lng;\n var distance = distFromCtr(hikelat, hikelng, ctrlat, ctrlng, 'M');\n if (distance <= radius) {\n starray.push(nmobj);\n }\n });\n if (starray.length > 0) {\n starray.sort(compareObj);\n formTbl(starray);\n var map_bounds = arrayBounds(starray);\n map.fitBounds(map_bounds, mapMarg);\n }\n else {\n alert(\"No hikes within specified range\");\n }\n}", "title": "" }, { "docid": "1e2d23c37e003661bd8a4fbfee64a2c5", "score": "0.55226463", "text": "function findReachableTiles(x, y, range, isMoving) {\n\tvar q = [];\n\tvar start = [x, y, 0];\n\tvar marked = [];\n\tmarked.push(x * mapWidth + y);\n\tq.push(start);\n\n\t// Breadth first search to find all possible destinations\n\twhile (q.length > 0) {\n\n\t\tpair = q.splice(0, 1)[0];\n\t\t// console.log(pair[0] + \" \" + pair[1]);\n\n\t\t// Move range check\n\t\tif (pair[2] >= range) continue;\n\n\t\t// Enumerate all possible moves\n\t\tfor (dx = -1; dx <= 1; dx++) {\n\t\t\tfor (dy = -1; dy <= 1; dy++) {\n\n\t\t\t\t// Make sure only vertical or horizontal moves\n\t\t\t\tif (dx != 0 && dy != 0) continue;\n\n\t\t\t\tvar nx = pair[0] + dx;\n\t\t\t\tvar ny = pair[1] + dy;\n\t\t\t\tvar d = pair[2] + 1;\n\n\t\t\t\t// Bounds check\n\t\t\t\tif (nx < 0 || nx >= mapHeight || ny < 0 || ny >= mapWidth) continue;\n\n\t\t\t\t// Terrain check\n\t\t\t\tif (blockMaps[nx][ny] != 0 && isMoving) continue;\n\n\t\t\t\t// bounds and obstacle check here\n\t\t\t\tif ($.inArray(nx * mapWidth + ny, marked) === -1) {\n\t\t\t\t\tmarked.push(nx * mapWidth + ny);\n\t\t\t\t\tq.push([nx, ny, d]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t\t\n\t}\n\n\t$.each(marked, function(i, coord) {\n\t\tvar x = Math.floor(coord / mapWidth);\n\t\tvar y = coord % mapWidth;\n\t\tmarked[i] = [x, y];\n\t\t//console.log(marked[i]);\n\t});\n\treturn marked;\n}", "title": "" }, { "docid": "206afab022f321788b3e7911584dfee6", "score": "0.5521655", "text": "function tileIndicesGoogle(loc, zoom) {\n const pos = project2( project1(loc) );\n const t = powersOf2[zoom];\n return {\n x: Math.round(pos.x * t),\n y: t - Math.round(pos.y * t) - 1\n };\n }", "title": "" }, { "docid": "c738cfdd8282bbd264fbd32bbbd3ce52", "score": "0.5508512", "text": "function getTL2() {\n map.setView({ zoom: 16, center: new Microsoft.Maps.Location(47.671150, -122.017540) });\n\n var options = { uriConstructor: './SdsTileServer.ashx?quadkey={quadkey}', width: 256, height: 256 };\n var tileSource = new Microsoft.Maps.TileSource(options);\n var tilelayer = new Microsoft.Maps.TileLayer({ mercator: tileSource });\n map.entities.push(tilelayer);\n}", "title": "" }, { "docid": "b45a2e59dc42b7a7a82eac475e9a19fe", "score": "0.55074996", "text": "function checkForContradictions(currentLocation, maps, portals) {\n var n = 0;\n var mapDim = [$('img[src^=\"http://images.neopets.com/nq/t\"]').closest(\"tr\").length, $('img[src^=\"http://images.neopets.com/nq/t\"]').closest(\"tr\").eq(0).find(\"td\").length - 2];\n console.log(\"Map dim: \" + mapDim);\n var halfMapSize = [Math.floor(mapDim[0]/2), Math.floor(mapDim[1]/2)];\n console.log(\"halfMapSize: \" + halfMapSize);\n var topLeftCoord = [currentLocation[0], currentLocation[1] - halfMapSize[0], currentLocation[2] - halfMapSize[1]];\n var bottomRightCoord = [currentLocation[0], currentLocation[1] + halfMapSize[0], currentLocation[2] + halfMapSize[1]];\n console.log(\"topLeftCoord: \" + topLeftCoord);\n console.log(\"bottomRightCoord: \" + bottomRightCoord);\n \n console.log(\"Top left coord from current position: \" + topLeftCoord);\n $('img[src^=\"http://images.neopets.com/nq/t\"]').each(function(){\n var currentRow = topLeftCoord[Y] + Math.floor(n / mapDim[1]);\n var currentColumn = topLeftCoord[X] + (n % mapDim[1]);\n var newTile = $(this).attr('src').substring($(this).attr('src').lastIndexOf(\"/\") + 1, $(this).attr('src').lastIndexOf(\".\"));\n\n // If our current position isn't a contradiction nor the 'lupe' tile....\n if (newTile.indexOf(\"lupe\") < 0) {\n if (maps[topLeftCoord[Z]][currentRow][currentColumn] != \"\" && maps[topLeftCoord[Z]][currentRow][currentColumn] != undefined && maps[topLeftCoord[Z]][currentRow][currentColumn].indexOf(\"unique_\") < 0 && maps[topLeftCoord[Z]][currentRow][currentColumn] != newTile) {\n console.log(\"Found a contradiction in map entries, aborting\");\n return false;\n } else {\n // Fill in the tile with our new information\n maps[topLeftCoord[Z]][currentRow][currentColumn] = maps[topLeftCoord[Z]][currentRow][currentColumn] || newTile;\n }\n }\n n++;\n });\n\n // If a contradiction was found, we need to alert the user to reconfigure\n if (n < $('img[src^=\"http://images.neopets.com/nq/t\"]').length - 1) {\n // Create a new blank map and move current location to the new map (let the player/user reconfigure position or blend maps)\n console.log(\"Detected map contradiction, alerting user to reconfigure\");\n alert(\"Whoops! Looks like Map Extender got a little confused as to where you are. \" + RECONFIGURE_POSITION_MESSAGE);\n setMapExtenderEnable(false);\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "6b5a18596824aeae7771bec0ea46128d", "score": "0.5505073", "text": "getElevation(pointAsLatLong, callback){\n const maxZoom = 15; // Reduced from 20, as per documenation, no benefit beyond zoom 15\n let tileFraction = this.tilebelt.pointToTileFraction(pointAsLatLong[0], pointAsLatLong[1], maxZoom);\n let tile = tileFraction.map(Math.floor);\n let url = this.getUrlOfElevationTile(tile);\n\n imagePixels(url, function(err, imgDataWrapper){\n if(err) return callback(err);\n\n const fractionalX = tileFraction[0] - tile[0];\n const fractionalY = tileFraction[1] - tile[1];\n\n const pixelX = Math.floor(fractionalX * imgDataWrapper.width);\n const pixelY = Math.floor(fractionalY * imgDataWrapper.height);\n\n const pixel = imgDataWrapper.getPixel(pixelX, pixelY);\n\n // Specific to mapbox.terrain-rgb encoding of height\n const height = -10000 + ((pixel.r * 256 * 256 + pixel.g * 256 + pixel.b) * 0.1);\n callback(null, height);\n }); \n }", "title": "" }, { "docid": "5a77916dc5f59d0949ae672ee6bc0eb8", "score": "0.55038404", "text": "function manualPlot(lat1, lon1, alt1, lat2, lon2, alt2, lat3, lon3, alt3) {\n\tpoint1 = [];\n\tpoint2 = [];\n\tpoint3 = [];\n\n\tlat1 = parseFloat(lat1);\n\tlon1 = parseFloat(lon1);\n\talt1 = parseFloat(alt1);\n\tlat2 = parseFloat(lat2);\n\tlon2 = parseFloat(lon2);\n\talt2 = parseFloat(alt2);\n\tlat3 = parseFloat(lat3);\n\tlon3 = parseFloat(lon3);\n\talt3 = parseFloat(alt3);\n\n\t//plot p1\n\t//useful if we wanted to get the ground altitude from GE, but sometimes inaccurate\n\t//var groundAltitude = ge.getGlobe().getGroundAltitude(lat1, lon1);\n\tpoint1.push(lat1, lon1, alt1);\n\t//Plot the point on the map\n\tplotPoint(\"P1\", lat1, lon1);\n\n\n\t//plot p2\n\t//groundAltitude = ge.getGlobe().getGroundAltitude(lat2, lon2);\n\tpoint2.push(lat2, lon2, alt2);\n\tplotPoint(\"P2\", lat2, lon2);\n\n\n\t//plot p3\n\t//groundAltitude = ge.getGlobe().getGroundAltitude(lat3, lon3);\n\tpoint3.push(lat3, lon3, alt3);\n\tplotPoint(\"P3\", lat3, lon3);\n\n\t//Find which is highest, medium, lowest\n\tvar p1z, p2z, p3z;\n\tp1z = point1[2];\n\tp2z = point2[2];\n\tp3z = point3[2];\n\n\tvar sortArr = [p1z, p2z, p3z];\n\tsortArr = sortArr.sort(function(a,b) { return a - b;});//Sort the elevation values\n\n\tvar l = sortArr[0];\n\tvar m = sortArr[1];\n\tvar h = sortArr[2];\n\n\t//vars for azimuth, distance, plunge\n\tvar hmAzimuth, hlAzimuth;\n\tvar hmDist, hlDist;\n\tvar hmPlunge, hlPlunge;\n\n\n\t//Logic to see which point is the high, medium, low\n\tif(point1[2] == h && point2[2] == m && point3[2] == l)\n\t{\n\t\thmAzimuth = calcBearing(point1, point2);\n\t\thlAzimuth = calcBearing(point1, point3);\n\n\t\thmDist = calcDistance(point1, point2);\n\t\thlDist = calcDistance(point1, point3);\n\n\t\thmPlunge = calcPlunge(point1, point2, hmDist);\n\t\thlPlunge = calcPlunge(point1, point3, hlDist);\n\t}\n\telse if(point1[2] == h && point2[2] == l && point3[2] == m)\n\t{\n\t\thmAzimuth = calcBearing(point1, point3);\n\t\thlAzimuth = calcBearing(point1, point2);\n\n\t\thmDist = calcDistance(point1, point3);\n\t\thlDist = calcDistance(point1, point2);\n\n\t\thmPlunge = calcPlunge(point1, point3, hmDist);\n\t\thlPlunge = calcPlunge(point1, point2, hlDist);\n\t}\n\telse if(point1[2] == m && point2[2] == h && point3[2] == l)\n\t{\n\t\thmAzimuth = calcBearing(point2, point1);\n\t\thlAzimuth = calcBearing(point2, point3);\n\n\t\thmDist = calcDistance(point2, point1);\n\t\thlDist = calcDistance(point2, point3);\n\n\t\thmPlunge = calcPlunge(point2, point1, hmDist);\n\t\thlPlunge = calcPlunge(point2, point3, hlDist);\n\n\t}\n\telse if(point1[2] == l && point2[2] == h && point3[2] == m)\n\t{\n\t\thmAzimuth = calcBearing(point2, point3);\n\t\thlAzimuth = calcBearing(point2, point1);\n\n\t\thmDist = calcDistance(point2, point3);\n\t\thlDist = calcDistance(point2, point1);\n\n\t\thmPlunge = calcPlunge(point2, point3, hmDist);\n\t\thlPlunge = calcPlunge(point2, point1, hlDist);\n\t}\n\telse if(point1[2] == m && point2[2] == l && point3[2] == h)\n\t{\n\t\thmAzimuth = calcBearing(point3, point1);\n\t\thlAzimuth = calcBearing(point3, point2);\n\n\t\thmDist = calcDistance(point3, point1);\n\t\thlDist = calcDistance(point3, point2);\n\n\t\thmPlunge = calcPlunge(point3, point1, hmDist);\n\t\thlPlunge = calcPlunge(point3, point2, hlDist);\n\t}\n\telse if(point1[2] == l && point2[2] == m && point3[2] == h)\n\t{\n\t\thmAzimuth = calcBearing(point3, point2);\n\t\thlAzimuth = calcBearing(point3, point1);\n\n\t\thmDist = calcDistance(point3, point2);\n\t\thlDist = calcDistance(point3, point1);\n\n\t\thmPlunge = calcPlunge(point3, point2, hmDist);\n\t\thlPlunge = calcPlunge(point3, point1, hlDist);\n\t}\n\n\n\t//Calculate the strike and dip and store in object results\n\tvar results = calcStrikeDip(hmAzimuth, hlAzimuth, hmPlunge, hlPlunge);\n\n\tdocument.getElementById('strike').innerHTML = 'Strike: <span style=\"color:#000; font-weight:bold;\">' + results.strike +'</span>';\n\tdocument.getElementById('dip').innerHTML = 'Dip: <span style=\"color:#000; font-weight:bold;\">' + results.dip +'</span>';\n\tdocument.getElementById('quad').innerHTML = 'Quadrant: <span style=\"color:#000; font-weight:bold;\">' + results.quad +'</span>';\n\tdocument.getElementById('dip-az').innerHTML = 'Dip-Azimuth: <span style=\"color:#000; font-weight:bold;\">' + results.dipaz +'</span>';\n\n\n\n\t//Draw the chosen symbol\n\tdrawSymbol(point2, hlDist, results.dip, results.dipaz);\n\tmoveCamera(point2);\n\n}", "title": "" }, { "docid": "3843cc129612109a8f1751ca79e3ceb5", "score": "0.54967076", "text": "function getTiledLayout(w, h, scale) {\n var points = [];\n var hexW = 2 * scale * 0.8660;\n var hexH = scale * 1.5;\n var rows = Math.ceil(h / hexH) + 1;\n var cols = Math.ceil(w / hexW) + 1;\n var count = rows * cols;\n var offset;\n var row;\n\n for (var i = 0; i < count; i++) {\n row = Math.floor(i / cols);\n offset = row % 2 ? -scale * 0.8660 : 0;\n points.push([i % cols * hexW + offset, row * hexH]);\n }\n\n return points;\n }", "title": "" }, { "docid": "829ace7f2c485a61e08e6ab697698248", "score": "0.5496258", "text": "function drawGridOnImage() {\n pick('#mapping-howto').innerText = 'Coordinates set. Drawing grid.';\n // let top_width = coordinates['ne'].x - coordinates['nw'].x;\n // let bottom_width = coordinates['se'].x - coordinates['sw'].x;\n // let grid_width = Math.floor((top_width + bottom_width) / 2);\n\n // let left_height = coordinates['sw'].y - coordinates['nw'].y;\n // let right_height = coordinates['se'].y - coordinates['ne'].y;\n // let grid_height = Math.floor((left_height + right_height) / 2);\n\n // let first_cell_width = coordinates['first'].x - coordinates['nw'].x;\n // let last_cell_width = coordinates['se'].x - coordinates['last'].x;\n // let cell_width = Math.floor((first_cell_width + last_cell_width) / 2);\n\n // let first_cell_height = coordinates['first'].y - coordinates['nw'].y;\n // let last_cell_height = coordinates['se'].y - coordinates['last'].y;\n // let cell_height = Math.floor((first_cell_height + last_cell_height) / 2);\n let grid_width = 500;\n let grid_height = 690;\n let cell_width = 45;\n let cell_height = 42;\n let border = 1;\n let origo = {'x': 11, 'y': 25 }; //coordinates['nw'];\n pick('#mapping-howto').innerText += ` || Grid ${grid_width}x${grid_height}, Cell ${cell_width}x${cell_height}`\n ctx.strokeStyle = \"limegreen\";\n // ctx.strokeRect(origo.x, origo.y, grid_width, grid_height);\n\n let x = origo.x;\n let y = origo.y;\n\n let rows = Math.round(grid_height / cell_height);\n let cols = Math.round(grid_width / cell_width);\n\n for (var ir = 0; ir < rows; ir++) {\n for (var ic = 0; ic < cols; ic++) {\n let c_x = x + (ic * (cell_width + border));\n let c_y = y + (ir * (cell_height + border));\n let cell_data = ctx.getImageData(c_x + (cell_height / 2), c_y + (cell_width / 2), 5, 5).data;\n // structure: const [redIndex, greenIndex, blueIndex, alphaIndex] = colorIndices;\n // we care only about rgb\n // let rgb_cell_count = (cell_data.length * 0.75);\n let total_cells = cell_data.length;\n let red_count = 0;\n for (var red_index = 0; red_index < cols; red_index++) {\n red_count += cell_data[red_index * 4];\n // if (ic == 0 && ir >= 8 && ir < 13)\n // console.log(\"R\", cell_data[red_index * 4]);\n }\n let avg_red = Math.ceil(red_count / cols);\n if (avg_red < 100) {\n ctx.fillStyle = \"rgba(255,0,0,0.5)\";\n } else if (avg_red > 250) {\n ctx.fillStyle = \"rgba(0,255,0,0.5)\";\n } else {\n ctx.fillStyle = \"rgba(0,0,255,0.5)\";\n }\n if (ic == 0 && ir >= 8 && ir < 13)\n console.log(ir, ic, avg_red);\n ctx.fillRect(c_x, c_y, cell_width, cell_height);\n // console.log(cell_avg, rgb_cell_count, rgb_sum);\n // console.log(cell_data);\n\n }\n }\n\n // while (x < grid_width) {\n // ctx.beginPath();\n // ctx.moveTo(x, y);\n // ctx.lineTo(x, y + grid_height);\n // ctx.closePath();\n // ctx.stroke();\n // x += cell_width;\n // }\n // x = origo.x;\n // y += cell_height;\n // while (y < grid_height) {\n // ctx.beginPath();\n // ctx.moveTo(x, y);\n // ctx.lineTo(x + grid_width, y);\n // ctx.closePath();\n // ctx.stroke();\n // y += cell_height;\n // }\n\n}", "title": "" }, { "docid": "cc34829dd5ad709174b001ccfc52e2d9", "score": "0.54934126", "text": "parseTiles(tds, layer, tilewidth, tileheight) {\n // pick out objects to use\n let objectLayer = null;\n let objectMap = new Map([\n ['bramble', 'brambleTile'],\n ['forestWalls', 'wallTile'],\n ]);\n if (objectMap.has(layer.name)) {\n objectLayer = objectMap.get(layer.name);\n }\n else {\n return;\n }\n // populate\n for (let i = 0; i < layer.data.length; i++) {\n let gid = layer.data[i];\n // ignore empty spots.\n if (gid === 0) {\n continue;\n }\n // lookup if we know how + want to make this one, and produce\n // it if so.\n let [terrains, desctiptor] = tds.descriptor(gid);\n if (desctiptor == null) {\n continue;\n }\n // maybe override layer if the terrain tile descriptor says to\n let curObjectLayer = objectLayer;\n if (desctiptor.objLayerOverride != null) {\n curObjectLayer = desctiptor.objLayerOverride;\n }\n let objJson = {\n height: 0.01,\n width: 0.01,\n rotation: desctiptor.angle,\n x: (i % layer.width) * tilewidth + tilewidth / 2,\n y: Math.floor(i / layer.width) * tileheight + tileheight / 2,\n };\n let e = this.produce(curObjectLayer, objJson);\n // this.ecs.addComponent(e, new Component.DebugTileInfo(terrains));\n this.ecs.addComponent(e, new Component.CollisionShape(desctiptor.coll.shape.vertices, desctiptor.coll.cTypes, desctiptor.coll.shape.shape));\n }\n }", "title": "" }, { "docid": "a63812a3505071fcf5a604cbd8d6f541", "score": "0.548906", "text": "* pixelMapper() {\n const width = this.mapWidth[1] - this.mapWidth[0];\n const height = this.mapHeight[1] - this.mapHeight[0];\n const dX = width / (this.canvasWidth - 1);\n const dY = height / (this.canvasHeight - 1);\n for (let y=0, curY=this.mapHeight[0]; y < this.canvasHeight; y++, curY+=dY) {\n for (let x=0, curX=this.mapWidth[0]; x < this.canvasWidth; x++, curX+=dX) {\n yield { x: x, y: y, mapX: curX, mapY: curY };\n }\n }\n }", "title": "" }, { "docid": "6c30e340903f2c60a499f0e289a4d298", "score": "0.5487405", "text": "function createTiledMap( w, h ) {\n\tvar m = new Array(w*h);\n\tvar moc = 0;\n\tfor (var i = 0; i < m.length; i++) {\n\t\tm[i] = {};\n\t\tm[i].height = Math.floor( 3 * Math.random() );\n\t\tm[i].setColor = function scolor() {\n\t\t\tif (this.height <= 0) {\n\t\t\t\tthis.color = '#00F088';\n\t\t\t} else if (this.height == 1) {\n\t\t\t\tthis.color = '#A0FF00';\n\t\t\t} else if (this.height == 2) {\n\t\t\t\tthis.color = '#00FF00';\n\t\t\t} else {\n\t\t\t\tthis.color = '#AAFFAA';\n\t\t\t}\n\t\t}\n\t\t\n\t\tm[i].color = '#222222';\n\t\tm[i].setColor();\n\t\t\n\t\tif (Math.random() < 0.02) {\n\t\t\tm[i].hasMana = true;\n\t\t\tmoc++;\n\t\t} else m[i].hasMana = false;\n\t\t\n\t} // END create tiles\n\tcurrentOrbs = moc;\n\tconsole.log( moc + \" mana orbs created (of \" + (w*h) + \" tiles).\");\n\t\n\tm.width = w;\n\tm.height = h;\n\tm.pixelWidth = w * tilesize;\n\tm.pixelHeight = h * tilesize;\n\t\n\tm.getTileAt = function gta( c, r ) {\n\t\treturn this[(r * this.width) + c];\n\t};\n\t\n\tm.getTileOf = function gto( ch ) {\n\t\tif (ch) {\n\t\t\tvar x = ch.getTileX(tilesize);\n\t\t\tvar y = ch.getTileY(tilesize);\n\t\t\treturn this[(y * this.width) + x];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tm.getArea = function ga( c, r, w, h ) {\n\t\tvar result = new Array();\n\t\tvar k = 0;\n\t\tvar current;\n\t\t\n\t\tfor (var i = r; i < r + h; i++) {\n\t\t\tfor (var j = c; j < c + w; j++) {\n\t\t\t\tif (i < 0 || i >= this.height) current = null;\n\t\t\t\telse if (j < 0 || j >= this.width) current = null;\n\t\t\t\telse current = this[ (i * this.width) + j ];\n\t\t\t\t\n\t\t\t\tif (current) result[k] = current;\n\t\t\t\telse result[k] = null;\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tresult.width = w;\n\t\tresult.height = h;\n\t\treturn result;\n\t}\n\t\n\treturn m;\n}", "title": "" }, { "docid": "680baddf4b007bec7943e81a0e16276e", "score": "0.54862887", "text": "calcBestWay(_lin, _col) {\n // Variaveis de controle\n let menorValHeuristico = 0;\n let menorLin = -1, menorCol = -1; // Armazenam as cordenadas do filho com menor valor heuristico\n\n let valorHeuristico; // Armazena a distancia do no filho para o destino\n\n // Os if's a seguir sempre checam se o existe um filho na direcao desejada(DIREITA, BAIXO, ESQUERDA, CIMA)\n // e tambem se esse filho nao eh um obstaculo\n // Filho da DIREITA\n if( (_col+1 >= 0 && _col+1 < this.map.dimension.col) && \n (this.map.fullMap[_lin][_col+1] != \"-\") && !this.alreadyVisited(_lin, _col+1)) {\n // Calcula o valor heuristico do no' filho\n valorHeuristico = this.calcDestDistance(_lin, _col+1);\n\n // Checa se eh o menor valor dentre os demais filhos\n if(menorValHeuristico == 0 || valorHeuristico < menorValHeuristico) {\n menorValHeuristico = valorHeuristico;\n menorLin = _lin;\n menorCol = _col+1;\n } \n }\n // Filho de BAIXO\n if( (_lin+1 >= 0 && _lin+1 < this.map.dimension.lin) && \n (this.map.fullMap[_lin+1][_col] != \"-\") && !this.alreadyVisited(_lin+1, _col)) {\n // Calcula o valor heuristico do no' filho\n valorHeuristico = this.calcDestDistance(_lin+1, _col);\n\n // Checa se eh o menor valor dentre os demais filhos\n if(menorValHeuristico == 0 || valorHeuristico < menorValHeuristico) {\n menorValHeuristico = valorHeuristico;\n menorLin = _lin+1;\n menorCol = _col;\n } \n }\n // Filho da ESQUERDA\n if( (_col-1 >= 0 && _col-1 < this.map.dimension.col) && \n (this.map.fullMap[_lin][_col-1] != \"-\") && !this.alreadyVisited(_lin, _col-1)) {\n // Calcula o valor heuristico do no' filho\n valorHeuristico = this.calcDestDistance(_lin, _col-1);\n\n // Checa se eh o menor valor dentre os demais filhos\n if(menorValHeuristico == 0 || valorHeuristico < menorValHeuristico) {\n menorValHeuristico = valorHeuristico;\n menorLin = _lin;\n menorCol = _col-1;\n } \n }\n // Filho de CIMA\n if( (_lin-1 >= 0 && _lin-1 < this.map.dimension.lin) && \n (this.map.fullMap[_lin-1][_col] != \"-\") && !this.alreadyVisited(_lin-1, _col)) {\n // Calcula o valor heuristico do no' filho\n valorHeuristico = this.calcDestDistance(_lin-1, _col);\n \n // Checa se eh o menor valor dentre os demais filhos\n if(menorValHeuristico == 0 || valorHeuristico < menorValHeuristico) {\n menorValHeuristico = valorHeuristico;\n menorLin = _lin-1;\n menorCol = _col;\n } \n }\n \n // Remove o pai da lista\n if(this.bestFSList.length > 0) {\n this.bestFSList.splice(0, 1);\n }\n\n // Adiciona o filho com menor valor heuristico\n this.bestFSList.push({menorLin, menorCol});\n\n // Adiciona o no filho no caminho gerado\n this.path.push({lin: menorLin, col: menorCol});\n return;\n }", "title": "" }, { "docid": "5302955496793cab06f9437ed8a49037", "score": "0.5484224", "text": "function LAMDENroadmap() {\n\tvar start = -4;\n\tvar end = 4;\n\tvar material = new THREE.LineBasicMaterial({color: 0x00ff00 });\n\tvar geometry = new THREE.Geometry();\n\n\tfor(i=start;i<=end;i++){\n\t\tgeometry.vertices.push(new THREE.Vector3((i*scrunch),0,0));\n\t}\n\tgeometry.vertices.push(new THREE.Vector3((end*scrunch),1,0.1));\t\t\t\n\tfor(k=end;k>=start;k--){\t\n\t\tgeometry.vertices.push(new THREE.Vector3((k*scrunch),1,0));\n\t}\n\tfor(k=start;k<=end;k++){\t\n\t\tgeometry.vertices.push(new THREE.Vector3((k*scrunch),-1,0));\n\t}\n\tvar line = new THREE.Line(geometry, material);\n\tline.position.set(0,0,0);\n\tscene.add(line);\n\t\n\tHourLabels();\n\t//grid();\n}", "title": "" }, { "docid": "33e717db56fe6f48127ba8195074f929", "score": "0.5482816", "text": "function renderLevel(args,cb){\n var bbox = args.bbox;\n var xyz = mercator.xyz(bbox, args.z);\n\n var alltiles = [];\n \n var i = 1;\n var total = (xyz.maxX - xyz.minX + 1) * (xyz.maxY - xyz.minY+ 1);\n for (var x = xyz.minX; x <= xyz.maxX; x++) {\n for (var y = xyz.minY; y <= xyz.maxY; y++) {\n alltiles.push({\n progress: args.progress,\n city: args.city,\n index: i++,\n total: total,\n pool: args.pool,\n z: args.z,\n x: x,\n y: y\n });\n }\n }\n \n \n async.map(alltiles, renderTile, function(err, results){\n if (err) return cb(err);\n cb(results);\n });\n}", "title": "" }, { "docid": "69f6e8022073ab4ebc77aa4ca25a540f", "score": "0.5462879", "text": "function setupMap()\r\n{\r\n map = [\r\n [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1],\r\n [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1],\r\n [1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1],\r\n [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1],\r\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],\r\n [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\r\n ]\r\n}", "title": "" }, { "docid": "1ec0a7f7b44a168d242a705bd7cf7d7c", "score": "0.5461591", "text": "function Here_roads(mapCenter, zoom)\n{\n //B&W map:\n //var url = \"https://image.maps.api.here.com/mia/1.6/mapview?c=\" + mapCenter.lat + \",\" + mapCenter.lng + \"&z=15&h=512&w=512&t=7&app_id=EQ2FkZpsZXXNKlWxC9GW&app_code=PdaA5007rq73wg6WSj65rQ\" +mapCenter.lat+\",\"+mapCenter.lng\n //colourful roads, dreamworks map\n\n // map without red box\n // var urlStatic = \"https://image.maps.api.here.com/mia/1.6/mapview?c=\" + mapCenter.lat + \",\" + mapCenter.lng + \"&z=\" + zoom + \"&h=512&w=512&style=dreamworks&app_id=\" + keyHere.app_id + \"&app_code=\" + keyHere.app_code;\n \n //map with red box:\n var boxsize = calcBoxSize(zoom);\n var nw = (mapCenter.lat + boxsize) + \",\" + (mapCenter.lng - boxsize);\n var ne = (mapCenter.lat + boxsize) + \",\" + (mapCenter.lng + boxsize);\n var se = (mapCenter.lat - boxsize) + \",\" + (mapCenter.lng + boxsize);\n var sw = (mapCenter.lat - boxsize) + \",\" + (mapCenter.lng - boxsize);\n var boxSpec = \"&a0=\" + nw + \",\" + ne + \",\" + se + \",\" + sw + \",\" + nw +\"&fc0=FFFF0000\";\n //console.log(\"boxSpec: \" + boxSpec);\n //https://developer.here.com/documentation/map-image/topics/examples-region-usa.html\n var urlStatic = \"https://image.maps.api.here.com/mia/1.6/region?c=\" + mapCenter.lat + \",\" + mapCenter.lng + \n boxSpec + \"&z=\" + zoom + \"&h=512&w=512&style=dreamworks&app_id=\" + keyHere.app_id + \"&app_code=\" + keyHere.app_code;\n\n //console.log(\"Here URL: \", urlStatic);\n var pixelToMeters = 156543.03392 * Math.cos(mapCenter.lat * Math.PI / 180) / Math.pow(2, zoom);\n //console.log(\"Pixel is \" + pixelToMeters);\n staticMap.setAttribute('src', urlStatic);\n map.appendChild(staticMap);\n removeWait();\n}", "title": "" }, { "docid": "aa58e318a52d704ac73216d8f60a5cd6", "score": "0.54593444", "text": "function locManchester(){\n \n bbox = [-2.306957244873047,53.4496246783658, -2.181987762451172, 53.50622200597148]; //min long, min lat, max long, max lat\n dbFolder = \"Manchester\";\n// gmMarkLoc = [53.46199902007057, -2.2304821014404297];\n tileNum = 700;\n showGame();\n initMap();\n initMap2();\n \n}", "title": "" }, { "docid": "33dd0a0b407c7663051468f1892e322b", "score": "0.54578763", "text": "buildHeatmap() {\n // Build vectors\n const lands = topojson.merge(this.jsonWorld, this.jsonWorld.objects.countries.geometries);\n if (!this.options.heatmap.disableMask) {\n this.maskHeatmap = this.layerHeatmap.append('defs')\n .append('clipPath')\n .attr('id', 'mt-map-heatmap-mask');\n\n this.maskHeatmap\n .datum(lands)\n .append('path')\n .attr('class', 'mt-map-heatmap-mask-paths')\n .attr('d', this.path);\n }\n\n this.imgHeatmap = this.layerHeatmap\n .append('image')\n .attr('width', this.getWidth())\n .attr('height', this.getHeight())\n .attr('x', 0)\n .attr('y', 0)\n .attr('class', 'mt-map-heatmap-img');\n\n if (this.options.heatmap.mask) {\n this.imgHeatmap = this.imgHeatmap.attr('clip-path', 'url(#mt-map-heatmap-mask)');\n }\n\n if (this.options.heatmap.borders) {\n const borders = topojson.mesh(\n this.jsonWorld,\n this.jsonWorld.objects.countries,\n (a, b) => a !== b,\n );\n\n this.bordersHeatmap = this.layerHeatmap\n .append('g')\n .attr('class', 'mt-map-heatmap-borders');\n\n this.bordersHeatmap.selectAll('path.mt-map-heatmap-borders-paths')\n .data([lands, borders])\n .enter()\n .append('path')\n .attr('class', 'mt-map-heatmap-borders-paths')\n .attr('fill', 'none')\n .attr('stroke-width', this.options.heatmap.borders.stroke)\n .attr('stroke', this.options.heatmap.borders.color)\n .attr('style', `opacity: ${this.options.heatmap.borders.opacity}`)\n .attr('d', this.path);\n }\n }", "title": "" }, { "docid": "0b34415da51abde810f25545ab659b9a", "score": "0.54557526", "text": "addNeighbors(tile) {\n\t\t// console.log(\"thingfish\");\n\t\t// console.log([tile.coordinates[0] - 1, tile.coordinates[0]]);\n\t\t// console.log(this.map.getItem([tile.coordinates[0] - 1, tile.coordinates[0]]));\n\t\tif(this.map.getItem([tile.coordinates[0] - 1, tile.coordinates[1]]) != undefined) {\n\t\t\tconsole.log(\"adding left neighbor\");\n\t\t\ttile.addNeighbor(\"left\", this.map.getItem([tile.coordinates[0] - 1, tile.coordinates[1]]));\n\t\t}\n\t\tif(this.map.getItem([tile.coordinates[0] + 1, tile.coordinates[1]]) != undefined) {\n\t\t\tconsole.log(\"adding right neighbor\");\n\t\t\ttile.addNeighbor(\"right\", this.map.getItem([tile.coordinates[0] + 1, tile.coordinates[1]]));\n\t\t}\n\t\tif(this.map.getItem([tile.coordinates[0], tile.coordinates[1] - 1]) != undefined) {\n\t\t\tconsole.log(\"adding up neighbor\");\n\t\t\ttile.addNeighbor(\"up\", this.map.getItem([tile.coordinates[0], tile.coordinates[1] - 1]));\n\t\t}\n\t\tif(this.map.getItem([tile.coordinates[0], tile.coordinates[1] + 1]) != undefined) {\n\t\t\tconsole.log(\"adding down neighbor\");\n\t\t\ttile.addNeighbor(\"down\", this.map.getItem([tile.coordinates[0], tile.coordinates[1] + 1]));\n\t\t}\n\t\t// for(var i in tile.neighbors.items) {\n\t\t// \tconsole.log(tile.neighbors[i]);\n\t\t// }\n\t}", "title": "" } ]
e47191be9fa783b9418426c518bcb72d
listed below. Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the the compiled file. WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD GO AFTER THE REQUIRES BELOW. = require jquery = require jquery_ujs = require twitter/bootstrap = require jqueryfileupload/basic = require jqueryfileupload/vendor/tmpl = require jquery.purr = require best_in_place = require_tree .
[ { "docid": "85c3d2fc59482c19e66515fee2192a91", "score": "0.0", "text": "function showBrand(window_width) {\n if (window_width >= 965) {\n $(\"#query\").removeClass(\"span5\").addClass(\"span3\");\n } else {\n $(\"#query\").removeClass(\"span3\").addClass(\"span5\");\n }\n}", "title": "" } ]
[ { "docid": "9ee28c4dc9643fc93ea2bbcdb4fa871c", "score": "0.6449134", "text": "function copyAssets(done) {\n var assets = {\n js: [\n \"./node_modules/jquery/dist/jquery.js\",\n \"./node_modules/bootstrap/dist/js/bootstrap.bundle.js\",\n \"./node_modules/metismenujs/dist/metismenujs.min.js\",\n \"./node_modules/jquery-slimscroll/jquery.slimscroll.js\",\n \"./node_modules/feather-icons/dist/feather.min.js\",\n ]\n };\n\n var third_party_assets = {\n css_js: [\n {\"name\": \"sortablejs\", \"assets\": [\"./node_modules/sortablejs/Sortable.min.js\"]},\n {\"name\": \"apexcharts\", \"assets\": [\"./node_modules/apexcharts/dist/apexcharts.min.js\"]},\n {\"name\": \"parsleyjs\", \"assets\": [\"./node_modules/parsleyjs/dist/parsley.min.js\"]},\n {\"name\": \"smartwizard\", \"assets\": [\"./node_modules/smartwizard/dist/js/jquery.smartWizard.min.js\", \n \"./node_modules/smartwizard/dist/css/smart_wizard.min.css\", \n \"./node_modules/smartwizard/dist/css/smart_wizard_theme_arrows.min.css\", \n \"./node_modules/smartwizard/dist/css/smart_wizard_theme_circles.min.css\",\n \"./node_modules/smartwizard/dist/css/smart_wizard_theme_dots.min.css\"\n ]},\n {\"name\": \"summernote\", \"assets\": [\"./node_modules/summernote/dist/summernote-bs4.min.js\", \"./node_modules/summernote/dist/summernote-bs4.css\"]},\n {\"name\": \"dropzone\", \"assets\": [\"./node_modules/dropzone/dist/min/dropzone.min.js\", \"./node_modules/dropzone/dist/min/dropzone.min.css\"]},\n {\"name\": \"bootstrap-tagsinput\", \"assets\": [\"./node_modules/@adactive/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js\", \"./node_modules/@adactive/bootstrap-tagsinput/dist/bootstrap-tagsinput.css\"]},\n {\"name\": \"select2\", \"assets\": [\"./node_modules/select2/dist/js/select2.min.js\", \"./node_modules/select2/dist/css/select2.min.css\"]},\n {\"name\": \"multiselect\", \"assets\": [\"./node_modules/multiselect/js/jquery.multi-select.js\", \"./node_modules/multiselect/css/multi-select.css\"]},\n {\"name\": \"flatpickr\", \"assets\": [\"./node_modules/flatpickr/dist/flatpickr.min.js\", \"./node_modules/flatpickr/dist/flatpickr.min.css\"]},\n {\"name\": \"bootstrap-colorpicker\", \"assets\": [\"./node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js\", \"./node_modules/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css\"]},\n {\"name\": \"bootstrap-touchspin\", \"assets\": [\"./node_modules/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js\", \"./node_modules/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.css\"] },\n {\n \"name\": \"datatables\", \"assets\": [\"./node_modules/datatables.net/js/jquery.dataTables.min.js\",\n \"./node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js\",\n \"./node_modules/datatables.net-responsive/js/dataTables.responsive.min.js\",\n \"./node_modules/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js\",\n \"./node_modules/datatables.net-buttons/js/dataTables.buttons.min.js\",\n \"./node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js\",\n \"./node_modules/datatables.net-buttons/js/buttons.html5.min.js\",\n \"./node_modules/datatables.net-buttons/js/buttons.flash.min.js\",\n \"./node_modules/datatables.net-buttons/js/buttons.print.min.js\",\n \"./node_modules/datatables.net-keytable/js/dataTables.keyTable.min.js\",\n \"./node_modules/datatables.net-select/js/dataTables.select.min.js\",\n \"./node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css\",\n \"./node_modules/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css\",\n \"./node_modules/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css\",\n \"./node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css\"\n ]\n },\n {\"name\": \"moment\", \"assets\": [\"./node_modules/moment/min/moment.min.js\"]},\n {\"name\": \"fullcalendar-bootstrap\", \"assets\": [\"./node_modules/@fullcalendar/bootstrap/main.min.js\", \n \"./node_modules/@fullcalendar/bootstrap/main.min.css\",\n ]\n },\n {\"name\": \"fullcalendar-core\", \"assets\": [\"./node_modules/@fullcalendar/core/main.min.js\", \n \"./node_modules/@fullcalendar/core/main.min.css\",\n ]\n },\n {\"name\": \"fullcalendar-daygrid\", \"assets\": [\"./node_modules/@fullcalendar/daygrid/main.min.js\", \n \"./node_modules/@fullcalendar/daygrid/main.min.css\"\n ]\n },\n {\"name\": \"fullcalendar-interaction\", \"assets\": [\"./node_modules/@fullcalendar/interaction/main.min.js\"]},\n {\n \"name\": \"fullcalendar-timegrid\", \"assets\": [\"./node_modules/@fullcalendar/timegrid/main.min.js\",\n \"./node_modules/@fullcalendar/timegrid/main.min.css\"]\n },\n {\n \"name\": \"fullcalendar-list\", \"assets\": [\"./node_modules/@fullcalendar/list/main.min.js\",\n \"./node_modules/@fullcalendar/list/main.min.css\"]\n },\n {\"name\": \"list-js\", \"assets\": [\"./node_modules/list.js/dist/list.min.js\"]},\n {\n \"name\": \"jqvmap\", \"assets\": [\"./node_modules/jqvmap/dist/jquery.vmap.min.js\", \n \"./node_modules/jqvmap/dist/jqvmap.min.css\",\n \"./node_modules/jqvmap/dist/maps/jquery.vmap.usa.js\",\n ]\n },\n ]\n };\n\n //copying third party assets\n lodash(third_party_assets).forEach(function (assets, type) {\n if (type == \"css_js\") {\n lodash(assets).forEach(function (plugin) {\n var name = plugin['name'];\n var assetlist = plugin['assets'];\n lodash(assetlist).forEach(function (asset) {\n gulp.src(asset).pipe(gulp.dest(folder.dist_assets + \"libs/\" + name));\n });\n });\n //gulp.src(assets).pipe(gulp.dest(folder.dist_assets + \"css/vendor\"));\n }\n });\n\n //copying required assets\n lodash(assets).forEach(function (assets, type) {\n if (type == \"scss\") {\n gulp\n .src(assets)\n .pipe(\n rename({\n // rename aaa.css to _aaa.scss\n prefix: \"_\",\n extname: \".scss\"\n })\n )\n .pipe(gulp.dest(folder.src + \"scss/vendor\"));\n } else {\n gulp.src(assets).pipe(gulp.dest(folder.src + \"js/vendor\"));\n }\n });\n\n //copying data files\n gulp.src(folder.src + \"data/**\").pipe(gulp.dest(folder.dist_assets + \"/data\"));\n\n done();\n}", "title": "" }, { "docid": "d1fda912e7de44e559dd41e8d62af60c", "score": "0.6000597", "text": "function loadDependencies() {\n /* md5.min.js */\n if (!document.getElementById(\"imguploader-md5\")) {\n var md5s = document.createElement(\"script\");\n md5s.src = \"https://raw.githubusercontent.com/emn178/js-md5/master/build/md5.min.js\";\n md5s.id = \"imguploader-md5\";\n md5s.type = \"text/javascript\";\n document.body.appendChild(md5s)\n };\n /* jquery.min.js */\n if (!document.getElementById(\"imguploader-jquery\")) {\n var jquerys = document.createElement(\"script\");\n jquerys.src = \"https://code.jquery.com/jquery-3.6.0.min.js\";\n jquerys.id = \"imguploader-jquery\";\n jquerys.type = \"text/javascript\";\n document.body.appendChild(jquerys)\n }; \n}", "title": "" }, { "docid": "ce11efdb6a9d9de7b445242ca3aa9ffc", "score": "0.5980126", "text": "function jqueryJs() {\n return src('./node_modules/jquery/dist/jquery.slim.min.js', { sourcemaps: true })\n \t.pipe(dest('./assets/js/', { sourcemaps: true }));\n}", "title": "" }, { "docid": "003712e5d379d9d1b9f0c8083cca39b4", "score": "0.57676125", "text": "function js() {\n return gulp.src(config.paths.jsFiles)\n .pipe(concat('bundle.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./_src/assets/js'));\n }", "title": "" }, { "docid": "342ad9cafa9c95957a1ee09f0959c1dd", "score": "0.5743055", "text": "function bower(mix) {\n\n\t/** JavaScript */\n\tmix\n .scripts(['../bower_components/jquery/dist/jquery.js'//, \n //'jquery-migrate.js'\n ], 'public/js/lib/jquery.js')\n .scripts(['../bower_components/bootstrap/dist/js/bootstrap.js', \n '../bower_components/bootstrap-combobox/js/bootstrap-combobox.js'], 'public/js/lib/bootstrap.js')\n \n .scripts(['../bower_components/markdown/lib/markdown.js', \n '../bower_components/to-markdown/dist/to-markdown.js',\n '../bower_components/bootstrap-markdown/js/bootstrap-markdown.js'], 'public/js/lib/markdown.js')\n \n .scripts(['../bower_components/jquery-ui/jquery-ui.js',\n '../bower_components/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.js',\n '../bower_components/jqueryui-timepicker-addon/dist/jquery-ui-sliderAccess.js'], 'public/js/lib/jquery-ui.js')\n\t\t\n .scripts(['sortable.js', \n '../bower_components/masonry/dist/masonry.pkgd.js', \n '../bower_components/imagesloaded/imagesloaded.pkgd.js', \n '../bower_components/taggingJS/tagging.js',\n '../bower_components/fancybox/lib/jquery.mousewheel-3.0.6.pack.js',\n '../bower_components/fancybox/source/jquery.fancybox.js'], 'public/js/lib/jquery.plugins.js')\n\t;\n\n\t/** CSS */\n\tmix\n\t\t.copy('resources/assets/bower_components/bootstrap-markdown/css/bootstrap-markdown.min.css', 'public/css/lib/markdown.css') // déja minifié\n\t\t\n .styles(['../bower_components/jquery-ui/themes/ui-lightness/jquery-ui.css', \n '../bower_components/jquery-ui-boostrap/css/custom-theme/jquery-ui-1.10.3.custom.css',\n '../bower_components/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.css'], 'public/css/lib/jquery-ui.css')\n\n\t\t.styles(['../bower_components/taggingJS/example/tag-basic-style.css'], 'public/css/lib/jquery.plugins.css') \n\t;\n\n\t/** Other resources */\n\tmix\n\t\t.copy('resources/assets/bower_components/jqueryui-timepicker-addon/dist/i18n/', 'public/js/lib/i18n/')\n\t\t.copy('resources/assets/bower_components/jquery-ui/themes/ui-lightness/images/', 'public/css/lib/images/')\n\t\t.copy('resources/assets/bower_components/jquery-ui-boostrap/css/custom-theme/images/', 'public/css/lib/images/')\n\t\t.copy('resources/assets/bower_components/bootstrap/dist/fonts/*.*', 'public/fonts/')\n .copy('resources/assets/bower_components/fancybox/source/*.png', 'public/img/fancybox/')\n .copy('resources/assets/bower_components/fancybox/source/*.gif', 'public/img/fancybox/')\n\t;\t\t\n}", "title": "" }, { "docid": "f8e1ad58f55f30154ba2b4aae556a1a7", "score": "0.571983", "text": "function jsTask(){\n return src([\n 'node_modules/jquery/dist/jquery.min.js',\n 'node_modules/@fortawesome/fontawesome-free/js/all.js',\n 'node_modules/bootstrap/dist/js/bootstrap.min.js',\n 'src/js/Utils/*',\n 'src/js/Ui/*.js',\n 'src/js/Analyser.js',\n 'src/js/Track.js',\n 'src/js/WaveformMarker.js',\n 'src/js/Player.js',\n 'src/js/index.js'\n\n\n ],\n {base:'node_modules'})\n .pipe(concat('app.js'))\n //.pipe(uglify())\n .pipe(dest('dist')\n );\n}", "title": "" }, { "docid": "cd000863681f8bcb44dcb807de7e19ed", "score": "0.5719247", "text": "function importjs() {\n return gulp.src([\n './node_modules/jquery/dist/jquery.js',\n './node_modules/popper.js/dist/umd/popper.js', \n './node_modules/bootstrap/dist/js/bootstrap.js',\n ])\n .pipe(rename(function(path) {\n path.basename = path.basename + '.min';\n path.extname = '.js';\n }))\n .pipe(stripdebug())\n .pipe(uglify())\n .pipe(gulp.dest(folder.build + 'assets/js/'));\n}", "title": "" }, { "docid": "cefdff62574efeca9919edef6ddf176a", "score": "0.5678316", "text": "function js() {\n var scriptPaths = [paths.js + \"/*.js\"];\n return gulp.src(scriptPaths)\n .pipe(concat(\"theme.min.js\"))\n .pipe(uglify())\n .pipe(gulp.dest(paths.js));\n}", "title": "" }, { "docid": "6c2f5f80ed547082f7e02f1d221a75a3", "score": "0.5673675", "text": "function JavascriptCompile(cb) {\n console.log('Concatinating all js assets into the minimum-viable-product.js file');\n gulp.src([\n ('bower_components/jquery/dist/jquery.min.js'),\n ('bower_components/foundation-sites/dist/foundation.min.js'),\n ('bower_components/what-input/what-input.min.js'),\n ('bower_components/wow/dist/wow.min.js'),\n ('bower_components/jquery-ui/ui/core.js'),\n ('bower_components/jquery-ui/ui/datepicker.js'),\n ('bower_components/jquery-ui/ui/widget.js'),\n ('bower_components/jquery-ui/ui/position.js'),\n ('bower_components/jquery-ui/ui/menu.js'),\n ('bower_components/jquery-ui/ui/autocomplete.js'),\n ('bower_components/jt.timepicker/jquery.timepicker.js'),\n ('bower_components/arrive/minified/arrive.min.js'),\n ('resources/js/custom/**/*')\n ]).pipe(plumber())\n .pipe(concat('minimum-viable-product.js'))\n .pipe(gulp.dest('resources/js'))\n .on('end', cb);\n}", "title": "" }, { "docid": "d6675d34a39d21061f0fbac190509cfa", "score": "0.5651499", "text": "function js() {\n return src('assets/js/**/*.js')\n .pipe($.concat('main.js'))\n .pipe(dest('app/js'))\n}", "title": "" }, { "docid": "853cd5b1f53b9aef3c530ca32a9a4d18", "score": "0.56412435", "text": "function jsTask(){\r\n return src([\r\n files.jsPath\r\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\r\n ])\r\n .pipe(concat('barcelona.min.js'))\r\n .pipe(uglify())\r\n .pipe(dest('assets/js')\r\n );\r\n}", "title": "" }, { "docid": "055dbb3020367e05c2b3aa6a6f865f95", "score": "0.5613851", "text": "function js_dev(){\n return src(['./js/navegacion.js','./js/persistencia.js','./js/alerts.js', './js/products.js']) // \n .pipe(concat(\"main.min.js\"))\n .pipe(uglify())\n .pipe(dest('./js'));\n\n}", "title": "" }, { "docid": "120df1aa8acabd80298787777f0c3c89", "score": "0.55902267", "text": "gruntUglify() {\n let assets = [];\n if (this.scripts.length > 0) {\n assets = assets.concat(this.scripts);\n }\n if (this.bundles.length > 0) {\n this.bundles.forEach((bundle, index, arr) => {\n if (bundle.type === \"js\") {\n assets.push(bundle);\n }\n });\n }\n if (assets && assets.length > 0) {\n const files = {};\n assets.forEach((asset, index, arry) => {\n files[asset.dest] = asset.dest;\n });\n return {\n files: files\n };\n }\n return undefined;\n }", "title": "" }, { "docid": "99d56ebd6ff19d00994fde871407084f", "score": "0.55750084", "text": "function scripts() {\n return gulp.src([\n \"src/js/vendors/*.js\",\n \"src/js/components/*.js\",\n \"src/js/init.js\"\n ])\n .pipe( concat( \"script.js\" ).on('error', handleError) )\n .pipe( uglify().on('error', handleError) )\n .pipe( gulp.dest( \"src/js\" ));\n }", "title": "" }, { "docid": "6ae7e21257c8aae027f993370225ce92", "score": "0.5561475", "text": "function laravel_javascriptLibraries() {\n return gulp.src(PATHS.javascriptLibraries)\n .pipe($.sourcemaps.init())\n .pipe($.babel())\n .pipe($.concat('frameworks.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('../DataMine/public/js'));\n}", "title": "" }, { "docid": "0013a286b39fd473f4aa6fd2bf2bc35d", "score": "0.5561015", "text": "function setupJquery(data) {\n var jqueryCDN = ' script(src=\"https://code.jquery.com/jquery-{{JQUERY_VERSION}}.min.js\" integrity=\"{{JQUERY_SRI_HASH}}\" crossorigin=\"anonymous\")';\n var jqueryLocalFallback = \" <script>window.jQuery || document.write(\" + \"'<script src=\" + '\"js/vendor/jquery/dist/jquery/jquery.min.js\"' + \"><\\\\/script>')</script>\";\n gulp.src(jqueryPath)\n .pipe(gulp.dest(buildLocations.jsDir+'/vendor/jquery/dist'));\n data.splice(data.length, 0, jqueryCDN);\n data.splice(data.length, 0, jqueryLocalFallback);\n}", "title": "" }, { "docid": "43c2c003c49219fce484048f55cb721b", "score": "0.5537259", "text": "function init() {\n this.$ = require(\"jquery/dist/jquery\");\n this.jQuery = this.$;\n\n require(\"svg4everybody/dist/svg4everybody\")();\n require(\"jquery-validation/dist/jquery.validate\");\n require(\"jquery.maskedinput/src/jquery.maskedinput\");\n\n $(document).ready(function () {\n // Globals\n require(\"slick-carousel/slick/slick.min\");\n\n // Modules\n require(\"./components/collapse\")();\n require(\"./components/carousel\")();\n require(\"./components/sub-menu\")();\n require(\"./components/switch-language\")();\n require(\"./components/items-providers\")();\n require(\"./components/mobile-menu\")();\n require(\"./components/forms-validate\")();\n require(\"./components/call-back-form\")();\n require(\"./components/contacts-form\")();\n });\n}", "title": "" }, { "docid": "655baf98bb747ed1ae1f7e18cd639e0b", "score": "0.54851127", "text": "function blog_javascript() {\n return gulp.src(PATHS.common_javascript.concat(PATHS.blog_javascript))\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['what-input.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n}", "title": "" }, { "docid": "130f4b28d210005789c9827619e81e46", "score": "0.54684323", "text": "function jsAsset() {\n\treturn src(`${localSettings.sourceFolder}/libs/bootstrap5/js/bootstrap.js`)\n\t.pipe(sourcemaps.init())\n\t.pipe(concat('bundle.js'))\n\t .pipe(sourcemaps.write(''))\n\t.pipe(dest(`${localSettings.distFolder}/js`));\n}", "title": "" }, { "docid": "f0b8d3c14eab4de0ac44a8206b3b6ba5", "score": "0.5461604", "text": "function js() {\n return (\n gulp.src('js/*.js')\n .pipe(uglify())\n .pipe(concat('all.min.js'))\n .pipe(gulp.dest(\"js/prod/\"))\n );\n}", "title": "" }, { "docid": "c5b98fc59b55180573a3e53f0fcf03a3", "score": "0.5460645", "text": "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('distribution/js'));\n}", "title": "" }, { "docid": "2aa2aec82e8d8f212c354ff1e6d1138b", "score": "0.54400104", "text": "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['what-input.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n}", "title": "" }, { "docid": "397c5806939abded9a193977cebadf0a", "score": "0.5432433", "text": "function js(source, destination) {\n\tconst opt = source[0] === '.' ? {} : {base: project.sourceDir}; // That cut when you build the way to destination\n\treturn gulp.src(source, opt)\n .pipe(abFilter('!vendor/**/*.js', { // Don't test vendor files\n\tyes: xo().on('error', addon.error)\n}))\n .pipe(abFilter('!*.js')) // Stop root files\n .pipe(gulp.dest(project.destDir + destination))\n .pipe(abFilter(project.destDirP !== '')) // Stop if not set production folder\n .pipe(abFilter('!*.debug.js')) // Stop debug files\n .pipe(uglify().on('error', addon.error))\n .pipe(gulp.dest(project.destDirP + destination))\n ;\n}", "title": "" }, { "docid": "96a3409b24b47455a35334c1653357ab", "score": "0.5423181", "text": "function copyJs() {\n return gulp\n .src([html5shiv, cookies])\n .pipe(changed(project_dir + dist_assets_js))\n .pipe(gulp.dest(project_dir + dist_assets_js))\n}", "title": "" }, { "docid": "0a4ab77349d7806c2a7ff985e440b510", "score": "0.54032445", "text": "function supportBrowsersAssets(){\n return gulp.src([\n './src/scripts/vendors/' + 'html5shiv.min.js',\n './src/scripts/vendors/' + 'respond.min.js',\n ])\n .pipe(gulp.dest(paths.scripts.dist));\n}", "title": "" }, { "docid": "2cc4b43260500853b7045a3872384cb8", "score": "0.53858745", "text": "function scripts() {\n return gulp.src('./lib/js/custom/*.js')\n .pipe(concat('scripts.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./lib/js/min'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "99b8e50c425cfac470ae2e75e99d61d5", "score": "0.5369373", "text": "function vendorJs() {\n //for all files './src/js/**/*.js'\n return gulp.src('./src/vendor/js/**/*.js')\n //concatenation\n .pipe(concat('vendor.js'))\n //clean js\n .pipe(uglify({\n toplevel: true\n }))\n //out file\n .pipe(gulp.dest('./build/js'))\n //reload browser\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "537c0734eeb54df58a8c7909a87b19e5", "score": "0.53661597", "text": "function javascriptLibraries() {\n return gulp.src(PATHS.javascriptLibraries)\n .pipe($.sourcemaps.init())\n .pipe($.babel())\n .pipe($.concat('frameworks.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('distribution/js'));\n}", "title": "" }, { "docid": "3a358caf276d9b69df22bc87657233d5", "score": "0.5342591", "text": "function js(cb) {\n gulp\n .src(devPaths.script + '/**/*.js')\n .pipe(plugins.uglify())\n .pipe(gulp.dest(webPaths.script))\n .pipe(browserSync.stream())\n cb()\n}", "title": "" }, { "docid": "c9d35a96a92521843c6a106c69c724d4", "score": "0.5329907", "text": "function vendor (done) {\n src(\n [\n 'source/js/vendors/jquery.min.js',\n 'source/js/vendors/*.js'\n ])\n .pipe(plumber())\n .pipe(concat('vendors.js'))\n .pipe(uglify())\n .pipe(dest('build/assets/js'))\n done()\n}", "title": "" }, { "docid": "1716a3ebf4b43a63b143f6aba80f3097", "score": "0.53279567", "text": "function scripts() {\n return gulp\n .src([\n // \"./library/js/cookie-consent-box.min.js\",\n // \"./library/js/vendor/chocolat.js\",\n \"./library/js/scripts.js\"\n ])\n .pipe(plumber({ errorHandler: onError }))\n .pipe(\n uglify({\n mangle: false,\n compress: {\n hoist_funs: false\n }\n })\n )\n .pipe(concat(\"all.min.js\"))\n .pipe(gulp.dest(\"./dist/js/\"))\n .pipe(browsersync.stream());\n}", "title": "" }, { "docid": "78a190d07aaec6c42849e5b24c71775e", "score": "0.53254944", "text": "function scripts() {\n log(\"-> Compiling Scripts\");\n gulp.src([\n paths.bower + '/jquery/dist/jquery.js',\n paths.bower + '/foundation-sites/dist/js/foundation.js'\n ])\n .pipe(uglify())\n .pipe(concat('main.min.js'))\n .pipe(gulp.dest('./web/assets/dist/js'));\n\n return gulp.src([\n paths.src + '/js/script.js',\n paths.src + '/js/scripts/ui.js',\n paths.src + '/js/scripts/alertExample.js'\n ])\n .pipe(sourcemaps.init())\n .pipe(uglify())\n .pipe(concat('scripts.min.js'))\n .pipe(size({\n //gzip: true,\n showFiles: true \n }))\n .pipe(sourcemaps.write('./maps'))\n .pipe(lec({verbose:true, eolc: 'LF', encoding:'utf8'}))\n .pipe(gulp.dest('./web/assets/dist/js'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "7eb41073a4f6d8926e6609ea197e10ec", "score": "0.5321971", "text": "function js(){\n\tif(isProd){\n\t\t$.fancyLog('-> Bundling JS via webpack ...');\n\t}else{\n\t\t$.fancyLog('-> Bundling Production JS via webpack ...');\n\t}\n\n\tvar jsDest = pkg.paths.public.js;\n\tif(isProd){\n\t\tjsDest = pkg.paths.production.js;\n\t}\n\n\treturn gulp.src(pkg.paths.src.js + pkg.vars.jsName)\n\t\t.pipe($.plumber({errorHandler: onError}))\n\t\t.pipe($.print())\n\t\t.pipe($.webpackStream( require('./webpack.config')(), null, function(err){\n\t\t\tif(err) {\n\t\t\t\t$.fancyLog.error(err);\n\t\t\t}\n\t\t} ))\n\t\t.pipe($.size({gzip: true, showFiles: true}))\n\t\t.pipe(gulp.dest(jsDest));\n}", "title": "" }, { "docid": "775625a042ab3184effc4bb5264d6a36", "score": "0.5313714", "text": "function vendorJS() {\n\treturn src(config.vendorJS.src)\n\t\t.pipe(dest(config.vendorJS.dest));\n}", "title": "" }, { "docid": "4d1db659943b6775bdc79b6458eeb385", "score": "0.52554065", "text": "function js() {\n return (\n gulp.src([\"wordpress/wp-content/themes/tempshop-theme/assets/js/*.js\", \"wordpress/wp-content/themes/tempshop-theme/assets/!js/*min.js\"])\n .pipe(terser())\n .pipe(rename({\n suffix: \".min\"\n }))\n .pipe(gulp.dest(\"wordpress/wp-content/themes/tempshop-theme/assets/js\"))\n );\n}", "title": "" }, { "docid": "c86edeeb513d53530a423a637f541952", "score": "0.5251993", "text": "function includeBootstrap () {\n return false;\n}", "title": "" }, { "docid": "78459242588f8ca5fd8a5669603cfeba", "score": "0.52513075", "text": "function scripts() {\n //Template to the searching JS files\n return gulp.src(jsFiles)\n\n //Concat all css files in './build/js/main.js'\n .pipe(concat('main.js'))\n\n //plugin to minify CSS\n .pipe(jsTerser())\n\n //Entering folder for the files\n .pipe(gulp.dest('./build/js'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "7c8667f26c30bb453d4bd5429c8e9f58", "score": "0.5251191", "text": "function modules() {\n // Bootstrap JS\n var bootstrapJS = gulp.src('./node_modules/bootstrap/dist/js/*')\n .pipe(gulp.dest(vendorPath + 'bootstrap/js'));\n // Bootstrap SCSS\n var bootstrapSCSS = gulp.src('./node_modules/bootstrap/scss/**/*')\n .pipe(gulp.dest(vendorPath + 'bootstrap/scss'));\n // ChartJS\n var chartJS = gulp.src('./node_modules/chart.js/dist/*.js')\n .pipe(gulp.dest(vendorPath + 'chart.js'));\n // dataTables\n var dataTables = gulp.src([\n './node_modules/datatables.net/js/*.js',\n './node_modules/datatables.net-bs4/js/*.js',\n './node_modules/datatables.net-bs4/css/*.css'\n ])\n .pipe(gulp.dest(vendorPath + 'datatables'));\n // Font Awesome\n var fontAwesome = gulp.src('./node_modules/@fortawesome/**/*')\n .pipe(gulp.dest(vendorPath));\n // jQuery Easing\n var jqueryEasing = gulp.src('./node_modules/jquery.easing/*.js')\n .pipe(gulp.dest(vendorPath + 'jquery-easing'));\n // jQuery\n var jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ])\n .pipe(gulp.dest(vendorPath + 'jquery'));\n return merge(bootstrapJS, bootstrapSCSS, chartJS, dataTables, fontAwesome, jquery, jqueryEasing);\n}", "title": "" }, { "docid": "db44f0feb60cf2744eac6d6563e04ab8", "score": "0.5247685", "text": "function scripts() {\n\treturn (\n\t gulp\n\t\t.src(js_in)\n\t\t.pipe(plumber())\n\t\t.pipe(concat('main.min.js'))\n\t\t.pipe(uglify())\n\t\t.pipe(gulp.dest(js_out))\n\t\t.pipe(browsersync.stream())\n\t);\n}", "title": "" }, { "docid": "5e6e16c800f7c3e7cde8fc31a6172349", "score": "0.52466667", "text": "function scripts() {\n return (\n gulp\n .src([\"./app/js/**/*\"])\n .pipe(plumber())\n .pipe(webpackstream(webpackconfig, webpack))\n // folder only, filename is specified in webpack config\n .pipe(gulp.dest(\"./_site/assets/js/\"))\n .pipe(browsersync.stream())\n );\n}", "title": "" }, { "docid": "16d11b616d904e42be0218e8af8aa314", "score": "0.52464247", "text": "function findjQMFiles(jQuerySourceFolder) \n{\n\tvar inCurrentSite = false; // the jQuery files are located within the current site if this is true\n\t\n\tif (jQuerySourceFolder != \"\") {\n\t\t//Add trailing slash if non-existent.\n\t\tif (jQuerySourceFolder[jQuerySourceFolder.length-1] != '/') {\n\t\t\tjQuerySourceFolder += \"/\";\n\t\t}\n\n\t\tif (isInCurrentSite(jQuerySourceFolder)) { // the user selected a folder inside the current site\n\t\t\tsiteRelativePath = dw.absoluteURLToDocRelative(jQuerySourceFolder, dw.getSiteRoot(), jQuerySourceFolder);\n\t\t\tinCurrentSite = true;\n\t\t} else {\n\t\t\tinCurrentSite = false;\n\t\t\tsiteRelativePath = getFolderName(jQuerySourceFolder);\n\t\t}\n\t\t\n\t\tvar i;\n\t\tvar fileMask = \"*.js\";\n\t\tvar jQMJSFile = null;\n\t\tvar jQueryJSFile = null;\n\t\tvar jQMcssFile = null;\n\t\tvar jQMIcons = null;\n\t\t\n\t\t//Arrays to hold file matches.\n\t\tvar jqmFullAssets = [];\n\t\tvar jqmMinAssets = [];\n\t\tvar jqFullAssets = [];\n\t\tvar jqMinAssets = [];\n\t\t\n\t\t//Variables for list element usage.\n\t\tvar listItem, listLen;\n\t\t\n\t\t// look for all *.js files\n\t\tvar list = DWfile.listFolder(jQuerySourceFolder + \"/\" + fileMask, \"files\");\n\t\tif (list) {\n\t\t\tlistLen = list.length;\n\t\t\tfor (i = 0; i < listLen; i++) {\n\t\t\t\tlistItem = list[i];\n\t\t\t\t//Look for minified versions first.\n\t\t\t\tif (validFileName(listItem, 'js', true))\n\t\t\t\t\tjqmMinAssets.push(listItem);\n\t\t\t\telse if (validFileName(listItem, 'js', false))\n\t\t\t\t\tjqmFullAssets.push(listItem);\n\t\t\t\t// match first form jquery.moble(.*).js if we don't find mobile then look for jquery(.*).js\n\t\t\t\telse if (validFileName(listItem, 'jq', true))\n\t\t\t\t\tjqMinAssets.push(listItem);\n\t\t\t\telse if (validFileName(listItem, 'jq', false))\n\t\t\t\t\tjqFullAssets.push(listItem);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Pick JS files if any.\n\t\tjQMJSFile = pickSourceFile(jQMJSFile, jqmMinAssets, jqmFullAssets);\n\t\tjQueryJSFile = pickSourceFile(jQueryJSFile, jqMinAssets, jqFullAssets);\n\t\t\n\t\t//Reset jqm arrays for reuse.\n\t\tjqmFullAssets = [];\n\t\tjqmMinAssets = [];\n\n\t\t// look for all *.css files to \n\t\tfileMask = \"*.css\";\n\t\tlist = DWfile.listFolder(jQuerySourceFolder + \"/\" + fileMask, \"files\");\n\t\tvar splitCSS = settings.cssType == SPLIT_CSS;\n\t\tif (list) {\n\t\t\tvar cssType;\n\t\t\t\n\t\t\t//Look for structure or single CSS file as main CSS depending on the CSS type.\n\t\t\tif (splitCSS) {\n\t\t\t\tcssType = \"structure\";\n\t\t\t\tvar cssFiles = list;\n\t\t\t} else {\n\t\t\t\tcssType = \"css\";\n\t\t\t}\n\t\t\t\n\t\t\t//Set corresponding preference string.\n\t\t\tsetPrefStrings(settings.cssType);\n\t\t\t\n\t\t\tlistLen = list.length;\n\t\t\tfor (i = 0; i < listLen; i++) {\n\t\t\t\tlistItem = list[i];\n\t\t\t\t//Check for minified over unminified CSS file.\n\t\t\t\tif (validFileName(listItem, cssType, true))\n\t\t\t\t\tjqmMinAssets.push(listItem);\n\t\t\t\telse if (validFileName(listItem, cssType, false))\n\t\t\t\t\tjqmFullAssets.push(listItem);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Pick CSS file if any.\n\t\tjQMcssFile = pickSourceFile(jQMcssFile, jqmMinAssets, jqmFullAssets);\n\t\t\n\t\t//Copy image folder.\n\t\tfileMask = \"*.png\";\n\t\tlist = DWfile.listFolder(jQuerySourceFolder + localIconDir + fileMask, \"files\");\n\n\t\tif (list != \"\") {\n\t\t\t//Get parent folder of images directory.\n\t\t\tvar dirNames = jQuerySourceFolder.split(\"/\");\n\t\t\tjQMIcons = dirNames[dirNames.length-2] + '/' + localIconDir;\n\t\t}\n\t\t\n\t\t//Did we find all the files?\n\t\tif (jQMJSFile && jQueryJSFile && jQMcssFile) {\n\t\t\tvar confirmDialog = true;\n\t\t\t//Are any of the files in our current site?\n\t\t\tif (!inCurrentSite) {\n\t\t\t\tmessage = getStatusMessage(\"success\", jQMJSFile, jQMcssFile, jQueryJSFile);\n\t\t\t\tmessage += dw.loadString(\"Commands/jQM/files/alert/fileNoExist\") + \"\\n\\n\";\n\t\t\t\t\n\t\t\t\tconfirmDialog = confirm(message);\n\t\t\t}\n\t\t\t\n\t\t\t//Don't update path if user cancels\n\t\t\tif (confirmDialog) {\n\t\t\t\t/** For each of the files, set the corresponding fields to match preference information.\n\t\t\t\t\tAlso, update the input field with file name. */\n\t\t\t\tvar resourcePrefs = jQM.Utils.prefStrings.resourceStrings;\n\t\t\t\t\n\t\t\t\tif (jQMJSFile) {\n\t\t\t\t\tsettings.JQMJS_LOCATION_FIELD.value = siteRelativePath + jQMJSFile;\n\t\t\t\t\tsettings.JQM_JS_DEST = settings.JQMJS_LOCATION_FIELD.value;\n\t\t\t\t\tsettings.JQM_JS_SOURCE = jQuerySourceFolder + jQMJSFile;\n\t\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.jsSrcPref, settings.JQM_JS_SOURCE);\n\t\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.jsDestPref, settings.JQM_JS_DEST);\n\t\t\t\t}\n\t\t\t\tif (jQueryJSFile) {\n\t\t\t\t\tsettings.JQ_LOCATION_FIELD.value = siteRelativePath + jQueryJSFile;\n\t\t\t\t\tsettings.JQ_JS_DEST = settings.JQ_LOCATION_FIELD.value;\n\t\t\t\t\tsettings.JQ_JS_SOURCE = jQuerySourceFolder + jQueryJSFile;\n\t\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.jqSrcPref, settings.JQ_JS_SOURCE);\n\t\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.jqDestPref, settings.JQ_JS_DEST);\n\t\t\t\t}\n\t\t\t\tif (jQMcssFile) {\n\t\t\t\t\tsettings.JQMCSS_LOCATION_FIELD.value = siteRelativePath + jQMcssFile;\n\t\t\t\t\tsettings.JQM_CSS_DEST = settings.JQMCSS_LOCATION_FIELD.value;\n\t\t\t\t\tsettings.JQM_CSS_SOURCE = jQuerySourceFolder + jQMcssFile;\n\t\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.cssSrcPref, settings.JQM_CSS_SOURCE);\n\t\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.cssDestPref, settings.JQM_CSS_DEST);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Do the same for the library source folder.\n\t\t\t\tsettings.JQ_LIB_SOURCE_FIELD.value = jQuerySourceFolder;\n\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.jqLibSrcPref, settings.JQ_LIB_SOURCE_FIELD.value);\n\t\t\t\t\n\t\t\t\t//Again with the icons to preserve directory name. Throw an alert if not found.\n\t\t\t\tif (jQMIcons) {\n\t\t\t\t\tdw.setPreferenceString(PREF_SECTION, resourcePrefs.jqImgSrcPref, jQMIcons);\n\t\t\t\t} else {\n\t\t\t\t\talert(dw.loadString(\"Commands/jQM/files/alert/imageNoExist\"));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t//Some files are not found.\n\t\t\tvar ok = dw.loadString(\"Commands/jQM/files/alert/OK\");\n\t\t\tvar notFound = dw.loadString(\"Commands/jQM/files/alert/notFound\");\n\t\t\t\n\t\t\tvar jsError = jQMJSFile ? ok : notFound;\n\t\t\tvar cssError = jQMcssFile ? ok : notFound;\n\t\t\tvar jqError = jQueryJSFile ? ok : notFound;\n\t\t\n\t\t\tmessage = getStatusMessage(\"error\", jsError, cssError, jqError);\n\t\t\talert(message);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4817629d9ab831559ea81c373c3a1c39", "score": "0.52385443", "text": "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n // .pipe($.babel()) if you activate this, socket.io won't work\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', function(e) { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist.client + '/assets/js'));\n}", "title": "" }, { "docid": "68d2a3ce4d92caff093c8b36f2649db4", "score": "0.52148217", "text": "function vendorJS() {\n\treturn gulp\n\t.src(vendorJs)\n\t.pipe(concat('vendor.min.js'))\n\t.pipe(gulp.dest(paths.scripts.dest));\n}", "title": "" }, { "docid": "31999f154f0ef8dbd3c06acf579578a8", "score": "0.51971525", "text": "function js() {\n return (\n gulp\n .src('src/js/*.js')\n .pipe(changed('dist/js'))\n .pipe(\n babel({\n presets: ['@babel/env'],\n })\n )\n .pipe(uglify())\n .pipe(\n size({\n showFiles: true,\n })\n )\n .pipe(gulp.dest('dist/js'))\n // Hot reloading for browser-sync\n .pipe(bs.stream())\n );\n}", "title": "" }, { "docid": "bdde7eb1c0832f725545aea66e38a13a", "score": "0.51749784", "text": "function javascript() {\n return gulp.src(PATHS.js)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfigDev, webpack4))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe(rename({ suffix: '.min', prefix: '' }))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/js'));\n}", "title": "" }, { "docid": "6ca9c69d412ecdbddb26da31c3755d6e", "score": "0.5171369", "text": "function loadStyleSheet(){\n $(\"head\").append($(\"<link rel='stylesheet' href='/static/css/toastr.min.css' type='text/css'/>\"));\n $(\"head\").append($(\"<link rel='stylesheet' href='/static/css/filter.css' type='text/css'/>\"));\n $(\"head\").append($(\"<script src='/static/js/toastr.min.js'></script>\"));\n $(\"head\").append($(\"<script src='/static/js/jquery.slimscroll.min.js'></script>\"));\n $(\"head\").append($(\"<link rel='stylesheet' href='/static/css/Jquery.modal.css' type='text/css'/>\"));\n $(\"head\").append($(\"<script src='/static/js/Jquery.modal.min.js'></script>\"));\n }", "title": "" }, { "docid": "4106610e2663560e6dce0f88f924ea68", "score": "0.51694673", "text": "function scripts() {\n\n return gulp.src([assets.js + '/src/lib/*.js', assets.js + '/src/*.js'])\n .pipe(plumber())\n .pipe(sourcemaps.init())\n .pipe(concat('all.js'))\n .pipe(gulp.dest(assets.js))\n .pipe(rename({suffix: '.min'}))\n .pipe(terser({\n ecma: 5,\n safari10: true,\n keep_fnames: false,\n mangle: false,\n compress: {\n defaults: false\n }\n }))\n .pipe(sourcemaps.write('/'))\n .pipe(gulp.dest(assets.js))\n .pipe(browsersync.stream());\n}", "title": "" }, { "docid": "fe9c8cd1a23cc4f6f2677844d4712756", "score": "0.51602435", "text": "addLayoutScriptsAndStyles() {\n this.asset.layoutScript = path.join(this.pageConfig.layoutsAssetPath, this.layout, 'scripts.js');\n this.asset.layoutStyle = path.join(this.pageConfig.layoutsAssetPath, this.layout, 'styles.css');\n this.includedFiles.add(\n path.join(this.pageConfig.rootPath, LAYOUT_FOLDER_PATH, this.layout, 'scripts.js'));\n this.includedFiles.add(\n path.join(this.pageConfig.rootPath, LAYOUT_FOLDER_PATH, this.layout, 'styles.css'));\n }", "title": "" }, { "docid": "3fddb33b19853ef54c8ab75db38854db", "score": "0.5156392", "text": "function _indexJsContent() {\n Meteor.npmRequire = function(moduleName) {\n var module = Npm.require(moduleName);\n return module;\n };\n\n Meteor.require = function(moduleName) {\n console.warn('Meteor.require is deprecated. Please use Meteor.npmRequire instead!');\n return Meteor.npmRequire(moduleName);\n };\n}", "title": "" }, { "docid": "8265f00b3a5930db5c6ff4370b8f6ba0", "score": "0.51443017", "text": "function js() {\n return gulp.src(['src/js/geral.js'])\n .pipe(uglify())\n .pipe(rename({\n basename: \"app\",\n suffix: \".min\",\n extname: \".js\"\n }))\n .pipe(gulp.dest('dist/js'));\n}", "title": "" }, { "docid": "ab4d3a518a2e8a6a66c92d102465b364", "score": "0.5138776", "text": "function scripts() {\n return (\n gulp\n .src(jsFiles)\n //Merge files into one\n .pipe(concat('script.js'))\n //JS minification\n .pipe(\n uglify({\n toplevel: true,\n })\n )\n //Output folder for scripts\n .pipe(gulp.dest('./assets/js'))\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "25df2baaa91d16d2a175ff39f163e992", "score": "0.51344854", "text": "function bowerScripts() {\n\treturn gulp.src( PATHS.javascriptWhatInput )\n\t\t.pipe( gulp.dest( PATHS.javascriptDist ) );\n}", "title": "" }, { "docid": "d4f6efb3e887b49788b3eb28ae0b9d21", "score": "0.51342285", "text": "function upload_demand_files() {\n $(function($) {'use strict';\n $.widget('blueimp.fileupload', $.blueimp.fileupload, {\n _onChange : function(e) {\n this._cancelHandler();\n this._super(e);\n },\n _initEventHandlers : function() {\n this._super();\n this._on($('#cancel-button'), {\n click : this.cancel\n });\n },\n cancel : function(e) {\n $('#file-upload-info-list').hide();\n $('#upload-file-preview').html('');\n this._cancelHandler();\n },\n _cancelHandler : function(e) {\n if(this.pfiles != null) {\n $.each(this.pfiles, function(index, element) {\n element.submit = null;\n });\n this.pfiles = null;\n }\n }\n });\n });\n\n $(function() {\n var vali = true;\n $('#demandupload').fileupload({\n singleFileUploads : false,\n acceptFileTypes : /(\\.|\\/)(csv)$/i,\n dataType : 'html',\n change : function(e, data) {\n vali = true;\n $('#file-upload-info-list').show();\n $('#upload-file-preview').html('');\n var i = 0;\n var reg = /(\\.|\\/)(csv)$/i;\n $.each(data.files, function(index, file) {\n i++;\n var msg = \"\";\n if(!reg.test(file.name)) {\n msg = '格式错误,只允许csv文件';\n vali = false;\n }\n $('#upload-file-preview').append(\"<tr><td class='filenum-td'><span class='filenum-list'>\" + i + \"</span></td><td class='filename-td'>\" + file.name + \"</td><td class='filebyte-td'>\" + file.size + \" Byte</td><td class='filemsg-td'>\" + msg + \"</td></tr>\");\n });\n },\n add : function(e, data) {\n $(\"#upload-button\").click(function() {\n if(vali) {\n if(data.submit != null) {\n data.submit();\n }\n }\n });\n },\n beforeSend : function(xhr) {\n xhr.setRequestHeader('X-CSRF-Token', $('meta[name=\"csrf-token\"]').attr('content'));\n },\n success : function(data) {\n do_after_fileupload(data);\n },\n done : function(e, data) {\n // data.context.text('Upload finished.');\n }\n });\n });\n}", "title": "" }, { "docid": "5dae2a4ff7fc9d9d956a8a72d9b01e2e", "score": "0.51281226", "text": "function bootstrap_js() {\n return gulp\n .src(['node_modules/bootstrap/dist/js/bootstrap.min.js',\n 'node_modules/bootstrap/dist/js/bootstrap.min.js.map',\n \t'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',\n 'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map'])\n .pipe(gulp.dest(config.built + '/assets/vendor/bootstrap/js'))\n}", "title": "" }, { "docid": "cd3e136669d955c3fd39810617482cd9", "score": "0.5127873", "text": "function processJavascriptDev () {\n\n // class handles a bunch of js related tasks, such as file translation and concatination.\n var browserified = browserify({\n paths: [ path.join(__dirname, SOURCE_PATH + '/js'), path.join(__dirname, SOURCE_PATH + '/view') ],\n entries: [INPUT_JAVASCRIPT_FILE],\n debug: true\n });\n \n // converts ES6 to vanilla javascript. Note that presets are an NPM dependency\n browserified.transform(babelify, { \"presets\": [\"es2015\"]} );\n browserified.transform(hoganify, { live:false, ext:'.html,.mustache' } );\n\n // bundles all the \"require\" dependencies together into one container\n var bundle = browserified.bundle();\n bundle.on('error', function(error){\n gutil.log(gutil.colors.red('[Build Error]', error.message));\n this.emit('end');\n });\n\n // now that files are bundled and transformed intto vanilla js, the final tasks can be performed.\n return bundle\n .pipe( source(OUTPUT_JAVASCRIPT_FILE_NAME) ) // convert vinyl virtual file\n .pipe( buffer() ) // convert back to buffer\n .pipe( sourcemaps.init({ loadMaps: true }) ) // creates sourcemap of javascript\n .pipe( sourcemaps.write('./') ) // in relation to \"BUILD_SCRIPTS_PATH\"\n .pipe( gulp.dest(BUILD_SCRIPTS_PATH) ) // outputs stream/buffer as build file\n}", "title": "" }, { "docid": "97922e4415f1fa429130029ea7e94ac6", "score": "0.51168454", "text": "function autoJSLoader() {\r\n\r\n}", "title": "" }, { "docid": "64b8081765ae00215050f70e0d4446f1", "score": "0.51078814", "text": "function javascriptExternal() {\n const installs = bowerData.appInstalls;\n const unminified = installs.js.map(item => `bower_components/${item}`);\n const minified = installs.jsMin.map(item => `bower_components/${item}`);\n\n const minifiedStream = gulp.src(minified);\n const externalStream = gulp.src('app/js/ext/**/*.js');\n const unminifiedStream = gulp.src(unminified)\n .pipe(gulpif(isProduction, uglify()));\n\n return merge(minifiedStream, unminifiedStream, externalStream)\n .pipe(concat('bower.js', { newLine: '\\n' }))\n .pipe(getStreamOutput('js'));\n}", "title": "" }, { "docid": "39aeab20448de6498d7564d8c681b821", "score": "0.51047564", "text": "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfig, webpack2))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n}", "title": "" }, { "docid": "9ed2494aae5312bbed89730ab693fbf1", "score": "0.510441", "text": "function bp_loadAllJsFiles(){\n //global javascript filepath queue\n js_filepath_queue.reverse();\n while(js_filepath_queue.length != 0){\n js_file_path = js_filepath_queue.pop();\n bp_loadJsFile(js_file_path);\n }\n}", "title": "" }, { "docid": "5adfa09efb2d2f3c52858eb1fd467010", "score": "0.5078692", "text": "function scripts() {\n return gulp\n .src([\"src/js/**/*.js\"])\n .pipe(plumber())\n .pipe(concat(\"main.js\"))\n .pipe(terser())\n .pipe(gulp.dest(\"assets/js/\"))\n .pipe(browsersync.stream());\n}", "title": "" }, { "docid": "710d5a0e19a51fd3f8887b9916550680", "score": "0.5077142", "text": "function initiate_plugins() {\n \n $('body').removeClass('menu-open');\n \n // Tabs\n $('ul.tabs').tabs();\n\n // Modal\n $('.modal-trigger').leanModal();\n\n // Accordion\n $('.collapsible').collapsible({\n accordion: true\n });\n\n // Drag\n $('.drag-target').remove();\n\n // Right Sidebar\n $('#open-right').sideNav({\n menuWidth: 240, // Default is 240\n edge: 'right', // Choose the horizontal origin\n closeOnClick: true // Closes side-nav on <a> clicks, useful for Angular/Meteor\n });\n\n // Left Sidebar\n $('#open-left').sideNav({\n menuWidth: 240, // Default is 240\n edge: 'left', // Choose the horizontal origin\n closeOnClick: true // Closes side-nav on <a> clicks, useful for Angular/Meteor\n });\n \n // Swipebox\n $('.swipebox').swipebox();\n\n // Masonry\n $('.grid').masonry({\n itemSelector: '.grid-item'\n });\n\n\n // Scrolling Floating Action Button\n $(window).scroll(function () {\n var scroll = $(window).scrollTop();\n if (scroll >= 1) {\n $(\".floating-button\").addClass(\"scrolled-down\");\n } else {\n $(\".floating-button\").removeClass(\"scrolled-down\");\n }\n });\n \n // Row Height for Drawer\n var grandparent_height = $('#grandparent').height();\n $('.child').height(grandparent_height * 0.25);\n\n // Swiper Sliders\n var swiper = new Swiper('.swiper-slider', {\n pagination: '.swiper-pagination',\n paginationClickable: true,\n nextButton: '.swiper-button-next',\n prevButton: '.swiper-button-prev',\n autoplay: false,\n loop: true\n });\n \n // MixItUP\n $(function () {\n var layout = 'grid', // Store the current layout as a variable\n $container = $('#filter'), // Cache the MixItUp container\n $changeLayout = $('#ChangeLayout'); // Cache the changeLayout button\n // Instantiate MixItUp with some custom options:\n try {\n $container.mixItUp('destroy');\n } catch (x) { }\n $container.mixItUp({\n animation: {\n animateChangeLayout: true, // Animate the positions of targets as the layout changes\n animateResizeTargets: true, // Animate the width/height of targets as the layout changes\n effects: 'fade rotateX(-40deg) translateZ(-100px)'\n },\n layout: {\n containerClass: 'grid' // Add the class 'list' to the container on load\n }\n });\n // MixItUp does not provide a default \"change layout\" button, so we need to make our own and bind it with a click handler:\n $changeLayout.on('click', function () {\n // If the current layout is a list, change to grid:\n if (layout == 'grid') {\n layout = 'list';\n $changeLayout.text('Grid'); // Update the button text\n $container.mixItUp('changeLayout', {\n containerClass: layout // change the container class to \"grid\"\n });\n // Else if the current layout is a grid, change to list: \n } else {\n layout = 'grid';\n $changeLayout.text('List'); // Update the button text\n $container.mixItUp('changeLayout', {\n containerClass: layout // Change the container class to 'list'\n });\n }\n });\n });\n \n // Material Layout\n $('.parallax').parallax();\n $(function () {\n var hBanner = $('.h-banner').height();\n var cbHeight = hBanner - 56;\n var hHeight = hBanner - 86; // for Title\n $(window).scroll(function () {\n var scroll = $(window).scrollTop();\n if (scroll >= cbHeight) {\n $(\".Eclipse-nav\").addClass('h-bg');\n }\n if (scroll <= cbHeight) {\n $(\".Eclipse-nav\").removeClass('h-bg');\n }\n // For heading Title\n if (scroll >= hHeight) {\n $(\".banner-title\").hide();\n $(\".Eclipse-nav .title\").show();\n }\n if (scroll <= hHeight) {\n $(\".banner-title\").show();\n $(\".Eclipse-nav .title\").hide();\n }\n });\n // opacity Plush button\n var fadeStart = 50 // 100px scroll or less will equiv to 1 opacity\n fadeUntil = 150 // 150px scroll or more will equiv to 0 opacity\n fading = $('.resize');\n $(window).on('scroll', function () {\n var offset = $(document).scrollTop(),\n opacity = 0;\n if (offset <= fadeStart) {\n opacity = 1;\n } else if (offset <= fadeUntil) {\n opacity = 1 - offset / fadeUntil;\n }\n fading.css({\n 'transform': 'scale(' + opacity + ')'\n });\n });\n });\n \n // Menu\n \n var isLateralNavAnimating = false;\n\n //open/close lateral navigation\n $('.menu-trigger').on('click', function(event){\n event.preventDefault();\n //stop if nav animation is running \n if( !isLateralNavAnimating ) {\n if($(this).parents('.csstransitions').length > 0 ) isLateralNavAnimating = true; \n \n $('body').toggleClass('menu-open');\n $('.menu-navigation').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){\n //animation is over\n isLateralNavAnimating = false;\n });\n }\n });\n \n $('#menu-icon').on('click', function(){\n $(this).toggleClass('open');\n });\n \n}", "title": "" }, { "docid": "df2b86a14a1e5b6857536012c2dd915c", "score": "0.50731516", "text": "function uglifyJSFiles(my_file_list) {\n module(\"uglifyjs\");\n build.run(my_url_list, my_file_list, quenchJS);\n }", "title": "" }, { "docid": "03751a4f5687b74efd44d15fd31fcac4", "score": "0.50630313", "text": "function javascript() {\n return gulp.src([\n 'app/js/app/utils.js',\n 'app/js/initialize.js',\n 'app/js/app/**/*.js',\n 'app/js/run.js'\n ])\n .pipe(dedupe())\n .pipe(gulpif(isDevelop, sourcemaps.init()))\n .pipe(babel({ presets: ['es2015'] }))\n .pipe(gulpif(isProduction, uglify()))\n .pipe(iife())\n .pipe(concat('app.js', { newLine: '\\n' }))\n .pipe(gulpif(isDevelop, sourcemaps.write()))\n .pipe(getStreamOutput('js'));\n}", "title": "" }, { "docid": "a693739135d4165323457e580c167e72", "score": "0.50584656", "text": "function jsTask() {\n return gulp\n .src(\"./src/js/**/*.js\")\n .pipe(concat(\"all.js\"))\n .pipe(uglify())\n .pipe(gulp.dest(\"./assets/js\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "849c78b6547a58de4827a7bd40580dbd", "score": "0.50557005", "text": "function load_js()\n {\n var head= document.getElementsByTagName('head')[0];\n var script= document.createElement('script');\n script.type= 'text/javascript';\n script.src= 'js/main.js';\n head.appendChild(script);\n }", "title": "" }, { "docid": "6f180f07bcc3352c5b408a78fc9cfd29", "score": "0.5054863", "text": "function js() {\n return gulp\n .src(['src/js/**/*.js'])\n .pipe(concat('app.js'))\n // .pipe(stripDebug()) // uncomment this line to strip JS comments\n .pipe(uglify())\n .pipe(gulp.dest('build/js'))\n .pipe(notify({ message: 'JS Compiled' }))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "752c40f297be0c368e28866df09857cb", "score": "0.5047575", "text": "function reload_scripts() {\n function reload_js(src) {\n\n $('script[src=\"' + src + '\"]').remove();\n $('<script>').attr('src', src).appendTo('body');\n\n }\n reload_js(AmbientLightParams.blog_url + '/wp-includes/js/admin-bar.min.js');\n reload_js(AmbientLightParams.blog_url + '/wp-includes/js/wp-embed.min.js');\n reload_js(AmbientLightParams.blog_url + '/wp-includes/js/mediaelement/mediaelement-and-player.min.js');\n reload_js(AmbientLightParams.blog_url + '/wp-includes/js/mediaelement/wp-mediaelement.min.js');\n }", "title": "" }, { "docid": "d23549245f274a9cbdcfdfe57a375cff", "score": "0.5037274", "text": "function jsTask(){\n return src(files.jsPath)\n .pipe(concat('scripts.js'))\n .pipe(uglify())\n .pipe(dest('pub/js'));\n}", "title": "" }, { "docid": "82869ebb38764078ae95eef331fbf435", "score": "0.5036199", "text": "function loadScripts( ) { \n\t\tmw.loader.using( __deps ).then( function( ) { \n\t\t\tObject.keys( __scripts ).forEach( function( name ) { \n\t\t\t\tconst key = name === \"ui\" ? \"doru\" : \"dev\";\n\t\t\t\tconst script = __scripts[ name ];\n\t\t\t\t\n\t\t\t\tif ( \n\t\t\t\t\twindow[ key ][ name ] || \n\t\t\t\t\t__installedScripts.includes( script ) \n\t\t\t\t) { \n\t\t\t\t\t__installedScripts.push( script );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\timportArticle( { type : \"script\", article : script } );\n\t\t\t} );\n\t\t\t\n\t\t\tloadCSS( );\n\t\t} );\n\t}", "title": "" }, { "docid": "e1fbd3336b1a55aaf77118b6429da584", "score": "0.5035388", "text": "function quickjavascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('../DataMine/public/js'));\n}", "title": "" }, { "docid": "8912b9a6662c620293ac516dd9c65f11", "score": "0.5032617", "text": "function GitHub_Gist_elementsExtraJS() {\n // screen (GitHub_Gist) extra code\n\n }", "title": "" }, { "docid": "931e02859ff0a5d5fc5fcf1ff2ad4ea4", "score": "0.50298756", "text": "extend (config, ctx) {\n config.plugins.push(new webpack.ProvidePlugin({\n $: 'jquery',\n jQuery: 'jquery',\n 'window.jQuery': 'jquery'\n }))\n }", "title": "" }, { "docid": "c4f8e6e9cfbadd15fa0926a6aea9472a", "score": "0.50215787", "text": "function browserifyJS(){\n var b = browserify({\n entries: 'assets/js/bootstrap.js',\n //debug: true\n })\n .transform(babel)\n .transform(vueify);\n\n return b\n .bundle()\n .pipe(source('bundle.js'))\n // .pipe(buffer())\n // .pipe(uglify())\n // .pipe(sourcemaps.init({loadMaps: true}))\n // .pipe(sourcemaps.write('./maps'))\n .pipe(gulp.dest('./assets/js/bundled'));\n\n}", "title": "" }, { "docid": "f73acf0fe2b5f0dbdd1456045b351ede", "score": "0.50214815", "text": "function build_scripts(done) {\n console.log(\"Compiling Scripts\");\n if (config.production) {\n pump([\n gulp.src([\n \"./_assets/scripts/**/*.js\",\n \"./node_modules/jquery/dist/jquery.min.js\",\n \"./node_modules/jquery-validation/dist/jquery.validate.js\",\n \"./node_modules/popper.js/dist/umd/popper.min.js\",\n \"./node_modules/bootstrap/dist/js/bootstrap.min.js\",\n ]),\n order(\n [\n \"node_modules/jquery/dist/jquery.min.js\",\n \"node_modules/jquery-validation/dist/jquery.validate.js\",\n \"node_modules/popper.js/dist/umd/popper.min.js\",\n \"node_modules/bootstrap/dist/js/bootstrap.min.js\",\n \"main.js\",\n ],\n {\n base: \"./\",\n }\n ),\n concat(\"app.js\"),\n uglify(),\n gulp.dest(\"./assets/scripts\"),\n ]);\n done();\n } else {\n pump([\n gulp.src([\n \"./_assets/scripts/**/*.js\",\n \"./node_modules/jquery/dist/jquery.js\",\n \"./node_modules/jquery-validation/dist/jquery.validate.js\",\n \"./node_modules/popper.js/dist/umd/popper.js\",\n \"./node_modules/bootstrap/dist/js/bootstrap.js\",\n ]),\n order(\n [\n \"node_modules/jquery/dist/jquery.js\",\n \"node_modules/jquery-validation/dist/jquery.validate.js\",\n \"node_modules/popper.js/dist/umd/popper.js\",\n \"node_modules/bootstrap/dist/js/bootstrap.js\",\n \"main.js\",\n ],\n {\n base: \"./\",\n }\n ),\n concat(\"app.js\"),\n gulp.dest(\"./assets/scripts\"),\n gulp.dest(\"./_site/assets/scripts\"),\n browserSync.reload({\n stream: true,\n }),\n ]);\n done();\n }\n}", "title": "" }, { "docid": "a0af1bddd8396a4fd1a89b35a86266a6", "score": "0.5021263", "text": "function modules() {\n // Bootstrap\n var bootstrap = gulp.src('./node_modules/bootstrap/dist/**/*')\n .pipe(gulp.dest('./vendor/bootstrap'));\n // jQuery\n var jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ])\n .pipe(gulp.dest('./vendor/jquery'));\n return merge(bootstrap, jquery);\n}", "title": "" }, { "docid": "c2d09f1ee3bea6b6d3518254e9473a21", "score": "0.5020878", "text": "static get DEFINITION_FILES() {\n return [\n 'core-concepts.js',\n 'layout.js',\n 'flexbox-and-grid.js',\n 'spacing.js',\n 'sizing.js',\n 'typography.js',\n 'backgrounds.js',\n 'borders.js',\n 'effects.js',\n 'filters.js',\n 'tables.js',\n 'transitions-and-animation.js',\n 'transforms.js',\n 'interactivity.js',\n 'svg.js',\n 'accessibility.js',\n ]\n }", "title": "" }, { "docid": "43619c815bab2fc9a51d3745195f96ce", "score": "0.50156146", "text": "function modules() {\n\t\n\t// Bootstrap JS\n\tvar bootstrapJS = gulp\n\t\t.src(\"./node_modules/bootstrap/dist/js/*\")\n\t\t.pipe(gulp.dest(paths.vendorDir + \"/bootstrap/js\"));\n\t \n\t// Bootstrap SCSS\n\tvar bootstrapSCSS = gulp\n\t\t.src(\"./node_modules/bootstrap/scss/**/*\")\n\t\t.pipe(gulp.dest(paths.vendorDir + \"/bootstrap/scss\"));\n\t \n\t// Bootstrap Select js\n\tvar bootstrapSelectJs = gulp\n\t\t.src(\"./node_modules/bootstrap-select/dist/js/bootstrap-select.min.js\")\n\t\t.pipe(gulp.dest(paths.vendorDir + \"/bootstrap-select/js\"));\n\t\n\t// Bootstrap Select js lang\n\tvar bootstrapSelectJsLang = gulp\n\t\t.src(\"./node_modules/bootstrap-select/dist/js/i18n/defaults-fr_FR.min.js\")\n\t\t.pipe(gulp.dest(paths.vendorDir + \"/bootstrap-select/js\"));\n\t\n\t// Bootstrap Select css\n\tvar bootstrapSelectCss = gulp\n\t\t.src(\"./node_modules/bootstrap-select/dist/css/bootstrap-select.min.css\")\n\t\t.pipe(gulp.dest(paths.vendorDir + \"/bootstrap-select/css\"));\n\n\t// Font Awesome\n\tvar fontAwesome = gulp\n\t\t.src(\"./node_modules/@fortawesome/**/*\")\n\t\t.pipe(gulp.dest(paths.vendorDir));\n\t \n\t// jQuery Easing\n\tvar jqueryEasing = gulp\n\t\t.src(\"./node_modules/jquery.easing/*.js\")\n\t\t.pipe(gulp.dest(paths.vendorDir + \"/jquery-easing\"));\n\t \n\t// jQuery\n\tvar jquery = gulp\n\t\t.src([\n\t\t\t\"./node_modules/jquery/dist/*\",\n\t\t\t\"!./node_modules/jquery/dist/core.js\"\n\t\t])\n\t\t.pipe(gulp.dest(paths.vendorDir + \"/jquery\"));\n\t \n\treturn merge(\n\t\t\tbootstrapJS, bootstrapSCSS,\n\t\t\tbootstrapSelectJs, bootstrapSelectJsLang, bootstrapSelectCss,\n\t\t\tfontAwesome, jquery, jqueryEasing\n\t);\n}", "title": "" }, { "docid": "420c0fd7a0e6d143b80255ebfc555b42", "score": "0.50108355", "text": "function bootsrapJs() {\n return src('./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js', { sourcemaps: true })\n .pipe(dest('./assets/js/', { sourcemaps: true }));\n}", "title": "" }, { "docid": "43277fc6a08125e88e5b0cb055dda9a5", "score": "0.5007246", "text": "function documentReady() {\n parseDates();\n\n //set up loading icons on form submit\n $(\"form.spinner\").submit(function () {\n $(\".submit-loading\").each(function () {\n $(this).css(\"visibility\", \"visible\");\n\n //turn off after 7 seconds\n setTimeout(function () { $(\".submit-loading\").css(\"visibility\", \"hidden\"); }, 7000)\n });\n });\n\n //set up all datepicker elements\n $(\".datepicker\").each(function () {\n $(this).datepicker();\n });\n\n //update all of our UTC offset information that gets sent to the server\n var localDate = new Date();\n var localOffset = localDate.getTimezoneOffset();\n $('input.utc-offset').each(function () {\n $(this).val(localOffset);\n });\n\n $(\"#Deliverable\").closest(\"div.row\").hide();\n if ($(\"#CourseId\").length > 0 && $(\"#CourseId\").val() != \"-1\") {\n FileManager.updateCourseDependencies();\n }\n\n $(\"#CourseId\").change(function () {\n FileManager.updateCourseDependencies();\n });\n\n $(\"#file\").change(function (e) {\n\n e.stopPropagation();\n e.preventDefault();\n\n FileManager.validateFileExtension();\n $(\".notice\").fadeOut();\n });\n\n $(\"#upload\").submit(function (e) {\n\n if (!FileManager.validateFileExtension() ) {\n e.stopPropagation();\n e.preventDefault();\n }\n });\n\n Nav.highlightCurrentView();\n}", "title": "" }, { "docid": "a534eaa36e4656e6036aba2ee061970d", "score": "0.49921915", "text": "_loadScripts() {\n let basePath = this.getBasePath(decodeURIComponent(import.meta.url));\n let jqueryPath = \"jquery/dist/jquery.min.js\";\n window.ESGlobalBridge.requestAvailability();\n window.ESGlobalBridge.instance.load(\"jquery\", basePath + jqueryPath);\n window.addEventListener(\n `es-bridge-jquery-loaded`,\n this._jqueryLoaded.bind(this)\n );\n }", "title": "" }, { "docid": "759689952551e6bb82197430a916454d", "score": "0.49859905", "text": "function js () {\n // HBS templating\n var templateData = {\n datasets: getDatasets(),\n rootUrl: process.env.COLLECTIONS_BROWSER_ROOT_URL,\n githubRepo: process.env.GIT_HUB_COLLECTIONS_REPO,\n githubBranch: process.env.GIT_HUB_COLLECTIONS_BRANCH\n };\n const options = {\n helpers: hbsHelpers\n };\n\n return gulp.src('./_build/**/*.js')\n .pipe(hb({data: templateData, helpers: hbsHelpers, handlebars: handlebars}))\n .pipe(gulp.dest('./_output/'));\n}", "title": "" }, { "docid": "603ed32ef9a7465af1c7a3eb7a71b8a0", "score": "0.49764672", "text": "function revslider_showDoubleJqueryError(t){var e=\"Revolution Slider Error: You have some jquery.js library include that comes after the revolution files js include.\";e+=\"<br> This includes make eliminates the revolution slider libraries, and make it not work.\",e+=\"<br><br> To fix it you can:<br>&nbsp;&nbsp;&nbsp; 1. In the Slider Settings -> Troubleshooting set option: <strong><b>Put JS Includes To Body</b></strong> option to true.\",e+=\"<br>&nbsp;&nbsp;&nbsp; 2. Find the double jquery.js include and remove it.\",e=\"<span style='font-size:16px;color:#BC0C06;'>\"+e+\"</span>\",jQuery(t).show().html(e)}", "title": "" }, { "docid": "d81505790570cc6bfea0e0ce1cc9647e", "score": "0.49755034", "text": "function modules() {\n // Bootstrap\n var bootstrap = gulp.src('./node_modules/bootstrap/dist/**/*')\n .pipe(gulp.dest('./dist/vendor/bootstrap'));\n // jQuery\n var jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ])\n .pipe(gulp.dest('./dist/vendor/jquery'));\n return merge(bootstrap, jquery);\n}", "title": "" }, { "docid": "1cb5fe3ee3f0de8d01427db639a77146", "score": "0.49691957", "text": "function jsImage() {\n return gulp\n .src([imgload, masonry, imgPopup])\n .pipe(changed(project_dir + dist_assets_js))\n .pipe(concat('wpg-image.js'))\n .pipe(uglify())\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest(project_dir + dist_assets_js))\n}", "title": "" }, { "docid": "20c7a3c393912131b5ee8f693ddebcf2", "score": "0.49678335", "text": "function JSManager(){\n\tthis.included = js_includes;\n\tthis.include = js_include_once;\n\tthis.remove = js_remove_include;\n}", "title": "" }, { "docid": "684886ab8da658a3744f123f04743b69", "score": "0.4967658", "text": "function js () {\n const bundler = browserify('src/assets/js/app.js', { debug: true }).transform(babel)\n return bundler.bundle()\n .on('error', function (err) { console.error(err.message); this.emit('end') })\n .pipe(source('app.js'))\n .pipe(buffer())\n .pipe(sourcemaps.init({ loadMaps: true }))\n .pipe(gulpif(!PRODUCTION, sourcemaps.write('.')))\n .pipe(gulpif(PRODUCTION, uglify()))\n .pipe(gulp.src(PATHS.additionalJsFiles2Copy, { since: gulp.lastRun(js) }))\n .pipe(gulp.dest(`${PATHS.dist}/assets/js`))\n}", "title": "" }, { "docid": "ab51c63eb87ab38a827be49508855ff2", "score": "0.49521184", "text": "function scripts(){\n return gulp.src(\"./src/scripts/main.js\")\n .pipe(include())\n .on('error', console.log)\n .pipe(uglify())\n .pipe(gulp.dest(paths.scripts.dist));\n}", "title": "" }, { "docid": "3b36ed23a557386bbb0fc370221a1d87", "score": "0.4936419", "text": "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream({module: webpackConfig}, webpack2)) // Read ES6 - Convert ES6 to ES5\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', function(e){\n console.log(e);\n })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n}", "title": "" }, { "docid": "41b6314993ff7e69122628cdfe85a219", "score": "0.4934593", "text": "addJavaScript(options) {\n this._minifiedFiles.push({ ...options });\n }", "title": "" }, { "docid": "4674f77de12d3c40142708026b931cef", "score": "0.49343547", "text": "function js() {\n return src(files.jsPath)\n .pipe(concat('main.js'))\n .pipe(babel({\n presets: ['@babel/env']\n }))\n .pipe(uglify())\n .pipe(dest('pub/js'))\n .pipe(browsersync.stream());\n}", "title": "" }, { "docid": "534936dc25738f11a78b06f70277126f", "score": "0.49324206", "text": "function app_name_scripts() {\n\treturn src(projects.app_name.scripts.src)\n\t.pipe(concat(projects.app_name.scripts.output))\n\t// .pipe(uglify()) // Minify js (opt.)\n\t.pipe(header(projects.app_name.forProd))\n\t.pipe(dest(projects.app_name.scripts.dest))\n\t.pipe(browserSync.stream())\n}", "title": "" }, { "docid": "11bc4b0505b08429611dfca4a3fc9c7b", "score": "0.49169126", "text": "function siteJS2() {\n\t//return gulp.src( PATHS.javascript )\n\treturn gulp.src( PATHS.javascriptTheme )\n\t\t.pipe( sourcemaps.init() )\n\t\t\n\t\t.pipe( jshint() )\n\t\t.pipe( jshint.reporter( 'jshint-stylish' ) )\n\n\t\t.pipe( concat( 'scripts.js' ) )\n\t\t\n\t\t.pipe( gulpif( PRODUCTION, uglify().on( 'error', e => { console.log( e ); } ) ) )\n\t\t.pipe( gulpif( PRODUCTION, rename( { suffix: '.min' } ) ) )\n\t\t\n\t\t.pipe( sourcemaps.write( '.' ) )\n\t\t\n\t\t.pipe( gulp.dest( PATHS.javascriptDist ) );\n\n\t\t//.pipe( browser.reload({ stream: true }) );\n\t\t//.pipe( browser.reload );\n}", "title": "" }, { "docid": "818a503448086bea28fc6e064288d3ee", "score": "0.4916244", "text": "function siteJS() {\n\t\n\tvar source = gulp.src( PATHS.javascriptTheme )\n\t\t\t\t\t\t\t\t.pipe( sourcemaps.init() )\n\t\t\t\t\t\t\t\t.pipe( jshint() )\n\t\t\t\t\t\t\t\t.pipe( jshint.reporter( 'jshint-stylish' ) )\n\t\t\t\t\t\t\t\t.pipe( concat( 'scripts.js' ) );\n\n var expanded = source.pipe(clone())\n\t\t\t\t\t\t\t\t\t\t.pipe( sourcemaps.write( '.' ) )\n\t\t\t\t\t\t\t\t\t\t.pipe( gulp.dest( PATHS.javascriptDist ) );\n\t\t\t\t\t\t\t\t\t\t\n\tif ( PRODUCTION ) {\t\t\t\t\t\t\t\t\n var minified = source.pipe(clone())\n\t\t\t\t\t\t\t\t\t\t.pipe( uglify().on( 'error', e => { console.log( e ); } ) )\n\t\t\t\t\t\t\t\t\t\t.pipe( rename( { suffix: '.min' } ) )\n\t\t\t\t\t\t\t\t\t\t.pipe( sourcemaps.write( '.' ) )\n\t\t\t\t\t\t\t\t\t\t.pipe( gulp.dest( PATHS.javascriptDist ) );\n\t\t\t\t\t\t\t\t\t\t\n\t\treturn merge( expanded, minified );\n\t} else {\n\t\treturn expanded;\t\t\n\t}\n}", "title": "" }, { "docid": "3e8f569555018da21a75fa7540721888", "score": "0.490408", "text": "function revslider_showDoubleJqueryError(a){var b=\"Revolution Slider Error: You have some jquery.js library include that comes after the revolution files js include.\";b+=\"<br> This includes make eliminates the revolution slider libraries, and make it not work.\",b+=\"<br><br> To fix it you can:<br>&nbsp;&nbsp;&nbsp; 1. In the Slider Settings -> Troubleshooting set option: <strong><b>Put JS Includes To Body</b></strong> option to true.\",b+=\"<br>&nbsp;&nbsp;&nbsp; 2. Find the double jquery.js include and remove it.\",b=\"<span style='font-size:16px;color:#BC0C06;'>\"+b+\"</span>\",jQuery(a).show().html(b)}", "title": "" }, { "docid": "543246db380c1598d172684b63c726c2", "score": "0.48977885", "text": "function Js() {\n return gulp.src('src/js/main.js') // получим файл main.js\n .pipe(babel({\n presets: ['@babel/env']\n }))\n .pipe(plumber()) // для отслеживания ошибок\n .pipe(rigger()) // импортируем все указанные файлы в main.js\n .pipe(uglify()) // минимизируем js\n .pipe(gulp.dest('build/js/'));\n}", "title": "" }, { "docid": "d36bdfbaab9a3bb7763dda027d96a5e9", "score": "0.48939273", "text": "function filterForJS(files) {\n return files.filter(function (file) {\n //console.log('File: ' + file);\n return file.match(/\\.js$/);\n });\n }", "title": "" }, { "docid": "5bde96bb8962b88270bedbf90179a7ab", "score": "0.48908067", "text": "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n\n // Call our main function\n\n main();\n }", "title": "" }, { "docid": "5bde96bb8962b88270bedbf90179a7ab", "score": "0.48908067", "text": "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n\n // Call our main function\n\n main();\n }", "title": "" }, { "docid": "b2dd166f4e4144c901dac7bb4870836f", "score": "0.48907244", "text": "function loadAssets() {\n\t//setup a global, ordered list of asset files to load\n\trequiredFiles = [\n\t\t\"src\\\\util.js\",\"src\\\\setupKeyListeners.js\", //misc functions\n\t\t\"src\\\\classes\\\\Enum.js\", \"src\\\\classes\\\\Shape.js\", \"src\\\\classes\\\\MouseFollower.js\" //classes\n\t\t];\n\t\n\t//manually load the asset loader\n\tlet script = document.createElement('script');\n\tscript.type = 'text/javascript';\n\tscript.src = \"src\\\\loadAssets.js\";\n\tscript.onload = loadAssets;\n\t//begin loading the asset loader by appending it to the document head\n document.getElementsByTagName('head')[0].appendChild(script);\n}", "title": "" }, { "docid": "e83efc0c9f66db4e77d95574eb59a432", "score": "0.48810717", "text": "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n window.alumeniPrismJQuery = jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "title": "" }, { "docid": "9894daa6382b9d4fd55901e876bff787", "score": "0.487742", "text": "function filterForJS ( files ) {\n return files.filter( function ( file ) {\n return file.match( /\\.js$/ );\n });\n }", "title": "" } ]
28b3651955678aaf180115b392c236cd
Search `\d+[.)][\n ]`, returns next pos after marker on success or 1 on fail.
[ { "docid": "d305c0456318334da3f0c18dc15bc6f8", "score": "0.5523371", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace$3(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" } ]
[ { "docid": "77c6c235dbf18885ed27986d7631b7fe", "score": "0.6085765", "text": "function lnstartindex(s, pos) {\n let i = pos\n while (i > 0) {\n if (s.charCodeAt(--i) == 0xA) {\n return i + 1\n }\n }\n return i // no linebreak\n}", "title": "" }, { "docid": "74f962d5d93c01cdae942ea749fb72b6", "score": "0.6071619", "text": "function getLineInfo(input,offset){for(var line=1,cur=0;;){lineBreakG.lastIndex=cur;var match=lineBreakG.exec(input);if(match&&match.index<offset){++line;cur=match.index+match[0].length;}else{return new Position(line,offset-cur);}}}", "title": "" }, { "docid": "5f01b952853aaf3c6500408df7d79322", "score": "0.5993806", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "5f01b952853aaf3c6500408df7d79322", "score": "0.5993806", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "0d44863c662d62e95bd4f42a41d6586a", "score": "0.59772456", "text": "function getLineInfo(input, offset) {\n \t for (var line = 1, cur = 0;;) {\n \t lineBreakG.lastIndex = cur;\n \t var match = lineBreakG.exec(input);\n \t if (match && match.index < offset) {\n \t ++line;\n \t cur = match.index + match[0].length;\n \t } else {\n \t return new Position(line, offset - cur)\n \t }\n \t }\n \t}", "title": "" }, { "docid": "bf96cb7da4331c4365c0cca7d1be5eb1", "score": "0.5974695", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur\n\t var match = lineBreakG.exec(input)\n\t if (match && match.index < offset) {\n\t ++line\n\t cur = match.index + match[0].length\n\t } else {\n\t return new Position(line, offset - cur)\n\t }\n\t }\n\t}", "title": "" }, { "docid": "6fe07ee0faa2d3d94674c9829b1cf336", "score": "0.59571755", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur\n\t var match = lineBreakG.exec(input)\n\t if (match && match.index < offset) {\n\t ++line\n\t cur = match.index + match[0].length\n\t } else {\n\t return new Position(line, offset - cur)\n\t }\n\t }\n\t }", "title": "" }, { "docid": "9602565925c6e3a17979f92287cac25d", "score": "0.59392655", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "9602565925c6e3a17979f92287cac25d", "score": "0.59392655", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "9602565925c6e3a17979f92287cac25d", "score": "0.59392655", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n }", "title": "" }, { "docid": "8d707bd359b1c4cf538ba0d31c394f2c", "score": "0.59252983", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0; ; ) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n }", "title": "" }, { "docid": "e3e3fe725e4a97ba1335ec7d88f50fa3", "score": "0.5914933", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e3e3fe725e4a97ba1335ec7d88f50fa3", "score": "0.5914933", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "e3e3fe725e4a97ba1335ec7d88f50fa3", "score": "0.5914933", "text": "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t lineBreakG.lastIndex = cur;\n\t var match = lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.5899819", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.5899819", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.5899819", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.5899819", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "57861237a3572cf870b0021810eb3136", "score": "0.5899819", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur\n var match = lineBreakG.exec(input)\n if (match && match.index < offset) {\n ++line\n cur = match.index + match[0].length\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.58598614", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.58598614", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.58598614", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.58598614", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.58598614", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.58598614", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "961e72ef9a372b244f91f67e09ff7fe4", "score": "0.58598614", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur)\n }\n }\n}", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.58530986", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.58530986", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "ab6aa3427bdd580e720212217f21429f", "score": "0.58530986", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "8d42a18d51531aa3061205898473edc6", "score": "0.5841343", "text": "function getLineInfo(input, offset) {\n\tfor (var line = 1, cur = 0; ; ) {\n\t\tlineBreakG.lastIndex = cur;\n\t\tvar match = lineBreakG.exec(input);\n\t\tif (match && match.index < offset) {\n\t\t\t++line;\n\t\t\tcur = match.index + match[0].length;\n\t\t} else {\n\t\t\treturn new Position(line, offset - cur);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7d00a1b9e371bae4f28ed2843e4d0445", "score": "0.57705367", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n lineBreakG.lastIndex = cur;\n var match = lineBreakG.exec(input);\n\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n} // A second optional argument can be given to further configure", "title": "" }, { "docid": "9e2638631c7b7d2fef5bee8137c63946", "score": "0.5732932", "text": "function lookAhead(notes, restLine, i, compare) {\n // If no valid next note group, nextRestLine is same as current.\n let nextRestLine = restLine;\n\n // Get the rest line for next valid non-rest note group.\n for (i += 1; i < notes.length; i += 1) {\n const note = notes[i];\n if (!note.isRest() && !note.shouldIgnoreTicks()) {\n nextRestLine = note.getLineForRest();\n break;\n }\n }\n\n // Locate the mid point between two lines.\n if (compare && restLine !== nextRestLine) {\n const top = Math.max(restLine, nextRestLine);\n const bot = Math.min(restLine, nextRestLine);\n nextRestLine = Vex.MidLine(top, bot);\n }\n return nextRestLine;\n}", "title": "" }, { "docid": "d5c4425a73f93230257df9aed611e48b", "score": "0.57311815", "text": "function searchFileEnd(pos) {\r\n if (chunck[pos] == 13 && chunck[pos + 1] == 10 && chunck[pos + 2] == 45 &&\r\n !Buffer.from(chunck.slice(pos + 2, pos + boundaryBuf.length + 2)).compare(boundaryBuf)) {\r\n // find boundary, use and to escape unnecessary of produce!!!!!!!!!!!\r\n pos += boundaryBuf.length + 2; // \\r\\nboundary\r\n if (memMode) {\r\n bufferStream.write(Buffer.from(data));\r\n bufferList.push(bufferStream.end());\r\n } else {\r\n writeStream.write(Buffer.from(data));\r\n writeStream.end();\r\n }\r\n if (chunck[pos] == 45 && chunck[pos + 1] == 45) { // find \"--\", end \"--\\r\\n\"\r\n state = stateSearchBoundary;\r\n return pos + 4;\r\n } else { // not end, \"\\r\\n\"\r\n subInfoArr = [];\r\n state = stateSearchFileInfo;\r\n return pos + 2;\r\n }\r\n } else {\r\n if (data.length > bufSize) {\r\n if (memMode) bufferStream.write(Buffer.from(data));\r\n else writeStream.write(Buffer.from(data));\r\n data.length = 0;\r\n }\r\n data.push(chunck[pos]);\r\n return pos + 1;\r\n }\r\n }", "title": "" }, { "docid": "5abe4d4211e8b7d05c3adc04918a7061", "score": "0.57209235", "text": "function lookAhead(notes, restLine, i, compare) {\n\t\t // If no valid next note group, nextRestLine is same as current.\n\t\t var nextRestLine = restLine;\n\t\t\n\t\t // Get the rest line for next valid non-rest note group.\n\t\t for (i += 1; i < notes.length; i += 1) {\n\t\t var note = notes[i];\n\t\t if (!note.isRest() && !note.shouldIgnoreTicks()) {\n\t\t nextRestLine = note.getLineForRest();\n\t\t break;\n\t\t }\n\t\t }\n\t\t\n\t\t // Locate the mid point between two lines.\n\t\t if (compare && restLine !== nextRestLine) {\n\t\t var top = Math.max(restLine, nextRestLine);\n\t\t var bot = Math.min(restLine, nextRestLine);\n\t\t nextRestLine = _vex.Vex.MidLine(top, bot);\n\t\t }\n\t\t return nextRestLine;\n\t\t}", "title": "" }, { "docid": "2f54b1c8a39aa7084fdac196632ab4fa", "score": "0.57164866", "text": "function computeOffset(n, startLine) {\n var pos = 0;\n for (;;) {\n var found = text.indexOf(\"\\n\", pos);\n if (found == -1 || (text.charAt(found-1) == \"\\r\" ? found - 1 : found) >= n)\n return {line: startLine, ch: n - pos};\n ++startLine;\n pos = found + 1;\n }\n }", "title": "" }, { "docid": "4c0293353702d9f925787dab32d39471", "score": "0.5705378", "text": "function skipBulletListMarker(e,t){var r,n,a;return(n=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],n>=a)?-1:(r=e.src.charCodeAt(n++),42!==r/* * */&&45!==r/* - */&&43!==r/* + */?-1:n<a&&32!==e.src.charCodeAt(n)?-1:n)}// Search `\\d+[.)][\\n ]`, returns next pos arter marker on success", "title": "" }, { "docid": "7b057469b7cbf8d15dbf9c6499df92af", "score": "0.56565225", "text": "matchLabel(index) {\n return this.searchMatches[index].lineNumber + 1;\n }", "title": "" }, { "docid": "4463c520a11adf0a262ade522c4436f6", "score": "0.56382763", "text": "function lnendindex(s, pos) {\n let i = pos\n while (i < s.length) {\n if (s.charCodeAt(i) == 0xA) {\n return i\n }\n i++\n }\n return i // no linebreak\n}", "title": "" }, { "docid": "7c78fc8097669472f47e395784971570", "score": "0.5607463", "text": "function dotindex(value) {\n var match = lastDotRe.exec(value);\n\n return match ? match.index + 1 : value.length\n}", "title": "" }, { "docid": "f7139cff6e0ca6ff1c14a3819490f1cd", "score": "0.56027365", "text": "function dotindex(value) {\n var match = EXPRESSION_LAST_DOT.exec(value);\n\n return match ? match.index + 1 : value.length;\n}", "title": "" }, { "docid": "96da90b314adcba2e3762d874d3d56bf", "score": "0.55921715", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n _whitespace.lineBreakG.lastIndex = cur;\n var match = _whitespace.lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "96da90b314adcba2e3762d874d3d56bf", "score": "0.55921715", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n _whitespace.lineBreakG.lastIndex = cur;\n var match = _whitespace.lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "96da90b314adcba2e3762d874d3d56bf", "score": "0.55921715", "text": "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n _whitespace.lineBreakG.lastIndex = cur;\n var match = _whitespace.lineBreakG.exec(input);\n if (match && match.index < offset) {\n ++line;\n cur = match.index + match[0].length;\n } else {\n return new Position(line, offset - cur);\n }\n }\n}", "title": "" }, { "docid": "51a10a1774a0d1cae7521bef68d2a81c", "score": "0.5565764", "text": "findLocation(pre, lineNumber, node, offset, interlinePosition, result) {\n if (node && !pre) {\n // Look upwards to find the current pre element.\n for (pre = node;\n pre.nodeName != \"PRE\";\n pre = pre.parentNode);\n }\n\n // The source document is made up of a number of pre elements with\n // id attributes in the format <pre id=\"line123\">, meaning that\n // the first line in the pre element is number 123.\n // However, in the plain text case, there is only one <pre> without an id,\n // so assume line 1.\n let curLine = pre.id ? parseInt(pre.id.substring(4)) : 1;\n\n // Walk through each of the text nodes and count newlines.\n let treewalker = content.document\n .createTreeWalker(pre, Ci.nsIDOMNodeFilter.SHOW_TEXT, null);\n\n // The column number of the first character in the current text node.\n let firstCol = 1;\n\n let found = false;\n for (let textNode = treewalker.firstChild();\n textNode && !found;\n textNode = treewalker.nextNode()) {\n\n // \\r is not a valid character in the DOM, so we only check for \\n.\n let lineArray = textNode.data.split(/\\n/);\n let lastLineInNode = curLine + lineArray.length - 1;\n\n // Check if we can skip the text node without further inspection.\n if (node ? (textNode != node) : (lastLineInNode < lineNumber)) {\n if (lineArray.length > 1) {\n firstCol = 1;\n }\n firstCol += lineArray[lineArray.length - 1].length;\n curLine = lastLineInNode;\n continue;\n }\n\n // curPos is the offset within the current text node of the first\n // character in the current line.\n for (var i = 0, curPos = 0;\n i < lineArray.length;\n curPos += lineArray[i++].length + 1) {\n\n if (i > 0) {\n curLine++;\n }\n\n if (node) {\n if (offset >= curPos && offset <= curPos + lineArray[i].length) {\n // If we are right after the \\n of a line and interlinePosition is\n // false, the caret looks as if it were at the end of the previous\n // line, so we display that line and column instead.\n\n if (i > 0 && offset == curPos && !interlinePosition) {\n result.line = curLine - 1;\n var prevPos = curPos - lineArray[i - 1].length;\n result.col = (i == 1 ? firstCol : 1) + offset - prevPos;\n } else {\n result.line = curLine;\n result.col = (i == 0 ? firstCol : 1) + offset - curPos;\n }\n found = true;\n\n break;\n }\n\n } else {\n if (curLine == lineNumber && !(\"range\" in result)) {\n result.range = content.document.createRange();\n result.range.setStart(textNode, curPos);\n\n // This will always be overridden later, except when we look for\n // the very last line in the file (this is the only line that does\n // not end with \\n).\n result.range.setEndAfter(pre.lastChild);\n\n } else if (curLine == lineNumber + 1) {\n result.range.setEnd(textNode, curPos - 1);\n found = true;\n break;\n }\n }\n }\n }\n\n return found || (\"range\" in result);\n }", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.5536564", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "6195589eb55e5bd44e91a1a113e18f27", "score": "0.54675937", "text": "function findOnLine(grille, line) {\r\n var already =[];\r\n for (var i=0;i<9;i++) {\r\n var digit = grille[line][i];\r\n if (digit != '.') already.push(parseInt(digit));\r\n }\r\n return buildMissing(already);\r\n}", "title": "" }, { "docid": "f89d42dcdf9cfd24e5f7e171529154f3", "score": "0.5451202", "text": "function findStartLine(cm, n) { // 903\n var minindent, minline, doc = cm.doc; // 904\n for (var search = n, lim = n - 100; search > lim; --search) { // 905\n if (search <= doc.first) return doc.first; // 906\n var line = getLine(doc, search - 1); // 907\n if (line.stateAfter) return search; // 908\n var indented = countColumn(line.text, null, cm.options.tabSize); // 909\n if (minline == null || minindent > indented) { // 910\n minline = search - 1; // 911\n minindent = indented; // 912\n } // 913\n } // 914\n return minline; // 915\n } // 916", "title": "" }, { "docid": "7f7de3c84c861b7049545ee2fd7b0799", "score": "0.5426083", "text": "function findNumber (index, string, dir, numbers){\n let lastNumIndex = 0;\n switch(dir) {\n case 'l':\n for(let i = 0; i < numbers.length; i++) {\n if(string.indexOf(numbers[i], lastNumIndex) >= index)\n return numbers[i-1];\n lastNumIndex += String(numbers[i]).length+1;\n }\n break;\n case 'r':\n for(let i = 0; i < numbers.length; i++) {\n if(string.indexOf(numbers[i], lastNumIndex) >= index)\n return numbers[i];\n lastNumIndex += String(numbers[i]).length+1;\n }\n break;\n }\n}", "title": "" }, { "docid": "63aa784ec76ee4bb3808660c46cf6739", "score": "0.541226", "text": "function posToLineNr(code, pos) {\n const lineBreaks = code.substr(0, pos).match(/(\\r\\n|\\r|\\n)/g);\n return !lineBreaks ? 1 : lineBreaks.length + 1;\n}", "title": "" }, { "docid": "b13d0c18abaeb4b98307bf525a359373", "score": "0.54108673", "text": "function skipOrderedListMarker(state, startLine) {\n\t var ch,\n\t pos = state.bMarks[startLine] + state.tShift[startLine],\n\t max = state.eMarks[startLine];\n\t\n\t if (pos + 1 >= max) { return -1; }\n\t\n\t ch = state.src.charCodeAt(pos++);\n\t\n\t if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\t\n\t for (;;) {\n\t // EOL -> fail\n\t if (pos >= max) { return -1; }\n\t\n\t ch = state.src.charCodeAt(pos++);\n\t\n\t if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\t continue;\n\t }\n\t\n\t // found valid marker\n\t if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n\t break;\n\t }\n\t\n\t return -1;\n\t }\n\t\n\t\n\t if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n\t // \" 1.test \" - is not a list item\n\t return -1;\n\t }\n\t return pos;\n\t}", "title": "" }, { "docid": "170a36debc9d45f11bfd62a4f959ee0f", "score": "0.53976583", "text": "function findHelper(vimState, start, char, count, direction) {\n const line = vimState.document.lineAt(start);\n let index = start.character;\n while (count > 0 && index >= 0) {\n if (direction === 'forward') {\n index = line.text.indexOf(char, index + 1);\n }\n else {\n index = line.text.lastIndexOf(char, index - 1);\n }\n count--;\n }\n if (index >= 0) {\n return new vscode_1.Position(start.line, index);\n }\n return undefined;\n}", "title": "" }, { "docid": "328e5847cc47b9282b105b9a87b62e6e", "score": "0.53933036", "text": "function skipOrderedListMarker(state, startLine) {\n\t var ch,\n\t pos = state.bMarks[startLine] + state.tShift[startLine],\n\t max = state.eMarks[startLine];\n\n\t if (pos + 1 >= max) { return -1; }\n\n\t ch = state.src.charCodeAt(pos++);\n\n\t if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n\t for (;;) {\n\t // EOL -> fail\n\t if (pos >= max) { return -1; }\n\n\t ch = state.src.charCodeAt(pos++);\n\n\t if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\t continue;\n\t }\n\n\t // found valid marker\n\t if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n\t break;\n\t }\n\n\t return -1;\n\t }\n\n\n\t if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n\t // \" 1.test \" - is not a list item\n\t return -1;\n\t }\n\t return pos;\n\t}", "title": "" }, { "docid": "6deb395b0fd3c67e0538f86edee924a8", "score": "0.53849524", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "title": "" }, { "docid": "6deb395b0fd3c67e0538f86edee924a8", "score": "0.53849524", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "title": "" }, { "docid": "6deb395b0fd3c67e0538f86edee924a8", "score": "0.53849524", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "title": "" }, { "docid": "6deb395b0fd3c67e0538f86edee924a8", "score": "0.53849524", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "title": "" }, { "docid": "6deb395b0fd3c67e0538f86edee924a8", "score": "0.53849524", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "title": "" }, { "docid": "cff9fc2c7c2ddb507efada474a792618", "score": "0.53799486", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n \n if (pos + 1 >= max) { return -1; }\n \n ch = state.src.charCodeAt(pos++);\n \n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n \n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n \n ch = state.src.charCodeAt(pos++);\n \n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n \n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n \n return -1;\n }\n \n \n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n }", "title": "" }, { "docid": "e003b28e06ce0c56bdd59e2f66de06c2", "score": "0.53776526", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }", "title": "" }, { "docid": "dccb52929c9d89d48dfe9ef444b972e9", "score": "0.5377341", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n }", "title": "" }, { "docid": "f8b2d53e794da8c52ebc832509feed52", "score": "0.5370103", "text": "function findStartLine(cm, n, precise) {\n var minindent,\n minline,\n doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) {\n return doc.first;\n }\n var line = getLine(doc, search - 1),\n after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) {\n return search;\n }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "bf529b168d572d5f6bf6a1a818803528", "score": "0.535852", "text": "function search(position) {\n for (var i=0, l=$scope.lines.length;i<l;i++) {\n if (position===$scope.lines[i].position){\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "41ceaf1b307903281a0d680a164b42e0", "score": "0.53455925", "text": "function searchFileInfo(pos) {\r\n if (chunck[pos] == 13 && chunck[pos + 1] == 10 &&\r\n chunck[pos + 2] == 13 && chunck[pos + 3] == 10) {\r\n // find \\r\\n\\r\\n\r\n info.push(Buffer.from(subInfoArr).toString());\r\n data.length = 0;\r\n var tmpFileName = new Date().getTime();\r\n tmpFiles.push(tmpFileName);\r\n if (memMode) bufferStream = new BufferStream();\r\n else writeStream = fs.createWriteStream(uploadDir + \"/\" + tmpFileName);\r\n state = stateSearchFileEnd;\r\n return pos + 4;\r\n } else {\r\n subInfoArr.push(chunck[pos]);\r\n return pos + 1;\r\n }\r\n }", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "f07792918c56c1417baa7e6efb536f08", "score": "0.5334156", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "title": "" }, { "docid": "9366f56e07426357eeef10291ce95c23", "score": "0.53261137", "text": "getPosition(cursor = this.cursor) {\n const prevLine = this.findPrevLineBreak();\n const lineMatches = this.toString().substr(0, cursor).match(/\\n/gi);\n const lineNumber = lineMatches ? lineMatches.length + 1: 1;\n const charNumber = cursor - prevLine;\n return [ lineNumber, charNumber ];\n }", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.53215915", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.53215915", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.53215915", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "86323636bd489a3f4d865e9a2986fc72", "score": "0.531142", "text": "function findStartLine(cm, n, precise) {\n for (var minindent, minline, doc = cm.doc, lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1e3 : 100), search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n (null == minline || minindent > indented) && (minline = search - 1, minindent = indented);\n }\n return minline;\n }", "title": "" }, { "docid": "a660ba5f1f4cef098d363cef670cd3e6", "score": "0.53096545", "text": "getPrecedingValidLine(model, lineNumber, indentRulesSupport) {\n let languageID = model.getLanguageIdAtPosition(lineNumber, 0);\n if (lineNumber > 1) {\n let lastLineNumber;\n let resultLineNumber = -1;\n for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\n if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) {\n return resultLineNumber;\n }\n let text = model.getLineContent(lastLineNumber);\n if (indentRulesSupport.shouldIgnore(text) || /^\\s+$/.test(text) || text === '') {\n resultLineNumber = lastLineNumber;\n continue;\n }\n return lastLineNumber;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" }, { "docid": "df7532ce9fcff3b9027bc5e4d1145223", "score": "0.5281242", "text": "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "title": "" } ]
79fca63695eec557ad72a702e71c1149
Function to build a button and put it in the global list of buttons.
[ { "docid": "5df1b7a207dcfead1a5f95a49af9c660", "score": "0.7700583", "text": "function make_button(colour, text, text_colour)\n{\n //var button = new Button(colour, text, text_colour, button_radius);\n var button = new Button(colour, [text], text_colour, button_radius);\n button.setBold(true);\n global_button_list.push(button);\n}", "title": "" } ]
[ { "docid": "d1361fa734fceb999dd7195794c6381b", "score": "0.7635494", "text": "function buttonmaker(){\n\tfor (i = 0; i < topics.length; i++) {\n\t\tvar buttonholder = $(\"<button>\" + topics[i] + \"</button>\");\n\t\tbuttonholder.attr(\"value\", topics[i]);\n\t\tbuttonholder.attr(\"class\", \"btn btn-primary btn-lg\");\n\t\t$(\"#buttonland\").append(buttonholder);\n\t};\n}", "title": "" }, { "docid": "c96ab118a653cedfec3b3ecf7f774b75", "score": "0.7490349", "text": "function buttonMaker() {\n nextSceneButton = createButton(\"Done Searching, Go to Next Scene\");\n seeMapButton = createButton(\"See the Labyrinth\");\n}", "title": "" }, { "docid": "4f3ec64592c6936ae4d597041ef7e3c9", "score": "0.74776834", "text": "function createButton() {\n\n // prevents repeat buttons\n $(\"#buttonsDisplay\").empty();\n \n // dynamically generate button for each item in my topics array and give it a class and data-name attribute\n for (var i = 0; i < topics.length; i++) {\n \n var newButton = $(\"<button>\");\n newButton.addClass(\"gifBtn hvr-shutter-out-vertical\");\n newButton.attr(\"data-name\", topics[i]);\n newButton.text(topics[i]);\n\n $(\"#buttonsDisplay\").append(newButton);\n }\n }", "title": "" }, { "docid": "bddd3725a52b82b321922d4cb20b3d52", "score": "0.74647516", "text": "function generateButtons() {\n // first, remove old buttons\n let removeBtns = $('.removable');\n removeBtns.remove()\n\n // Then, create new buttons\n for (i = 0; i < searches.length; i++) {\n let li = document.createElement('li');\n // let btn = document.createElement('button');\n li.setAttribute('class', 'col-8 btn btn-light removable border border-primary');\n li.innerText = searches[i];\n searchListEl.append(li);\n }\n}", "title": "" }, { "docid": "419fd66716736ec54cd4acf59f16da37", "score": "0.74229413", "text": "_createButtons() {\n this.buttons = document.createElement('div');\n this.buttons.classList.add(BUTTONS_ELEMENT);\n\n this.add_all_button = document.createElement('button');\n this.add_all_button.classList.add(BUTTON_ELEMENT);\n this.add_all_button.innerHTML = this.addAllButtonText;\n this.add_all_button.setAttribute('type', 'button');\n\n this.add_button = document.createElement('button');\n this.add_button.classList.add(BUTTON_ELEMENT);\n this.add_button.innerHTML = this.addButtonText;\n this.add_button.setAttribute('type', 'button');\n\n this.remove_button = document.createElement('button');\n this.remove_button.classList.add(BUTTON_ELEMENT);\n this.remove_button.innerHTML = this.removeButtonText;\n this.remove_button.setAttribute('type', 'button');\n\n this.remove_all_button = document.createElement('button');\n this.remove_all_button.classList.add(BUTTON_ELEMENT);\n this.remove_all_button.innerHTML = this.removeAllButtonText;\n this.remove_all_button.setAttribute('type', 'button');\n\n if(this.showAddAllButton) {\n this.buttons.appendChild(this.add_all_button);\n }\n if(this.showAddButton) {\n this.buttons.appendChild(this.add_button);\n }\n if(this.showRemoveButton) {\n this.buttons.appendChild(this.remove_button);\n }\n if(this.showRemoveAllButton) {\n this.buttons.appendChild(this.remove_all_button);\n }\n }", "title": "" }, { "docid": "c2082a20a31721c3b4467274c56dfd51", "score": "0.7377771", "text": "function createButton() {\n\n //replaces buttons everytime function is run. prevents duplicates\n $(\"#addButtons\").empty();\n\n for (i = 0; i < buttonArray.length; i++) {\n\n var button = $(document.createElement('button'));\n\n button.attr('data-name', buttonArray[i]);\n button.addClass('button');\n button.text(buttonArray[i]);\n\n button.appendTo('#addButtons');\n\n }\n\n\n }", "title": "" }, { "docid": "3736370f112ea2dbf936e3145d4ada50", "score": "0.73504514", "text": "function makeButton() {\n\n // for loop that creates each button\n for (var i = 0; i < painters.length; i++) {\n\n // variable to hold button values\n var buttons = $('<button value=\"' + painters[i] + '\">' + painters[i] + '</button>')\n\n // appending buttons to div\n $('#buttons-appear-here').append(buttons);\n }\n }", "title": "" }, { "docid": "20d699b9b59b7cb1fd6941a0a688b34c", "score": "0.7278636", "text": "function createButton(name, body, color) {\r\n \r\n button = new Button(name, body, color);\r\n \r\n buttons.push(button); // Now we can find this button!\r\n\r\n elements.click_board.appendChild(button.element); // Now we can see this button!\r\n\r\n button.element.addEventListener(\"click\", clickTemplateButton); // Now we can click this button!\r\n button.element.addEventListener(\"contextmenu\", contextMenuTemplateButton);\r\n button.element.addEventListener(\"dblclick\", dblClickTemplateButton); // And so on.\r\n\r\n return button;\r\n\r\n}", "title": "" }, { "docid": "d6491b63701da96719da53d051245098", "score": "0.7271724", "text": "function btnMaker() {\n \n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button>\");\n btn.text(topics[i]);\n btn.attr(\"data-title\", topics[i]);\n btn.addClass(\"newBtn\", \"showBtn\");\n $(\"#topicbuttons\").append(btn);\n }\n}", "title": "" }, { "docid": "4e1ad9b185963518e8c278f9020a8809", "score": "0.72324586", "text": "function createBtns() {\n for (i = 0; i < topicList.length; i++) {\n var button = $(\"<button class='topicBtn' value='\" + topicList[i] + \"'>\" + topicList[i] + \"</button>\")\n $(\"#btns-section\").append(button);\n }\n }", "title": "" }, { "docid": "bb7e02d39edd9f10522dc7cbe2294d2a", "score": "0.7229723", "text": "function createButtons() {\n // Inbuilt Dom method which removes objects from the page\n startButton.remove();\n\n // Creation of buttons using the forEach array methods\n buttons.forEach((indivdualButton) => {\n const button = document.createElement('div');\n button.classList.add('btn', 'btn-lg', 'btn-secondary');\n button.innerHTML = `${indivdualButton}`;\n\n buttonWrapper.appendChild(button);\n\n if (button.innerHTML === 'Magic') {\n button.addEventListener('click', handleMagicButton);\n }\n if (button.innerHTML === 'Show/Hide') {\n button.addEventListener('click', handleShowButton);\n }\n if (button.innerHTML === 'Shuffle') {\n button.addEventListener('click', handleShuffleButton);\n }\n });\n}", "title": "" }, { "docid": "d0079f6bcfa27dcd4aba9420560b5445", "score": "0.7207857", "text": "function buttonMaker() {\n for (i=0; i < topics.length; i++) {\n console.log(topics[i]);\n //this makes the button\n var button = $(\"<button>\");\n //this adds the character's name to the button\n button.attr(\"data-search\", topics[i]);\n button.addClass (\"btn btn-info\");\n button.text(topics[i]);\n //this adds the button to the div with #buttonArea\n $(\"#buttonArea\").append(button);\n }\n }", "title": "" }, { "docid": "b1831addc94da35ea94398121c3e5e21", "score": "0.7202438", "text": "function makeButtons() {\n\t\tvar l = box.screen.x2+50,\n\t\t\tt = box.screen.y+50,\n\t\t\tw = 100,\n\t\t\th = 50,\n\t\t\tc = 7,\n\t\t\titems = ['left','right','up','down','back','front'];\n\t\t\n\t\t$.each(items,function(n,nam){\n\t\t\tnew Btn({\n\t\t\t\tid: 'btn-'+nam,\n\t\t\t\tl:l,\n\t\t\t\tt:t+=(h*1.5),\n\t\t\t\tw:w,\n\t\t\t\th:h,\n\t\t\t\ttxt: nam.toUpperCase(),\n\t\t\t\texe: nam\n\t\t\t});\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "f1f37dd761fabd6fb4b72799da3d2e48", "score": "0.7181755", "text": "function createButton() {\n for (let i = 0; i < tabList.length; i++) {\n let button = document.createElement('button');\n button.classList.add('tablink');\n button.innerText = tabList[i];\n button.id = tabList[i];\n nav.append(button);\n }\n }", "title": "" }, { "docid": "84434bd3a34fd081f5395ea0b7483ff5", "score": "0.71701664", "text": "function renderBtn() {\n $btnArea.empty()\n for (i = 0; i < topics.length; i++) {\n let a = $('<button>')\n a.addClass('m-1 btn btn-dark gifNewBtn')\n a.text(topics[i])\n a.attr('gif-name', topics[i])\n a.attr('id', topics[i])\n $btnArea.append(a)\n }\n}", "title": "" }, { "docid": "8d6f170fa493049f5c6a013324bd14db", "score": "0.71641165", "text": "function createButtons() {\n\tvar numButtons = BUTTONS.get();\n\t\n\t//Markup attributes for buttons.\n\tvar inlineButton = '';\n\tvar inlineLabel = dw.loadString(\"Commands/jQM/buttons/dialog/position/inline\");\n\tif (POSITION.get().indexOf(inlineLabel) != -1) {\n\t\tinlineButton = ' data-inline=\"true\"';\n\t}\n\t\n\tvar iconButton = ICON.getValue();\n\tif (iconButton) {\n\t\ticonButton = ' data-icon=\"' + iconButton + '\"';\n\t}\n\t\n\tvar iconPosButton = '';\n\tvar iconPosValue = ICONPOS.getValue();\n\tif (!ICONPOS.object.disabled && iconPosValue != '') {\n\t\ticonPosButton = ' data-iconpos=\"' + iconPosValue + '\"';\n\t}\n\t\n\t//Use the right markup for the chosen button tag.\n\tvar btnMarkup = '<';\n\tvar btnTag = BUTTONTYPE.getValue();\n\tvar buttonLabel = dw.loadString(\"Commands/jQM/dummy/buttons/buttonLabel\");\n\tvar btnEndMarkup = '>' + buttonLabel + '</' + btnTag + '>';\n\t\n\tswitch (btnTag) {\n\t\tcase 'a':\n\t\t\twidgetId = 'jQMLinkBtn';\n\t\t\tbtnMarkup += btnTag + ' href=\"#\" data-role=\"button\"';\n\t\t\tbreak;\n\t\tcase 'button':\n\t\t\tbtnMarkup += btnTag;\n\t\t\twidgetId = 'jQMButtonBtn';\n\t\t\tbreak;\n\t\tcase 'input':\n\t\t\tvar btnVal;\n\t\t\tvar inputType = INPUTTYPE.getValue();\n\t\t\tswitch (inputType) {\n\t\t\t\tcase \"button\":\n\t\t\t\t\tbtnVal = dw.loadString(\"Commands/jQM/dummy/buttons/buttonLabel\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"submit\":\n\t\t\t\t\tbtnVal = dw.loadString(\"Commands/jQM/buttons/dialog/inputtype/submit\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"reset\":\n\t\t\t\t\tbtnVal = dw.loadString(\"Commands/jQM/buttons/dialog/inputtype/reset\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"image\":\n\t\t\t\t\tbtnVal = dw.loadString(\"Commands/jQM/buttons/dialog/inputtype/image\") + '\" src=\"';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbtnMarkup += btnTag + ' type=\"' + inputType + '\" value=\"' + btnVal + '\"';\n\t\t\tbtnEndMarkup = ' />';\n\t\t\twidgetId = 'jQMInputBtn';\n\t}\n\t\n\tif (numButtons > 1) {\n\t\twidgetId = \"jQMButtonGroup\";\n\t\tmarkupArr.push('<div mmTranslatedValue=\"transId=%22'+widgetId+'%22\" ' + POSITION.getValue());\n\t\t\n\t\tif (HORIZONTAL.checked) {\n\t\t\tmarkupArr.push(' data-type=\"horizontal\"');\n\t\t}\n\t\t\n\t\tmarkupArr.push('>');\n\t\t\n\t\tfor (var i = 0; i < numButtons; i++) {\n\t\t\tmarkupArr.push(btnMarkup + inlineButton + iconButton + iconPosButton + btnEndMarkup);\n\t\t}\n\t\tmarkupArr.push('</div>');\n\t} else {\n\t\tmarkupArr.push(btnMarkup + ' mmTranslatedValue=\"transId=%22'+widgetId+'%22\"' + inlineButton + iconButton + iconPosButton + btnEndMarkup);\n\t}\n\t\n\twidgetMarkup = markupArr.join('');\n}", "title": "" }, { "docid": "da9d83e17f89541737ba5fbee04a0922", "score": "0.71638674", "text": "[buildButton](settings, doSaveData, insertIndex) {\n\t\tconst self = this;\n\t\tconst button = self[BUTTON_RECYCLER].getRecycledControl();\n\t\tconst currentButtons = self.buttons();\n\n\t\tsettings.id = settings.id ? settings.id.toString() : shortid.generate();\n\n\t\tapplySettings(button, {\n\t\t\t...settings,\n\t\t\tcontainer: self.contentContainer,\n\t\t\tisSelectable: self.isSelectable(),\n\t\t\twidth: self[getButtonWidthSetting](),\n\t\t\tonClick(event) {\n\t\t\t\tself[onButtonClick](this, event);\n\t\t\t}\n\t\t});\n\n\t\tinsertIndex = Math.min(enforceInteger(insertIndex, currentButtons.length), currentButtons.length);\n\n\t\tif (insertIndex < currentButtons.length) {\n\t\t\tself.contentContainer.insertAt(button, insertIndex + 1);\n\t\t}\n\t\telse {\n\t\t\tself.contentContainer.append(button);\n\t\t}\n\n\t\tif (doSaveData) {\n\t\t\tcurrentButtons.splice(insertIndex, 0, settings);\n\t\t}\n\t\tself[MULTI_ITEM_FOCUS].length(currentButtons.length);\n\t}", "title": "" }, { "docid": "abd1d89bca1aae525f5092cd9872cf3e", "score": "0.7146367", "text": "function generateBtns() {\r\n $(\"#gifBtns\").empty();\r\n $(\"#gifBtns\").append($(\"<p>\").text(\"Click to dispay GIF's\"));\r\n\r\n buttons.btnInfo.forEach(function (element) {\r\n var newBtn = $(\"<li>\")\r\n .append($(\"<button>\")\r\n .addClass(\"btn btn-light col-12 my-1\")\r\n .attr(\"data-animal\", element)\r\n .text(element));\r\n $(\"#gifBtns\").append(newBtn);\r\n $(\"#newBtnText\").val(\"\");\r\n });\r\n}", "title": "" }, { "docid": "dca3f1b850f48729bff2b777de7691d2", "score": "0.71415997", "text": "function makeButtons() {\n $(\"#button_container\").empty();\n for(var i = 0; i < topics.length; i++){\n var p = $(\"<button>\");\n // add attributes. reference movie-button-layout-solved.\n p.addClass(\"gif-btn\");\n p.attr(\"gif-name\", topics[i]);\n p.text(topics[i]);\n $(\"#button_container\").append(p);\n }\n }", "title": "" }, { "docid": "8853d6eb852abd0e3e8305ef64a085f5", "score": "0.7137605", "text": "function makeButtons() {\n\t//Clears #buttons area for when new buttons are added\n\t$(\"#buttons\").html(\"\");\n\n\t//Loop through topics array to make each button\n\tfor (var i=0; i<topics.length; i++) {\n\t\tnewButton = $(\"<button>\" + topics[i] + \"</button>\");\n\t\tnewButton.attr(\"data-name\", topics[i]);\n\t\tnewButton.addClass(\"Doug\");\n\t\t$(\"#buttons\").append(newButton);\n\t};\n}", "title": "" }, { "docid": "9696735204cf78f83965a13cae829d59", "score": "0.7135987", "text": "function createButton(){\n\n //deletes the other games prior to adding new ones\n\n $(\"#glitchbutton\").empty();\n\n //necessary or we will need to repeat buttons\n\n //looping through\n\n for (var i = 0; i < games.length; i++){\n\n //creating the button html\n\n var g = $(\"<button>\");\n\n //add a class of newButton to the button\n\n g.addClass(\"newButton\");\n\n //add a game-attribute\n\n g.attr(\"game-name\", games[i]);\n\n //Providing the initial button text\n\n g.text(games[i]);\n\n //Adding the button to the buttons div\n\n $(\"#glitchbutton\").append(g);\n }\n }", "title": "" }, { "docid": "5c6a9d5da1985d139d98b9d5abf7c08e", "score": "0.7133399", "text": "function generateButtons() {\n $(\"#treatButtons\").empty();\n for (i = 0; i < topics.length; i++) {\n $(\"<button>\").appendTo(\"#treatButtons\").addClass(\"btn btn-primary m-1\").attr(\"id\", \"button\" + i).text(topics[i]);\n };\n }", "title": "" }, { "docid": "acb3001330f0db5da0b1009e30bdf757", "score": "0.7124985", "text": "function createButtons() {\n\t$buttonDiv.empty();\n\tfor (var i=0; i<topics.length; i++) {\n\t\t$button= $(\"<button>\").addClass(\"gif-button\").text(topics[i]).attr(\"seinfeld-term\", topics[i]);\n\t\t$buttonDiv.append($button);\n\t};\n}", "title": "" }, { "docid": "aeafc35232c19a1bd06f69a010e76428", "score": "0.7112334", "text": "createButton () {\n\n this.button = document.createElement('button')\n\n this.button.title = 'This model has multiple views ...'\n\n this.button.className = 'viewable-selector btn'\n\n this.button.innerHTML = 'Views'\n\n this.button.onclick = () => {\n\n this.showPanel(true)\n }\n\n const span = document.createElement('span')\n\n span.className = 'fa fa-list-ul'\n\n this.button.appendChild(span)\n\n this.viewer.container.appendChild(this.button)\n }", "title": "" }, { "docid": "b18c27e73affb1461684a1cb26b9e9fa", "score": "0.70970255", "text": "function drawButtons() {\n\t\t$(\"#buttonHome\").empty();\n\t\tbuttons.forEach(function(arr){\n\t\t\tvar button = $(\"<button/>\").addClass(\"btn btn-default searchButton\").attr(\"value\", arr).text(arr);\n\t\t\t$(\"#buttonHome\").append(button);\n\t\t})\n\t}", "title": "" }, { "docid": "c32d1834900d4d449f596834371babd9", "score": "0.7086334", "text": "function generateButtons() {\n $(\"#all-the-buttons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\" + topics[i] + \"</button>\")\n button.addClass(\"topics-button\");\n button.attr(\"data-name\", topics[i]);\n $(\"#all-the-buttons\").append(button);\n }\n }", "title": "" }, { "docid": "f53e8bd24277319a3c7ab13a873ab095", "score": "0.7080055", "text": "function CreateButtons() {\n\n $(\"#gamingButtons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var g = $(\"<button>\");\n g.addClass(\"games-input\");\n g.attr(\"data-name\", topics[i]);\n g.text(topics[i]);\n $(\"#gamingButtons\").append(g);\n }\n }", "title": "" }, { "docid": "f12aa2cacdcbc8b60fa559e7358847ba", "score": "0.7075515", "text": "function generate_buttons()\n{\n for (var ii = 0; ii < 32; ii++)\n {\n make_button(\"white\", ii + 1, \"black\");\n }\n\n shuffle(global_button_list)\n \n // Generate the locations for the buttons\n for (var button_num = 0; button_num < global_button_list.length; button_num++)\n {\n button_location = generate_button_location()\n global_button_locations.push(button_location);\n }\n}", "title": "" }, { "docid": "4c5e8ba6196aaafc2eab41a34502ca1f", "score": "0.7072752", "text": "function makeButton() {\n $(\"#buttonContainer\").empty();\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button>\").attr(\"data-musicals\", topics[i]).text(topics[i]);\n $(\"#buttonContainer\").append(btn);\n }\n }", "title": "" }, { "docid": "60a2322a2416d35d8f14b3ef760178e7", "score": "0.70722526", "text": "function createButtonSet(li) {\n\tlet upButton = document.createElement('button');\n\tupButton.className = 'upBtn';\n\tupButton.textContent = 'Up';\n\tli.appendChild(upButton);\n\n\tlet downButton = document.createElement('button');\n\tdownButton.className = 'downBtn';\n\tdownButton.textContent = 'Down';\n\tli.appendChild(downButton);\n\n\tlet editButton = document.createElement('button');\n\teditButton.className = 'editBtn';\n\teditButton.textContent = 'Edit';\n\tli.appendChild(editButton);\n\n\tlet removeButton = document.createElement('button');\n\tremoveButton.className = 'removeBtn';\n\tremoveButton.textContent = 'Remove';\n\tli.appendChild(removeButton);\n}", "title": "" }, { "docid": "98272994aa5a10b8c9e4434fc1a21a6c", "score": "0.70718163", "text": "function makeButtons() {\n //deleting the gif button before adding new gif buttons, do not want repeat buttons \n $(\"#feelingBtn\").empty();\n\n for (var i = 0; i < feelings.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"feeling\");\n a.data(\"name\", feelings[i]);\n a.text(feelings[i]);\n $(\"#feelingBtn\").append(a);\n }\n }", "title": "" }, { "docid": "908b857d5605b2d33535b9f654c12874", "score": "0.7066143", "text": "function makeButtons() {\n $(\"#buttons\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\");\n button.text(topics[i]);\n button.addClass(\"gif-button\");\n button.attr(\"data-removal\", \"keep\");\n\n $(\"#buttons\").append(button);\n }\n }", "title": "" }, { "docid": "abe3fbc671b8f97581da9f1f1111d060", "score": "0.70654005", "text": "function createButtons() {\n for (let i = 0; i < 26; i++) {\n buttons.push(new Button(i));\n }\n}", "title": "" }, { "docid": "488b1d2bfd7c13dada16bac84162ad2d", "score": "0.7060758", "text": "function buildButtonElement(buttonSpec) {\n var toolbar = this;\n\n // create the HTML element\n var btn = Element(\n 'a', \n {\"class\": \"button button\" + buttonSpec.label, \"href\": \"#\"}\n );\n btn.update('<span>' + buttonSpec.label + '</span>');\n\n // invoke the action when the button is clicked\n btn.observe(\n 'click', \n function (event) { \n toolbar.editArea.invokeAction(buttonSpec.action.name);\n Event.stop(event);\n }\n );\n\n // set or remove the 'selected' class on the element when state changes\n toolbar.editArea.observe(\n 'wysihat:state:'+buttonSpec.action.name,\n function (event) {\n if (event.memo.state) {\n btn.addClassName('selected');\n } else {\n btn.removeClassName('selected');\n }\n }\n );\n\n return btn;\n }", "title": "" }, { "docid": "810c2fcfbee7a356d3bed57b59f9f151", "score": "0.70606923", "text": "function buttonGenerator() {\n $(\"#buttonDiv\").empty();\n for (var i = 0; i < buttonArray.length; i++) {\n var addButton = $(\"<button>\");\n addButton.attr(\"data-name\", buttonArray[i]);\n addButton.addClass(\"buttonClass\");\n addButton.text(buttonArray[i]);\n $(\"#buttonDiv\").append(addButton);\n }\n }", "title": "" }, { "docid": "b5bf75afe79c8150796473e5adc32e55", "score": "0.7060537", "text": "function creation () {\n\tfor (var i = 0; i < buttons.length; i++) {\n\t\tvar newButton = $(\"<button>\");\n\t\tnewButton.addClass(\"theButtons btn btn-primary\");\n\t\tnewButton.text(buttons[i]);\n\t\t$(\"#buttonsHere\").append(newButton);\n\n\t}\n}", "title": "" }, { "docid": "b77983092770c3d5716e29be9176c67d", "score": "0.7058194", "text": "function generateButtons() {\n topics.forEach(function(movie) {\n var button = $('<button>');\n button.attr('type', 'button');\n button.addClass('movBTN');\n button.html(movie);\n $('#movieButtons').append(button);\n });\n}", "title": "" }, { "docid": "c70fd1d5c4ff3a6b846a7f14317a1553", "score": "0.7051547", "text": "_makeButton() {\n if (this.options.showButton === true) {\n const generateButton = document.createElement(\"div\");\n generateButton.className = \"vis-configuration vis-config-button\";\n generateButton.innerText = \"generate options\";\n generateButton.onclick = () => {\n this._printOptions();\n };\n generateButton.onmouseover = () => {\n generateButton.className = \"vis-configuration vis-config-button hover\";\n };\n generateButton.onmouseout = () => {\n generateButton.className = \"vis-configuration vis-config-button\";\n };\n\n this.optionsContainer = document.createElement(\"div\");\n this.optionsContainer.className =\n \"vis-configuration vis-config-option-container\";\n\n this.domElements.push(this.optionsContainer);\n this.domElements.push(generateButton);\n }\n }", "title": "" }, { "docid": "85b802caab35c6e73579761f887a7fc8", "score": "0.705125", "text": "function createAttackBtn() {\n var newBtn = $(\"<button>Attack</button>\");\n newBtn.appendTo(\".selected-player\");\n}", "title": "" }, { "docid": "5241d5e45f8e0852d2404b61ee1212a1", "score": "0.7032838", "text": "static renderButtons() {\n\t\tthis.makeButtons(\n\t\t\t'allBtn',\n\t\t\t'All',\n\t\t\t`<i class=\"fas svg linkicon fa-list\"></i>`\n\t\t);\n\t\tthis.makeButtons(\n\t\t\t'todaybtn',\n\t\t\t'Today',\n\t\t\t`<i class=\"fas svg linkicon fa-inbox\"></i>`\n\t\t);\n\t\tthis.makeButtons(\n\t\t\t'weekbtn',\n\t\t\t'Week',\n\t\t\t`<i class=\"fas svg linkicon fa-calendar-week\"></i>`\n\t\t);\n\t\tthis.nonBtnProjectTxt();\n\t\tthis.makeAddProjectBtn();\n\t}", "title": "" }, { "docid": "037c3dac30f01902bef30a4cfe32fce9", "score": "0.7028574", "text": "function renderButton() \n{\n $(\"#buttons-display\").empty();\n for(i = 0; i < topics.length; i++)\n {\n //Create a dynamic button\n var newBtn = $(\"<button>\");\n //Set class and attribute for button\n newBtn.addClass(\"animal-button\");\n newBtn.attr(\"data-buttonName\", topics[i]);\n //Set button's name\n newBtn.text(topics[i]);\n $(\"#buttons-display\").append(newBtn);\n }\n}", "title": "" }, { "docid": "9aad53c0c8a1663577b0a4cee7653654", "score": "0.7017295", "text": "function createButtons() {\r\n\r\n $(\"#gameButtons\").empty();\r\n\r\n for (var i = 0; i < topicsObjArray.length; i++) {\r\n var btn = $(\"<button>\");\r\n\r\n btn.addClass(\"btn btn-info game-buttons\");\r\n\r\n btn.text(topicsObjArray[i].name);\r\n\r\n btn.attr(\"data-character\", topicsObjArray[i].name);\r\n\r\n $(\"#gameButtons\").append(btn);\r\n }\r\n}", "title": "" }, { "docid": "4378536d04d12daff4956a1f597e9b3c", "score": "0.701294", "text": "function buildButtons() \n{\n for (let i = 0; i < wordsStartArray.length; i++) \n {\n let button = createButton(wordsStartArray[i], wordsEndArray[i]);\n }\n}", "title": "" }, { "docid": "f412fd6ace6535988269c1cbd9ccc188", "score": "0.7008425", "text": "function renderbtn () {\n\t$(\"#button-view\").empty();\n\tfor (var i = 0; i < buttonChoices.length; i++) {\n\t\tvar newbtn = $(\"<button>\");\n\t\t$(\"#button-view\").append(newbtn);\n\t\tnewbtn.addClass(\"gifOption\").attr(\"data-name\", buttonChoices[i]).text(buttonChoices[i]);\n\t}\n}", "title": "" }, { "docid": "187848422a15a578cc6346fdbc4437c8", "score": "0.7004717", "text": "function createPlaylistButtons() {\n // 1. reference to where buttons will be appended to:\n var appendTarget = $(\"#channel-menu\"); // *** CHANGE THIS TO REFERNCE where we will append to\n // 2. for each key-value pair in the playlist dictionary, create a button\n Object.keys(playlist_dict).map(function (key) {\n // console.log(`${key}: ${playlist_dict[key]}`);\n // create a button for each playlist\n var btn = $(\"<button>\")\n .addClass(\"playlist-btn button small\")\n .data(\"id\", playlist_dict[key])\n .data(\"playlist\", key)\n .html(key);\n // append the created btn to the Target\n appendTarget.append(btn);\n }); // closes map function\n }", "title": "" }, { "docid": "33770ed78adacc48ef2f80500beebe37", "score": "0.70044464", "text": "function makeButtons() {\n let container = document.getElementById(\"buttons\");\n let fragment = document.createDocumentFragment();\n\n // Removes the previous buttons if they exist\n emptyContainer(container);\n\n topics.forEach(topic => {\n let topicButton = document.createElement(\"button\");\n\n // Assigns classes to the button\n topicButton.className = \"topic btn btn-secondary m-2\";\n\n // Adds text to the button\n topicButton.textContent = topic;\n\n // Sends the button into the queue\n fragment.appendChild(topicButton);\n });\n\n // Displays all of the buttons at once to the screen\n container.appendChild(fragment);\n}", "title": "" }, { "docid": "b9ad251fce6a8b920cca4c0a56ca29ef", "score": "0.69976366", "text": "function createButtons(){\n\t\t$('#buttons').empty();\n\t\tfor(var i = 0; i < topics.length; i++){\n\t\t\tvar b = $(\"<button>\");\n\t\t\tb.attr('class', 'button btn btn-lg');\n\t\t\tb.attr('data-name', topics[i]);\n\t\t\tb.text(topics[i]);\n\t\t\t$(\"#buttons\").append(b);\n\t\t}\n\t}", "title": "" }, { "docid": "6e4fe95518ada9575e9987d149ab4fd0", "score": "0.69910955", "text": "function createButtons(){\n $(\"#button\").empty(); // this clears out hte extra buttons... inner value button div set = to 0\n for (var i=0; i< topicsArray.length; i++) {\n // dynamically make a button for each topic\n var button = $(\"<button>\").addClass(\"theme\").text(topicsArray[i]);\n $(\"#button\").append(button);\n // name the button after the topic\n }\n}", "title": "" }, { "docid": "2f6a7b96448f8f94770d177676df1229", "score": "0.6984262", "text": "function generateButtons() {\n $(\"#btn-container\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button>\");\n // Adding a class of movie-btn to our button\n btn.addClass(\"btn-style\");\n btn.addClass(\"btn\");\n btn.attr(\"value\", topics[i]);\n // Providing the initial button text\n btn.text(topics[i]);\n\n // Adding the button to the buttons-view div\n $(\"#btn-container\").append(btn);\n }\n}", "title": "" }, { "docid": "71208c6cee5aa2320e3a4ced56663f5c", "score": "0.6979433", "text": "function createBtn(){\n $(\"#btnArea\").empty();\n \n //FOREACH LOOP TO CREATE BUTTONS DYNAMYCALLY\n topics.forEach(function(element){\n console.log(element);\n var topicsBtn = $('<button type=\"button\" class=\"btn btn-outline-info\">');\n topicsBtn.addClass(\"topics\");\n topicsBtn.attr(\"data-name\", element);\n topicsBtn.text(element);\n $(\"#btnArea\").append(topicsBtn).append(\" \");\n\n })\n}", "title": "" }, { "docid": "4a34f9a00d4427bbe41f30957caabe4c", "score": "0.69731504", "text": "function buttonCreate() {\n $(\"#button-space\").empty();\n for (var i = 0; i < topics.length; i++) {\n var buttons = $(\"#button-space\");\n var newString = topics[i].replace(/\\s/g, '-');\n buttons = buttons.append($(\"<button id =\" + newString + \">\"));\n var addToButtons = $(\"#\" + newString);\n addToButtons.addClass(\"button-click\");\n addToButtons.append(topics[i]);\n }\n }", "title": "" }, { "docid": "d547393b27a8054c8fe53fad8a072916", "score": "0.6966416", "text": "function makeButtons() {\n\n //Remove old buttons to avoid duplicate set\n $(\"#gifButtons\").empty();\n\n //Loop array of topics\n for (i = 0; i < topics.length; i++) {\n\n //Make buttons and append\n var b = $(\"<button>\");\n b.addClass(\"topics\");\n b.attr(\"data-topic\", topics[i]);\n b.text(topics[i]);\n $(\"#gifButtons\").append(b);\n }\n }", "title": "" }, { "docid": "b185c5301fbe541d26afe251a3f3f3ee", "score": "0.6962832", "text": "function makeButtons() {\n\n $(\".recentResults\").empty();\n for (var i = 0; i < buttons.length; i++) {\n var buttonName = buttons[i];\n\n var button = `<div class =\"wrap-buttons\">\n <button class = \"btn btn-search\" data-name = \"${buttonName}\">${buttonName}</button>\n <button data-name = \"${buttonName}\" data-index=\"${i}\" class = \"btn btn-delete far fa-times-circle\"></button>\n </div>`;\n\n $(\".recentResults\").append(button);\n }\n}", "title": "" }, { "docid": "831037cafa05fe4b8a907b81cce3566e", "score": "0.6961553", "text": "function buttonRender() {\n\n \n var buttonRender =\n $(\"#buttonPopBox\").append(\"<button id=\"keyButton\" keyword=\"topics[i].text\"> + topics[i].text + \"</button>\");\n // POTENTIALLY BETTER WAY TO CREATE BUTTONS BY THE ARRAY?\n // document.getElementById(\"buttonPopBox\").innerHTML = \"<button> + topics[i] + </button>\"\n \n // method to add a keyword attribute to the button based on the for loop text\n // $(\"buttonRender\").attr(keyword.buttonRender.text);\n \n // create a new var containing the button and giving it a unique id from the array.\n // var buttonQuery = $(\"buttonRender\").attr()\n console.log(buttonRender);\n\n }", "title": "" }, { "docid": "30ba49ef8c19e05a994f241f8d3bc6a2", "score": "0.69387007", "text": "function createButtons() {\n\t\t// empty the button holder\n\t\t$('#buttonHolder').empty();\n\t\t\n\t\t// for each index in the topics array: \n\t\t// 1. create a button element\n\t\t// 2. add btn class, add data-name attribute and player name to it\n\t\t// 3. display the player name in the button text\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t\tvar btn = $('<button>');\n\t\t\tbtn.addClass('btn btn-warning player');\n\t\t\tbtn.attr('data-name', topics[i]);\n\t\t\tbtn.text(topics[i]);\n\t\t\t$('#buttonHolder').append(btn);\n\t\t}\n\t} // end of createButtons function", "title": "" }, { "docid": "fe7b1ff37ac4fccc36e5f029a6bdd0d8", "score": "0.69358206", "text": "function makeButtons() {\n $(\"#sitcom-buttons\").empty();\n for (i = 0; i < topics.length; i++) {\n $(\"#sitcom-buttons\").append(\"<button class='btn btn-success' data-topic='\" + topics[i] + \"'>\" + topics[i] + \"</button>\");\n }\n }", "title": "" }, { "docid": "11b8f5b6ad3ca8d2f4835d3c08f20f6d", "score": "0.6930532", "text": "function renderButtons(savedButtons) {\n $(\"#api-list\").empty();\n // Looping through the array of topics\n for (var i = 0; i < savedButtons.length; i++){\n $(\"#api-list\").append(\n addObj({\n type: \"button\"\n ,class: \"classApi\"\n ,text: savedButtons[i].name\n ,attr: [\n { a: \"api-name\", v: savedButtons[i].name}\n , { a: \"api-description\", v: savedButtons[i].description}\n , { a: \"api-owner\", v: savedButtons[i].owner}\n , { a: \"api-authors\", v: savedButtons[i].authors}\n , { a: \"api-docurl\", v: savedButtons[i].docurl} \n , { a: \"api-url\", v: savedButtons[i].url}\n , { a: \"api-param\", v: savedButtons[i].param}\n , { a: \"api-sample\", v: savedButtons[i].sample}\n , { a: \"api-index\", v: i}\n ]\n }\n )\n\n )}\n }", "title": "" }, { "docid": "798c4dcc1ae7133518edddf642dcf9df", "score": "0.69191897", "text": "function makeButton() {\n //prevent appending duplicate buttons\n $(\"#button-holder\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n //loop thru array items and make them into buttons\n console.log(topics[i]);\n //append a button for each element in array to the button holder div\n var a = $(\"<button>\");\n //add class\n a.addClass(\"btn-btn-info topic\");\n //add attribute\n a.attr(\"data-animal\", topics[i]);\n //append the text to the buttons\n a.text(topics[i]);\n $(\"#button-holder\").append(a);\n }\n }", "title": "" }, { "docid": "91eeabbc14ca4f9cea54b6bfd3551ad4", "score": "0.69153726", "text": "function createButtons() {\n // Deleting the giph prior to adding new giph\n $(\"#buttons-view\").empty();\n\n // Looping through the array of giphs\n for (var i = 0; i < topic.length; i++) {\n // Then dynamicaly generating buttons for each giph in the array\n var button = $(\"<button>\");\n // Adding a class of giph to our button\n button.addClass(\"giph\");\n // Adding a data-attribute\n button.attr(\"data-name\", topic[i]);\n // Providing the initial button text\n button.text(topic[i]);\n // Adding the button to the HTML\n $(\"#buttons-view\").append(button);\n }\n}", "title": "" }, { "docid": "1740d0a786c40280007d93201eeecabb", "score": "0.6913362", "text": "function createButtons() {\n\n\tvar btnList = new Array();\n\tbtnList = createMainList();\n\tvar dataTheme = \"b\";\n\tvar btnClass;\n\n\tfor (var i = 0; i < numButtons; i++) {\n\t\tvar num = btnList[i];\n\n\t\tif (i % 2 != 0) {\n\t\t\tbtnClass = \"btnO\";\n\t\t} else {\n\t\t\tbtnClass = \"btnE\";\n\t\t}\n\n\t\tvar btn = $(\"<a data-role=\\\"button\\\" id=\" + i + \" class=\\\"\" + btnClass\n\t\t\t\t+ \"\\\" data-theme=\\\"b\\\" data-inline=\\\"true\\\">\" + num\n\t\t\t\t+ \"</button>\")\n\t\t$('#btnList').append(btn);\n\t\tbtn.button();\n\t}\n\n\tvar testBtn = $(\"<a onclick=\\\"showSuccess()\\\" data-role=\\\"button\\\" id=\\\"test\\\" data-theme=\\\"b\\\" data-inline=\\\"true\\\">testWin</button>\")\n\t$('#btnList').append(testBtn);\n\ttestBtn.button();\n}", "title": "" }, { "docid": "608db39e5625e042bdc6e1e065387d59", "score": "0.69117016", "text": "function createButtons() {\n $(\".button-list\").empty(); // prevent repeat buttons on each submission\n\n for (var i = 0; i < topics.length; i++) { // creating a button for each item in topics array\n var topicButton = $(\"<button>\");\n topicButton.addClass(\"btn btn-dark topic-btn\");\n topicButton.attr(\"topic-data\", topics[i]);\n topicButton.text(topics[i]);\n $(\".button-list\").append(topicButton);\n }\n }", "title": "" }, { "docid": "b7ff2a1f26cef3827e5fc397f9e4df55", "score": "0.69088966", "text": "function createButtonElement(toolbar, options) {\n var button = new Element('a', {\n 'class': 'button', 'href': '#'\n });\n button.update('<span>' + options.get('label') + '</span>');\n button.addClassName(options.get('name'));\n\n toolbar.appendChild(button);\n\n return button;\n }", "title": "" }, { "docid": "df8574bef8a8d02bc17da5efd8d04ec4", "score": "0.69029087", "text": "function renderButton(){\n\t$('#buttons').empty();\n\tfor (var i = 0; i < topicArray.length; i++) {\n\t\tvar b = $('<button>');\n\t\tb.addClass('baller');\n\t\tb.addClass('btn btn-success');\n\t\tb.addClass('col-lg-3');\n\t\tb.append(topicArray[i]);\n\t\t$('#buttons').append(b);\n\t}\n\t\n}", "title": "" }, { "docid": "d96ab123483a30e4c7f809bf3671e58d", "score": "0.6899552", "text": "function renderButtons() { \n $(\"#itemButtons\").empty();\n\t\t//loop for adding buttons modeled after in class example on movie topics\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"topicItem\");\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\"#itemButtons\").append(a);\n }\n }", "title": "" }, { "docid": "86d45d4e7952ace04946752be1f9929d", "score": "0.689937", "text": "function build() {\n for (i = 0; i < categoryList.length; i++) {\n var catButton = $(\"<button>\");\n catButton.attr(\"data-category\", categoryList[i]);\n catButton.html(categoryList[i]);\n catButton.addClass(\"category-button\")\n $(\"#button-list\").append(catButton);\n }\n}", "title": "" }, { "docid": "41d675cf2fc77b472b8c4a304a1d577e", "score": "0.6895309", "text": "function createBtn(parent, IDName, text){//DRY 2btn\r\n\t\t\t\t$('<button/>', {\r\n\t\t\t\t\t'type': 'button',\r\n\t\t\t\t\t'id': IDName,\r\n\t\t\t\t\t'text': text\r\n\t\t\t\t}).appendTo(parent);\r\n\t\t\t}", "title": "" }, { "docid": "e5b31a2a7675c07c574fe85de06aee81", "score": "0.6890263", "text": "function makeButtons() {\n\t$(\"#button-div\").empty();\n\tfor (var i = 0; i < topics.length; i++) {\n\t\tvar a = $(\"<button>\");\n\t\ta.addClass(\"tv-show\");\n\t\ta.attr(\"data-name\", topics[i]);\n\t\ta.text(topics[i]);\n\t\t$(\"#button-div\").append(a);\n\t}\n}", "title": "" }, { "docid": "6857d9ddc539874a7c51dd6530527f18", "score": "0.68884706", "text": "function createButtons() {\n let currentLetter = INITIAL_ASCII;\n for (let i = 0; i < LETTER_COUNT; i++) {\n let newButton = new Button(currentLetter, \"alphabet\");\n userKeyboard.appendChild(newButton.button);\n currentLetter++;\n }\n}", "title": "" }, { "docid": "d201e43eec918a6247df1454a4d4d605", "score": "0.6887856", "text": "function createButtons() {\n $(\"#buttonsArea\").empty();\n for (var i = 0; i < myMusicGenres.length; i++) {\n var newBtn = $(\"<button>\");\n newBtn.addClass(\"btn btn-primary btn-lg musicGenre nunito\");\n newBtn.attr(\"data-name\", myMusicGenres[i]);\n newBtn.text(myMusicGenres[i]);\n $(\"#buttonsArea\").append(newBtn);\n }\n}", "title": "" }, { "docid": "1f3245fbbff9db584e65ec332ea7b6df", "score": "0.6881798", "text": "function buttonBuilderJr(buttonArray, parent) {\n let buttonElementArray = [];\n for (i = 0; i < buttonArray.length; i++) {\n let projectButton = elementBuilder(\"button\", \"btn\", parent);\n projectButton.type = \"button\";\n projectButton.classList.add(\"btn-outline-primary\");\n projectButton.innerHTML = buttonArray[i];\n buttonElementArray.push(projectButton);\n };\n return buttonElementArray;\n}", "title": "" }, { "docid": "f9654e7a6af02522862fd3387dbe2a62", "score": "0.68749434", "text": "function makeBtns(){\n $('#btn-list').empty()\n gifArr.forEach(gif=>$('#btn-list').append(`<button class='btn btn-primary show-gifs' data-name=${gif}>${gif.charAt(0).toUpperCase() + gif.slice(1)}</button>`))\n $('.show-gifs').on('click', onClickAddGifs)\n}", "title": "" }, { "docid": "75210f996296da914036268dd468e100", "score": "0.68726194", "text": "function renderButtons() {\n\n for (i = 0; i < topics.length; i++) {\n var newButton = $(\"<button>\");\n $(\"#themeButtons\").append(newButton);\n newButton.text(topics[i]).addClass(\"btn btn-primary\").attr(\"data-name\", topics[i]);\n }\n }", "title": "" }, { "docid": "29b717e7bffa129b953dbbba9266c6fe", "score": "0.6872262", "text": "function addButton(button) {\n $('.request-buttons').append(`<div class=\"button-container\"><button class=\"asksos-button post\" value=\"${button}\" title=\"Post ${button}\">${button}</button><button class=\"asksos-button remove\" value=\"${button}\" title=\"Remove button\">x</button></div>`);\n\n}", "title": "" }, { "docid": "92089a4a6e183c08ec0907902d3095aa", "score": "0.6870685", "text": "function createButtons() {\n\n $(\"#topicBtns\").empty();\n \n\n // Loopthrough the array of teams\n for (var i = 0; i < teams.length; i++) {\n\n // Generate buttons for each team in the array.\n \n var teamBtn = $(\"<button>\");\n \n teamBtn.addClass(\"team\");\n teamBtn.addClass(\"btn btn-lg\")\n // Adding a data-attribute with a value of the movie at index i\n teamBtn.attr(\"data-name\", teams[i]);\n // Providing the button's text with a value of the movie at index i\n teamBtn.text(teams[i]);\n // Adding the button to the HTML\n $(\"#topicBtns\").append(teamBtn);\n }\n }", "title": "" }, { "docid": "4fa5091f25e587c95ab66c5ec7bbef4f", "score": "0.68668294", "text": "function mkButton(canvas, w, h, top, left, label, fontSize, action) {\n let btn = document.createElement(\"BUTTON\");\n btn.className = 'btn btn-1';\n btn.innerText = label;\n btn.style.width = w.toString() + \"px\";\n btn.style.height = h.toString() + \"px\";\n btn.style.top = top.toString() + \"px\";\n btn.style.left = left.toString() + \"px\";\n btn.style.fontSize = fontSize.toString() + \"px\";\n btn.addEventListener(\"click\", action);\n canvas.appendChild(btn);\n return btn;\n}", "title": "" }, { "docid": "fbd86a431cb1d3970cbbcdda0de1647d", "score": "0.68651724", "text": "function renderButton() {\n\n //empty out the gif container which holds the buttons\n $('#button-container').empty();\n\n // make a loop through the topics array to create buttons for everything in the array, even the one that has been added\n //give them classes and data attributes and then append them to the place where the buttons go on html\n for (let i = 0; i < topics.length; i++) {\n const x = $('<button>');\n x.addClass('gif-button');\n x.attr('data-name', topics[i]);\n x.text(topics[i]);\n $('#button-container').append(x);\n }\n}", "title": "" }, { "docid": "59796e509d0ff6c835025a9ae895d112", "score": "0.6861066", "text": "function makeButtons(){ \n\t// deletes the movie prior to adding new movies so there are no repeat buttons\n\t$('#buttonsView').empty();\n\t// loops through the movies array\n\tfor (var i = 0; i < movies.length; i++){\n\t\t\n\t\tvar a = $('<button>') \n\t\ta.addClass('movie'); \n\t\ta.attr('data-name', movies[i]); \n\t\ta.text(movies[i]); \n\t\t$('#buttonsView').append(a); \n\t}\n}", "title": "" }, { "docid": "181cae2e757938c45db49a7c5b76ba11", "score": "0.6854171", "text": "function makeButtons() {\n $(\"#animalButtons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button id = addAnimal>\");\n a.addClass(\"animal\");\n a.attr(\"data-animal\", topics[i]);\n a.text(topics[i]);\n $(\"#animalButtons\").append(a);\n }\n }", "title": "" }, { "docid": "7501560b59a4db3a9ac27eb8a122d91f", "score": "0.6847017", "text": "function renderButtons() {\n $(\"#button-display\").empty();\n for (i = 0; i < topics.length; i++) {\n var btn = $(\"<input class='btn btn-primary mr-2 my-2 vehicle'>\");\n btn.attr(\"type\", \"button\"); \n btn.attr(\"data-vehicle\", topics[i].toLocaleLowerCase());\n btn.attr(\"value\", topics[i]);\n $('#button-display').append(btn);\n };\n}", "title": "" }, { "docid": "d078d49a145be7a706ed66e455d61c68", "score": "0.6842225", "text": "function createButtons() {\n $(\"#buttonArea\").empty();\n for (var i = 0; i < topicsArray.length; i++) {\n var html = '';\n html = html + \"<button class='athleteGifs', data-person=\";\n html = html + topicsArray[i];\n html = html + '>';\n html = html + topicsArray[i];\n html = html + '</button>';\n // var gifButtons = $(\"<button>\");\n // gifButtons.addClass(\"athleteGifs\");\n // gifButtons.attr(\"data-person\", topics[i]);\n // $(\"<button>\").text(topics[i]);\n $(\"#buttonArea\").append(html);\n }\n}", "title": "" }, { "docid": "3582cd37f6c5967fdfd8604928e2b4bc", "score": "0.68374735", "text": "function buttonFactory(id) {\n var listItem = document.createElement('li');\n var button = document.createElement('button');\n button.id = id;\n button.innerHTML = tags[id].term\n button.className += \"tech-tag\";\n listItem.append(button);\n document.getElementById('tags').append(listItem);\n }", "title": "" }, { "docid": "136926f5252cf859791ce91304678084", "score": "0.68360865", "text": "function renderButtons() {\n\n // to avoid repeat buttons\n $(\"#officebuttons\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n var a = $(\"<button>\");\n // Adding a class of officeBtn \n a.addClass(\"officeBtn btn btn-default\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the officebuttons div\n $(\"#officebuttons\").append(a);\n }\n }", "title": "" }, { "docid": "b47034e271d1d0d24c333d5c4e481588", "score": "0.6833508", "text": "function buttonMaker(cityArray) {\n $(\"#btns\").empty(); \n for (let i = 0; i < cityArray.length; i++) {\n const cityBtn = $(\"<button>\");\n cityBtn.addClass(\"btn btn-secondary\");\n cityBtn.text(cityArray[i]);\n $(\"#btns\").append(cityBtn);\n }\n}", "title": "" }, { "docid": "79aff10d8fe923b0684fabcfcf4b2768", "score": "0.68314034", "text": "function createButtons() {\n\n // Store reference to document\n\n const doc = document;\n\n // Initialize Form that will contain buttons\n\n const outerForm = createDiv();\n outerForm.setAttribute('id', 'buttons-container');\n\n // Initialize three buttons\n\n let values = ['reset', 'manual', 'run'];\n\n function makeButton(name) {\n\n const svg = createSvg(svgDict[name])\n svg.setAttribute('id', `${name}-button`)\n\n const feedbackString = {\n 'reset': 'Click to clear all words and start over.',\n 'run': 'Click to manually run all tests.',\n 'manual': 'Turn off automatic tests. This might be a good idea if things are slow.'\n }[name]\n\n svg.onmouseover = function() {\n\n showFeedback(feedbackString);\n }\n\n svg.onmouseout = removeFeedback;\n\n svg.onclick = {\n 'reset': reset,\n 'run': main,\n 'manual': toggleManual\n }[name];\n\n return svg;\n }\n\n const buttons = values.map(makeButton);\n\n // Append buttons to Form\n\n for (let i = 0; i < buttons.length; i++) {\n outerForm.appendChild(buttons[i])\n }\n\n // Append form to dom\n\n const container = doc.getElementById('buttons');\n container.appendChild(outerForm);\n}", "title": "" }, { "docid": "e982a98838b4d211f615b05e91a2211a", "score": "0.6829463", "text": "function buttonCreate(){ \n $(\".aircraft-buttons\").empty(); \n for (var i = 0; i < topics.length; i++) {\n aircraftBtn = $(\"<button type='button' class='btn btn-primary aircraft'>\")\n aircraftBtn.attr(\"data-aircraft\", topics[i]);\n aircraftBtn.text(topics[i]);\n $(\".aircraft-buttons\").append(aircraftBtn);\n };\n }", "title": "" }, { "docid": "efdd92d3692912f5c3b8beddc83e47d5", "score": "0.68293166", "text": "function buttonBuild(){\n //clears the buttons and then appends the new button. otherwise it would duplicate buttons\n $('.topic-buttons').empty();\n \n for(var i=0; i<topics.length; i++){\n var topicButtons = $('.topic-buttons');\n var topicButtonGen = $('<button>');\n topicButtonGen.addClass('btn btn-primary btn-sm topic-btn')\n topicButtonGen.attr('data-title',topics[i])\n topicButtonGen.text(topics[i])\n topicButtons.append(topicButtonGen)\n console.log(topics)\n }\n }", "title": "" }, { "docid": "f5824a49b528e5b9bb3a301b395c6f56", "score": "0.6827085", "text": "function addButton(indexInArr, btnText){\n var btnString ='<li> <button value=\"' + indexInArr + '\" type=\"button\" onclick=\"selectedAnswer_CLICK(this); return false;\">' + btnText + '</button></li>';\n return btnString;\n}", "title": "" }, { "docid": "1b5c2b65dd2c0cec59fffd00a4a9aee3", "score": "0.682622", "text": "function makeButtons() {\n \n $(\"#species-buttons\").empty();\n\n for (i = 0; i < topics.length; i++) {\n \n var b = $(\"<button>\");\n\n b.addClass(\"species-btn\");\n b.attr(\"data-name\", topics[i]);\n b.text(topics[i]);\n\n $(\"#species-buttons\").append(b);\n };\n}", "title": "" }, { "docid": "dfe407486be5d43f0ece0db1ddd68057", "score": "0.68140006", "text": "function createButtons(){\n $(\"#button-bar\").empty();\n\n for (i=0; i < topics.length; i++){\n dogBreed = topics[i];\n $(\"#button-bar\").append(\"<button class='dog-button'>\" + dogBreed + \"</button>\");\n }\n }", "title": "" }, { "docid": "225a541b3d2f5e6543c1b19acfcc6daa", "score": "0.6810783", "text": "function renderButtons() {\n\n $(\"#buttons\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.attr(\"data-name\", topics[i]);\n a.addClass(\"gif btn btn-outline-warning\");\n a.text(topics[i]);\n $(\"#buttons\").append(a);\n };\n }", "title": "" }, { "docid": "1708b8a5e40a1fa37eb8e9daf442cf0d", "score": "0.68056494", "text": "function createButtons() {\n \n // Looping through the array of bands\n for (var i = 0; i < bands.length; i++) {\n\n // Then dynamicaly generating buttons for each band in the array\n var a = $(\"<button>\");\n // Adding a class of band to the buttons\n a.addClass(\"band\");\n // Adding a data-attribute\n a.attr(\"data-name\", bands[i]);\n // Providing the initial button text\n a.text(bands[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "5763410afe58db4065b649b603b032ca", "score": "0.680007", "text": "function addBtns() {\n $(\"#dogBtns\").empty();\n for (i = 0; i < dogs.length; i++) {\n var b = $(\"<button>\");\n b.addClass(\"dog_button\");\n b.attr(\"data-type\", dogs[i]);\n b.text(dogs[i]);\n $(\"#dogBtns\").append(b);\n }\n }", "title": "" }, { "docid": "d0eb65984eb8697570feaccb5bdca390", "score": "0.679513", "text": "function createButton(item) {\r\n return `<input type='button' value=${item}>`;\r\n}", "title": "" }, { "docid": "2b308e5a4f0a5fa80eb40517e7e46072", "score": "0.6795064", "text": "function makeButton(item) {\n var newButton = $('<button>');\n newButton.text(item);\n newButton.attr('data-name', item);\n newButton.attr('class', 'celebButton');\n return newButton;\n}", "title": "" }, { "docid": "f1e7f7251873e4cd2276d22f09d847d9", "score": "0.67881215", "text": "function addButtons() {\n while (arrayIndex < queryTermArray.length) {\n $(\"#buttons\").append(\"<button class='btn btn-primary thisButton mx-1 my-1' data-topic='\" + queryTermArray[arrayIndex] + \"'>\" + queryTermArray[arrayIndex] + \"</button>\");\n arrayIndex++;\n }\n }", "title": "" }, { "docid": "54a26521473c00671e29304e3c1a7293", "score": "0.67808235", "text": "function createButtons() {\n\n $(\"#buttonZone\").empty();\n // need to add padding to buttons to make them space properly, might needs divs for it\n for (var i = 0; i < superHeros.length; i++) {\n var buttonDiv = $(\"<div class='fl padding'>\");\n var button = $(\"<a class='f6 grow no-underline br-pill ph3 pv2 mb2 dib white bg-red button' href='#0'></a>\");\n button.attr(\"data-hero\", superHeros[i]);\n button.text(superHeros[i]);\n buttonDiv.append(button);\n $(\"#buttonZone\").append(buttonDiv);\n }\n }", "title": "" }, { "docid": "93a4786cdf4d2858a68d61b147b63a5b", "score": "0.6777732", "text": "function btnCreator(){\n \n // Empties Div from previous elements\n $(\"#btn-section\").empty();\n \n // FOR loop, creates buttons by looping through the \"topic\" array\n for(var i = 0; i < topics.length; i++) {\n var btn = $(\"<button>\");\n btn.addClass(\"btn btn-info\");\n btn.attr(\"data\",topics[i]);\n btn.text(topics[i]);\n $(\"#btn-section\").append(btn);\n };\n}", "title": "" }, { "docid": "62d9f81a91ad2a7cd7e2cf031edf6b76", "score": "0.67770654", "text": "function makeButtons() {\n\n $(\"#buttons-view\").empty();\n\n // loops through the players array\n for (var i = 0; i < players.length; i++) {\n var button = $(\"<button>\")\n button.addClass(\"soccerBtn\")\n button.attr(\"data-name\", players[i])\n button.text(players[i])\n $(\"#buttons-view\").append(button);\n }\n }", "title": "" }, { "docid": "f35bd22b35264b337c8c66cbfd6027b4", "score": "0.67753536", "text": "function renderButtons() {\n // delete what was there first\n $(\".buttons\").empty();\n\n //loop thru array of movies for initial buttons\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\").attr(\"id\", i).text(topics[i]).css({\n \"padding\": \"1%\",\n \"font-size\": \"100%\"\n });\n $(\".buttons\").append(button);\n\n }\n $(\".button\").css(\"margin-left\", \"40%\");\n}", "title": "" }, { "docid": "58c28d3c3b035bee11876696d0129c95", "score": "0.6766317", "text": "function makeButtons(){ \n\t// deletes the shows prior to adding new shows so there are no repeat buttons\n\t$('#buttonsView').empty();\n\t// loops through the shows array\n\tfor (var i = 0; i < shows.length; i++){\n\t\t// dynamically makes buttons for every show in the array\n\t\tvar a = $('<button>') \n\t\ta.addClass('show'); // add a class\n\t\ta.attr('data-name', shows[i]); // add a data-attribute\n\t\ta.text(shows[i]); // make button text\n\t\t$('#buttonsView').append(a); // append the button to buttonsView div\n\t}\n}", "title": "" } ]
12046e7ea8581581f29fb9b9e8ef8e9c
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ iNFO DE RESERVAS PARA USUARIO ============================== ==================================== ADMINISTRACION DE ESTADO DE OFERTAS VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
[ { "docid": "87f14adf82d3d64f5fbc0627053834d3", "score": "0.5870581", "text": "function construirAdministracionDeEstadoDeOfertas() {\n // este array contiene OFERTAS para las cuales la reserva esta en estado pendiente, aprobada, o rechazada\n var todasLasOfertas = \"\";\n\n var arrayOfertas = getOfertasParaHabilitacion(\"todas\");\n todasLasOfertas = cargarOfertasParaHabilitacion(arrayOfertas);\n\n $(\"#mainDiv\").html(selectHabilitadasDeshabilitadas() + todasLasOfertas);\n $(\"#selectHabDes\").change(updateOfertasAdmin);\n}", "title": "" } ]
[ { "docid": "ed059e2c9bfc35dd8baae8733749b79f", "score": "0.69701403", "text": "function formularioDeRegistroUsuarioAnfitrion() {\n\n let tipoUsuario = \"anfitrion\" // El anfitrion lo registra el Administrador\n let nombre = document.querySelector(\"#txtNombreAnfi\").value;\n let apellido = document.querySelector(\"#txtApellidoAnfi\").value;\n let correo = document.querySelector(\"#txtCorreoAnfi\").value;\n let celular = document.querySelector(\"#txtCelularAnfi\").value;\n let contrasena = document.querySelector(\"#txtContrasenaAnfi\").value;\n let contrasena2 = document.querySelector(\"#txtContrasena2Anfi\").value;\n\n logicaNegocioAgregarPersona(esPrecarga = false, tipoUsuario, nombre, apellido, correo, celular, contrasena, contrasena2);\n}", "title": "" }, { "docid": "51f90eec207550685e5f85ae4a944b17", "score": "0.67956185", "text": "function autenticacaoLoja() {\r\n const situacao = autenticacaoLogin()\r\n\r\n if (JSON.parse(situacao).tipo == 'Administrador') {\r\n verificarCadastroLoja()\r\n } else {\r\n mensagemDeErro('Usuário não autorizado!')\r\n }\r\n}", "title": "" }, { "docid": "15981ddc359ad0509e728ed803ff5514", "score": "0.65791", "text": "function enviarIniciarSesion(){\n\t\tvar inputNombreUsuario=document.querySelector('#txtIniciarUsuario'),\n\t\t \tinputContrasenna=document.querySelector('#txtIniciarContrasenna'),\n\t\t\tsMensaje=document.querySelector('#txtMensajeRegistrar'),\n\t\t\taInputs=[inputNombreUsuario, inputContrasenna],\n\t\t\tbValidacionInicioIncorrecta=validacionInicioIncorrecta(aInputs),\n\t\t\tbEnviarSolicitudIniciar=false;\n\n\t\t\tif (bValidacionInicioIncorrecta==true) {\n\t\t\t\tsMensaje.innerHTML='No se puede iniciar con campos vacios';\n\n\t\t\t\tsMensaje.classList.add('mensajeError');\n\t\t\t\tsMensaje.classList.remove('mensajeBien');\n\t\t\t}else{\n\t\t\t\tbAdmin=verificarAdmin(aInputs);\n\n\t\t\t\tif(bAdmin==true){\n\t\t\t\t\twindow.location='../practica_arreglos/admin.html';\n\t\t\t\t}else{\n\t\t\t\t\tfor(var t=0; t<aInputs.length; t++){\n\t\t\t\t\t\taInputs[t].classList.add('inputError');\n\t\t\t\t\t\taInputs[t].classList.remove('inputBien');\n\t\t\t\t\t}\n\t\t\t\t\tsMensaje.innerHTML='Los datos no con concuerdan, intente de nuevo';\n\t\t\t\t\tsMensaje.classList.add('mensajeError');\n\t\t\t\t\tsMensaje.classList.remove('mensajeBien');\n\t\t\t\t\n\t\t\t\t\tbEnviarSolicitudIniciar=iniciacionDeUsuario(aInputs);\n\n\t\t\t\t\tif (bEnviarSolicitudIniciar==false) {\n\t\t\t\t\t\tsMensaje.innerHTML='Ingresado';\n\n\t\t\t\t\t\tsMensaje.classList.add('mensajeBien');\n\t\t\t\t\t\tsMensaje.classList.remove('mensajeError');\n\n\t\t\t\t\t\tfor(var i=0; i<aInputs.length; i++){\n\t\t\t\t\t\t\taInputs[i].classList.add('inputBien');\n\t\t\t\t\t\t\taInputs[i].classList.remove('inputError');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*enviar a pagina de listas*/\n\t\t\t\t\t\twindow.location='../practica_arreglos/listas.html'\n\t\t\t\t\t}else{\n\t\t\t\t\t\tsMensaje.innerHTML='Datos incorrectos, verifique el nombre de usuario o la contraseña';\n\n\t\t\t\t\t\tsMensaje.classList.add('mensajeError');\n\t\t\t\t\t\tsMensaje.classList.remove('mensajeBien');\n\t\t\t\t\t\tfor(var i=0; i<aInputs.length; i++){\n\t\t\t\t\t\t\taInputs[i].classList.remove('inputBien');\n\t\t\t\t\t\t\taInputs[i].classList.add('inputError');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ffcbde67b1048c20c67095c84775ef1d", "score": "0.6567074", "text": "function formularioDeRegistroUsuario() {\n let tipoUsuario = \"huesped\" // El unico que se puede registrar solo es el huesped\n let nombre = document.querySelector(\"#txtNombre\").value;\n let apellido = document.querySelector(\"#txtApellido\").value;\n let correo = document.querySelector(\"#txtCorreo\").value;\n let celular = document.querySelector(\"#txtCelular\").value;\n let contrasena = document.querySelector(\"#txtContrasena\").value;\n let contrasena2 = document.querySelector(\"#txtContrasena2\").value;\n\n logicaNegocioAgregarPersona(esPrecarga = false, tipoUsuario, nombre, apellido, correo, celular, contrasena, contrasena2)\n}", "title": "" }, { "docid": "f189c795072325e42a44a9410169c206", "score": "0.64255756", "text": "function enviarDatos(e) {\n e.preventDefault()\n //cada vez que salga accion encrea deberoa de crear el usuario y si es accion editar deberia de editarlo con esta accion vamos hacer una cosa o la otra\n const accion = e.target.innerText;\n console.log('esta es la accion' ,accion)\n //le paso nombre.value capturar el valor del input\n const datos = {\n nombre: nombre.value,\n apellido: apellido.value,\n pais: pais.value\n };\n\n//aquivamos ha poner codiciones de acuerdo donde trabajara la accion si es en editar o crear\n//aqui habra una variable de la url\nlet url = null;\nlet method= null;\nif (accion === 'Crear') {\n url = 'https://bootcamp-dia-3.camilomontoyau.now.sh/usuarios' \nmethod = 'POST';\n} else if(accion ==='Editar') {\n if (indice.value) {\n url= `https://bootcamp-dia-3.camilomontoyau.now.sh/usuarios/${indice.value}`\n method = 'PUT';\n } else {\n return;\n }\n\n} else{\n return;\n\n}\n\n // const data = { username: 'example' };\n\n //esta url sveremos la siguientes informacion de los usuarios\n /*\n este fetch retorna una promesa,esa promesa si a resolve \n es decir tenobtendra una respuesta y esa respuesta nosera una respuesta leida por nosotros \n \n */\n fetch(url, {\n //le decimos a fetch que utilizra el metodo post si no se lo ponemos seria un get y get no quiero porque es para obtener si no un post mandar los datos\n // hara un post a esa url que le mando arriba donde dice fetch\n method: method, // or 'PUT'\n //ya no es url enconded si no apllication json porque ,porqueestoy mandado un json\n headers: {\n \"Content-Type\": \"application/json\",\n },\n //fetch no lo puede mandar un json como tal por eso debemos de hacer un stringify con la variable datos no data porque esa ata no la necesito\n //ymnadra los datos que esta en la const datos qu es lunes 24\n body: JSON.stringify(datos),\n })\n .then((response) => response.json())\n .then((respuestaJSON) => {\n console.log(\"respuestaJson\", respuestaJSON);\n //refresacmos todos los uauarios y abajo en esa funcion refrescar los estamos recibiendo\n refrescar();\n //pero tambien se deberia de ejecutar esa funcion de restaurar bton aqui tambien en ambascasos\n restaurarBoton();\n //si no es exitosa sabemos que hay un cath que recibe un error o razon de qu porque fallo esa razon ypor alli mismo deberiamos de poner restaurarBoton\n }).catch((razon)=>{\n console.log(razon);\n restaurarBoton();\n })\n\n //podremos una bandera\n //console.log('response ', response);\n\n //esta peticion se hara cuando de click al boton porque alli llamo a la funcion enviar datos\n}", "title": "" }, { "docid": "00d20f3ddc10b994d57e1fbdf83b35bd", "score": "0.6354775", "text": "function InicioAutenticado() {\n // Poner _Nombre y _Apellidos \n var user = $('#mb_tdUserName');\n user.html(user.html().replace('_Nombre', jqNombre));\n user.html(user.html().replace('_Apellidos', jqApellidos));\n //jqAutenticado = true;\n // jqStatus = \"CONFIRM\";\n jqStatus = \"confirmarRegistro\";//Revisado\n PresentaIndex(\"inicio\");\n NotificaTop(\"ConfirmarRegistro\", jqNotTop);\n tdTexto.html(tdTexto.html().replace('_user', jqNombre).replace('_email', jqEmail));\n}", "title": "" }, { "docid": "ea8245c73a9b6d83873b12d0eb94beb5", "score": "0.63181865", "text": "function EnviarInformacion(){\n\n\n //setea parametros para crear objeto de data que aqui lo llame datos y se puede llamar de cualquier forma\n var datos = {\"Nombre\": $('#txtNombre').val(), \t\t//obtiene nombre de campo de texto\n \"Correo\": $('#txtCorreo').val(),\t//obtiene correo\n \"Telefono\": $('#txtTelefono').val(),\n \"NomUsuario\": $('#txtNombreUsuario').val(),\n \"Pass\": $('#txtPass').val(),\n \"Rol\": $('#selRol').val(),\n \"IdUsuario\": \t sessionStorage.getItem('Usuario'),\t//obtiene id seleccionado de estado\n \"IdCompany\": \t sessionStorage.getItem('Compania')\t//obtiene id seleccionado de estado\n };\n\n debugger;\n //la data se manda por ajax\n $.ajax({\n type: \"POST\",\n url: '../public/api/Usuario/nuevo',//esta url la copie del archivo proceso.php ahi estan los otros metodos\n data: datos\n });\n\n $(\"#datosUsuario\")[0].reset();//limpia el formulario\n\n\n //muestra mensaje\n Swal.fire( 'Usuario guardado', 'Se ha registrado el Usuario '+$('#txtNombre').val(), 'success');\n //cierra modal\n $('#btn_cerrar_proc').click();\n\n\n\n\n\n}", "title": "" }, { "docid": "546928a41c4986e3834ef956007a1633", "score": "0.62799495", "text": "function _11_asociarAutorizacionNueva(){\n var valido = _11_formModificarAuto.isValid();\n if(!valido) {\n datosIncompletos();\n }else{\n _11_windowModificarAut.close();\n guardaCambiosAutorizacionServ(_11_aseguradoSeleccionado, _11_textfieldNmautservMod.getValue(),\"0\",\"1\");\n }\n}", "title": "" }, { "docid": "f834d67003c6fc42bb9d565f6f0f1c15", "score": "0.6256166", "text": "function construirSolicitudesDeUsuario() {\n console.log(\"Administrador trata de ver solicitudes de usuario\");\n var htmlBody = \"\";\n htmlBody += \"<h1>Solicitudes De Usuario</h1>\";\n\n htmlBody += \"<table><tr><th>Nombre</th><th>Apellido</th><th>Email</th><th>Fecha de nacimiento</th><th>Estado</th><th>Aprobar</th><th>Rechazar</th></tr>\";\n var botonAprobar = \"\";\n var botonRechazar = \"\";\n var htmlTableCells = \"\";\n for (var i = 0; i < usuariosPreCargados.length; i++) {\n botonAprobar = crearBotonAprobar(i);\n botonRechazar = crearBotonRechazar(i);\n htmlTableCells += \"<tr><td>\" + usuariosPreCargados[i].name + \"</td><td>\" + usuariosPreCargados[i].lastName + \"</td><td>\" + usuariosPreCargados[i].email + \"</td><td>\" + usuariosPreCargados[i].edad + \"</td><td>\" + usuariosPreCargados[i].status + \"</td><td>\" + botonAprobar + \"</td><td>\" + botonRechazar + \"</td></tr>\";\n }\n htmlBody = htmlBody + htmlTableCells + \"</table>\";\n\n $(\"#mainDiv\").html(htmlBody);\n\n\n //asigno los botones de aprobar y rechazar\n for (var x = 0; x < usuariosPreCargados.length; x++) {\n var botonAprobarId = \"#aprobarBtn_\" + x;\n var botonRechazarId = \"#rechazarBtn_\" + x;\n $(botonAprobarId).click({param1: x}, clickBotonAprobar);\n $(botonRechazarId).click({param1: x}, clickBotonRechazar);\n }\n}", "title": "" }, { "docid": "4c659ef70a580da4874abdc52c313786", "score": "0.62539226", "text": "function fallaAutorizacion (){\n throw new Error('No tienes los permisos necesarios para poder acceder');\n}", "title": "" }, { "docid": "82bd4ef259cf5911bfe9d963d76cacdf", "score": "0.62508285", "text": "function _11_asociarAutorizacion() {\n var valido = _11_formPedirAuto.isValid();\n if(!valido) {\n datosIncompletos();\n }\n\n if(valido) {\n var json = {\n 'params.nmautser' : _11_textfieldNmautserv.getValue()\n ,'params.nmpoliza' : _11_recordActivo.get('NMPOLIZA')\n ,'params.cdperson' : _11_recordActivo.get('CDPERSON')\n ,'params.ntramite' : panelInicialPral.down('[name=params.ntramite]').getValue()\n ,'params.nfactura' : panelInicialPral.down('[name=params.nfactura]').getValue()\n ,'params.feocurrencia' : _11_recordActivo.get('FEOCURRE')\n ,'params.cdunieco' : _11_recordActivo.get('CDUNIECO')\n ,'params.cdramo' : _11_recordActivo.get('CDRAMO')\n ,'params.estado' : _11_recordActivo.get('ESTADO')\n ,'params.cdpresta' : panelInicialPral.down('combo[name=params.cdpresta]').getValue()\n ,'params.secAsegurado' : _11_recordActivo.get('SECTWORKSIN')\n };\n \n gridFacturaDirecto.setLoading(true);\n _11_windowPedirAut.close();\n Ext.Ajax.request( {\n url : _11_URL_INICIARSINIESTROTWORKSIN\n ,params : json\n ,success : function(response) {\n json = Ext.decode(response.responseText);\n debug(\"Valor de respuesta del guardado ===>>\",json);\n if(json.success==true) {\n _11_guardarInformacionAdicional();\n gridFacturaDirecto.setLoading(false);\n mensajeCorrecto('Autorizaci&oacute;n Servicio',json.mensaje,function(){\n storeAseguradoFactura.removeAll();\n cargarPaginacion(panelInicialPral.down('[name=params.ntramite]').getValue(), panelInicialPral.down('[name=params.nfactura]').getValue());\n });\n }\n else {\n gridFacturaDirecto.setLoading(false);\n mensajeError(json.mensaje);\n }\n }\n ,failure : function() {\n gridFacturaDirecto.setLoading(false);\n errorComunicacion();\n }\n });\n }\n}", "title": "" }, { "docid": "cb27a94f6dc5b136b760897739dc589f", "score": "0.62502486", "text": "function construirAdministracion() {\n var htmlBody = \"\";\n var htmlCeldaRegister = \"\";\n\n htmlCeldaRegister += '<label for=\"nameModifyField\" >Nombre: </label><input id=\"nameModifyField\" type=\"text\"/>' + \"<br>\";\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<label for=\"lastNameModifyField\" >Apellido: </label><input id=\"lastNameModifyField\" type=\"text\"/>' + \"<br>\";\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<label for=\"edadModifyField\" >Edad: </label><input id=\"edadModifyField\" type=\"text\"/>' + \"<br>\";\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<label for=\"emailModifyField\" >Email: </label><input id=\"emailModifyField\" type=\"text\"/>' + \"<br>\";\n ;\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<hr>';\n htmlCeldaRegister += '<label for=\"oldPasswordModifyField\" >Contraseña Anterior: </label><input id=\"oldPasswordModifyField\" type=\"password\"/>' + \"<br>\";\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<label for=\"newPasswordModifyField\" >Contraseña Nueva: </label><input id=\"newPasswordModifyField\" type=\"password\"/>' + \"<br>\";\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<label for=\"newPasswordCheckModifyField\" >Repetir Contraseña: </label><input id=\"newPasswordCheckModifyField\" type=\"password\"/>' + \"<br>\";\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<hr>';\n htmlCeldaRegister += '<button onclick=\"updateUserDataClicked()\">Aplicar</button>';\n htmlCeldaRegister += '<p></p>';\n htmlCeldaRegister += '<div id=\"messageToUserModifyData\"></div>';\n\n\n htmlBody += \"<table><tr><th>Datos de Usuario</th></th>\";\n htmlBody += \"<tr><td>\" + htmlCeldaRegister + \"</td></tr></table>\";\n\n $(\"#mainDiv\").html(htmlBody);\n cargarDatosExitentes();\n}", "title": "" }, { "docid": "4c0c95815e6f8ef817567a3a41e22a36", "score": "0.6248082", "text": "function usuarioPuntoventa()\n {\n\n //try{\n function callBackUsuarioPuntoVenta(r){\n var res = Ext.util.JSON.decode(r)[0];\n objUsuarioPV.CKPVT_NOMBRE = res.CKPVT_NOMBRE;\n if(INTIPO_ASIGNACION == TypeAsignacion.TRANSFERENCIA)\n objUsuarioPV.CRPER_NOMBRES = res.CKPVT_NOMBRE;\n\n else\n {\n objUsuarioPV.CRPER_NOMBRES = res.CRPER_NOMBRES;\n\n }\n txtCkupv_codigo.setValue(res.CKUPV_CODIGO);\n objUsuarioPV.CKUPV_CODIGO = res.CKUPV_CODIGO;\n objUsuarioPV.CKPVT_CODIGO = res.CKPVT_CODIGO;\n tplInfoPuntoVenta.overwrite(Ext.getCmp('pnlPuntoVenta').body,objUsuarioPV);\n\n }\n var param = new SOAPClientParameters();\n param.add('format',TypeFormat.JSON);\n SOAPClient.invoke(urlCgg_kdx_asignacion,\"selectUsuarioPuntoVenta\",param, true, callBackUsuarioPuntoVenta);\n\n //}catch(inErr){\n // winFrmCgg_kdx_asignacion.getEl().unmask();\n //}\n\n }", "title": "" }, { "docid": "c76693484a44d29f3a5f4c901a95dba3", "score": "0.62223035", "text": "function autenticarUsuario(accion) {\n\tvar rutaN = $('#txtUsuario').val();\n var contrasena = $('#txtPass').val();\n \n rutaN = rutaN.toUpperCase();\n \n rutaN = rutaN.trim();\n rutaN = rutaN.replace(\" \",\"\");\n\n if ($(\"#btnAceptarAutenticacion .ui-btn-text\").text() == 'Enviar') {\n alert(\"ENVIO INICIADO \\nUsuario: \" + rutaN + \" Contraseña: \" + contrasena);\n\n } else {\n if (rutaN != \"\" && contrasena != \"\") {\n \t\n \tif(rutaN.substr(0,1) == 'T')\n {\n \tsincronizarRecepcionDatos(rutaN.toUpperCase(), generarToken(contrasena));\n }\n else\n {\n \tnavigator.notification.alert('Debe utilizar una ruta de Entrega!!', \n\t null, // callback\n\t 'Ruta Equivocada', // title\n\t 'Aceptar' // buttonName\n\t ); \n }\n \n \n } else {\n alert(\"Debe escribir el Número de Ruta y su Contraseña\");\n }\n\n }\n}", "title": "" }, { "docid": "41f2c3e1f6f4e9a9c34efeb1356f6b2f", "score": "0.62146896", "text": "function ConsultarInformacionUsuarioEmpresa(tipoDocumentoEmpresa, documentoEmpresa, tipoDocumento, documento) {\n PopupPosition();\n $.ajax({\n type: \"post\",\n data: { tipoDocumentoEmp: tipoDocumentoEmpresa, numDocumentoEmp: documentoEmpresa, tipoDocumento: tipoDocumento, numDucumento: documento },\n url: urlBase + urlUsuario + '/ConsultarInformacionUsuarioEmpresaSiarp'\n }).done(function (response) {\n if (response != undefined && response != '' && response.Estado == 'OK' && response.MensajeError == '') {\n var nombres = response.NombresUsuario;\n var apellidos = response.ApellidosUsuario;\n var razonSocial = response.RazonSocialEmpresa;\n var municipioEmpresa = response.MunicipioSedePpalEmrpresa;\n var esUsuarioNuevo = $('#esUsuarioNuevo').val()// es verdadero si se hace el evento desde la vista soliticarUsuarioEmpresa,y es falso si se hace desde el evnto desde recuperar contraseña\n if (response.PreguntasSeguridad != 'undefined' && response.PreguntasSeguridad != null && response.PreguntasSeguridad.length > 0) {\n var preguntaUno = response.PreguntasSeguridad[0].NombrePregunta;\n var preguntaDos = response.PreguntasSeguridad[1].NombrePregunta;\n var preguntaTres = response.PreguntasSeguridad[2].NombrePregunta;\n if ($('#ConfiguracionPreguntasSeguridad_NombrePreguntaUno').length > 0) {\n $('#ConfiguracionPreguntasSeguridad_NombrePreguntaUno').val(preguntaUno);\n }\n if ($('#ConfiguracionPreguntasSeguridad_NombrePreguntaDos').length > 0) {\n $('#ConfiguracionPreguntasSeguridad_NombrePreguntaDos').val(preguntaDos);\n }\n if ($('#ConfiguracionPreguntasSeguridad_NombrePreguntaTres').length > 0) {\n $('#ConfiguracionPreguntasSeguridad_NombrePreguntaTres').val(preguntaTres);\n }\n $('#Nombres').val(nombres);\n $('#Apellidos').val(apellidos);\n $('#RazonSocialEmpresa').val(razonSocial);\n $('#MunicipioSedePpalEmpresa').val(municipioEmpresa);\n \n } else if (response.PreguntasSeguridad.length <= 0 && esUsuarioNuevo == 'false') {\n swal(\"Atención\", \"Favor comunicarse con la mesa de ayuda de Alissta (Línea nacional: 01 8000 413 535) para solicitar una nueva contraseña, debido que no tiene preguntas de seguridad\" );\n } else if (esUsuarioNuevo) {\n $('#Nombres').val(nombres);\n $('#Apellidos').val(apellidos);\n $('#RazonSocialEmpresa').val(razonSocial);\n $('#MunicipioSedePpalEmpresa').val(municipioEmpresa);\n }\n \n } else if (response != undefined && response != '' && response.Estado == 'OK' && response.MensajeError != '') {\n $(\"#TipoDocumentoEmpresa\").val('');\n $(\"#DocumentoEmpresa\").val('');\n $(\"#TipoDocumento\").val('');\n $(\"#Documento\").val('');\n $('#Nombres').val('');\n $('#Apellidos').val('');\n $('#RazonSocialEmpresa').val('');\n $('#MunicipioSedePpalEmpresa').val('');\n swal(\"Atención\", response.MensajeError);\n }\n OcultarPopupposition();\n }).fail(function (response) {\n $(\"#TipoDocumentoEmpresa\").val('');\n $(\"#DocumentoEmpresa\").val('');\n $(\"#TipoDocumento\").val('');\n $(\"#Documento\").val('');\n $('#Nombres').val('');\n $('#Apellidos').val('');\n $('#RazonSocialEmpresa').val('');\n $('#MunicipioSedePpalEmpresa').val('');\n swal(\"Atención\", \"No se logró obtener datos del Usuario. Intente nuevamente.\");\n OcultarPopupposition();\n });\n}", "title": "" }, { "docid": "5073f9bdee1a1a37eb30aa53deffe4eb", "score": "0.621351", "text": "function reporte_empresa_admin(form)\n{\nif (form.area.value == \"\")\n{ alert(\"Por favor, seleccione una empresa\"); form.area.focus(); return false; }\n\nif (form.estado.value == \"abiertos\")\n{\nif (form.proyec.value == \"\")\n{ \nalert(\"Error, la empresa seleccionada no tiene proyectos en curso\"); form.estado.focus(); return false; \n}\n}\n\n\nif (form.estado.value == \"cerrados\")\n{\nif (form.proyec.value == \"\")\n{ \nalert(\"Error, la empresa seleccionada no tiene proyectos finalizados\"); form.estado.focus(); return false; \n}\n}\n\n}", "title": "" }, { "docid": "5e9defb0d354b56404beeef2a3b09707", "score": "0.6206165", "text": "async function recuperarSenha() {\r\n if (validaDadosCampo(['#login', '#pergunta', '#novaSenha'])) {\r\n const result = await requisicaoPOST(\r\n 'forgot',\r\n JSON.parse(\r\n `{\"name\":\"${document.getElementById('login').value}\",\"response\":\"${\r\n document.getElementById('pergunta').value\r\n }\",\"password\":\"${document.getElementById('novaSenha').value}\"}`\r\n ),\r\n null\r\n )\r\n if (result) {\r\n mensagemDeAviso('Atualizado com sucesso!')\r\n }\r\n } else {\r\n mensagemDeErro('Preencha todos os dados!')\r\n }\r\n}", "title": "" }, { "docid": "a1e78aa7dd606f67a0c6d05c3df50a1f", "score": "0.61988306", "text": "function onSucces(retorno) {\n //teste = JSON.parse(retorno);\n\n teste = retorno;\n \n alert(teste.data.login.nome + \" - \" + teste.data.login.nome_maxLenght + \" - \" + teste.data.login.nome_dataType + \"\\n\" +\n teste.data.login.email + \" - \" + teste.data.login.email_maxLenght + \" - \" + teste.data.login.email_dataType + \"\\n\" +\n teste.data.produto.descricao + \" - \" + teste.data.produto.marca + \"\\n\" +\n teste.dataCollections.login.fields);\n\n teste.alerta();\n\n document.body.style.cursor = \"default\";\n //document.getElementById(\"btnProverLogin_entrar\").style.cursor = \"pointer\";\n\n //login = smartDataStrToObject(retorno);\n\n if (teste.all.error.number == 0) {\n\n //#region Remove login e mostra Boas Vindas\n document.getElementById(\"lblProverLogin_bemvindo\").innerHTML = teste.data.login.nome;\n document.getElementById(\"divProverLogin\").remove();\n document.getElementById(\"divProverLogin_bemvindo\").style.display = \"\";\n //#endregion\n\n //#region Libera links da faixa de atalho\n\n document.getElementById(\"divCategorias01\").remove();\n document.getElementById(\"divProverFaixa_servicos01\").addEventListener(\"click\", function () { subAbreLink(\"produtos.html\"); }, false);\n\n document.getElementById(\"divCategorias02\").remove();\n document.getElementById(\"divProverFaixa_servicos02\").addEventListener(\"click\", function () { subAbreLink(\"clientes.html\"); }, false);\n\n document.getElementById(\"divCategorias03\").remove();\n document.getElementById(\"divProverFaixa_servicos03\").addEventListener(\"click\", function () { subAbreLink(\"usuarios_cadastro.html\"); }, false);\n\n //#endregion\n\n } else {\n\n alert(login.message);\n }\n return;\n }", "title": "" }, { "docid": "85fdff5d5df9a1b8fe6e133edd4bcfac", "score": "0.61951673", "text": "function obtenerDatos() {\n let sId = document.querySelector('#txtCedula').value;\n let sContra = document.querySelector('#txtPassword').value;\n let acceso = false;\n\n\n acceso = validarCredenciales(sId, sContra);\n\n if (acceso == true) {\n ingresar();\n } else {\n swal({\n title: \"Credenciales inválidas\",\n text: \"La identificación o la contraseña no son correctos, por favor intentelo de nuevo.\",\n buttons: {\n cancel: \"Aceptar\",\n },\n });\n }\n}", "title": "" }, { "docid": "ec410107eb6cf5b1f471292c5f500b17", "score": "0.618967", "text": "function entradaUsuario( form )\n\t{\n\t\tvar regreso;\n\t\t\tregreso = true;\n\t\t\tregreso = vtxtVacio( form.txt_nombre, \"Nombre\" );\n\t\t\tif( regreso )\n\t\t\t\tregreso = vtxtVacio( form.txt_paterno, \"Apellido Paterno\" );\n\t\t\tif( regreso )\n\t\t\t\tregreso = vtxtVacio( form.txt_materno, \"Apellido Materno\" );\n\t\t\tif( regreso )\n\t\t\t\tif( form.slc_sLaboral.value == \"SLIN\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tregreso = vtxtVacio( form.txt_nomina, \"Numero de nomina\" );\n\t\t\t\t\t\tif ( regreso )\n\t\t\t\t\t\t\tregreso = vtxtLongitudExacta( form.txt_nomina, 6 );\n\t\t\t\t\t\tif ( regreso )\n\t\t\t\t\t\t\tregreso = vtxtNumero( form.txt_nomina );\n\t\t\t\t\t}\n\t\t\t\telse regreso = vtxtVacio( form.txt_rfc, \"R.F.C.\" );\n\t\t\tif( regreso )\n\t\t\t\tregreso = vtxtLetra( form.txt_nombre );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtLetra( form.txt_paterno );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtLetra( form.txt_materno );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtTelefono( form.txt_telefono );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtCorreoE( form.txt_mail );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtRFC( form.txt_rfc );\n\t\treturn regreso;\n\t\t\n\t}", "title": "" }, { "docid": "3bd3bf5d4062f5a66943bc217d993389", "score": "0.6171207", "text": "function amSp4CRUDEnfermedadCronica(CodAccion) {\n \n let data = {};\n let EjecutarModal = false;\n let TituloModal = '';\n let Fecha = '';\n\n /* \n\n Los codigos de accion seran:\n 0 Para inicializar\n 1 Para confirmar o modificar\n 2 Para eliminar\n\n */\n\n if(CodAccion == 0){\n\n data.Id1 = 0; //si es cero se crea el registro diferente se modifica el registro\n data.NombreEnfermedad = \"\";\n data.CreadoFecha = \"\";\n data.IdHC = idHC;\n data.Estado = 0;\n data.CreadoPor = \"SHO\";\n data.ModificadoPor = \"SHO\";\n data.accion = CodAccion; //0 crear registro, 1 modificarlo, 2 eliminarlo logicamente\n data.FechaModificacion = \"\";\n\n }\n else{ \n\n if( ingresoControl ){\n\n Fecha = paObj_ec[\"EnfermedadesCronica\"].CreadoFecha;\n\n }\n else{\n\n Fecha = $('#sp4EnferCron_enfercro_fecha_reg').val(); \n\n }\n \n\n data.Id1 = idTemporalEC; //si es cero se crea el registro diferente se modifica el registro\n data.NombreEnfermedad = $('#sp4EnferCron_enfercro_nombre_enfermedad').val();\n data.CreadoFecha = Fecha;\n data.IdHC = idHC;\n data.Estado = 1;\n data.CreadoPor = \"SHO\";\n data.ModificadoPor = \"SHO\";\n data.accion = CodAccion; //0 crear registro, 1 modificarlo, 2 eliminarlo logicamente\n data.FechaModificacion = Fecha;\n\n }\n \n let url = apiUrlsho+`/api/hce_enfermedad_cronica_post?code=RYkQ68yUfbG3TsAv9E3Hh8hguSoa6A5nDA7s9DhyZGs60mCm05omkA==&httpmethod=post`;\n\n let headers = {\n \"apikey\": constantes.apiKey,\n \"Content-Type\": \"application/json\"\n }\n\n let settings = {\n \"url\": url,\n \"method\": \"post\",\n \"timeout\": 0,\n \"crossDomain\": true,\n \"dataType\": 'json',\n \"headers\": headers,\n \"data\": JSON.stringify(data)\n };\n\n return $.ajax(settings).done((response) => {\n\n idTemporalEC = response.Id;\n paObj_ECTemporal[idTemporalEC] = response;\n\n console.log(\"Objeto Temporal EC: \"+JSON.stringify(paObj_ECTemporal[idTemporalEC]));\n\n if( CodAccion == 1 ){\n\n EjecutarModal = true;\n TituloModal = 'Enfermedad Crónica anexada con éxito';\n\n }\n\n if( CodAccion == 2 ){\n\n EjecutarModal = true;\n TituloModal = 'Enfermedad Crónica eliminada con éxito';\n\n }\n\n if( EjecutarModal ){\n\n Swal.fire({\n title: TituloModal,\n iconColor: \"#8fbb02\",\n iconHtml: '<img src=\"./images/sho/check.svg\" width=\"28px\">',\n showConfirmButton: false,\n padding: \"3em 3em 6em 3em \",\n timer: 1500,\n }).then(() => {\n\n handlerUrlhtml('contentGlobal', 'view/sho-hce/historia_clinica/datosGenerales.html', 'Historia Clínica');\n\n }); \n\n } \n\n });\n\n}", "title": "" }, { "docid": "32536329d04a4181dd9d0989040e4c66", "score": "0.61677915", "text": "function verificarOrdenServicio(form, accion) {\r\n\tvar organismo = document.getElementById(\"organismo\").value;\r\n\tvar dependencia = document.getElementById(\"dependencia\").value;\r\n\tvar nroorden = document.getElementById(\"nroorden\").value;\r\n\tvar estado = document.getElementById(\"estado\").value;\r\n\tvar codproveedor = document.getElementById(\"codproveedor\").value;\r\n\tvar nomproveedor = document.getElementById(\"nomproveedor\").value;\r\n\tvar nrointerno = document.getElementById(\"nrointerno\").value.trim();\r\n\tvar dentrega = document.getElementById(\"dentrega\").value.trim();\r\n\tvar fentrega = document.getElementById(\"fentrega\").value.trim();\r\n\tvar codservicio = document.getElementById(\"codservicio\").value;\r\n\tvar tipopago = document.getElementById(\"tipopago\").value;\r\n\tvar fdocumento = document.getElementById(\"fdocumento\").value.trim();\r\n\tvar formapago = document.getElementById(\"formapago\").value;\r\n\tvar dias_pagar = document.getElementById(\"dias_pagar\").value.trim();\r\n\tvar descripcion = document.getElementById(\"descripcion\").value.trim();\r\n\tvar descripcion_adicional = document.getElementById(\"descripcion_adicional\").value.trim();\r\n\tvar observaciones = document.getElementById(\"observaciones\").value.trim();\r\n\tvar razon = document.getElementById(\"razon\").value.trim();\r\n\tvar impuesto = document.getElementById(\"impuesto\").value.trim();\r\n\tvar fdesde = document.getElementById(\"fdesde\").value.trim();\r\n\tvar fhasta = document.getElementById(\"fhasta\").value.trim();\r\n\tvar codccosto = document.getElementById(\"codccosto\").value;\r\n\tvar detalles = \"\";\r\n\tvar error_detalles = \"\";\r\n\t\r\n\tvar frmdetalles = document.getElementById(\"frmdetalles\");\r\n\tfor(i=0; n=frmdetalles.elements[i]; i++) {\r\n\t\tif (n.name == \"chkdetalles\") detalles += n.title + \"|\";\r\n\t\tif (n.name == \"txtdescripcion\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"txtcantidad\") {\r\n\t\t\tvar cant = new Number(setNumero(n.value));\r\n\t\t\tif (cant <= 0) { error_detalles = \"¡ERROR: No puede ingresar items con cantidad en cero!\"; break; } \r\n\t\t\telse detalles += setNumero(n.value) + \"|\";\r\n\t\t}\r\n\t\tif (n.name == \"txtpu\") {\r\n\t\t\tvar pu = new Number(setNumero(n.value));\r\n\t\t\tif (pu <= 0) { error_detalles = \"¡ERROR: No puede ingresar items con precio unitario en cero!\"; break; } \r\n\t\t\telse detalles += setNumero(n.value) + \"|\";\r\n\t\t}\r\n\t\tif (n.name == \"txtfesperada\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"txtccostos\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"txtactivo\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"chkterminado\") detalles += n.checked + \"|\";\r\n\t\tif (n.name == \"codpartida\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"codcuenta\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"txtobs\") detalles += n.value + \";\";\r\n\t}\r\n\tvar len = detalles.length; len--;\r\n\tdetalles = detalles.substr(0, len);\r\n\t\r\n\tif (organismo == \"\" || codproveedor == \"\" || nomproveedor == \"\" || fentrega == \"\" || dentrega == \"\" || formapago == \"\" || codservicio == \"\" || tipopago == \"\" || fdocumento == \"\" || codccosto == \"\") alert(\"¡Los campos marcados con (*) son obligatorios!\");\r\n\telse if (!esFecha(fentrega)) alert(\"¡Formato de fecha de entrega incorrecta!\");\r\n\telse if (!esFecha(fdocumento)) alert(\"¡Formato de fecha de entrega incorrecta!\");\r\n\telse if (!esFecha(fdesde) || !esFecha(fhasta)) alert(\"¡Formato de fecha incorrecta!\");\r\n\telse if (isNaN(dentrega)) alert(\"¡Dias de entrega debe ser numérico!\");\r\n\telse if (dias_pagar != \"\" && isNaN(dias_pagar)) alert(\"¡Dias de entrega debe ser númerico!\");\r\n\telse if (detalles == \"\") alert(\"¡Debe ingresar por lo menos un detalle a la orden!\");\r\n\telse if (error_detalles != \"\") alert(error_detalles);\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_lg.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=ORDENES-SERVICIO&accion=\"+accion+\"&organismo=\"+organismo+\"&nroorden=\"+nroorden+\"&estado=\"+estado+\"&codproveedor=\"+codproveedor+\"&nomproveedor=\"+nomproveedor+\"&fentrega=\"+fentrega+\"&dentrega=\"+dentrega+\"&formapago=\"+formapago+\"&codservicio=\"+codservicio+\"&nrointerno=\"+nrointerno+\"&fdocumento=\"+fdocumento+\"&dias_pagar=\"+dias_pagar+\"&descripcion=\"+descripcion+\"&descripcion_adicional=\"+descripcion_adicional+\"&observaciones=\"+observaciones+\"&razon=\"+razon+\"&detalles=\"+detalles+\"&impuesto=\"+impuesto+\"&codccosto=\"+codccosto+\"&tipopago=\"+tipopago+\"&dependencia=\"+dependencia+\"&fdesde=\"+fdesde+\"&fhasta=\"+fhasta);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp = ajax.responseText;\r\n\t\t\t\tvar datos = resp.split(\"|\");\r\n\t\t\t\t\r\n\t\t\t\tif (datos[0].trim() != \"\") alert(datos[0]);\r\n\t\t\t\telse if (accion == \"INSERTAR\") {\t\t\t\t\t\r\n\t\t\t\t\talert(\"Nueva Orden de Servicio \" + datos[1] + \" ha sido creada\");\r\n\t\t\t\t\tcargarPagina(form, 'ordenes_servicios.php?limit=0');\r\n\t\t\t\t}\r\n\t\t\t\telse cargarPagina(form, 'ordenes_servicios.php?limit=0');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "007c08e4e72db8bc6cd82e21bac3b9c2", "score": "0.6126103", "text": "function limpiarControles(){\n clearControls(obtenerInputsIds());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n htmlText('txtCodigoError', '');\n htmlText('txtNombreError', '');\n}", "title": "" }, { "docid": "4a07ed2d55a3f1f82f209cb81df48152", "score": "0.61215055", "text": "function busquedaAvanzadaPaciente() {\n // var bValidacion = validarAvanzadaFormulario();\n ////FYIconsole.log(bValidacion);\n //return;\n //if(bValidacion = true)\n //{\n // //FYIconsole.log(\"busca1\");\n mostrarMensajeCargando();\n var ruta = Routing.generate(\"Caja_vresultadoBusquedaAvanzadaPaciente\");\n // //FYIconsole.log(ruta);\n var formulario = $(\"#busquedaAvanzadaPaciente\").serializeArray();\n $.post(ruta, formulario, function(result) {\n $(\"#resultadosBusquedaAvanzadaPaciente\").html(result);\n $(\"#busquedaPacientesForm\").slideUp(1000);\n if ($('#busquedaAvanzadaPaciente_nombres').val() !== \"\") {\n $(\"#parametrosBusquedaResumenNombre\").html(\"Nombres:\" + \" '\" + $('#busquedaAvanzadaPaciente_nombres').val() + \"' \");\n }\n if ($('#busquedaAvanzadaPaciente_apPaterno').val() !== \"\") {\n $(\"#parametrosBusquedaResumenApep\").html(\"Apellido Paterno:\" + \" '\" + $('#busquedaAvanzadaPaciente_apPaterno').val() + \"' \");\n }\n if ($('#busquedaAvanzadaPaciente_apMaterno').val() !== \"\") {\n $(\"#parametrosBusquedaResumenApem\").html(\"Apellido Paterno:\" + \" '\" + $('#busquedaAvanzadaPaciente_apMaterno').val() + \"' \");\n }\n\n // //FYIconsole.log(\"busca2\");\n $('.edit').on('click', function() {\n //funcion para ir a buscar al usuario una vez hecho click en su nombre completo\n ////FYIconsole.log(\"mamalo codigo rqlo\");\n var idpaciente = $(this).closest('tr').attr('id');\n buscaUNusuarioporIdPersona(idpaciente);\n ////FYIconsole.log(idpaciente);\n });\n ocultarMensajeNav();\n });\n //} \n }", "title": "" }, { "docid": "a471e628cdc3c853ff0e1830b9906635", "score": "0.6116234", "text": "function ModificarEstudiante(){\n\n var id_usuario = document.getElementById(\"id_usuario\").value;\n var id_persona = document.getElementById(\"id_persona\").value;\n //var fecha_solicitud = document.getElementById(\"fecha_solicitud\").value;\n var telefono = document.getElementById(\"telefono\").value;\n var correo = document.getElementById(\"correo\").value;\n var usuario = document.getElementById(\"usuario\").value\n var contrasena_b = document.getElementById(\"contrasena_b\").value;\n var pregunta = document.getElementById(\"pregunta\").value\n var respuesta = document.getElementById(\"respuesta\").value;\n \n var boton = \"Modificar\";\n\n \n $.ajax({\n async:true, \n cache:false,\n dataType:\"html\", \n type: 'POST', \n url: \"../controlador/estudiante_usuario_controlador.php\",\n data: {\n\n \n id_usuario : id_usuario, \n id_persona : id_persona, \n //fecha_solicitud : fecha_solicitud,\n telefono : telefono,\n correo : correo,\n usuario : usuario,\n contrasena_b : contrasena_b,\n pregunta : pregunta,\n respuesta : respuesta,\n\n Modificar : boton\n\n },\n \nsuccess: function(data){ \n\n if(data==0){\n\n restablecer_de_nuevo();\n \n swal('Error','Ocurrió un error de Programación','error'); \n\n }else if(data==1) {\n \n restablecer_de_nuevo();\n \n swal('Datos Modificados Con Exito','','success');\n \n }\n \n } \n\n });\n\n\n\n}", "title": "" }, { "docid": "67e884ad247fe95f7d7ec7e9d950cfe6", "score": "0.60986924", "text": "function registro(){\n var nombre, apellido, correo, clave, exprecion;\n nombre = document.getElementById(\"Nombre\").value;\n apellido = document.getElementById(\"Apellido\").value;\n correo = document.getElementById(\"Correo\").value;\n clave = document.getElementById(\"Clave\").value;\n //verificar el correo si esta bien estructurado\n exprecion = /\\w+@\\w+\\.+[a-z]/;\n \n if(nombre ==\"\" || apellido ==\"\" || correo == \"\" || Clave ==\"\"){\n alert(\"Todos los campos son obligatorios\");\n return false;\n }\n else if(nombre.length>15){\n alert(\"El nombre es muy largo\");\n return false;\n }\n else if (apellido.length>30){\n alert(\"Los apellidos son muy largos\");\n return false;\n }\n else if(correo.length>25){\n alert(\"El correo es muy largo\");\n return false;\n }\n else if(!exprecion.test(correo)){\n alert(\"El correo no es válido\");\n return false;\n }\n \n }", "title": "" }, { "docid": "9e58c574e04d265b32906a372354b1cd", "score": "0.6091373", "text": "function PutFormClientes()\n{\n\t\n\tvar ListaCamposIDs='Nombre+Nacionalidad+PaisOrigen+Fecha+PaisDomicilio+Poblacion+DIRECCION+Portal+email+Telefono+movil+EstadoCivil+RegimenEconomico+Profesion+CodigoCliente+Entidad+Oficina+DC+Cuenta+Latitud+Longitud';\n\tvar vCursor='PEREZ CABALLERO ANTONIO+ESPAÑOLA';\n\t\nLeerCliente(ListaCamposIDs, vCursor);\n}", "title": "" }, { "docid": "98b03795926f226cae324bd334efa54f", "score": "0.6090795", "text": "function AgregaUsuario(){\n //obtenemos la informacion del formulario \n let name = document.getElementById('name-f').value;\n let lastn = document.getElementById('lastname-f').value;\n let usern = document.getElementById('username').value;\n let password = document.getElementById('passw').value;\n\n\n //Agregamos a info a un objeto de usuarios \n let usuario = {\n nombre: name,\n lastname: lastn,\n username:usern,\n password:password,\n mensajes:[]\n }; \n\n guardaLS(usuario);\n \n \n}", "title": "" }, { "docid": "45e3a248f34a249142c4e27a1eb7bf35", "score": "0.6069592", "text": "function lembra_senha(){\n\t var tipo=\"\";\n\t\tif(form_5.tipo[0].checked){\n\t\t tipo=form_5.tipo[0].value;\n\t\t}\n\t\telse if(form_5.tipo[1].checked){\n\t\t tipo=form_5.tipo[1].value;\n\t\t}\n\t\t\n\t\tif (tipo==\"\"){\n\t\t\tif (form_5.l0.value==\"\"){\n\t\t\t alert(\"Digite o email de login e marque algum dos tipos de administrador!\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert(\"Marque algum dos tipos de administrador!\");\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif (form_5.l0.value==\"\"){\n\t\t\t alert(\"Digite o email de login!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlogin=form_5.l0.value;\n\t\t\t\tshowDiv2('progresso',true);\n\t\t\t c=\"funcoes_php_requeridas.php?f=5&tipo=\"+tipo+\"&login=\"+login;\n\t\t\t\tloadXMLDoc(c);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f0570a3155f9f576fa6911d9882c624a", "score": "0.606905", "text": "function actualizarTablasCliente_Informe(){\n var codigoInspector = window.localStorage.getItem(\"codigo_inspector\");\n var codigoInforme = window.sessionStorage.getItem(\"cantidadInformes\");\n var consecutivoInforme = window.sessionStorage.getItem(\"consecutivo_informe\");\n var codigoCliente = window.sessionStorage.getItem(\"codigo_cliente\");\n var consecutivoCliente = window.sessionStorage.getItem(\"consecutivo_cliente\");\n\n var textCliente = $(\"#text_cliente\").val();\n var textContacto = $(\"#text_contacto_legal\").val();\n var textNitContacto = $(\"#text_nit_contacto\").val();\n var textDireccion = $(\"#text_direccion_cliente\").val();\n var textTelefono = $(\"#text_telefono_cliente\").val();\n var textCorreo = $(\"#email\").val();\n var textEncargado = $(\"#text_encargado\").val();\n \n enviarValoresAudiosInforme(codigoInforme);\n addItemInforme(codigoInforme,consecutivoInforme,codigoInspector);\n /* Al ejecutarse esta funcion se envian los datos al servidor */\n addItemCliente(codigoCliente,consecutivoCliente,codigoInspector,textCliente,textContacto,textNitContacto,textDireccion,textTelefono,textCorreo,textEncargado);\n\n}", "title": "" }, { "docid": "a58135d1abfaeab5582008102554b92f", "score": "0.60634327", "text": "function traerUsuario(clave,accion){\n\tvar ruta = '../../herramientas/funcionalidad/operacionesadminusuario.php'; //asignamos la ruta donde se enviaran los datos a una variable llamada url\n\tvar pars= {'operacion': 3,'cveusu':clave,'accion':accion}; //asignamos el parametro que se enviara\n\t$.ajax({\n\t type: \"POST\",\n url : ruta,\n data: pars,\n success: function(msg){\n\t\t\t\t$(\"#modusu\").html(msg);\n\t\t\t\tindexSecundario();\n\t },\n\t statusCode:{\n\t\t\t404: function(){\n\t\t\t\talert(\"pagina no encontrada\");\n\t\t\t}\n\t }\n\t});\n}", "title": "" }, { "docid": "bcec59880b84ca8b9b22bcd629ea390a", "score": "0.60566336", "text": "function ControlesNuevo()\n{ \ndocument.getElementById(\"guardar\").disabled=false;\ndocument.getElementById(\"dnir\").value='';\ndocument.getElementById(\"dnib\").value='';\n/*document.getElementById(\"codsucursal\").value='';*/\ndocument.getElementById(\"importe_r\").value='0';\ndocument.getElementById(\"cargo_r\").value='0';\ndocument.getElementById(\"igv_r\").value='0';\ndocument.getElementById(\"otros_r\").value='0';\ndocument.getElementById(\"total_r\").value='0';\ndocument.getElementById(\"efectivo_r\").value='0';\ndocument.getElementById(\"vuelto_r\").value='0';\ndocument.getElementById(\"observa\").value='';\ndocument.getElementById(\"ciudaddestino\").value='';\ndocument.getElementById(\"destino\").value='';\ndocument.getElementById(\"nuevo\").disabled=true;\ndocument.getElementById(\"nombresb\").value='';\ndocument.getElementById(\"nombresr\").value='';\n\ndocument.getElementById(\"dnir\").disabled=false;\ndocument.getElementById(\"dnib\").disabled=false;\n/*document.getElementById(\"codsucursal\").disabled=false;*/\ndocument.getElementById(\"importe_r\").disabled=false;\ndocument.getElementById(\"cargo_r\").disabled=false;\ndocument.getElementById(\"otros_r\").disabled=false;\ndocument.getElementById(\"observa\").disabled=false;\ndocument.getElementById(\"ciudaddestino\").disabled=false;\ndocument.getElementById(\"destino\").disabled=false;\ndocument.getElementById(\"dnib\").focus();\ndocument.getElementById(\"imprimir_r\").disabled=true;\n\ndocument.getElementById(\"busca_beneficiario\").disabled=false;\ndocument.getElementById(\"busca_remitente\").disabled=false;\ndocument.getElementById(\"busca_sucursal\").disabled=false;\n\n$(\"#destino\").attr(\"readonly\",false);\n}", "title": "" }, { "docid": "d2fc2322962467a30acf7ef74d04ac23", "score": "0.6054212", "text": "function RegistrarEstudiante(){\n\n var id_instituto = document.getElementById(\"id_institutoo\").value;\n var id_persona = document.getElementById(\"id_persona\").value;\n var fecha_solicitud = document.getElementById(\"fecha_solicitud\").value;\n var telefono = document.getElementById(\"telefono\").value;\n var correo = document.getElementById(\"correo\").value;\n var usuario = document.getElementById(\"usuario\").value\n var contrasena_b = document.getElementById(\"contrasena_b\").value;\n var pregunta = document.getElementById(\"pregunta\").value\n var respuesta = document.getElementById(\"respuesta\").value;\n \n \n var boton = \"Registrar\";\n\n // alert(id_instituto+\"\\n\"+id_persona+\"\\n\"+fecha_solicitud+\"\\n\"+telefono+\"\\n\"+correo+\"\\n\"+usuario+\"\\n\"+contrasena_b+\"\\n\"+pregunta+\"\\n\"+respuesta);\n \n $.ajax({\n async:true, \n cache:false,\n dataType:\"html\", \n type: 'POST', \n url: \"../controlador/estudiante_usuario_controlador.php\",\n data: {\n\n \n id_instituto : id_instituto, \n id_persona : id_persona, \n fecha_solicitud : fecha_solicitud,\n telefono : telefono,\n correo : correo,\n usuario : usuario,\n contrasena_b : contrasena_b,\n pregunta : pregunta,\n respuesta : respuesta,\n\n Registrar : boton\n\n },\n \nsuccess: function(data){ \n\n\n if(data==0){\n\n restablecer_de_nuevo();\n \n swal('Error','Ocurrió un error de Programación','error');\n\n }else if(data==1) {\n restablecer_de_nuevo();\n \n swal('Datos Registrados Con Exito','','success');\n\n }\n\n } \n\n });\n\n\n\n}", "title": "" }, { "docid": "28e1b28470d3b5bdf098ef79e283b2ec", "score": "0.60361695", "text": "function ActualizarOrden() {\n let id = document.getElementById(\"idArticulo\").value;\n let N_Inspector = document.getElementById(\"N_Inspector\").value;\n var CantidadConforme = document.getElementById(\"CantidadConforme\").value;\n var CantidadNoConforme = document.getElementById(\"CantidadNoConforme\").value;\n var CantidadRetrabajo = document.getElementById(\"Retrabajo\").value;\n var CantidadAjuste = document.getElementById(\"Ajuste\").value;\n var Notas = document.getElementById(\"Notas\").value;\n let Arreglo = [id, N_Inspector, CantidadConforme, CantidadNoConforme, CantidadRetrabajo, CantidadAjuste, Notas]\n let data = {\n id: id,\n N_Inspector: N_Inspector,\n CantidadConforme: CantidadConforme,\n CantidadNoConforme: CantidadNoConforme,\n CantidadRetrabajo: CantidadRetrabajo,\n CantidadAjuste: CantidadAjuste,\n\n Notas: Notas\n }\n\n var Condicion = true; //para campos vacios\n for (var a in Arreglo) { //recorrer arreglo en busca de campos vacios\n if (Arreglo[a].length == 0) {\n Condicion = false; //si algun campo esta vacio cambia a falso\n alert(\"Faltan campos por llenar\")\n }\n }\n\n $.post(\"/ActualizarOrden\", // inicia la lista de ot en el flujo de produccion\n {\n data\n }, // data to be submit\n function (objeto, estatus) { // success callback\n //console.log(\"objeto: \" + objeto + \"Estatus: \" + estatus);\n if (objeto == true) { }\n });\n document.getElementById(\"Notas\").value = '';\n setTimeout(\"redireccionar()\", 800); //Tiempo para reedireccionar\n}", "title": "" }, { "docid": "6e2824eae3711e7cdaca88bc89ffdca5", "score": "0.60350114", "text": "function ingresar(){\n var correoAcces, claveAcces,exprecion;\n \n correoAcces = document.getElementById(\"correoAcces\").value;\n claveAcces = document.getElementById(\"claveAcces\").value;\n //verificar el correo si esta bien estructurado\n \n \n \n if( correoAcces == \"\" || claveAcces ==\"\"){\n alert(\"Todos los campos son obligatorios\");\n return false;\n }\n else if(correoAcces.length>25){\n alert(\"El correo es muy largo\");\n return false;\n ;\n }\n \n else {\n alert(\"Datos incorrectos, verifique usuario y contraseña\");\n return false;\n }\n \n }", "title": "" }, { "docid": "3de00bc0442333a1a6afb89412fff3d1", "score": "0.6031408", "text": "presupuestoRestante(cantidad){\n\n const restante=document.querySelector('span#restante');\n //leemos el presupuesto restante\n const presupuestoRestanteUsuario=cantidadPresupuesto.presupuestoRestante(cantidad);\n restante.innerHTML=`${presupuestoRestanteUsuario}`;\n \n this.comprobrarPresupuesto();\n }", "title": "" }, { "docid": "2326722866f47d86831f613b7aba00e0", "score": "0.60304797", "text": "function respuestaPedir(respuesta){\n\tdocument.getElementById(\"dni_usu\").value=\"\";\n\tdocument.getElementById(\"cod_lib\").value=\"\";\n\tif(respuesta==\"RESERVADO\"){\n\t\talert(\"El usuario ya tiene el libro reservado\");\n\t}else if(respuesta==\"PRESTADO\"){\n\t\talert(\"El usuario ya tiene el libro prestado\");\n\t}else if(respuesta==\"SANCIONADO\"){\n\t\talert(\"El usuario está sancionado\");\n\t}else if(respuesta[0]==\"RESERVAR\"){\n\t\tvar fechaR=respuesta[1];\n\t\tvar dni=respuesta[2];\n\t\tvar cod=respuesta[3];\n\t\tvar sep1 = new RegExp(\"-\", \"g\");\n\t\tvar fechaRes = fechaR.split(sep1);\n\t\tif(confirm(\"No está disponible \\n Fecha aproximada en la que estara disponible: \"+fechaRes[2]+\"-\"+fechaRes[1]+\"-\"+fechaRes[0]+\" \\n¿Quieres reservar? \")){\n\t\t\treservarLibro(cod,fechaR,dni);\n\t\t}\n\t}else if(respuesta[0]==\"PRESTAR\"){\n\t\tvar fechaIni=respuesta[1];\n\t\tvar fechaFin=respuesta[2];\n\t\tvar dni=respuesta[3];\n\t\tvar cod=respuesta[4]\n\t\tvar sep1 = new RegExp(\"-\", \"g\");\n\t\tvar fechaI = fechaIni.split(sep1);\n\t\tvar fechaF = fechaFin.split(sep1);\n\t\tif(confirm(\"¿Quieres realizar un préstamo ? \\n Desde: \"+fechaI[2]+\"-\"+fechaI[1]+\"-\"+fechaI[0]+\" \\n Hasta: \"+fechaF[2]+\"-\"+fechaF[1]+\"-\"+fechaF[0])){\n\t\t\tprestarLibro(cod,fechaIni,fechaFin,dni);\n\t\t}\n\t}\t\t\t\n}", "title": "" }, { "docid": "a6b3d2a94fab85e86676823c8f099f51", "score": "0.60257244", "text": "function registrarCliente(){\n var nombre = pedirDatos(nombre, Cajero.datosCliente[0], 'texto' )\n var apellido = pedirDatos(apellido, Cajero.datosCliente[1], 'texto')\n var dni = pedirDatos(dni, Cajero.datosCliente[2], 'numero')\n\n Cajero.nuevoCliente(nombre, apellido, dni);\n printCliente()\n nuevaFactura()\n}", "title": "" }, { "docid": "1e355853cfedac83fd62d42e1d4b493a", "score": "0.6015775", "text": "function GuardarEspecialClientes(formulario,archivo_envio,archivo_vizualizar,donde_mostrar)\n{\n\t//alert(archivo_envio);\n\tif(confirm(\"\\u00BFEstas seguro de querer realizar esta operaci\\u00f3n?\"))\n\t{\n\t\tvar datos = ObtenerDatosFormulario(formulario);//obteniedo los datos del formulario\n\t\tconsole.log(datos);\n\t\t$('#abc').html('<div align=\"center\" class=\"mostrar\"><img src=\"images/loader.gif\" alt=\"\" /><br />Cargando...</div>');\n\t\toverlayopen('abc');\n\t\tsetTimeout(function(){\n\t\t\t\t $.ajax({\n\t\t\t\t\t type: 'POST',\n\t\t\t\t\t url: archivo_envio,\n\t\t\t\t\t data: datos,\n\t\t\t\t\t error:function(XMLHttpRequest, textStatus, errorThrown){\n\t\t\t\t\t\t var error;\n\t\t\t\t\t\t console.log(XMLHttpRequest);\n\t\t\t\t\t\t if (XMLHttpRequest.status === 404) error=\"Pagina no existe\"+XMLHttpRequest.status;// display some page not found error \n\t\t\t\t\t\t if (XMLHttpRequest.status === 500) error=\"Error del Servidor\"+XMLHttpRequest.status; // display some server error \n\t\t\t\t\t\t $('#abc').html('<div class=\"alert_error\">'+error+'</div>');\t\n\t\t\t\t\t\t overlayclose('abc');\n\t\t\t\t\t\t aparecermodulos(archivo_vizualizar+\"?ac=0&msj=Error. \"+error,donde_mostrar);\n\t\t\t\t\t },\n\t\t\t\t\t success:function(msj){\n\t\t\t\t\t\t console.log(\"El resultado de msj es: \"+msj);\n\t\t\t\t\t\t var array = msj.split(\"|\"); \n\t\t\t\t\t\t $('.modal').modal('hide');\n\t\t\t\t\t\t if ( array[0] == '1' ){\n\t\t\t\t\t\t\t overlayclose('ventana');\n\t\t\t\t\t\t\t overlayclose('abc');\n\t\t\t\t\t\t\t aparecermodulos(archivo_vizualizar+\"?ac=1&msj=Operacion realizada con exito&id=\"+array[1],donde_mostrar);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t overlayclose('ventana');\n\t\t\t\t\t\t\t overlayclose('abc');\n\t\t\t\t\t\t\t aparecermodulos(archivo_vizualizar+\"?ac=0&msj=Error. \"+msj,donde_mostrar);\n\t\t\t\t\t\t }\t\n\t\t\t\t\t }\n\t\t\t\t });\t\t\t\t \t\t\t\t\t \n\t\t},1000);\n\t}\n}// fin de function GuardarEspecial", "title": "" }, { "docid": "37f821b75071eea9f77071da9f2d2456", "score": "0.60105497", "text": "function activadorEventosUsuarios()\n{\n// VARIABLES DEL MENU VERTICAL DE LA OPCION USUARIOS\n var listadoV, visitasV, viaticosV;\n// ASIGNACION DE EVENTOS A LAS VARIABLES DECLARADAS\n listadoV=$(\"#listadoUsuarios\");\n listadoV.click(seccionListado);\n visitasV=$(\"#VisitasVendedor\");\n visitasV.click(seccionVisitas);\n viaticosV=$(\"#viaticosVendedor\");\n viaticosV.click(seccionViaticos);\n//*******************************************************\n//** VARIABLES DE LAS OPCIONES DEL LISTADO DE USUARIOS **\n//*******************************************************\n var adicionarU, modificarU, borrarU, visualizarU;\n var volverUsuario, vBorrarOk, vBorrarU, vHideDelU;\n// ASIGNACION DE EVENTOS A LAS VARIABLES DECLARADAS\n adicionarU=$(\"#AUsuario\");\n adicionarU.click(AddUsuario);\n modificarU=$(\".ModUsuario\");\n modificarU.click(DatosModUsuario);\n visualizarU=$(\".VerUsuario\");\n visualizarU.click(DatosVerUsuario);\n borrarU=$(\".DelUsuario\");\n borrarU.click(DatosDelUsuario);\n\n volverUsuario=$(\"#volverAddUsuario\");\n volverUsuario.click(seccionListado);\n vBorrarU=$(\"#borrarUsuario\");\n vBorrarU.click(ConfirmDelUsuario);\n vBorrarOk=$(\"#OkDelUsuario\");\n vBorrarOk.click(DelUsuarioOk);\n vHideDelU=$(\"#NotDelUsuario\");\n vHideDelU.click(HideConfirmDelUsuario); \n//******************************************************\n//** VARIABLES DE LAS OPCIONES DEL LISTADO DE VISITAS **\n//******************************************************\n var addVisita, modVisita, delVisita, verVisita;\n var volverVisitas, vBorrarOk, verVisita, delVisita, hideDelVisita, vBorrarV;\n// ASIGNACION DE EVENTOS A LAS VARIABLES DECLARADAS\n addVisita=$(\"#AdVisita\");\n addVisita.click(AddVisita);\n modVisita=$(\".ModVisita\");\n modVisita.click(DatosModVisita);\n verVisita=$(\".VerVisita\");\n verVisita.click(DatosVerVisita);\n delVisita=$(\".DelVisita\");\n delVisita.click(DatosDelVisita);\n \n vBorrarOk=$(\"#OkDelVisita\");\n vBorrarOk.click(DelVisitaOk);\n vBorrarV=$(\"#borrarVisita\");\n vBorrarV.click(ConfirmDelVisita);\n hideDelVisita=$(\"#NotDelVisita\");\n hideDelVisita.click(HideConfirmDelVisita);\n volverVisitas=$(\"#volverVisita\");\n volverVisitas.click(seccionVisitas);\n//*******************************************************\n//** VARIABLES DE LAS OPCIONES DEL LISTADO DE VIATICOS **\n//*******************************************************\n var addViatico, modViatico, verViatico, delViatico;\n var VBorrarOk, VBorrarV, hideDelViatico, volverViatico;\n// ASIGNACION DE EVENTOS A LAS VARIABLES DECLARADAS\n addViatico=$(\"#AddViatico\");\n addViatico.click(AddViatico);\n modViatico=$(\".ModViatico\");\n modViatico.click(DatosModViatico);\n verViatico=$(\".VerViatico\");\n verViatico.click(DatosVerViatico);\n delViatico=$(\".DelViatico\");\n delViatico.click(DatosDelViatico);\n \n VBorrarOk=$(\"#OkDelViatico\");\n VBorrarOk.click(DelViaticoOk);\n VBorrarV=$(\"#borrarViatico\");\n VBorrarV.click(ConfirmDelViatico);\n hideDelViatico=$(\"#NotDelViatico\");\n hideDelViatico.click(HideConfirmDelViatico);\n volverViatico=$(\"#volverViatico\");\n volverViatico.click(seccionViaticos);\n}", "title": "" }, { "docid": "4f8d779c999effd9433cd3991c478251", "score": "0.60102534", "text": "presupuestoRestante(cantidad){\n const restante = document.querySelector('#restante');\n const presupuestoRestanteUsuario = cantidadPresupuesto.presupuestoRestante(cantidad);\n restante.innerHTML = `${presupuestoRestanteUsuario}`;\n this.comprobarPresupuesto();\n\n\n }", "title": "" }, { "docid": "368f3f4ff79b23adb1a94d7f7a74d33c", "score": "0.6008386", "text": "function oquvMarkazQushish() {\n let form = document.forms['createOquvMarkazForm'];\n let check = {};\n let userId1={};\n let userId2={};\n check.nomi = form[\"nomi\"].value;\n check.manzil = form[\"manzil\"].value;\n check.koordinataX = form[\"koordinataX\"].value;\n check.koordinataY = form[\"koordinataY\"].value;\n check.googleManzil = form[\"googleManzil\"].value;\n check.tuman = form[\"tuman\"].value;\n check.qisqaMalumot = form[\"qisqaMalumot\"].value;\n check.nomer = form[\"nomer\"].value;\n check.sayt = form[\"sayt\"].value;\n check.telegram = form[\"telegram\"].value;\n check.viloyat = document.getElementById(\"viloyat\").value;\n check.startWork = document.getElementById(\"startWork\").value;\n check.endWork = document.getElementById(\"endWork\").value;\n userId1.id = document.getElementById(\"boshliq\").value;\n check.boshliq = userId1;\n userId2.id = document.getElementById(\"admin\").value\n check.admin = userId2;\n oquvMarkazService.create(JSON.stringify(check), location.reload(), console.log(\"xato\"));\n}", "title": "" }, { "docid": "2e84fbfc18a8892abad230ef45bea277", "score": "0.60055256", "text": "function recuperando() {\r\n //obteniendo los datos del formulario de recuperar\r\n var valoresForm = $(\"#frmRecuperar\").serialize();\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"../app/controllers/UsuarioController.php\",\r\n data: valoresForm,\r\n beforeSend: function () {\r\n //ocultando botones mientras se realiza la peticion\r\n $('#elementosRegisto').hide();\r\n //se muestra el preloader\r\n $('#preloader').show();\r\n },\r\n success: function (response) {\r\n //si la respuesta tiene exito\r\n var resp = response.indexOf(\"Exito\");\r\n if (resp >= 0) {\r\n //llamando a la funcion recuperar\r\n recuperar();\r\n //mostrando botones de registro\r\n $('#elementosRegisto').show();\r\n //se muestra el preloader\r\n $('#preloader').hide();\r\n //mensaje de exito\r\n M.toast({ html: 'Se le ha enviado un correo con la nueva contraseña', classes: 'rounded' });\r\n } else {\r\n //mostrando botones de registro\r\n $('#elementosRegisto').show();\r\n //se muestra el preloader\r\n $('#preloader').hide();\r\n //mensaje de error\r\n M.toast({ html: JSON.parse(response), classes: 'rounded' ,displayLength: Infinity});\r\n }\r\n },\r\n error: function () {\r\n M.toast({ html: \"Error al contactar con el servidor\", classes: 'rounded' });\r\n }\r\n });\r\n}", "title": "" }, { "docid": "855fd357bd43f6fb8b4782718de66976", "score": "0.6004845", "text": "function getAcuerdos() {\n //alert(\"getAcuerdos \"+empresa)\n \t$http.get(url_server+\"acuerdo/listar/\"+empresa).success(function(response) {\n\t if(response.status == 'OK') { // Si nos devuelve un OK la API...\n //alert(\"ok \"+response.data[0].ACUNAC);\n\t \t$scope.acuerdos = response.data;\n\t \tif($scope.acuerdos.length == 0){\n //alert(\"length == 0\");\n $scope.newClave = 1;\n //nuevaClave = 1;\n\t\t\t\t\t$(\"#mensaje\").empty();\n\t\t\t\t\t$(\"#mensaje\").append('<div class=\"row\"><div class=\"col s12 m12 l12\"><div class=\"card blue-grey darken-1\"><div class=\"card-content white-text\"><span class=\"card-title\">Ops</span><p>Aún no hay acuerdos registrados en el sistema.</p></div></div></div></div>');\n\t\t\t\t\t$(\"#mensaje\").css('color', '#d50000');\n\t\t\t\t}else{\n\t $(\"#mensaje\").empty();\n var indice = response.data;\n $scope.newClave = getNewIndice(indice);\n //alert(\"length > 0 \"+$scope.newClave);\n //nuevaClave = $scope.newClave;\n\t }\n\t }\n\t });\n }", "title": "" }, { "docid": "03a176e764dc847065f4df17f122bb65", "score": "0.5988964", "text": "function obtenerDatosEstudiante(){\n\n //obtiene los datos de las cajas de texto \n\tvar sbCedula = txtCedula.value;\n\tvar sbNombre = txtNombre.value;\n\tvar sbApellido = txtApellido.value;\n\tvar sbDireccion = txtDireccion.value;\n\tvar sbTelefono = txtTelefono.value;\n\tvar sbEmail = txtEmail.value;\n\t\n\t//inicializa variable para saber si se puede enviar la peticion url\n\tvar blSubmit = true;\n\t\n\t//crea variable para armar mensaje de alerta\n\tvar sbMensaje = 'Complete los siguientes campos:\\n';\n \n\t\n\t//valida si la caja de texto cedula esta vacia\n\tif(sbCedula == ''){\n\t\tsbMensaje += \"- sbCedula \\n\";\t\t\n\t\tblSubmit = false;\n\t}//fin del else\n\t\n\t//valida si la caja de texto nombre esta vacia\n\telse if(sbNombre == ''){\n\t\tsbMensaje += \"- sbNombre \\n\";\n\t\tblSubmit = false;\n\t}//fin del else\n\t\n\t\n\t//valida si la variabe blSubmit esta en true para poder realizar el llamado al Url\n\t//usa metodo ajax\n\tif(blSubmit){\n\t\t$.ajax({\n\t\t\n\t\t //arma url usa metodo post\n\t\t\turl: \"http://172.26.3.74/j2me-php/recibir.php\",\n\t\t\ttype: \"POST\",\n\t\t\t//obtiene la informacion de las variables usuario y clave\n\t\t\tdata: {cedula: sbCedula, nombre: sbNombre, apellido: sbApellido, direccion: sbDireccion, telefono: sbTelefono, email: sbEmail},\n\t\t\t\n\t\t\t//envia los datos por medio de function\n\t\t\tsuccess: function(data){\n\t\t\t\n\t\t\t //muestra mensaje si estuvo bien el proceso o no!\n\t\t\t\tnavigator.notification.alert(data);\n\t\t\t\t\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t //muestra mensaje si estuvo bien el procesoo no!\n\t\t\t navigator.notification.alert(data);\t\t\t\t\t\t\n\t\t\t}\n\t\t})\n\t\t\n\t}//fin del if\n\t\n\t//entra aqui si falta por llenar algun campo, lo que indica que la variable blSubmit esta en false \n\telse\n\t{\n\t\tnavigator.notification.vibrate(1000);\n\t\tnavigator.notification.alert(sbMensaje, \"Estudiante\");\t\n\t}//fin del else\n\t\n}//fin de funcion obtenerDatosEstudiante", "title": "" }, { "docid": "c523f14bf8c30fe02660cfb13f0ae33c", "score": "0.5985306", "text": "function muestraDatosDeEsteAdmin() {\n\n //Obtener valor del option seleccionado\n var select = document.querySelector('#selectAdmin_ModAdm');\n\n if (select.selectedIndex != 0) {\n\n var codAdmin = select.value;\n var oAdmin = oConsultoria.dameAdministrador(codAdmin);\n\n //Extraer los valores de sus atributos y colocarlos en los campos de texto.\n\n var nomAdmin = document.querySelector('#nombreAdmin_ModAdm');\n nomAdmin.value = oAdmin.nombreTrabajador;\n nomAdmin.removeAttribute('readonly');\n\n var apeAdmin = document.querySelector('#apellidoAdmin_ModAdm');\n apeAdmin.value = oAdmin.apellidosTrabajador;\n apeAdmin.removeAttribute('readonly');\n\n //Este campo es unico(DNI), no debe poderse modificar. Dejamos el atributo readonly\n var dniAdmin = document.querySelector('#dniAdmin_ModAdm');\n dniAdmin.value = oAdmin.dniTrabajador;\n\n var tlfAdmin = document.querySelector('#telefonoAdmin_ModAdm');\n tlfAdmin.value = oAdmin.telefonoTrabajador;\n tlfAdmin.removeAttribute('readonly');\n\n var dirAdmin = document.querySelector('#direccionAdmin_ModAdm');\n dirAdmin.value = oAdmin.direccionTrabajador;\n dirAdmin.removeAttribute('readonly');\n\n }\n}", "title": "" }, { "docid": "25da7f5e45d4b2aea1051d73634eb106", "score": "0.59839445", "text": "presupuestoRestante (cantidad) {\n const restante = document.getElementById('span-cantidad')\n // leermos el presupuesto restante\n const presupuestoRestanteUsuario = cantidadPresupuesto.presupuestoRestante(cantidad)\n restante.innerHTML = `${presupuestoRestanteUsuario}`\n\n this.comprobarPresupuesto()\n }", "title": "" }, { "docid": "94ca4ac4e787929a18cea7baac0f61c4", "score": "0.5983013", "text": "static registrarAlumnoByDocentes2() {\n Utilitario.agregarMascara();\n fetch(\"formularioMatricula.html\", {\n method: \"GET\",\n })\n .then(function(response) {\n return response.text();\n })\n .then(function(vista) {\n (Utilitario.getLocal('rol') == 3) ?\n window.location.href = \"principal.html\": $(\"#mostrarcontenido\").html(vista);\n })\n .finally(function() {\n Utilitario.quitarMascara();\n });\n }", "title": "" }, { "docid": "cf8566c259ac9b9fa9ef9501d27aa4a1", "score": "0.5979862", "text": "function amSp4CRUDComentarioEnfermedadCronica(CodAccion, IdComentario) {\n \n let data = {};\n let TituloModal = '';\n let NumeroFilas = 0;\n\n /* \n\n Los codigos de accion seran:\n 0 Para inicializar\n 1 Para eliminar\n\n */\n\n if( CodAccion == 0){\n\n if (validationForm('check-comentario').length > 0) {\n return;\n }\n\n }\n \n data.Id1 = IdComentario; //si es cero se crea el registro diferente se modifica el registro\n data.EnfermedadCronicaId = idTemporalEC;\n data.CreadoPor = \"JG\";\n data.Comentario = $('#sp4EnferCron_comentario_com').val()\n data.HistoriaClinicaId = idHC; \n data.accion = CodAccion; //0 crear registro, 1 eliminarlo logicamente\n\n let url = apiUrlsho+`/api/hce_enfermedad_cronica_post_comentario?code=mmhtfeuXjUdG9BZpDoDK9F4AOVXY/0wsQkGBSOr2fp6IMJ9xvl1NBA==&httpmethod=post`;\n\n let headers = {\n \"apikey\": constantes.apiKey,\n \"Content-Type\": \"application/json\"\n }\n\n let settings = {\n \"url\": url,\n \"method\": \"post\",\n \"timeout\": 0,\n \"crossDomain\": true,\n \"dataType\": 'json',\n \"headers\": headers,\n \"data\": JSON.stringify(data)\n };\n\n return $.ajax(settings).done((response) => {\n\n $(\"#table_sp4EnferCron_comentario tbody\").find(\".table-empty\").remove();\n\n NumeroFilas = $(\"#table_sp4EnferCron_comentario tbody tr\").length;\n\n if( CodAccion == 0 ){\n\n TituloModal = 'Comentario anexado con éxito';\n\n html_tbody = \"<tr>\";\n html_tbody += \"<td>\"+$('#sp4EnferCron_comentario_com').val()+\"</td>\";\n html_tbody += \"<td width='700px'>\"+new Date().toLocaleDateString('en-GB').split('T')[0]+\"</td>\";\n html_tbody += \"<td>\";\n html_tbody += \"<a class='dropdown-item btn-delete' onclick='amSp4CRUDComentarioEnfermedadCronica(1, \"+response.Id+\");'>\";\n html_tbody += \"<img src='./images/sho/delete.svg' alt='' fill='#ff3636'>\";\n html_tbody += \"</a>\";\n html_tbody += \"</td>\";\n html_tbody += \"</tr>\";\n\n $(\"#table_sp4EnferCron_comentario tbody\").append(html_tbody);\n $(\"#table_sp4EnferCron_comentario-count-row\").text(NumeroFilas+1);\n $('.check-comentario').val('');\n\n }\n else{\n\n TituloModal = 'Comentario eliminado con éxito';\n\n if( NumeroFilas == 0 ){\n\n html_tbody =\n \"<tr class='table-empty'>\"+ \n \"<td colspan='3' class='text-center text-uppercase'>\"+\n \"No hay informacion registrada\"+\n \"</td>\"+\n \"</tr> \";\n\n $(\"#table_sp4EnferCron_comentario tbody\").append(html_tbody);\n\n }\n\n }\n\n Swal.fire({\n title: TituloModal,\n iconColor: \"#8fbb02\",\n iconHtml: '<img src=\"./images/sho/check.svg\" width=\"28px\">',\n showConfirmButton: false,\n padding: \"3em 3em 6em 3em \",\n timer: 1500,\n });\n\n });\n\n}", "title": "" }, { "docid": "dd0005a8c694cb7dbffbe539d41463e2", "score": "0.59760046", "text": "function ObtenerDatosUsuario(usuario) {\n let idUsuario = usuario.querySelector('th').textContent;\n console.log(idUsuario);\n let btnActualizar = document.getElementById('btnActualizar');\n let btnGuardar = document.getElementById('btnAgregarUsuario');\n let inputIdUsuario = document.getElementById('idUsuario');\n \n let padreBtnActualizar = btnActualizar.parentElement;\n let padreBtnGuardar = btnGuardar.parentElement;\n let padreInputIdUsuario = inputIdUsuario.parentElement;\n\n padreBtnGuardar.classList.add('d-none');\n padreBtnActualizar.classList.remove('d-none');\n padreInputIdUsuario.classList.remove('d-none');\n\n\n fetch(url + 'ObtenerDatosUsuario', {\n method : 'POST',\n headers : {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n \"idUsuario\" : idUsuario\n })\n })\n .then(function(response){\n return response.json();\n })\n .then(function(data){\n console.log(data);\n document.getElementById('idUsuario').value = data[0].IdUsuario;\n document.getElementById('txtNombres').value = data[0].TxtNombres;\n document.getElementById('txtApellidos').value = data[0].TxtApellidos;\n document.getElementById('txtDireccion').value = data[0].TxtDireccion;\n document.getElementById('txtEmail').value = data[0].TxtEmail;\n document.getElementById('txtPassword').value = data[0].TxtPassword;\n })\n \n}", "title": "" }, { "docid": "b902cf84dcd068fd6ab92f6a4f57bfcd", "score": "0.5973909", "text": "function agregarConsulta() {\n var id = this.value;\n var fecha = $(\"#a_fecha\").val();\n var motivo = $(\"#a_motivo\").val();\n var derivacion = $(\"#a_derivacion\").val();\n var internacion = $(\"#a_internacion\").val();\n var tratamiento = $(\"#a_tratamiento\").val();\n var acompanamiento = $(\"#a_acompanamiento\").val();\n var articulacion = $(\"#a_articulacion\").val();\n var diagnostico = $(\"#a_diagnostico\").val();\n var observaciones = $(\"#a_observaciones\").val();\n var token = $('meta[name=\"token\"]').attr('content');\n\n if (! id) {\n mostrarAlerta(\"Seleccione un paciente de la lista\",\"error\");\n return;\n }\n\n if (!(fecha && motivo && diagnostico && (internacion == \"1\" || internacion == \"0\"))) {\n mostrarAlerta(\"Complete los campos obligatorios\",\"error\");\n return;\n }\n\n if (articulacion.length > 255 || diagnostico.length > 255 || observaciones.length > 255) {\n mostrarAlerta(\"Los textos ingresados deben tener un maximo de 255 caracteres\",\"error\");\n return;\n }\n\n $.ajax({\n url : '?action=agregarConsulta',\n data : { id: id, fecha: fecha, motivo: motivo, derivacion: derivacion,\n internacion: internacion, tratamiento: tratamiento, acompanamiento: acompanamiento,\n articulacion: articulacion, diagnostico: diagnostico, observaciones: observaciones, token: token },\n type : 'POST',\n dataType: 'json',\n // código a ejecutar si la petición es satisfactoria;\n // la respuesta es pasada como argumento a la función\n success : function(respuesta) {\n //Pregunto si se realizo la operacion correctamente\n switch (respuesta.estado) {\n case \"success\":\n adminMarkers.clearMarkers();\n mostrarAlerta(respuesta.mensaje,respuesta.estado);\n $('#formularioAgregarConsulta').trigger(\"reset\");\n $(\"#btnAgregarConsulta\").val(\"\");\n document.getElementsByClassName(\"page-item active\")[0].children[0].onclick();\n break;\n case \"error\":\n mostrarAlerta(respuesta.mensaje,respuesta.estado);\n break;\n default:\n mostrarAlerta(\"No se pudo realizar la operacion, vuelva a intentar mas tarde\",\"error\");\n }\n }\n });\n}", "title": "" }, { "docid": "091ab333ce282e374a40b58c5c294ed3", "score": "0.59737253", "text": "function sincronizarRecepcionDatos(rutaN, token) {\n\tif(checkConnection() == 'No network connection') {\n\t\talert(\"No esta Conectado a una Red!\");\n\t} else {\n\t\tintentosRecibidos = 0;\n\t\tcantArchRecibidos = 0;\n\t\terrorRecibidos = 0;\n\t\tbloqRecibidos = 0;\n\t\tpassErrorRecibidos = 0;\n\t\tnoDatosRecibidos = 0;\n\n\t\tvar tipoConexion = $(\"#cambiaServerBajar option:selected\").val();\n\n\t\t//alert(\"Conexion: \" + tipoConexion);\n\n\t\tif(parseInt(tipoConexion) == 1) {\n\t\t\t\n\t\t\t //servidorWS = \"https://192.168.134.32:92/DIST/OperacionesFDC\";\n servidorWS=\"http://isaws05:90/DIST/OperacionesFDC\"\n /**\n\t\t\t//Servidor de Prueba\n\t\t\tservidorWS = \"http://192.168.134.32:2013/DIST/OperacionesFDC.ashx\";\n\t\t\t*/\n \n\t\t\tusuarioFTP = \"ISAWS02\\\\FTP_Distribucion\";\n\t\t\tpassFTP = \"iW8qYFeK\";\n\t\t\tservidorftp=\"192.168.134.35\"\n\t\t\t//servidorFTP = \"piloto.nsel-clnsa.com.ni\";\n\t\t\t//alert(\"Red Interna\");\n\t\t} else {\n\t\t\t//servidorWS = \"https://190.212.139.230/DIST/OperacionesFDC\";\n\t\t\tservidorWS=\"http://isaws05:90/DIST/OperacionesFDC\"\n\n\t\t\tusuarioFTP = \"ISAWS02\\\\FTP_Distribucion\";\n\t\t\tpassFTP = \"iW8qYFeK\";\n\t\t\tservidorftp=\"192.168.134.35\"\n\t\t\t//servidorFTP = \"190.212.139.230\";\n\t\t\t//alert(\"INTERNET PUBLICO\");\n\t\t}\n\n\t\tconsole.log(\"token:\" + token)\n\n\t\t//Se cambia metodo ObtenerSKUS por ObtenerSKUSPCOR, debido a cambio en WS por Edwin Pereira, 2014.06.08\n\t\tobtenerDatosServidor(\"ObtenerSKUSPCOR\", rutaN, token, \"Bajando datos de Productos!\", \"No hay datos de Productos!\", naProductos);\n\t\tobtenerDatosServidor(\"ObtenerDocumentosPendientes\", rutaN, token, \"Bajando documentos pendientes!\", \"No hay documentos pendientes!\", naDocsPendientes);\n\t\tobtenerDatosServidor(\"ObtenerPedidosPorRuta\", rutaN, token, \"Bajando Pedidos!\", \"No hay Pedidos\", naPedidos);\n\t\tobtenerDatosServidor(\"ObtenerAsignacionImpresora\", rutaN, token, \"Configurando Impresora!\", \"No hay datos de Impresora!\", naImpresora);\n\t\tobtenerDatosServidor(\"ObtenerBancos\", rutaN, token, \"Bajando datos de bancos!\", \"No hay datos de bancos!\", naBancos);\n\t\tobtenerDatosServidor(\"ObtenerRetornosPorRuta\", rutaN, token, \"Bajando Devolucion Envases!\", \"No hay Devolucion Envases!\", naDevolucionEnvases);\n\t\tobtenerDatosServidor(\"ObtenerCambiosPorRuta\", rutaN, token, \"Bajando Datos de Cambios!\", \"No hay Cambios!\", naCambios);\n\t\tobtenerDatosServidor(\"ObtenerDevolucionesPorRuta\", rutaN, token, \"Bajando Datos de Devoluciones!\", \"No hay Devoluciones!\", naDevoluciones);\n\t\tobtenerDatosServidor(\"ObtenerPreciosEnvase\", rutaN, token, \"Bajando precios envases!\", \"No hay precios envases\", naEnvases);\n\t\tobtenerDatosServidor(\"ObtenerFacturaSiguiente\", rutaN, token, \"Bajando datos de Correlativo!\", \"No hay datos de Correlativo\", naCorrelativo);\n\t\tobtenerDatosServidor(\"ObtenerReciboSiguiente\", rutaN, token, \"Bajando datos de abonos!\", \"No hay datos de abonos\", naCorrelativoabono);\n\t\tobtenerDatosServidor(\"ObtenerTasaCambio\", rutaN, token, \"Bajando datos de Tipo de Cambio!\", \"No hay datos de Tipo Cambio\", naTipoCambio);\n\t\tobtenerDatosServidor(\"ObtenerCargaInicialRuta\", rutaN, token, \"Bajando datos de Carga Inicial!\", \"No hay datos de Carga Inicial!\", naCargaInicial);\n\t\tobtenerDatosServidor(\"ObtenerClientesEntrega\", rutaN, token, \"Bajando datos de Clientes!\", \"No hay datos de Clientes!\", naClientes);\n\n\t\t$(\"#numeroderuta\").html(rutaN);\n\t\tgrabaArchivoBajado(naRuta, rutaN);\n\n\t\treiniciaTodo();\n\t\t$(\"#btnIniciodia\").removeClass('ui-disabled');\n\t\t$.mobile.changePage('#page1', \"reloadPage\");\n\t}\n}", "title": "" }, { "docid": "0e272f1aa1531f90eae14498ef692ab8", "score": "0.5973083", "text": "constructor(nombre, edad, correo){\n //Estas variables tambien se conocen como propiedades\n //Este Usuario . nombre o edad = valor asignado\n this.nombre = nombre,\n //Este dato es un dato fijo, es decir, si quiero agregar otro usuario con otro nombre, al consultar su nombre obtendra el mismo nombre asignado\n //this.edad = 28,\n this.edad = edad,\n this.correo = correo;\n //Lo recomendable es que al final lleve punto y coma ;\n }", "title": "" }, { "docid": "cb1a008e6a79e6ad5ce1acbb4e205593", "score": "0.59729713", "text": "async addTareaAccionProcesoPersona({request,response}){\n \n var idProcesoPersona= request.input('idProcesoPersona');\n var idEtapaTareaProcesoPersona= request.input('idEtapaTareaProcesoPersona');\n var idEdeEtapaTareaAccion= request.input('idEdeEtapaTareaAccion');\n var idAccionEstado= request.input('idAccionEstado');\n var cliente = request.input('cliente');\n try{\n const query = `call ede_addEtapaTareaAccionProcesoPersona('${idProcesoPersona}','${idEtapaTareaProcesoPersona}','${idEdeEtapaTareaAccion}','${idAccionEstado}')`;\n const respuesta = await data.execQuery(cliente,query);\n response.json({mensaje:\"OK\"});\n }\n catch(err)\n { \n response.json({mensaje:err});\n }\n }", "title": "" }, { "docid": "c8f1bb77403856cea11aed5c630c8a39", "score": "0.5969757", "text": "function ingreso(){\n\tvar sesion1 = document.getElementById('correoSesion').value;\n\tvar sesion2 = document.getElementById('clavesesion').value;\n\tvar bandera1 = 0;\n\tfor(var i = 0; i < usuarios_a.length; i++){ \n\t \t/* Si hay alguna coincidencia el correo ya existe, es decir\n\t \tbandera = 1 */\n\t \tif( usuarios_a[i].correo == sesion1 && usuarios_a[i].clave == sesion1){ \n\t \t\tbandera1 = 1;\n\t \t}\n\t \t} \n\t \tif(bandera1 == 1){\n\t \t\talert(\"Puede ingresar al sistema\");\n\n\t \t}\n\t \telse{\n\t \t\talert(\"Sus datos no coinciden con el sistema\");\n\t \t\tsesion1.value = \"\";\n\t \t\tsesion2.value = \"\";\t\n\t \t}\n}", "title": "" }, { "docid": "868e7ca838345c32601c56ff6773e707", "score": "0.59676236", "text": "function ingresarUsuario(){\n\tvar usuario = $(\"#txt-usuario\");\n\tvar clave = $(\"#txt-clave\");\n\tvar contenedorError = $(\"#error-login\");\n\tvar loginExito = false;\n\tvar medico = false;\n\tvar userLog;\n\n\tfor(var i = 0; i < doctores.length; i++){\n\t\tif(doctores[i].numeroProfesional === Number(usuario.val())){\n\t\t\tif(doctores[i].clave === Number(clave.val())){\n\t\t\t\tloginExito = true;\n\t\t\t\tmedico = true;\n\t\t\t\tuserLog = doctores[i];\n\t\t\t}\n\t\t}\n\t}\n\tfor(var i = 0; i < pacientes.length; i++){\n\t\tif(pacientes[i].numeroPaciente === Number(usuario.val())){\n\t\t\tif(pacientes[i].clave === Number(clave.val())){\n\t\t\t\tloginExito = true;\n\t\t\t\tmedico = false;\n\t\t\t\tuserLog = pacientes[i];\n\t\t\t}\n\t\t}\t\n\t}\n\tif(!loginExito || !validarVacio(usuario.val(), clave.val())){\n\t\tcontenedorError.html(\"Usuario y/o contraseña incorrectos\");\n\t}\n\n\tif(loginExito && medico){\n\t\t$(\".menuDoctor\").show();\n\t}else if(loginExito && !medico){\n\t\t$(\".menuCliente\").show();\n\t\t$(\".botonera\").show();\n\t}\n\n\tif(loginExito){\n\t\tusuarioIngresado = userLog;\n\t\t$(\"#login-form\").modal('hide');\n\t\tmostrarOcultarBotonLoginLogout();\n\t\tbienvenida(usuarioIngresado);\n\t}\n}", "title": "" }, { "docid": "de1d57f3dfb2c0a6cf0e0b423a8be34c", "score": "0.5965239", "text": "function altaTrabajador(){\n\tvar oForm = document.frmAltaTrabajador;\n\tvar sMensaje =\"\";\n\n\tvar dni = oForm.dni.value.trim();\n\tvar nombre = oForm.nombre.value.trim();\n\tvar tlfn = oForm.tlfn.value.trim();\n\tvar nacionalidad = oForm.comboNacionalidad.value.trim();\n\tvar validacion = validarTrabajador();\n\tif (validacion == \"\"){\n\n\n\t\tvar tipo = oForm.tipoTrabajador.value.trim();\n\n\t\tif (tipo == \"Director\") \n\t\t{\n\t\t\tvar oDirector = new Director(dni,nombre,tlfn,nacionalidad);\n\t\t\t\n\t\t\tif(!oManagerCorporation.getTrabajadorPorDniYTipo(oDirector.dni, \"Director\")){\n\t\t\ttoastr.success(oManagerCorporation.altaTrabajador(oDirector, tipo));\n\t\t\t}\n\t\t\telse\n\t\t\t\ttoastr.error(\"Director registrado previamente\");\t\n\t\t}\n\t\telse\n\t\t\tif (tipo == \"Representante\") \n\t\t\t{\n\t\t\t\tvar oRepresentante = new Representante(dni,nombre,tlfn,nacionalidad);\n\t\t\t\tif(!oManagerCorporation.getTrabajadorPorDniYTipo(oRepresentante.dni,\"Representante\")){\n\t\t\t\ttoastr.success(oManagerCorporation.altaTrabajador(oRepresentante, tipo));\n\t\t\t\t}else{\n\t\t\t\t\ttoastr.error(\"Representante registrado previamente\");\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(oForm.Representante.value==\"NoExistenRepresentantes\"){\n\t\t\t\t\ttoastr.error(\"No puedes añadir trabajadores sin representantes.\");\t\n\t\t\t\t}else{\n\t\t\t\t\tvar representante = oManagerCorporation.getTrabajadorPorDniYTipo(oForm.Representante.value,\"Representante\");\n\t\t\t\t\tvar estatus = oForm.estatus.value.trim();\n\t\t\t\t\tvar oActor = new Actor(dni,nombre,tlfn,nacionalidad,estatus,representante);\n\t\t\t\t\tif(!oManagerCorporation.getTrabajadorPorDniYTipo(oActor.dni,\"Actor\")){\n\t\t\t\t\t\toManagerCorporation.asociarActorARepesentante(oForm.Representante.value, oActor);\n\t\t\t\t\t\ttoastr.success(oManagerCorporation.altaTrabajador(oActor, tipo));\n\t\t\t\t\t}else{\n\t\t\t\t\t\ttoastr.error(\"Actor registrado previamente\");\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\toForm.reset();\n\t\tdocument.getElementById(\"actor\").style.display = \"none\";\n\t}\t\n\telse\n\t\ttoastr.warning(validacion);\n}", "title": "" }, { "docid": "09f6694f7eab682299e010cf5e5fc9a1", "score": "0.59640986", "text": "static registrarAlumnoByDocentes2() {\n Utilitario.agregarMascara();\n fetch(\"formularioMatricula.html\", {\n method: \"GET\",\n })\n .then(function (response) {\n return response.text();\n })\n .then(function (vista) {\n (Utilitario.getLocal('rol') == 3) ?\n window.location.href = \"principal.html\" : $(\"#mostrarcontenido\").html(vista);\n })\n .finally(function () {\n Utilitario.quitarMascara();\n });\n }", "title": "" }, { "docid": "333a01e85c01af9e2bbb1ac673082240", "score": "0.5959077", "text": "function invioDati() {\n let oggettoMail = `ore giornaliere del ${calendario.value}`;\n let testoMail =\n `INFORMAZIONI GLOBALI%0A%0A\n Data: ${calendario.value}%0A\n Diaria: ${checkRadio(diaria)}%0A\n Ore_Totali (Diurne + Notturne): ${sommaArray(oreTotaliArray)}%0A\n Ore_Notturne: ${sommaArray(oreNotturneArray)}%0A\n Ore_Permesso: ${checkRadio(presenza)}%0A\n Reperibilità: ${checkRadio(reperibilita)}%0A%0A\n\n INFORMAZIONI LAVORI%0A%0A\n ${testoMailLavori}`;\n\n window.location.href = 'mailto:' + noDuplicateArray + \"?subject=\" + oggettoMail + \"&body=\" + testoMail;\n}", "title": "" }, { "docid": "4197a27fdc86870701cd403b19df1e0f", "score": "0.59535444", "text": "function regNewAsessor(obj) {\n bot.telegram.sendMessage(process.env.CHAT_ADMIN,\n `❓ __Пользователь__ ❓\\n \n *ФИО:* \\`${obj.first_name} ${obj.last_name}\\` \\n\n *username:* \\`${obj.username}\\` \\n\n *id:* \\`${obj.id}\\` \\n`, {\n parse_mode: 'MarkdownV2',\n reply_markup: {\n inline_keyboard: [\n [\n {\n text: '✅Предоставить доступ',\n callback_data: `add\\t${obj.id}\\t${obj.username}`\n },\n {\n text: '❌Отказать в доступе',\n callback_data: `cancel\\t${obj.id}\\t${obj.username}`\n }\n ]\n ]\n }\n })\n\n bot.on('callback_query', async (ctx) => {\n\n let dataCallback = ctx.callbackQuery.data.split('\\t')\n switch (dataCallback[0]) {\n case 'add':\n let asessorCheck = await Asessor.find({\n idChatAsessor: dataCallback[1]\n })\n if (asessorCheck.length > 0) {\n //совпадение = дубль\n //delete message\n ctx.deleteMessage()\n //send message admin\n bot.telegram.sendMessage(process.env.CHAT_ADMIN, `\n ⭕ __Пользователь__ ⭕ \\n \n *username:* \\`${dataCallback[2]}\\` \\n\n *id:* \\`${dataCallback[1]}\\` \\n\n уже имеет доступ в систему`, { parse_mode: 'MarkdownV2' })\n //send message asessor\n bot.telegram.sendMessage(dataCallback[1], `✅ У Вас, \\`${dataCallback[2]}\\`, уже есть доступ в систему ✅`, { parse_mode: 'MarkdownV2' })\n\n } else {\n //добавляем\n const asessor = new Asessor({\n idChatAsessor: dataCallback[1],\n username: dataCallback[2]\n })\n await asessor.save()\n //delete message\n ctx.deleteMessage()\n //send message admin\n bot.telegram.sendMessage(process.env.CHAT_ADMIN, `\n ✅ __Пользователь__ ✅ \\n \n *username:* \\`${dataCallback[2]}\\` \\n\n *id:* \\`${dataCallback[1]}\\` \\n\n был успешно добавлен в систему`, { parse_mode: 'MarkdownV2' })\n //send message asessor\n bot.telegram.sendMessage(dataCallback[1], `✅ Вам, \\`${dataCallback[2]}\\`, был предоставлен доступ в систему ✅`, { parse_mode: 'MarkdownV2' })\n }\n break\n case 'cancel':\n //delete message\n ctx.deleteMessage()\n //send message admin\n bot.telegram.sendMessage(process.env.CHAT_ADMIN, `\n 🚫 __Пользователю__ 🚫 \\n \n *username:* \\`${dataCallback[2]}\\` \\n\n *id:* \\`${dataCallback[1]}\\` \\n\n было отказано в доступе в систему`, { parse_mode: 'MarkdownV2' })\n //send message asessor\n bot.telegram.sendMessage(dataCallback[1], `🚫 Вам, \\`${dataCallback[2]}\\`, был отказано в доступе 🚫`, { parse_mode: 'MarkdownV2' })\n break\n }\n })\n}", "title": "" }, { "docid": "d213c09a52bf5c6c83c04d2d0c8799c3", "score": "0.595245", "text": "function entradaUsuarioCambio( form )\n\t{\n\t\tvar regreso;\n\t\t\tregreso = true;\n\t\t\tregreso = vtxtVacio( form.txt_nombre, \"Nombre\" );\n\t\t\tif( regreso )\n\t\t\t\tregreso = vtxtVacio( form.txt_paterno, \"Apellido Paterno\" );\n\t\t\tif( regreso )\n\t\t\t\tregreso = vtxtVacio( form.txt_materno, \"Apellido Materno\" );\n\t\t\tif( regreso )\n\t\t\t\tregreso = vtxtLetra( form.txt_nombre );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtLetra( form.txt_paterno );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtLetra( form.txt_materno );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtTelefono( form.txt_telefono );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtCorreoE( form.txt_mail );\n\t\t\tif ( regreso )\n\t\t\t\tregreso = vtxtRFC( form.txt_rfc );\n\t\treturn regreso;\n\t\t\n\t}", "title": "" }, { "docid": "d13270938652cd4463910c2f29e70b4e", "score": "0.5949615", "text": "function pruebas(req,res){\n\tres.status(200).send({\n\t\tmessage:'Probando el controlador de usuarios y la acción de pruebas',\n\t\tuser:req.user\n\t});\n}", "title": "" }, { "docid": "a6b9315730c98fafa8f8c52781196610", "score": "0.59490764", "text": "function enviarDatos(registro) {\n\n\tlet re = /^(([^<>()\\[\\]\\\\.,;:\\s@”]+(\\.[^<>()\\[\\]\\\\.,;:\\s@”]+)*)|(“.+”))@((\\[[0–9]{1,3}\\.[0–9]{1,3}\\.[0–9]{1,3}\\.[0–9]{1,3}])|(([a-zA-Z\\-0–9]+\\.)+[a-zA-Z]{2,}))$/; \n\t\tif(!re.test(registro.email.value)){\n\t\t\tdocument.getElementById('errormsg'). innerHTML = \" ¡Ingrese su correo electrónico!\";\n\t return false;\n\t } else\n\t\n\t if(registro.password.value.trim().length == 0) {\n\t\tdocument.getElementById('errorpwd'). innerHTML = \" ¡Ingrese su contraseña!\";\n\t\t return false;\n\t } else\n\t if(registro.password.value != registro.confirmacion.value) {\n\t\tdocument.getElementById('errorpwd1'). innerHTML = \"¡La contraseña no coincide!\";\n\t\t return false;\n\t } else\n\t if(registro.género.value === \"\") {\n\t\tdocument.getElementById('errorgenero'). innerHTML = \"¡Seleccione genero musical!\";\n\t\t return false;\n\t } else\n\t if(registro.edades.value === \"\") {\n\t\tdocument.getElementById('erroredad'). innerHTML = \"¡Por favor ingrese su rango etáreo!\";\n\t\t return false;\n\t } else\n\t\t \n\t if (registro.edades.value === \"joven\") {\n\t\tdocument.getElementById('erroredad'). style.display = \"none\";\n\t\tdocument.getElementById('errorjoven'). innerHTML = \"Solo apto para mayores de 18 años.\";\n\t\treturn false;\n\t \n\t} else\n\t \n\t if(!registro.condiciones.checked) {\n\t\tdocument.getElementById('errorterm'). innerHTML = \"Debe aceptar los térrminos y condiciones.\";\n\t\t return false;\n\t } else\n\t alert(\"Se ha registrado correctamente\");\n\t return true;\n\t}", "title": "" }, { "docid": "ab9817e3c814b9c2e7df34006bd30d7c", "score": "0.5948659", "text": "function verificarOrdenCompra(form, accion) {\r\n\tvar organismo = document.getElementById(\"organismo\").value;\r\n\tvar nroorden = document.getElementById(\"nroorden\").value;\r\n\tvar estado = document.getElementById(\"estado\").value;\r\n\tvar codproveedor = document.getElementById(\"codproveedor\").value;\r\n\tvar nomproveedor = document.getElementById(\"nomproveedor\").value;\r\n\tvar dias_entrega = document.getElementById(\"dias_entrega\").value.trim();\r\n\tvar fentrega = document.getElementById(\"fentrega\").value.trim();\r\n\tvar clasificacion = document.getElementById(\"clasificacion\").value;\r\n\tvar formapago = document.getElementById(\"formapago\").value;\r\n\tvar codservicio = document.getElementById(\"codservicio\").value;\r\n\tvar almacen_entrega = document.getElementById(\"almacen_entrega\").value;\r\n\tvar almacen_ingreso = document.getElementById(\"almacen_ingreso\").value;\r\n\tvar nomcontacto = document.getElementById(\"nomcontacto\").value.trim();\r\n\tvar faxcontacto = document.getElementById(\"faxcontacto\").value.trim();\r\n\tvar entregaren = document.getElementById(\"entregaren\").value.trim();\r\n\tvar direccion = document.getElementById(\"direccion\").value.trim();\r\n\tvar instruccion = document.getElementById(\"instruccion\").value.trim();\r\n\tvar observaciones = document.getElementById(\"observaciones\").value.trim();\r\n\tvar detallada = document.getElementById(\"detallada\").value.trim();\r\n\tvar razon = document.getElementById(\"razon\").value.trim();\r\n\tvar impuesto = document.getElementById(\"impuesto\").value.trim();\r\n\tvar total_impuesto = document.getElementById(\"monto_impuestos\").value.trim();\r\n\tvar btInsertarItem = !document.getElementById(\"btInsertarItem\").disabled;\r\n\tvar btInsertarCommodity = !document.getElementById(\"btInsertarCommodity\").disabled;\r\n\tvar detalles = \"\";\r\n\tvar error_detalles = \"\";\r\n\t\r\n\tvar frmdetalles = document.getElementById(\"frmdetalles\");\r\n\tfor(i=0; n=frmdetalles.elements[i]; i++) {\r\n\t\tif (n.name == \"chkdetalles\") detalles += n.title + \"|\";\r\n\t\telse if (n.name == \"txtdescripcion\") detalles += n.value + \"|\";\r\n\t\telse if (n.name == \"txtcodunidad\") detalles += n.value + \"|\";\r\n\t\telse if (n.name == \"txtcantidad\") {\r\n\t\t\tvar cant = new Number(setNumero(n.value));\r\n\t\t\tif (cant <= 0) { error_detalles = \"¡ERROR: No puede ingresar items con cantidad en cero!\"; break; } \r\n\t\t\telse detalles += setNumero(n.value) + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"txtpu\") {\r\n\t\t\tvar pu = new Number(setNumero(n.value));\r\n\t\t\tif (pu <= 0) { error_detalles = \"¡ERROR: No puede ingresar items con precio unitario en cero!\"; break; } \r\n\t\t\telse detalles += setNumero(n.value) + \"|\";\r\n\t\t}\r\n\t\telse if (n.name == \"txtdescp\") detalles += setNumero(n.value) + \"|\";\r\n\t\telse if (n.name == \"txtdescf\") detalles += setNumero(n.value) + \"|\";\r\n\t\telse if (n.name == \"chkexon\") detalles += n.checked + \"|\";\r\n\t\telse if (n.name == \"txtfentrega\") detalles += n.value + \"|\";\r\n\t\telse if (n.name == \"txtccostos\") detalles += n.value + \"|\";\r\n\t\telse if (n.name == \"codpartida\") detalles += n.value + \"|\";\r\n\t\telse if (n.name == \"codcuenta\") detalles += n.value + \"|\";\r\n\t\telse if (n.name == \"txtobs\") detalles += n.value + \";\";\r\n\t}\r\n\tvar len = detalles.length; len--;\r\n\tdetalles = detalles.substr(0, len);\r\n\t\r\n\tif (organismo == \"\" || codproveedor == \"\" || nomproveedor == \"\" || dias_entrega == \"\" || formapago == \"\" || codservicio == \"\" || almacen_entrega == \"\") alert(\"¡Los campos marcados con (*) son obligatorios!\");\r\n\telse if (detalles == \"\") alert(\"¡Debe ingresar por lo menos un detalle a la orden!\");\r\n\telse if (error_detalles != \"\") alert(error_detalles);\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"fphp_ajax_lg.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"modulo=ORDENES-COMPRA&accion=\"+accion+\"&organismo=\"+organismo+\"&nroorden=\"+nroorden+\"&estado=\"+estado+\"&codproveedor=\"+codproveedor+\"&nomproveedor=\"+nomproveedor+\"&fentrega=\"+fentrega+\"&clasificacion=\"+clasificacion+\"&formapago=\"+formapago+\"&codservicio=\"+codservicio+\"&almacen_entrega=\"+almacen_entrega+\"&almacen_ingreso=\"+almacen_ingreso+\"&nomcontacto=\"+nomcontacto+\"&faxcontacto=\"+faxcontacto+\"&entregaren=\"+entregaren+\"&direccion=\"+direccion+\"&instruccion=\"+instruccion+\"&observaciones=\"+observaciones+\"&detallada=\"+detallada+\"&razon=\"+razon+\"&detalles=\"+detalles+\"&btInsertarItem=\"+btInsertarItem+\"&btInsertarCommodity=\"+btInsertarCommodity+\"&impuesto=\"+impuesto+\"&dias_entrega=\"+dias_entrega+\"&total_impuesto=\"+total_impuesto);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp = ajax.responseText;\r\n\t\t\t\tvar datos = resp.split(\"|\");\r\n\t\t\t\t\r\n\t\t\t\tif (datos[0].trim() != \"\") alert(datos[0]);\r\n\t\t\t\telse if (accion == \"INSERTAR\") {\t\t\t\t\t\r\n\t\t\t\t\talert(\"Nueva Orden de Compra \" + datos[1] + \" ha sido creada\");\r\n\t\t\t\t\tcargarPagina(form, 'ordenes_compras.php?limit=0');\r\n\t\t\t\t}\r\n\t\t\t\telse cargarPagina(form, 'ordenes_compras.php?limit=0');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "4181151d54b88b3cd65736dc1c4b1917", "score": "0.5945616", "text": "function recuperar(id) {\n var active = dataBase.result;\n var data = active.transaction([\"clientes\"], \"readonly\");\n var object = data.objectStore(\"clientes\");\n var index = object.index(\"id_cliente\");\n var request = index.get(id);\n\n //$(\"#formu\").show();\n //$(\"#busquedaregistro\").hide();\n\n\n request.onsuccess = function () {\n var result = request.result;\n if (result !== undefined) {\n \n //document.querySelector('#id').value = result.id;\n document.querySelector('#ci').value = result.cedula;\n document.querySelector('#nombre').value = result.nombre;\n document.querySelector('#apellido').value = result.apellido;\n document.querySelector('#direccion').value = result.direccion;\n document.querySelector('#telefono').value = result.telefono;\n\n\n //$('#eliminar').attr(\"disabled\", false);\n $('#btnSubmit').attr(\"disabled\", true);\n $('#editar').attr(\"disabled\", false);\n //$('#ci').attr(\"readonly\", true);\n $(\"#nombre\").focus();\n \n }\n };\n}", "title": "" }, { "docid": "0790f0de9bebae3c892e5042e87d9a74", "score": "0.5945323", "text": "function salvar(){\n //le os campos do formulario\n var codigo = $('#txtCodigo').val();\n var descricao = $('#txtDescricao').val();\n var ativo = 'N';\n if ($('#chbAtivo').is(\":checked\") == true)\n ativo = 'S';\n\n //verifica se o campo descricao esta preenchido\n if (descricao === ''){\n $('#mensagem').show();\n $('#txtDescricao').focus();\n }\n else {\n //prepara o objeto a ser gravado\n grupoUsuario.CodigoGrupoUsuario = codigo;\n grupoUsuario.Descricao = descricao;\n grupoUsuario.Ativo = ativo;\n\n var descricaoAtivo = '';\n if (ativo === 'S')\n descricaoAtivo = 'Sim';\n else\n descricaoAtivo = 'Não';\n \n var dados = JSON.stringify(grupoUsuario);\n\n //verifica se é uma edicao\n if(codigo == 0){\n //var novoCodigo = $('#lista_registros tbody tr').length + 1;\n var novoCodigo = gravar(dados);\n\n //grava as paginas de acesso\n var listaChb = document.getElementsByClassName('pull-right');\n for(i = 0; i < listaChb.length; i++){\n if (listaChb[i].checked){\n var codigoPagina = listaChb[i].id.replace('chb','');\n var controleAcesso = {\n CodigoGrupoUsuario: novoCodigo,\n CodigoPagina: codigoPagina\n }\n var dadosAcesso = JSON.stringify(controleAcesso);\n //grava o controle de acesso\n gravarControleAcesso(dadosAcesso);\n }\n }\n \n $('#lista_registros').append(\n '<tr id=\"linha' + novoCodigo + '\">' +\n '<td>' + descricao + '</td>' +\n '<td>' + descricaoAtivo + '</td>' +\n '<td>' +\n '<button class=\"btn btn-primary btn-xs\" onclick=\"editar('+novoCodigo+')\">Editar</button>&nbsp;' +\n '<button class=\"btn btn-danger btn-xs\" onclick=\"excluir('+novoCodigo+')\">Excluir</button>' +\n '</td>' +\n '</tr>'\n );\n }\n else {\n alterar(dados);\n //limpa controle de acesso\n limpaControleAcesso(codigo);\n //grava as paginas de acesso\n var listaChb = document.getElementsByClassName('pull-right');\n for(i = 0; i < listaChb.length; i++){\n if (listaChb[i].checked){\n var codigoPagina = listaChb[i].id.replace('chb','');\n var controleAcesso = {\n CodigoGrupoUsuario: codigo,\n CodigoPagina: codigoPagina\n }\n var dadosAcesso = JSON.stringify(controleAcesso);\n //grava o controle de acesso\n gravarControleAcesso(dadosAcesso);\n }\n }\n\n var linha = document.getElementById(\"linha\"+codigo);\n var colunas = linha.getElementsByTagName('td');\n colunas[0].innerHTML = descricao;\n colunas[1].innerHTML = descricaoAtivo;\n }\n $('#formulario').modal('hide');\n }\n}", "title": "" }, { "docid": "6392365611ccb41fcd22bbb0eec0a980", "score": "0.5945143", "text": "function amSp4GuardarEditarTransferenciaEnfermedadCronica(CodAccion) {\n \n let data = {};\n let EjecutarModal = false;\n let TituloModal = ''; \n\n /* \n\n Los codigos de accion seran:\n 0 Para inicializar\n 1 Para eliminar\n\n */\n\n if( CodAccion == 0 ){\n \n data.IdHC = idHC;\n data.IdHashUser = \"\";\n data.IdTransf = 0; //si es cero se crea el registro diferente se modifica el registro\n data.A_Empresa = \"\";\n data.A_DireccionTrabajador = \"\";\n data.A_Telefono = \"\";\n data.A_Anamnesis = \"\";\n data.B_Tratamiento = \"\";\n data.B_MotivoTrasferencia = \"\";\n data.B_HoraAtencionDSO = \"16:21\"; \n data.B_HoraEvaluacion = \"16:21\";\n data.C_Tratamiento = \"\";\n data.C_RecibidoPor = \"\";\n data.C_IdHashRecibido = \"\";\n data.C_Lugar = \"\";\n data.C_Fecha = \"2000-01-01\";\n data.CodigoOrigen = \"\";\n data.IdOrigen = idTemporalEC; // aqui debe ir el Id la historia clinica, atencion medica, o de la enfermedad cronica\n data.IdTipoOrigen = 4; // si es enfremedada cronica es 4\n data.IdSV = 0; //si es cero se crea el registro diferente se modifica el registro\n data.PresionArterial_SV = 0;\n data.FrecuenciaCardiaca_SV = 0;\n data.FrecuenciaRespiratoria_SV = 0;\n data.Temperatura_SV = 0;\n data.PesoKg_SV = 0;\n data.Talla_SV = 0; \n data.Saturacion_SV = 0;\n data.IndiceMasaCorporal_SV = 0; \n data.PerimetroAbdominal_SV = 0;\n data.EnfermedadCronicaId = idTemporalEC;\n\n }\n else{\n\n if (validationForm('submit').length > 0) {\n return;\n }\n\n data.IdHC = idHC;\n data.IdHashUser = \"\";\n data.IdTransf = idTemporalTransferencia; //si es cero se crea el registro diferente se modifica el registro\n data.A_Empresa = $(\"#sp4EnferCron_transf_empresa\").val();\n data.A_DireccionTrabajador = $(\"#sp4EnferCron_transf_dir\").val();\n data.A_Telefono = $(\"#sp4EnferCron_transf_tlf\").val();\n data.A_Anamnesis = $(\"#sp4EnferCron_transf_anamnesis\").val();\n data.B_Tratamiento = $(\"#sp4EnferCron_transf_diagCIE10_trat\").val();\n data.B_MotivoTrasferencia = $(\"#sp4EnferCron_transf_diagCIE10_motivo\").val();\n //data.B_HoraAtencionDSO = $(\"#sp4EnferCron_transf_diagCIE10_hora_dso\").val(); \n //data.B_HoraEvaluacion = $(\"#sp4EnferCron_transf_diagCIE10_hora_eval\").val();\n data.B_HoraAtencionDSO = \"16:21\";\n data.B_HoraEvaluacion = \"16:21\";\n data.C_Tratamiento = $(\"#sp4EnferCron_transf_diagCIE10_trat2\").val();\n data.C_RecibidoPor = $(\"#sp4EnferCron_transf_diagCIE10_recibido2\").val();\n data.C_IdHashRecibido = \"\";\n data.C_Lugar = $(\"#sp4EnferCron_transf_diagCIE10_luga_des2\").val();\n data.C_Fecha = $(\"#sp4EnferCron_transf_diagCIE10_fecha2\").val();\n data.CodigoOrigen = \"TR-\"+idTemporalTransferencia;\n data.IdOrigen = idTemporalEC; // aqui debe ir el Id la historia clinica, atencion medica, o de la enfermedad cronica\n data.IdTipoOrigen = 4; // si es enfremedada cronica es 4\n data.IdSV = 0; //si es cero se crea el registro diferente se modifica el registro\n data.PresionArterial_SV = $(\"#dat_hc_presion_arterial_sv\").val();\n data.FrecuenciaCardiaca_SV = $(\"#dat_hc_frecuencia_cardiaca_sv\").val();\n data.FrecuenciaRespiratoria_SV = $(\"#dat_hc_frecuencia_respiratoria_sv\").val();\n data.Temperatura_SV = $(\"#dat_hc_temperatura_sv\").val();\n data.PesoKg_SV = $(\"#dat_hc_peso_sv\").val();\n data.Talla_SV = $(\"#dat_hc_talla_sv\").val(); \n data.Saturacion_SV = $(\"#dat_hc_saturacion_sv\").val();\n data.IndiceMasaCorporal_SV = $(\"#dat_hc_masa_corporal_sv\").val(); \n data.PerimetroAbdominal_SV = $(\"#dat_hc_perimetro_abdominal_sv\").val();\n data.EnfermedadCronicaId = idTemporalEC;\n\n }\n\n let url = apiUrlsho+`/api/hce_Post_017_transferencias?code=x69HnqaaZgWZQTcc61KfkEokA8TYLE6bRUfIxQIwrhOkrrFiYcDVbQ==&httpmethod=post`;\n\n let headers = {\n \"apikey\": constantes.apiKey,\n \"Content-Type\": \"application/json\"\n }\n\n let settings = {\n \"url\": url,\n \"method\": \"post\",\n \"timeout\": 0,\n \"crossDomain\": true,\n \"dataType\": 'json',\n \"headers\": headers,\n \"data\": JSON.stringify(data)\n };\n\n return $.ajax(settings).done((response) => {\n\n idTemporalTransferencia = response.Id;\n paObj_TransferenciaECTemporal[idTemporalTransferencia] = response;\n\n console.log(\"Objeto Temporal Transferencia EC: \"+JSON.stringify(paObj_TransferenciaECTemporal[idTemporalTransferencia]));\n\n if( CodAccion == 1 ){\n\n EjecutarModal = true;\n TituloModal = 'Transferencia anexada con éxito';\n\n }\n\n if( EjecutarModal ){\n\n Swal.fire({\n title: TituloModal,\n iconColor: \"#8fbb02\",\n iconHtml: '<img src=\"./images/sho/check.svg\" width=\"28px\">',\n showConfirmButton: false,\n padding: \"3em 3em 6em 3em \",\n timer: 1500,\n }).then(() => {\n\n handlerUrlhtml('contentGlobal', 'view/sho-hce/enfermedades_cronicas/gestionEnfermedadCronica.html', 'Registrar Enfermedades Crónicas');\n\n });\n\n }\n \n });\n \n}", "title": "" }, { "docid": "cd39ca5ed3461d50f0b20fc3a2b5438e", "score": "0.5938723", "text": "function MostrarDatos(){\n var nssa=$('#NSSA').val();\n //se desabilita el campo de NSSA\n $('#NSSA').attr('disabled',true);\n //se manda a llamar el archivo php\n $.ajax({\n method: 'POST',\n //ruta del archivo php de control\n url: 'control/Paciente.php',\n //datos que se enviaran \n data: {\"NSSA\": nssa,\"Boton\":\"Buscar\"},\n \n // el parametro res es la respuesta que da php mediante impresion de pantalla (echo)\n success: function(res){\n //si no es alguno de los errores programados, si encontró datos\n if(res!= \"Ese paciente no existe\" && res!=\"Error con la sentencia sql\" && res!=\"\"){\n swal({\n title: \"Datos encontrados\"\n });\n //se separan los datos por comas\n var Datos=res.split(\",\");\n //se le asigna a cada campo su parte según el split\n var nombre=Datos[0];\n var apPaterno=Datos[1];\n var apMaterno=Datos[2];\n var calle= Datos[3];\n var numExt=Datos[4];\n if(Datos[5]==\"NULL\"){\n var numInt=\"s/n\";\n }else{\n var numInt=Datos[5];\n }\n var colonia=Datos[6];\n var delegacion=Datos[7];\n\n if(Datos[8]==\"NULL\"){\n var email=\"sin correo electrónico\";\n }else{\n var email=Datos[8];\n }\n if(Datos[9]==\"NULL\"){\n var observaciones=\"sin observaciones\";\n }else{\n var observaciones=Datos[9];\n }\n //los telefonos, depende del tipo que tenga, se selecciona un tipo\n if(Datos[10]>=1){\n var tel1=Datos[11];\n if(Datos[12]=='C'){\n var tipo1=\"Celular\";\n }else{\n var tipo1=\"Fijo\";\n } \n }\n \n if(Datos[10]>=2){\n var tel2=Datos[13];\n if(Datos[14]=='C'){\n var tipo2=\"Celular\";\n }else{\n var tipo2=\"Fijo\";\n } \n }\n\n if(Datos[10]==3){\n var tel3=Datos[15];\n if(Datos[16]=='C'){\n var tipo3=\"Celular\";\n }else{\n var tipo3=\"Fijo\";\n }\n }\n //genera la parte de HTML que se insertará con los datos anteriores\n var textoAInsertar=`\n <dl>\n <dt class=\"shadow p-3 mb-3 LabelPersonalizadoCampoLargo rounded\">Nombre del paciente</dt>\n <dd class=\"ml-5 mb-5\">${nombre} ${apPaterno} ${apMaterno}</dd>\n \n <dt class=\"shadow p-3 mb-3 LabelPersonalizadoCampoLargo rounded\">Domicilio</dt>\n <dd class=\"ml-5\">${calle} No.Ext.${numExt} No.Int.${numInt}</dd>\n <dd class=\"ml-5\">${colonia}</dd>\n <dd class=\"ml-5 mb-5\">${delegacion}</dd>\n\n <dt class=\"shadow p-3 mb-3 LabelPersonalizadoCampoLargo rounded\">Correo electronico</dt>\n <dd class=\"ml-5 mb-5\">${email}</dd>\n\n <dt class=\"shadow p-3 mb-3 LabelPersonalizadoCampoLargo rounded\">Observaciones</dt>\n <dd class=\"ml-5 mb-5\">${observaciones}</dd>\n\n <dt class=\"shadow p-3 mb-3 LabelPersonalizadoCampoLargo rounded\">Telefonos</dt>\n <dd class=\"ml-5\">${tipo1} | ${tel1}</dd> `\n //dependiendo de la cantidad de telefonos encontrados, se mostrarán\n if(Datos[10]>=2){\n textoAInsertar=textoAInsertar+`<dd class=\"ml-5\">${tipo2} | ${tel2}</dd>`\n }\n if(Datos[10]==3){\n textoAInsertar=textoAInsertar+`<dd class=\"ml-5\">${tipo3} | ${tel3}</dd>`\n }\n //se termina de concatenar el texto\n textoAInsertar=textoAInsertar+`</dl>`\n //se agrega el código al div correspondiente\n $('#Datos').append(textoAInsertar);\n //en caso contrario muestra el error\n }else{\n swal({\n title: \"Error\",\n text: res,\n icon: \"warning\"\n })\n }\n }\n });\n}", "title": "" }, { "docid": "41715a6631fcf246867748f727825fb8", "score": "0.5938708", "text": "restablecerUser() {\n document.getElementById(\"btn-registro\").innerHTML=\"REGISTRAR\";\n document.getElementById(\"adduserTitle\").innerHTML=\"Registrar usuario\";\n \n this.funcion=0;\n this.id_user=0;\n this.perfil=null;\n\n document.getElementById(\"fotos\").innerHTML = ['<img class=\"img60\" src=\"', PATHNAME + \"/resource/images/imgFiles/personas/user.png\", '\" title=\"', , '\" />'].join('');\n this.getIdentificaciones(null,1);\n this.getCategorias(null,1);\n //ocultar modal después de guardar los datos\n //$('#adduser').modal('toggle');\n\n $(\"#adduser\").modal('hide');\n $(\"#deleteUser\").modal('hide');\n $('body').removeClass('modal-open');\n $('.modal-backdrop').remove();\n\n //limpiar campos de texto\n document.getElementById(\"nomb_pers\").value = \"\";\n document.getElementById(\"ape_pers\").value = \"\";\n document.getElementById(\"id\").value = \"\";\n document.getElementById(\"direccion\").value = \"\";\n document.getElementById(\"password\").value = \"\";\n //this.getUsers(null,1);\n window.location.href = URL + \"admin/user\";\n }", "title": "" }, { "docid": "276bf89f14c4fd52994021f4127f0d11", "score": "0.5931481", "text": "function checkuserauthO(){\n \n DisplayTbleO('mold_operator_table','mold_operatorsp','Mold Operator List');\n \n}", "title": "" }, { "docid": "27bd04685c04eeeaf4bab780301d7726", "score": "0.59291285", "text": "function habilitarEdicion(){\n elementos.forEach(function(element){\n element.removeAttribute(\"disabled\");\n });\n\n inputPass = document.querySelector('input[name=\"password\"]');\n //LO PONGO EN ROJO PARA QUE EL USUARIO SE DE CUENTA FACILMENTE QUE DEBE COMPLETAR EL CAMPO\n inputPass.classList.add('is-invalid');\n inputPass.setAttribute(\"placeholder\", \"Ingresá tu contraseña para confirmar cambios\");\n\n //DESHABILITO EL MAIL PORQUE NO SE PUEDE CAMBIAR\n inputEmail = document.querySelector('input[name=\"email\"]');\n inputEmail.setAttribute(\"disabled\", \"disabled\");\n\n inputFile = document.querySelector(\".input-file-ale\");\n inputFile.removeAttribute(\"disabled\");\n\n botonEditar = document.querySelector(\"#botonEditar\"); // Desactivo el boton de editar perfil\n botonEditar.disabled = \"disabled\";\n\n botonDescartar = document.querySelector(\"#botonDescartar\");\n botonDescartar.removeAttribute(\"hidden\"); // Remueve el atributo hidden del boton descartar\n\n botonGuardar = document.querySelector(\"#botonGuardar\");\n botonGuardar.removeAttribute(\"hidden\"); // Remueve el atributo hidden del boton guardar\n }", "title": "" }, { "docid": "1f797fac20b8ec0bbb8e0a662787eece", "score": "0.5926072", "text": "function mostraAlunos() {\n\t\t\t\tstr = document.querySelector(\"#entradaNomeID\").value + document.querySelector(\"#entradaCPFID\").value;\n\t\t\t\tif(document.querySelector(\"#entradaNomeID\"))\n\t\t\t\tvar xmlhttp = new XMLHttpRequest();\n\t\t\t\txmlhttp.onreadystatechange = function() {\n\t\t\t\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\t\t\t\tdocument.querySelector(\"#tabela\").innerHTML = this.responseText;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\txmlhttp.open(\"GET\", \"PHJL-WEB-Procura-alunos.php?q=\" + str + \"&tipo=\" + tipoInput + \"&valorfiltro=\" + valorFiltro + \"&tipofiltro=\" + tipoFiltro, true);\n\t\t\t\txmlhttp.send();\n\t\t\t}", "title": "" }, { "docid": "d613dc60c9f8cda7b729e84d4c0c8b36", "score": "0.5921707", "text": "function getDatos (error, fila){\n if (error != null){\n console.log(\"error 500 en getDatosCliente\");\n respuesta.sendStatus(500);\n }else if(fila === undefined){\n console.log(\"error 401 en getDatosCliente\");\n respuesta.sendStatus(401)\n }else{\n console.log(\"envio del objeto con los datos del usuario en getDatosCliente\");\n respuesta.send(fila);\n }\n }", "title": "" }, { "docid": "f87fa59d6aaea41e98eb869b17b47f51", "score": "0.591964", "text": "function DelUsuario(jsonObject)\n{\n var codigoHTML = '<div class=\"encabezado2\">Borrar Usuario</div>'+\n '<div class=\"tabla\">'+\n '<form action=\"\" method=\"POST\" name=\"form_borrar_usuario\">'+\n '<table align=\"center\" border=\"0\" align=\"left\">'+\n '<tr>'+\n '<td colspan=\"2\" rowspan=\"9\" align=\"center\">'+\n '<div class=\"foto\">'+\n '<div class=\"imagen\">'+\n '<img src=\"images/usuario.png\" align=\"center\">'+\n '</div>'+\n '</div>'+\n '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Identificación:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.cedula_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Apellidos:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.apellidos_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Nombres:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.nombre_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Nickname:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.nickname_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Contraseña:</th>'+\n '<td type=\"password\" style=\"font-size:15px; color: #000; font-weight:bold;\">######</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Dirección:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.direccion_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Teléfono:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.telefono_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Celular:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.celular_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<th align=\"right\" style=\"padding-right:5px;\">Fecha Ingreso:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.fecha + '</td>'+\n '<th align=\"right\" style=\"padding-right:5px;\">email:</th>'+\n '<td style=\"font-size:15px; color: #000; font-weight:bold;\">' + jsonObject.email_usuario + '</td>'+\n '</tr>'+\n '<tr>'+\n '<td colspan=\"4\" align=\"center\">'+\n '<input type=\"button\" value=\"Volver\" class=\"button\" id=\"volverAddUsuario\" />'+\n '<a href=\"#DelV\" class=\"button\" name=\"' + jsonObject.id_usuario + '\" id=\"borrarUsuario\" style=\"text-decoration:none; padding:2px 4px 2px 4px;\">Borrar<a/>'+\n '</td>'+\n '</tr>'+\n '</table>'+ \n '</form>'+\n '</div>';\n\n $(\"#datos\").html(codigoHTML);\n activadorEventosUsuarios();\n}", "title": "" }, { "docid": "2a8a01bc1abc8bd91ffb3754e0e5f6e5", "score": "0.5917953", "text": "async indexRegistro(req,res){\n var msgErr = req.flash(\"msgErr\"); //vai atrás da variavel que contém a mensagem\n var msgSuccess = req.flash(\"msgSuccess\"); //vai atrás da variavel que contém a mensagem\n \n var usuarioDaSessaoID = parseInt(req.session.user.id)\n\n var usuario = await Usuario.encontreUsuarioPorID(usuarioDaSessaoID);\n \n msgErr = (msgErr == undefined || msgErr.length == 0 ) ? undefined : msgErr\n msgSuccess = (msgSuccess == undefined || msgSuccess.length == 0 ) ? undefined : msgSuccess\n\n\n var listaDespesas = await Despesas.pegarTodasDespesasDoUsuario(usuario);\n\n var balanca = await Despesas.atualizarValoresDaBalanca(usuario)\n\n if(listaDespesas == undefined){\n listaDespesas = []\n }\n res.render(\"registro_despesa\", {listaDespesas, msgErr,msgSuccess, balanca, usuario});\n }", "title": "" }, { "docid": "0cac0c24dd43b332f9b301fcc1b1a654", "score": "0.59029275", "text": "function registroDocente(string){ \n let nombre = document.getElementById(\"nombre\").value;\n let paterno = document.getElementById(\"paterno\").value;\n let materno = document.getElementById(\"materno\").value;\n let email = document.getElementById(\"email\").value;\n let codigo = document.getElementById(\"codigo\").value;\n let contr = document.getElementById(\"password\").value;\n let contrarepeat = document.getElementById(\"password_repeat\").value;\n let hombre = document.getElementById(\"masculino\").checked;\n let mujer = document.getElementById(\"femenino\").checked;\n let filtro = 'abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890áÁéÉíÍóÓúÚ_.@\" ';//Caracteres validos\n\n email = email.substring((email.length-11),email.length);\n\n let out = '';\n for (var i=0; i<string.length; i++){\n if (filtro.indexOf(string.charAt(i)) != -1){\n out += string.charAt(i);\n }\n }\n if(nombre.length>0 && paterno.length>0 && materno.length>0 && email.length>0 && codigo.length>0 \n && contr.length>0 && contrarepeat.length>0 && (hombre == true || mujer == true) && (contr == contrarepeat)){\n\n //Eliminar espacios\n nombre = nombre.trim();\n paterno = paterno.trim();\n materno = materno.trim();\n email = email.trim();\n codigo = codigo.trim();\n contr = contr.trim();\n contrarepeat = contrarepeat.trim();\n email = email.toLowerCase();\n\n //Cambiar la primera a mayuscula\n nombre = nombre[0].toUpperCase() + nombre.slice(1);\n paterno = paterno[0].toUpperCase() + paterno.slice(1);\n materno = materno[0].toUpperCase() + materno.slice(1);\n \n document.getElementById(\"btnRegistrar\").disabled = false;\n }else{\n document.getElementById(\"btnRegistrar\").disabled = true;\n }\n return out;\n}", "title": "" }, { "docid": "787113cbdeb34edf1f678bdb143afde2", "score": "0.58978534", "text": "function arranque_personalizado()\n{\n\t//peticionAJAX_GET(\"/practica2/rest/viaje/?u=6\");//conexion para los comentarios [funcional]\n\t\tif(sessionStorage.getItem(\"login_session\"))\n\t\t{\n\t\t\t//si esta logueado\n\t\t\tdocument.getElementById(\"noregistrado\").getElementsByTagName(\"h4\")[0].innerHTML = \"Usted esta logeado, puede jugar.\";\n\t\t\tdocument.getElementById(\"noregistrado\").getElementsByTagName(\"h4\")[0].style.color = \"green\";\n\t\t\tdocument.getElementById(\"noregistrado\").style.display = \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById(\"noregistrado\").getElementsByTagName(\"h4\")[0].style.color = \"orange\";\n\t\t\tdocument.getElementById(\"noregistrado\").style.display = \"\";\n\t\t}\n\t\t\n\t\tllamada_ajax_generico(\"GET\",\"clasificacion\");\n}", "title": "" }, { "docid": "bedf2cf4712517f1c09f457de717b0f1", "score": "0.58900714", "text": "function altaTrabajador(){\n\tvar oForm = document.frmAltaTrabajador;\n\tvar sMensaje =\"\";\n\n\tvar dni = oForm.dni.value.trim();\n\tvar nombre = oForm.nombre.value.trim();\n\tvar tlfn = oForm.tlfn.value.trim();\n\tvar nacionalidad = oForm.comboNacionalidad.value.trim();\n\tvar validacion = validarTrabajador();\n\tvar sURL = \"php/altaTrabajador.php\";\n\tvar sParametros;\n\tif (validacion == \"\"){\n\n\n\t\tvar tipo = oForm.tipoTrabajador.value.trim();\n\n\t\tif (tipo == \"Director\") \n\t\t{\n\t\t\tvar oDirector = new Director(dni,nombre,tlfn,nacionalidad);\n\t\t\t\n\t\t\tif(!oManagerCorporation.getTrabajadorPorDniYTipo(oDirector.dni, \"Director\")){\n\t\t\t\t\n\t\t\t\tvar oTrabajador = {\n\t\t\t\t\tdni : oForm.dni.value.trim(),\n\t\t\t\t\tnombre: oForm.nombre.value.trim(),\n\t\t\t\t\ttlfn: oForm.tlfn.value.trim(),\n\t\t\t\t\tnacionalidad: oForm.comboNacionalidad.value.trim(),\n\t\t\t\t\testatus: \"null\",\n\t\t\t\t\trepresentante: \"null\",\n\t\t\t\t\ttipo: \"Director\"\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tsParametros = \"datos=\" + JSON.stringify(oTrabajador);\n\t\t\t\t\n\t\t\t\tpeticionAjax(sURL,sParametros);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t\ttoastr.error(\"Director registrado previamente\");\t\n\t\t}\n\t\telse\n\t\t\tif (tipo == \"Representante\") \n\t\t\t{\n\t\t\t\tvar oRepresentante = new Representante(dni,nombre,tlfn,nacionalidad);\n\t\t\t\tif(!oManagerCorporation.getTrabajadorPorDniYTipo(oRepresentante.dni,\"Representante\")){\n\t\t\t\t\t\n\t\t\t\t\tvar oTrabajador = {\n\t\t\t\t\t\tdni : oForm.dni.value.trim(),\n\t\t\t\t\t\tnombre: oForm.nombre.value.trim(),\n\t\t\t\t\t\ttlfn: oForm.tlfn.value.trim(),\n\t\t\t\t\t\tnacionalidad: oForm.comboNacionalidad.value.trim(),\n\t\t\t\t\t\testatus: \"null\",\n\t\t\t\t\t\trepresentante: \"null\",\n\t\t\t\t\t\ttipo: \"Representante\"\n\t\t\t\t\t};\n\t\t\t\t\tsParametros = \"datos=\" + JSON.stringify(oTrabajador);\n\n\t\t\t\t\tpeticionAjax(sURL,sParametros);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\ttoastr.error(\"Representante registrado previamente\");\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(oForm.Representante.value==\"NoExistenRepresentantes\"){\n\t\t\t\t\ttoastr.error(\"No puedes añadir trabajadores sin representantes.\");\t\n\t\t\t\t}else{\n\t\t\t\t\tvar representante = oManagerCorporation.getTrabajadorPorDniYTipo(oForm.Representante.value,\"Representante\");\n\t\t\t\t\tvar estatus = oForm.estatus.value.trim();\n\t\t\t\t\tvar oActor = new Actor(dni,nombre,tlfn,nacionalidad,estatus,representante);\n\t\t\t\t\tif(!oManagerCorporation.getTrabajadorPorDniYTipo(oActor.dni,\"Actor\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar oTrabajador = {\n\t\t\t\t\t\t\tdni : oForm.dni.value.trim(),\n\t\t\t\t\t\t\tnombre: oForm.nombre.value.trim(),\n\t\t\t\t\t\t\ttlfn: oForm.tlfn.value.trim(),\n\t\t\t\t\t\t\tnacionalidad: oForm.comboNacionalidad.value.trim(),\n\t\t\t\t\t\t\testatus: oForm.estatus.value.trim(),\n\t\t\t\t\t\t\trepresentante: oForm.Representante.value.trim(),\n\t\t\t\t\t\t\ttipo: \"Actor\"\n\t\t\t\t\t\t};\n\t\t\t\t\t\tsParametros = \"datos=\" + JSON.stringify(oTrabajador);\n\t\t\t\t\t\tpeticionAjax(sURL,sParametros);\n\t\t\t\t\t\t\n\t\t\t\t\t\toManagerCorporation.asociarActorARepesentante(oForm.Representante.value, oActor);\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\ttoastr.error(\"Actor registrado previamente\");\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\toForm.reset();\n\t\t\tdocument.getElementById(\"actor\").style.display = \"none\";\n\t\t}\t\n\t\telse\n\t\t\ttoastr.warning(validacion);\n\t}", "title": "" }, { "docid": "e8f58450acf4cde3e8aad5eff6c74675", "score": "0.58827204", "text": "function ActualizarDatosUsuario()\n{\n if($('#NuevoCorreoUsuario').val()==\"\")\n {\n ActualizarDatosUsuario1();\n }else{\n if(ValidacionCorreos($('#NuevoCorreoUsuario').val())==0)\n {\n ActualizarDatosUsuario1();\n }else{\n swal(\"¡Error!\", \"¡La dirección de email \"+$('#NuevoCorreoUsuario').val()+\" es incorrecta... !\", \"warning\"); \n }\n \n }\n\n function ActualizarDatosUsuario1()\n { \n var IdUsuario = $('#IdUsuario').val();\n var NombreUsuario = $('#NuevoNombreUsuario').val();\n var ApellidoUsuario = $('#NuevoApellidoUsuario').val();\n var RolUsuario = $('#NuevoRolUsuario').val();\n var TelefonoUsuario = $('#NuevoTelefonoUsuario').val();\n var CorreoUsuario = $('#NuevoCorreoUsuario').val();\n var ContrasenaUsuario = $('#NuevaContrasenaUsuario').val();\n var NombreProceso=\"ActualizarDatosUsuario\";\n var parametros = {\"NombreProceso\":NombreProceso,\"IdUsuario\":IdUsuario,\"NombreUsuario\" : NombreUsuario,\"ApellidoUsuario\" : ApellidoUsuario,\"RolUsuario\" : RolUsuario,\"TelefonoUsuario\" : TelefonoUsuario,\"CorreoUsuario\" : CorreoUsuario,\"ContrasenaUsuario\" : ContrasenaUsuario};\n $.ajax({\n data: parametros,\n url: '../modulos/parametrizacion/funciones.php',\n type: 'post',\n beforeSend: function () {\n // $(\"#ResultadoActualizarDatos\").html(\"Procesando, espere por favor...\");\n },\n success: function (response) {\n \n if(response.trim()==\"ACTUALIZO\")\n {\n swal(\"¡Bien!\", \"Se ha actualizado el usuario\", \"success\");\n }\n if(response.trim()==\"NOACTUALIZO\")\n {\n swal(\"¡Error!\", \"No se ha actualizado el usuario\", \"error\");\n }\n if(response.trim()==\"ERROR\")\n {\n swal(\"¡Error!\", \"El usuario ya existe verifique los campos\", \"warning\");\n }\n var url=\"../modulos/parametrizacion/MostrarUsuarios.php\" \n cargar(url,\"TablaRecarga\");\n }\n }); \n\n } \n \n\n}", "title": "" }, { "docid": "3e3069dab69b894fa36e2d96edcc8446", "score": "0.5877764", "text": "function carregar_dados_usuario() { \n\n if(usuarioLogado.tipo == false){\n\n document.getElementById ('disciplina').hidden = true;\n document.getElementById ('valor').hidden = true;\n document.getElementById ('link').hidden = true;\n\n let inputUsername = document.getElementById('user');\n let inputName = document.getElementById('name');\n let inputEmail = document.getElementById('email');\n \n inputUsername.value = usuarioLogado.username;\n inputName.value = usuarioLogado.nome;\n inputEmail.value = usuarioLogado.email;\n\n } else {\n\n document.getElementById ('disciplina').hidden = false;\n document.getElementById ('valor').hidden = false;\n document.getElementById ('link').hidden = false;\n\n let inputUsername = document.getElementById('user');\n let inputName = document.getElementById('name');\n let inputEmail = document.getElementById('email');\n let inputDisciplina = document.getElementById('disciplina');\n let inputValor = document.getElementById('valor');\n let inputLink = document.getElementById('link');\n \n inputUsername.value = usuarioLogado.username;\n inputName.value = usuarioLogado.nome;\n inputEmail.value = usuarioLogado.email;\n inputDisciplina.value = usuarioLogado.disciplina; \n inputValor.value = usuarioLogado.valor;\n inputLink.value = usuarioLogado.link; \n }\n\n }", "title": "" }, { "docid": "0b473a3301695d48f813a998267f9bd3", "score": "0.5877622", "text": "function validar_contra(){\n\t/**\n\t * se definen las variables para capturar la informacion de los \n * input de los formularios de actualizar la clave en los 3 perfiles\n * (usuario,supervisor,vigilante). \n * \n * getElementById permite seleccionar un elemento del formulario registro \n * por medio del valor del atributo id que se haya asignado.\n * \n\t * @var String clave2\n\t * @var String clave \n\t */\n var clave, clave2, expre;\n clave = document.getElementById(\"clave\").value;\n clave2 = document.getElementById(\"clave2\").value;\n\t/**\n\t * se definen las variables que contendran una combinacion de carácteres\n * dentro de una cadena de texto (expresiones regulares).\n * \n * @var String expre =\t Contiene el patron que de caracteres que se debe \n * llevar la contraseña, exigiendo una \n * mayúscula, minúscula y un número:\n * //: dentro debe ir el patron de carácteres.\n * ^(?=.*\\d): exige numeros.\n * (?=.*[a-z]): exige una minúscula.\n * (?=.*[A-Z]): exige una mayúscula.\n * .{0,30}$ : debe contener minimo 6 y maximo 30 carácteres.\t \n\t */\n expre = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{0,30}$/;\n /**\n * si las variables estan vacias mostrara una alerta.\n */\n if(clave === \"\" || clave2 === \"\"){\n /**\n * se llama la funcion Swal.fire de la libreria SweetAlert2(agregada en el archivo perfil_supervisor.php,\n * perfil_usuario.php, perfil_vigilante.php) para mostrar la alerta\n */\n Swal.fire({\n title: 'Ups!',\n text: 'Todos los campos son obligatorios', \n confirmButtonText: 'Aceptar', \n confirmButtonColor: '#1ABC9C',\n backdrop: false\n });\n return false;\n }\n /**\n * si la variable clave es mayor a 80 o menor a 6 caracteres, se mostrara una alerta.\n */\n else if(clave.length>80 || clave.length<6){\n /**\n * se llama la funcion Swal.fire de la libreria SweetAlert2(agregada en el archivo perfil_supervisor.php,\n * perfil_usuario.php, perfil_vigilante.php) para mostrar la alerta\n */\n Swal.fire({\n title: 'Ups!',\n text: 'La contraseña debe ser de más de 6 y menos de 80 caracteres', \n confirmButtonText: 'Aceptar', \n confirmButtonColor: '#1ABC9C',\n backdrop: false\n });\n return false;\n }\n /**\n * si la variable clave es diferente a la variable expre, se mostrara una alerta.\n */\n else if(!expre.test(clave)){\n /**\n * se llama la funcion Swal.fire de la libreria SweetAlert2(agregada en el archivo perfil_supervisor.php,\n * perfil_usuario.php, perfil_vigilante.php) para mostrar la alerta\n */\n Swal.fire({\n title: 'Ups!',\n text: 'La contraseña debe tener al menos una minuscula, mayuscula y un número', \n confirmButtonText: 'Aceptar', \n confirmButtonColor: '#1ABC9C',\n backdrop: false\n });\n return false; \n }\n}", "title": "" }, { "docid": "944c8db1406a9a0a0ff12b7550f17ba1", "score": "0.5877549", "text": "function fn_acciones(){\n var eje_fun = \"fn_juzgado\"\n if(accion_btn == 2)\n eje_fun = \"fn_anular\";\n else\n if(accion_btn = 3)\n eje_fun = \"fn_finalizar\";\n \n parameters = \n {\n\t\t\"func\":eje_fun,\n\t\t\"empresa\":$(\"#tx_empresa\").val(),\n \"p_rol\":$(\"#tx_rol\").val(),\n \"Ip\":$(\"#tx_ip\").val(),\n \"p_cliente\":$(\"#tx_cliente\").val(),\n \"p_accion\":\"5\", //accion de actualizar valorización\n \"p_nombre_val\":$(\"#tx_nombre_val\").val(),\n \"p_tipo_doc\":$(\"#cb_tipo_doc\").val(),\n \"p_documento\":dato_id,\n \"p_finca\":$(\"#tx_finca\").val(),\n \"p_tomo\":$(\"#tx_tomo\").val(),\n \"p_folio\":$(\"#tx_folio\").val(),\n \"p_obs\":$(\"#tx_obs_valorizar\").val() \n \n };\n\n $(\"#dlg_valorizar\").modal(\"hide\");\n \n HablaServidor(my_url,parameters,'text', function(text) \n {\n if(text == \"\")\n fn_mensaje_boostrap(\"ACCIÓN REALIZADA\", g_tit, $(\"#\"));\n \n });\n}", "title": "" }, { "docid": "c081047c00f1265c010f8bac0b0d84ca", "score": "0.58775336", "text": "function carga_datos_emergente(tipo_acc,flag,num){\r\n\t\tvar onclick=\"\",val_txt=\"\",titulo=\"\";//declaramos variables\r\n\t\tif(tipo_acc=='inventario'){//si es por inventario\r\n\t\t//asignamos el evento de verificar pass por inventario\r\n\t\t\tval_txt='value=\"Solo cambiar este Inventario\"';\r\n\t\t}else if(tipo_acc=='mantener_cantidad'){//si es por mantener una presentación incompleta\r\n\t\t//asignamos el evento para verificar pass y mantener presentacion incompleta\r\n\t\t\tval_txt='value=\"Mantener presentación incompleta\"';\r\n\t\t\tedicionTemporal=0;\r\n\t\t\tflag=\"1\";\r\n\t\t}\r\n\t//formamos datos a cargar en pantalla emeregente\r\n\t\tvar info_pantalla='<p align=\"right\" style=\"position:relative;top:-20px;\"><input type=\"button\" value=\"X\" onclick=\"verifica_pass_inventario('+num+','+edicionTemporal+','+($(\"#\"+flag+\"_\"+num).html()).trim()+',-1);\" style=\"padding:5px;border:1px black;background:red;color:white;border-radius:5px;\"></p>';\r\n\t\tinfo_pantalla+='Pida al encargado de la Sucural que introduzca la contraseña:<br>';\r\n/*modificación Oscar 12.11.2018 para hacer tipo password un tipo text*/\r\n\t\tinfo_pantalla+='<input type=\"text\" style=\"padding:10px;font-size:25px;\" id=\"pass_inventario_1\" onkeyDown=\"cambiar(this,event,\\'pass_inventario\\')\"><br>';\r\n\t\tinfo_pantalla+='<input type=\"hidden\" id=\"pass_inventario\" value=\"\">';\r\n\t\tinfo_pantalla+='<input type=\"button\" '+val_txt+' onclick=verifica_pass_inventario('+num+','+edicionTemporal+','+($(\"#\"+flag+\"_\"+num).html()).trim()+',0,\\''+tipo_acc+'\\'); style=\"padding:10px;border-radius:6px;\"> ';\r\n/*fin de cambio Oscar 12.11.2018*/\r\n\t\tif(tipo_acc=='inventario'){\r\n\t\t\tinfo_pantalla+='<input type=\"button\" value=\"Cambiar varios Inventarios\" onclick=verifica_pass_inventario('+num+','+edicionTemporal+','+($(\"#\"+flag+\"_\"+num).html()).trim()+',1,\\''+tipo_acc+'\\'); style=\"padding:10px;border-radius:6px;\">';\r\n\t\t}\r\n\t//mostramos emergente\r\n\t\t$(\"#mensaje_pres\").html(info_pantalla);\r\n\t\t$(\"#cargandoPres\").css(\"display\",\"block\");\r\n\t}", "title": "" }, { "docid": "f2a44fa3604d2f48798e937de7017005", "score": "0.58762866", "text": "function hospitalAlta(){\n creaBorraDiv(\"hospital\");\n //Lista de entry tipo texto\n let propiedades=[\"Nombre\",\"Localidad\",\"Responsable\"];\n creaFormulario(propiedades,\"visualizacion\"+\"hospital\"); \n}", "title": "" }, { "docid": "3928048c5575d37a662efaa9d06e77d3", "score": "0.5876079", "text": "function obtenerDatosActual() {\n let infoUsuarioActual = [];\n\n let id = inputIdUsuario.value;\n sNombre = inputNombre.value;\n sPrimerApellido = inputPrimerApellido.value;\n sSegundoApellido = inputSegundoApellido.value;\n nCedula = inputCedula.value;\n dFecha = inputFecha.value;\n sCorreo = inputCorreo.value;\n nTelefono = inputTelefono.value;\n sDireccion = inputDireccion.value;\n sProvincia = inputProvincia.value;\n sCanton = inputCanton.value;\n sDistrito = inputDistrito.value;\n sRol = inputRol.value;\n sEstado = inputEstado.value;\n\n\n let bError = false;\n bError = validarUsuario();\n\n if (bError) {\n swal({\n title: 'Actualización incorrecta',\n text: 'No se pudo actualizar el usuario, verifique que completó correctamente la información que se le solicita',\n type: 'warning',\n confirmButtonText: 'Entendido'\n });\n } else {\n swal({\n title: 'Actualización correcta',\n text: 'El usuario se actualizó correctamente',\n type: 'success',\n confirmButtonText: 'Entendido'\n });\n infoUsuarioActual.push(id, imagenUrl, sNombre, sPrimerApellido, sSegundoApellido, nCedula, dFecha, sCorreo, nTelefono, sDireccion, sProvincia, sCanton, sDistrito, sRol, sEstado);\n actualizarUsuario(infoUsuarioActual);\n $('.swal2-confirm').click(function () {\n reload();\n });\n botonRegistrar.hidden = false;\n botonActualizar.hidden = true;\n divEstado.hidden = true;\n }\n}", "title": "" }, { "docid": "5462282da936cca24e6efaf707df58d4", "score": "0.5868737", "text": "function cargarNuevoCliente() {\n\t//resultado de la operacion\n\ttry {\n\t\tres = document.getElementById('r_operation').value;\n\t\tif (res == '1') {\n\t\t\tci_dni_valor = document.getElementById('r_ci_dni').value;\n\t\t\tapellidos_valor = document.getElementById('r_apellidos').value;\n\t\t\tnombres_valor = document.getElementById('r_nombres').value;\n\t\t\ttelefonos_valor = document.getElementById('r_telefonos').value;\n\t\t\temail_valor = document.getElementById('r_email').value;\n\n\t\t\tci_dni = document.getElementById('ci_dni');\n\t\t\tapellidos = document.getElementById('apellidos');\n\t\t\tnombres = document.getElementById('nombres');\n\t\t\ttelefonos = document.getElementById('telefonos');\n\t\t\temail = document.getElementById('email');\n\n\t\t\tci_dni.value = ci_dni_valor;\n\t\t\tapellidos.value = apellidos_valor;\n\t\t\tnombres.value = nombres_valor;\n\t\t\ttelefonos.value = telefonos_valor;\n\t\t\temail.value = email_valor;\n\n\t\t\tcliente_detalle = document.getElementById('cliente_detalle');\n\t\t\tponer = apellidos.value + ' ' + nombres.value + ', CI/DNI: ' + ci_dni.value + ', Fonos: ' + telefonos.value;\n\t\t\tcliente_detalle.innerHTML = poner;\n\t\t}\n\t}\n\tcatch (e) {\n\t\t//\n\t\talert('error');\n\t}\n\n}", "title": "" }, { "docid": "fd52ff95e80158e2915e675f6b04ff67", "score": "0.5867889", "text": "function sv_actualizarArreglo(CantidadCierre){\n\n\n log(\"Marcando nueva cantidad en caja..\"+CantidadCierre);\n \n\n\tvar\turl = \"arqueoservices.php?modo=actualizarCantidadCaja&IdLocal=\"+Local.IdLocalActivo+\n\t\t\"&cantidad=\"+escape(CantidadCierre)+\"&r=\" + Math.random();\n\tvar xrequest = new XMLHttpRequest();\n\t\n\txrequest.open(\"POST\",url,false);\n\txrequest.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded; charset=UTF-8\");\n\txrequest.send(null);\t\n\n\tvar res = xrequest.responseText;\t\n}", "title": "" }, { "docid": "c08f6efe3c3a3acc4a7c476d271f77c3", "score": "0.5865874", "text": "function AccionesPedidos(idAccion,idPedido,idFactura='',Observaciones=''){ \r\n \r\n if(idAccion === 1 || idAccion === 2 || idAccion === 3){\r\n //Observaciones=CapturarObservaciones(\"Por favor escriba por qué eliminará el pedido\");\r\n //Observaciones = prompt(\"por favor indicar el por qué se eliminará el item\", \"\");\r\n if(Observaciones === '' || Observaciones === null || Observaciones === undefined){\r\n alertify.alert(\"Debe escribir el por que se descarta el pedido\");\r\n return;\r\n }\r\n \r\n }\r\n var form_data = new FormData();\r\n form_data.append('Accion', idAccion);\r\n form_data.append('Observaciones', Observaciones);\r\n form_data.append('idPedido', idPedido);\r\n if(idFactura != \"\"){\r\n form_data.append('idFactura', idFactura);\r\n }\r\n $.ajax({\r\n url: 'Consultas/Restaurante.process.php',\r\n dataType: \"json\",\r\n cache: false,\r\n processData: false,\r\n contentType: false,\r\n data: form_data,\r\n type: 'POST',\r\n success: (data) =>{\r\n //console.log(data);\r\n \r\n if(data.msg==='OK'){\r\n if(idAccion===1){\r\n alertify.success(\"Se ha descartado el pedido \"+idPedido+\", por: \"+Observaciones); \r\n TimersPedidos(1);\r\n }\r\n if(idAccion===2){\r\n alertify.success(\"Se ha descartado el Domicilio \"+idPedido+\", por: \"+Observaciones); \r\n TimersPedidos(2);\r\n }\r\n if(idAccion===3){\r\n alertify.success(\"Se ha descartado el servicio para llevar \"+idPedido+\", por: \"+Observaciones); \r\n TimersPedidos(3);\r\n }\r\n if(idAccion===4){\r\n alertify.success(\"Se ha impreso el pedido \"+idPedido); \r\n \r\n }\r\n if(idAccion===5){\r\n alertify.success(\"Se ha impreso el domicilio \"+idPedido); \r\n \r\n }\r\n if(idAccion===6){\r\n alertify.success(\"Se ha impreso el servicio para llevar \"+idPedido); \r\n \r\n }\r\n if(idAccion===7){\r\n alertify.success(\"Precuenta del pedido \"+idPedido+\" impresa\"); \r\n \r\n }\r\n if(idAccion===8){\r\n alertify.success(\"Factura Impresa\"); \r\n \r\n }\r\n if(idAccion===9){\r\n alertify.alert(\"Turno Cerrado\"); \r\n TimersPedidos(99);\r\n document.getElementById('DivPedDom').innerHTML ='Turno Cerrado';\r\n }\r\n }\r\n \r\n if(data.msg===\"SD\"){\r\n alertify.alert(\"No se recibiron todos los datos\");\r\n }\r\n \r\n \r\n },\r\n error: function(xhr, ajaxOptions, thrownError){\r\n alert(xhr.status);\r\n alert(thrownError);\r\n }\r\n })\r\n \r\n}", "title": "" }, { "docid": "2b9247062cdc5ff20f5fd51ff1c40dc3", "score": "0.58630997", "text": "function registrar() {\n\n\tvar path = 'assets/php/pacientes.php';\n\tvar btn = document.getElementById(\"btnRegistrar\").value; //Obtiene el valor del control por medio del ID\n\tvar exped = document.getElementById(\"txtExp\").value;\n\tvar nom = document.getElementById(\"txtNombre\").value; //Obtiene el valor del control por medio del ID\n\tvar ape = document.getElementById(\"txtApellido\").value;\n\tvar dir = document.getElementById(\"txtDireccion\").value;\n\tvar stat = $('input:radio[name=\"rdoEstado\"]:checked').val();\n\tvar fecN = document.getElementById(\"dtpNac\").value;\n\tvar tel = document.getElementById(\"txtTel\").value;\n\tvar numhab = $('select[name=\"numHab\"]').val();\n\tvar diag = $('select[name=\"diagnostico\"]').val();\n\tvar med = $('select[name=\"medicos\"]').val();\n\t$.ajax({\n\t\ttype:'POST',\n\t\turl:path,\n\t\tdata: {opc: btn, expediente: exped, nombre: nom, apellidos: ape, direccion: dir, estado: stat, fechaN: fecN, telefono: tel, habitacion: numhab, diagnostico: diag, medico: med}, //Aquí le pasa los datos al file de php que los puede leer por el $_POST\n\t\tsuccess:function(response){ //Se devuelve el echo que de el script\n\t\tsetTimeout(function(){// wait for 5 secs(2)\n\t\t\tlocation.reload(); // then reload the page.(3)\n\t\t}, 2000);\t\n\t\tif (response.substring(0,1) == '1') { //Si el primer caracter es 1, quiere decir que todo salió bien\n\t\tnotifyUser('Éxito!','success',response.substring(2)); //Aquí manda a llamar la funcion que muestra la notificacion de resultado\n\t\t} //Se le pasa el titulo, tipo(o sea error, correcto, etc) y el response.substring le pasa el resultado que dió la base\n\t\telse{ //Sino hay algun error\n\t\tnotifyUser('Error!','error',response.substring(2));\n\t\t}\n\t\t},\n\t\terror:function(){\n\t\talert(\"Error al ejecutar la funcion\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "debfcae6068a68a3feb1fd1e16b286db", "score": "0.5861872", "text": "async function cadastrarLoja() {\r\n if (\r\n validaDadosCampo(['#nome', '#cpfCnpj', '#telefone', '#email', '#endereco'])\r\n ) {\r\n let json = `{\"name\":\"${$('#nome').val()}\",`\r\n json += `\"identification\":\"${$('#cpfCnpj').val()}\",`\r\n json += `\"phone\":\"${$('#telefone').val()}\",`\r\n json += `\"email\":\"${$('#email').val()}\",`\r\n json += `\"address\":\"${$('#endereco').val()}\"}`\r\n\r\n try {\r\n await requisicaoPOST('shops', JSON.parse(json), {\r\n headers: { Authorization: `Bearer ${buscarSessionUser().token}` },\r\n })\r\n mensagemDeAviso('Cadastrado com sucesso!')\r\n autenticacaoLoja();\r\n } catch (error) {\r\n mensagemDeErro(`Não foi possível cadastrar! Erro: ${error}`)\r\n }\r\n } else {\r\n mensagemDeErro('Preencha todos os dados!')\r\n mostrarCamposIncorreto(['nome', 'cpfCnpj', 'telefone', 'email', 'endereco'])\r\n }\r\n}", "title": "" }, { "docid": "16cf92140d31ba9c254f5f81677cd4f2", "score": "0.5861773", "text": "function hacerRegistro(frm){\r\n let fd = new FormData(frm),\r\n url = 'api/usuarios/registro';\r\n\r\n console.log(permiteRegistro);\r\n if(permiteRegistro == true){\r\n fetch(url,{method:'POST',body:fd}).then(function(respuesta){\r\n if(respuesta.ok){\r\n respuesta.json().then(function(datos){\r\n console.log(\"Registro: \");\r\n console.log(datos);\r\n document.getElementById(\"formRegistro\").reset();\r\n let html = '';\r\n html += '<article>';\r\n html += '<h2>Registro correcto</h2>';\r\n //html += '<p>La operación de login se ha realizado correctamente';\r\n html += '<p>Los datos introducidos son correctos y el registro se ha efectuado correctamente.</p>';\r\n html += '<footer><button onclick = \"cerrarMensajeModal(2);\">Aceptar</button>';\r\n html += '</article>';\r\n mensajeModal(html);\r\n });\r\n }\r\n });\r\n\r\n }else{//permiteRegistro == false\r\n let html = '';\r\n html += '<article>';\r\n html += '<h2>Error en el registro</h2>';\r\n //html += '<p>La operación de login se ha realizado correctamente';\r\n html += '<p>Los datos introducidos no son correctos para efectuar el registro.Por favor, vuelva a intentarlo.</p>';\r\n html += '<footer><button onclick = \"cerrarMensajeModal(0);\">Aceptar</button>';\r\n html += '</article>';\r\n mensajeModal(html);\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "bd52e88d6690e81545b420adac699227", "score": "0.58617", "text": "function altaContrato(){\n\t\tvar id = oManagerCorporation.contratos.length;\n\t\tvar oForm = document.frmAltaContrato;\n\t\tvar fechaIni = oForm.fechaInicio.value.trim();\n\t\tvar fechaFin = oForm.fechaFin.value.trim();\n\t\tvar papel = oForm.papel.value.trim(); \n\t\tvar idProduccion = oForm.produccionSeleccionada.selectedOptions[0].getAttribute(\"idproduccion\");\n\t\tvar dniActor = oForm.actorSeleccionado.value.trim();\n\t\tvar pago = oForm.pago.value.trim();\n\t\tvar validacion = validarContrato();\n\t\tvar sRuta = \"php/altaContrato.php\";\n\t\tif (validacion == \"\"){\n\t\t\t\n\t\t\tvar oContrato = {\n\t\t\t\tfechaIni: fechaIni,\n\t\t\t\tfechaFin:fechaFin,\n\t\t\t\tpapel: papel,\n\t\t\t\tpago:pago,\n\t\t\t\tactor: dniActor,\n\t\t\t\tproduccion: idProduccion\n\t\t\t};\n\t\t\t\n\t\t\t\n\t\t\t$.ajax({url:sRuta,\n\t\t\t\tdata : \"datos=\" + JSON.stringify(oContrato),\n\t\t\t\tdataType: \"jsonp\",\n\t\t\t\tcomplete: exitoContrato\n\t\t\t});\n\t\t\t\n\n\t\t//oForm.reset();\n\t}\t\n\telse\n\t\ttoastr.warning(validacion);\n}", "title": "" }, { "docid": "27003021298382460616bc65a2a58bbc", "score": "0.5858468", "text": "function crear_presentancion_usuario(seccion,nombre,id,typeButton, txtButton){\n $(\"<div>\" ,{\n id : 'cuerpo_presentacion',\n class: 'cuerpo_presentacion_class'\n }).append($('<div>',{\n id: 'panel-primary',\n class : 'panel panel-primary'\n }).append($('<div>',{\n id: 'panel-body',\n class : 'panel-body'\n }).append($('<img>',{\n id: 'presentacion_imagen',\n src : '/static/imagenes/car1.png'\n }),$('<div>',{\n id:\"presentacion_cuerpo_body\"\n }).append($('<a>',{\n class:'presentacionNombre',\n id:'presentacion_bodynombre',\n href:'#',\n title: 'Ver Perfil'\n }).append($('<span>',{\n class: 'presentacionTextNombre',\n text: nombre,\n value: id\n })),$('<label>',{\n id:'presentacion_bodyID',\n class: 'label_user',\n text:id\n })),$('<div>',{\n value: id,\n class: 'click_button'\n }).append($('<div>',{\n class : 'btn_seguir'\n }).append($('<button>',{\n id:'button_seguir',\n class : 'btn btn-'+ typeButton+' center-block',\n text:txtButton,\n name : 'botones__seguir'\n })))))).hide().appendTo(\".list_seg\").fadeIn('slow');\n\n}", "title": "" }, { "docid": "cbdb280b55ffbe7c89f6658a414ae159", "score": "0.5852082", "text": "function Registrar_usuario()\n{\nvar numero_id=document.getElementById(\"txtId\").value;\nvar nombre=document.getElementById(\"txtNombre\").value;\nvar clave=document.getElementById(\"txtPassword\").value;\nvar tipo_usuario=document.getElementById(\"sregistro\").value;\n\n\nvalor_enviar=numero_id+'//'+nombre+'//'+clave+'//'+tipo_usuario;\nif(numero_id==\"\" || nombre==\"\" || clave==\"\" || tipo_usuario==\"\")\n{\nalert(\"ERROR, FALTAN DATOS POR COMPLETAR...\");\n\n}\nvar value =valor_enviar;\n\njQuery.ajax({\t\n\t\t type: \"POST\",\n url:'usuarios/crear_nuevo_cliente.php',\n\t\t\tasync: false,\n\t\t\tdata:{value:value},\n success:function(respuesta){\n\t \n\t\t\t\talert(respuesta)\n\t\t\t\twindow.close();\n\t\t\t\t\t\t\t\t\t\t},\n error: function () {\n\t\t\t\t alert(\"Error inesperado\")\n\t\t\t\t window.top.location =\"../index.html\";\t\n\t\t\t}\n });\n}", "title": "" }, { "docid": "3c299272c96013356c2ba433c76a594e", "score": "0.58506846", "text": "async function telaRecuperacaoSenha() {\r\n let codigoHTML = ''\r\n try {\r\n const questao = await requisicaoGET(\r\n `forgot?name=${document.getElementById('login').value}`,\r\n null\r\n )\r\n\r\n codigoHTML =\r\n '<h3 class=\"text-center\" style=\"margin-top:30px;\">Recuperar conta</h3>'\r\n codigoHTML += '<div class=\"text-center\" style=\"margin-top:10px;\">'\r\n codigoHTML += '<div class=\"form-row col-4 rounded mx-auto d-block\">'\r\n codigoHTML += `<label for=\"pergunta\">Responda a pergunta de segurança: ${questao.data.question}</label>`\r\n codigoHTML +=\r\n '<input id=\"pergunta\" type=\"text\" class=\"form-control mb-2 mousetrap\" placeholder=\"Resposta\">'\r\n codigoHTML += '<div class=\"input-group mb-3\">'\r\n codigoHTML +=\r\n '<input id=\"novaSenha\" type=\"password\" class=\"form-control mousetrap\" placeholder=\"Digite uma nova senha\" aria-describedby=\"recuperarsenhabutton\">'\r\n codigoHTML += '<div class=\"input-group-append\">'\r\n codigoHTML += '<button class=\"btn btn-outline-secondary btn-sm\" type=\"button\" id=\"recuperarsenhabutton\" onmouseover=\"document.getElementById(\\'novaSenha\\').type=\\'text\\'\" onmouseout=\"document.getElementById(\\'novaSenha\\').type=\\'password\\'\"><span class=\"fas fa-eye\"></span></button>'\r\n codigoHTML += '</div>'\r\n codigoHTML += '</div>'\r\n codigoHTML +=\r\n '<button onclick=\"if(validaDadosCampo([\\'#pergunta\\',\\'#novaSenha\\'])){confirmarAcao(\\'Recuperar senha desta conta!\\',\\'recuperarSenha();\\'); animacaoSlideUp([\\'#areaRecuperarSenha\\'])}else{mensagemDeErro(\\'Preencha os campos resposta e nova senha!\\'); mostrarCamposIncorreto([\\'pergunta\\',\\'novaSenha\\']);}\" type=\"button\" class=\"btn btn-success border border-dark col-md-4\">'\r\n codigoHTML += '<span class=\"fas fa-user-lock\"></span> Recuperar'\r\n codigoHTML += '</button>'\r\n codigoHTML += '</div>'\r\n codigoHTML += '</div>'\r\n\r\n document.getElementById('areaRecuperarSenha').innerHTML = codigoHTML\r\n animacaoSlideDown(['#areaRecuperarSenha']);\r\n } catch (error) {\r\n mensagemDeErro('Usuário não existente!')\r\n }\r\n}", "title": "" }, { "docid": "69378ff287db6aa1357a318febf942b4", "score": "0.5846202", "text": "function confirma_alter_adSite(){\n\t\tif (window.confirm('Desejas alterar realmente seus dados?')){\n\t\t login=document.getElementById('lo').value;\n\t\t\tnome=document.getElementById('n0').value;\n\t\t\tsenha=document.getElementById('s0').value;\n\t\t\t\n\t\t\tc=\"funcoes_php_requeridas.php?f=26&l0=\"+login+\"&n0=\"+nome+\"&s0=\"+senha;\n\t\t\tloadXMLDoc(c);\n\t\t}\n\t\telse {\n\t\t alert('Ok, os dados deste administrador não serão alterados!');\n\t\t}\n\t}", "title": "" }, { "docid": "4364a681d34d565b631484e712d80a50", "score": "0.58457", "text": "function fn_act_analista(){\n \n parameters = \n {\n\t\t\"func\":\"fn_act_analista\",\n\t\t\"empresa\":$(\"#tx_empresa\").val(),\n \"p_rol\":$(\"#tx_rol\").val(),\n \"Ip\":$(\"#tx_ip\").val(),\n \"p_cliente\":$(\"#tx_cliente\").val(),\n \"p_accion\":\"5\", //accion de actualizar analista\n \"p_analista\":$(\"#cb_analista\").val(),\n \"p_obs_ini\":$(\"#tx_obs_analista\").val()\n \n };\n\n HablaServidor(my_url,parameters,'text', function(text) \n {\n if(text == \"\")\n fn_mensaje_boostrap(\"ACCIÓN REALIZADA\", g_tit, $(\"#\"));\n \n });\n}", "title": "" }, { "docid": "e0eadabe6d47238b20f561caf667c154", "score": "0.5844316", "text": "function cnsAml_liberaAcesso(fCustom){\n if (!TestaAcesso('M.LIVRE')) { //usuario sem acesso fecha janela\n swal({\n title: \"Atenção\",\n text: \"Você não possuí acesso a essa tela, ela será fechada!<br>\" +\n \"Nome do acesso necessário: M.LIVRE\",\n type: \"warning\",\n html: true,\n },\n function() {\n if(empty($CNSAMLdimmer)){\n var win = window.open(\"\", \"_self\");\n win.close();\n }else{\n cnsAml_fecha();\n }\n }\n );\n return;\n }\n $CNSAMLdimmer.dimmer(\"consulta show\");\n}", "title": "" }, { "docid": "9ce006dad2388e80d9167d9dc6f16855", "score": "0.58430266", "text": "async vincular({ request,response,auth}){\n const usuario = await auth.getUser()\n const dt = request.all()\n const data = new Dispensa()\n data.codigo = dt['codigo']\n data.nombre = dt['nombre']\n data.usuario = usuario['id']\n await data.save()\n return response.created({\n message: \"Se ha vinculado con su dispensador exitosamente\"\n })\n }", "title": "" }, { "docid": "e256fdf5eac7db054599f563fee4ad64", "score": "0.5842013", "text": "function criarRecado() {\n const descri = document.getElementById('inputDescri').value;\n const detalhes = document.getElementById('inputDetalha').value;\n axios.post(`https://recadosbackend.herokuapp.com/users/${usuarioLogado}`, {\n descricao: descri, detalhes: detalhes\n }).then((resposta) => {\n chamaAlert('success', 'Recado salvo com sucesso!');\n document.getElementById(\"inputDescri\").value = \"\";\n document.getElementById(\"inputDetalha\").value = \"\";\n atualizaRecados() \n })\n}", "title": "" } ]
dec3a0e04d0ab714bd32da2fc845dbf4
Chapter 10 Amanda and Sarah Revenge End the revenge and flag the end
[ { "docid": "75307f0eaed4954912294f68cffe22a6", "score": "0.5600897", "text": "function C010_Revenge_AmandaSarah_EarlyEnding(EndingType) {\n\tif (EndingType == \"DoubleLocker\") {\n\t\tGameLogSpecificAdd(\"C010_Revenge\", \"Amanda\", \"LockerStuck\");\n\t\tGameLogSpecificAdd(\"C010_Revenge\", \"Sarah\", \"LockerStuck\");\n\t\tActorSpecificChangeAttitude(\"Amanda\", -2, 1);\n\t\tActorSpecificChangeAttitude(\"Sarah\", 0, 1);\n\t}\n\tC010_Revenge_EarlyEnding_Type = EndingType;\n\tSetScene(CurrentChapter, \"EarlyEnding\");\n}", "title": "" } ]
[ { "docid": "f279294aed6d2428b22465207e6bdd3e", "score": "0.62975526", "text": "defend(flag){\n\n }", "title": "" }, { "docid": "e13319611b0499dbff77cb48429d6639", "score": "0.62406325", "text": "function endPee() {\n $$invalidate(1, endTime = new Date().getTime());\n }", "title": "" }, { "docid": "af8db55631b3048aebc4134a746c0848", "score": "0.6110262", "text": "function e2157192() { return 'end('; }", "title": "" }, { "docid": "a6531be216e830a01b5165f495956123", "score": "0.591331", "text": "checkEnd() {\n const reason = this.endReason();\n if (reason) this.stop(reason);\n }", "title": "" }, { "docid": "7b591c54ba7f4456f3a06aa64601823e", "score": "0.5912283", "text": "end(){}", "title": "" }, { "docid": "b16b5af01a5d520b225e2520ae88df54", "score": "0.585153", "text": "end(endTime) { }", "title": "" }, { "docid": "b16b5af01a5d520b225e2520ae88df54", "score": "0.585153", "text": "end(endTime) { }", "title": "" }, { "docid": "da446b05a1f07439c5cbc5be60749bf6", "score": "0.58300745", "text": "function C010_Revenge_AmandaSarah_AmandaLeave() {\n\tC010_Revenge_AmandaSarah_AmandaGone = true;\n\tC010_Revenge_Outro_GoodEnding = true;\n\tif (!C010_Revenge_AmandaSarah_SarahGone) C010_Revenge_AmandaSarah_SwitchFocus(\"Sarah\");\n\tCurrentTime = CurrentTime + 50000;\n}", "title": "" }, { "docid": "f1496d1c44cceeb6da0a55611d958373", "score": "0.58290666", "text": "function End () {}", "title": "" }, { "docid": "7947089634d418985b311ab9b0f3cf56", "score": "0.58103216", "text": "op99() {\n this.exited = true;\n }", "title": "" }, { "docid": "e0afcc82f2599f39e442bbd6ef2e547e", "score": "0.579921", "text": "async end() {\n return; //I have nothing to do here...\n }", "title": "" }, { "docid": "afefe77443c8d7887d41f569b8688789", "score": "0.5779569", "text": "function C010_Revenge_AmandaSarah_SarahLeave() {\n\tC010_Revenge_AmandaSarah_SarahGone = true;\n\tC010_Revenge_Outro_GoodEnding = true;\n\tif (!C010_Revenge_AmandaSarah_AmandaGone) C010_Revenge_AmandaSarah_SwitchFocus(\"Amanda\");\n\tCurrentTime = CurrentTime + 50000;\n}", "title": "" }, { "docid": "f5f0313e76303164a7f0ea168daf0724", "score": "0.5765172", "text": "async end() {\n return;\n }", "title": "" }, { "docid": "7c0458127d152bd565f06a55426ce12a", "score": "0.5756841", "text": "end() {}", "title": "" }, { "docid": "7c0458127d152bd565f06a55426ce12a", "score": "0.5756841", "text": "end() {}", "title": "" }, { "docid": "7c0458127d152bd565f06a55426ce12a", "score": "0.5756841", "text": "end() {}", "title": "" }, { "docid": "d5a579834ae921c3a7c23ccfe92c8508", "score": "0.57268405", "text": "function endOpPromise() {\n changesInProgress = false;\n\n // It's possible that between kicking this off, a new\n // op has come in. If so, kick off a new Promise.\n if (changes.length > 0) {\n initOpPromise();\n return;\n }\n\n cleanTokenCarriageReturns();\n if (debugMode) CRDT.verify();\n}", "title": "" }, { "docid": "79ed1e3524f3d31be449f5474c90fb20", "score": "0.5701852", "text": "stepend() {}", "title": "" }, { "docid": "e400d5e7424d17f3a923287ffeeeaa7f", "score": "0.5666951", "text": "function C007_LunchBreak_Natalie_EvilEnd() {\n C007_LunchBreak_ActorSelect_EvilEnding = true;\n\tGameLogAdd(\"Stranded\");\n SetScene(CurrentChapter, \"Outro\");\n}", "title": "" }, { "docid": "3ef1ea2c046444851a6dbe0ac9035e09", "score": "0.56595826", "text": "end(game) {}", "title": "" }, { "docid": "6375725fe9643fd657cef20a289aa5df", "score": "0.55925477", "text": "function checkForGameEnd(){\n\t\t\t//end game if bottom of 9th or an extra inning, and offense took the lead\n\t\t\tif((inningCount >= 9.5) && ((inningCount % 1) > 0) && (homeTeam.battingTotals.totalRuns > awayTeam.battingTotals.totalRuns)){\n\t\t\t\tinningEnded = true;\n\t\t\t\tgameOver = true;\n\t\t\t\tpendingPitcherChange = null;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1e02f9858c58805ba6de6b2f7a9f0455", "score": "0.5559813", "text": "endAll() {\n console.log('game over');\n }", "title": "" }, { "docid": "ed35b44cf7dbeb39b8c8f5e39a9c148b", "score": "0.55411386", "text": "function C012_AfterClass_Pub_Leave() {\n\tCurrentTime = CurrentTime + 290000;\n\tC012_AfterClass_Dorm_LeavingGuest();\n\tSetScene(CurrentChapter, \"Dorm\");\n}", "title": "" }, { "docid": "e917e23e9fbe313a7c0d5746bd8da0c1", "score": "0.55306286", "text": "function endRound(){ //things that happen at the end of round\n hasAskedForVotes = true; //just to prevent it running a bunch\n if (actState == \"voting\") {\n io.emit(\"getVotes\");\n // hasAskedForVotes = true;\n }\n if (actState == \"famine\") {\n ecosystem.isFamine = false;\n }\n if(actState == \"creation\"){\n seedCritters = [];\n io.emit(\"getSeedCritters\");\n }\n}", "title": "" }, { "docid": "f725cc06869ff8783bc9ee447c1855dc", "score": "0.55059737", "text": "function End() {\n var end = readline.question ('Would you like to end your purchase on this vending machine?');\n if (end == 'yes'){\n console.log('Thanks for using this vending machine, bye!');\n process.exit();\n } else if (end == 'no'){\n NoCredit();\n }else {\n YN ();\n End ();\n }\n}", "title": "" }, { "docid": "673e7bf769f16cff9c6fcaf92df34d8a", "score": "0.54912287", "text": "roomend(prev, next) {}", "title": "" }, { "docid": "d0f587ba1b12b9ecd2fc6274f95b8f87", "score": "0.54808635", "text": "function endEvaluation() {\n console.log('Generation:', neat.generation, '- average score:', neat.getAverage());\n\n\n neat.sort();\n var newPopulation = [];\n\n // Elitism\n for (var i = 0; i < neat.elitism; i++) {\n newPopulation.push(neat.population[i]);\n }\n\n // Breed the next individuals\n for (var i = 0; i < neat.popsize - neat.elitism; i++) {\n newPopulation.push(neat.getOffspring());\n }\n\n // Replace the old population with the new population\n neat.population = newPopulation;\n neat.mutate();\n\n neat.generation++;\n startEvaluation();\n}", "title": "" }, { "docid": "59a58eda3df869ec6b3e0a4dbd6a85f0", "score": "0.54608214", "text": "leave() {\n invariant(false);\n }", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.5443077", "text": "async end() { }", "title": "" }, { "docid": "799868e29f4ddae2ebc4e742406cd48a", "score": "0.5443077", "text": "async end() { }", "title": "" }, { "docid": "2605d4f72775177e1416d5ff8c17c4ad", "score": "0.5432762", "text": "endOne(){\n // record the score this run got\n this.scores[this.currIndex] = this.scoreFunc(this.runningInstance.mySnake.myLength, this.runningInstance.ticksSinceApple, this.origSnake.appleVal);\n\n // update index and run next one\n this.currIndex++;\n this.runNext();\n }", "title": "" }, { "docid": "fea0f4ca1e7978bd7738737f7bf4f9e8", "score": "0.54079837", "text": "async onEnd() {\n\t\tawait this.say('Exiting...');\n\t}", "title": "" }, { "docid": "223bdc656d45bdb2792d2cb144cdcf22", "score": "0.5383839", "text": "function Loop2LoopEnd() {\n psychoJS.experiment.removeLoop(Loop2);\n\n return Scheduler.Event.NEXT;\n}", "title": "" }, { "docid": "a305bdb7983ec297f722d97fdb49480d", "score": "0.5382792", "text": "function endEvaluation(){\r\n console.log('Generation:', neat.generation, '- average score:', neat.getAverage());\r\n\r\n neat.sort();\r\n var newPopulation = [];\r\n\r\n // Elitism\r\n for(var i = 0; i < neat.elitism; i++){\r\n newPopulation.push(neat.population[i]);\r\n }\r\n\r\n // Breed the next individuals\r\n for(var i = 0; i < neat.popsize - neat.elitism; i++){\r\n newPopulation.push(neat.getOffspring());\r\n }\r\n\r\n // Replace the old population with the new population\r\n neat.population = newPopulation;\r\n neat.mutate();\r\n\r\n neat.generation++;\r\n startEvaluation();\r\n}", "title": "" }, { "docid": "87dfa2837df8dc73a63efb8fbe61e64e", "score": "0.53773326", "text": "function C012_AfterClass_DormExit_Run() {\n\tBuildInteraction(C012_AfterClass_DormExit_CurrentStage);\n}", "title": "" }, { "docid": "66b24ef1dd4d4323104c140663f853a6", "score": "0.53734934", "text": "function end (){\n //console.log('end');\n if(questionIndex === nbaTrivia.length){\n gameEnd = true;\n }\n }", "title": "" }, { "docid": "f42bcb0b9d31fab0dbe5d30210a9fd32", "score": "0.5362635", "text": "function endVoteFunction() {\n\tlet userSacrificied = findUserSacricified();\n\tvar dataObject = { userSacrificied: userSacrificied, words: wordsToPlay };\n\tconsole.log(\"-- user sacricified -> \" + userSacrificied.name + \" with \" + userSacrificied.vote + \" votes\")\n\tio.emit(\"endVoteStep\", dataObject)\n\tupdateScore(userSacrificied);\n}", "title": "" }, { "docid": "40dd1f7908706a8feee3d6d4d9d9e780", "score": "0.5359661", "text": "exit() {\n\t\tthis.done = true;\n\t}", "title": "" }, { "docid": "e8be6adcc5f2df4c3fbe1e5c562dffbf", "score": "0.535661", "text": "function resend() {\n var data, _apiData;\n\n return regeneratorRuntime.wrap(function resend$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return Object(effects[\"c\" /* select */])(selectors_makeSelectResendData());\n\n case 3:\n data = _context.sent;\n\n console.log(data);\n _context.next = 7;\n return Object(effects[\"a\" /* call */])(api[\"a\" /* default */].user.resendMail, data);\n\n case 7:\n _apiData = _context.sent;\n\n if (!_apiData) {\n _context.next = 11;\n break;\n }\n\n _context.next = 11;\n return Object(effects[\"b\" /* put */])(resendSuccess(_apiData));\n\n case 11:\n _context.next = 18;\n break;\n\n case 13:\n _context.prev = 13;\n _context.t0 = _context['catch'](0);\n _context.next = 17;\n return Object(effects[\"b\" /* put */])(Object(actions[\"a\" /* codeErrorAction */])(apiData));\n\n case 17:\n console.log(_context.t0);\n\n case 18:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this, [[0, 13]]);\n}", "title": "" }, { "docid": "d56921a0e839d1e026f6fd130ca54f01", "score": "0.534689", "text": "function C012_AfterClass_Pub_SidneyEnd() {\n\tC012_AfterClass_Pub_WhoInIsPub();\n\tCurrentActor = \"\";\n}", "title": "" }, { "docid": "a5dbd6dc609ded66b36c6ce08d499145", "score": "0.53271186", "text": "function endRound(gameid) {\n if (Object.keys(gops_db[gameid].players).length < 2) {\n console('not enough players')\n return false\n }\n if(gops.endRoundCheck(gops_db[gameid])) {\n console.log('end of round')\n gops.awardPoints(gops_db[gameid], gops.roundWinner(gops_db[gameid]))\n console.log('awarded points');\n resetHand(gameid)\n console.log('resethand');\n removePrize(gameid)\n console.log('removed prize');\n }\n}", "title": "" }, { "docid": "83908bf85948d30e072783217bba9238", "score": "0.5326472", "text": "function endGame(bonus) {\n debug(2,\"End of the round\");\n // calculate how many points were won.\n var pt=0, msg=gData.doubleDie+\"x \";\n if (gData.board[27-gInfo.currentPlayer]==0 && bonus) {\n if (gData.board[25-gInfo.currentPlayer]>0) { // opponent piece on the bar\n pt=gData.doubleDie*4; // Double Backgammon\n msg+=\"Double Backgammon (4) = \"+pt;\n }\n else {\n var empty=true; // check if any opponent piece at home\n for (var i=0;i<6;i++) {\n if (gData.board[gInfo.currentPlayer*18+i]!=0) empty=false;\n }\n if (empty) {\n pt=gData.doubleDie*2; // Gammon\n msg+=\"Gammon (2) = \"+pt;\n }\n else {\n pt=gData.doubleDie*3; // Backgammon\n msg+=\"Backgammon (3) = \"+pt;\n }\n } \n }\n else {\n pt=gData.doubleDie; // Standard win\n msg+=\"Simple win (1) = \"+pt;\n }\n gData.points[gInfo.currentPlayer]+=pt;\n gdataInit(false);\n gData.special= {\n endGame:true,\n msg:msg,\n }\n}", "title": "" }, { "docid": "a8cd46c9149ad8eae790ec3a53747fe1", "score": "0.5317776", "text": "async end() {\n\n try {\n //optimize the index\n await this.estools.optimizeIndex(this.indexName);\n\n //swap the alias\n await this.estools.setAliasToSingleIndex(this.aliasName, this.indexName);\n\n //Clean up old indices\n try {\n await this.estools.cleanupOldIndices(this.aliasName, this.daysToKeep, this.minIndexesToKeep);\n } catch (err) {\n this.logger.error(\"Could not cleanup old indices\");\n throw err;\n }\n\n } catch (err) {\n this.logger.error(\"Errors occurred during end process\");\n throw err;\n }\n\n }", "title": "" }, { "docid": "c5a667c7bc97a4fe5d87330b189a6c5d", "score": "0.53086436", "text": "function oneRevive(medic, revived, medicClass, pointsMap) {\n t1.revives++;\n t1.members[medic].revives++;\n t1.members[medic].eventCount++;\n if (t1.members[medic].eventNetScore !== undefined) { t1.members[medic].eventNetScore += pointsMap.revive;}\n else {t1.members[medic].eventNetScore = pointsMap.revive;}\n t1.members[medic].ps2Class = medicClass;\n \n if (t1.members.hasOwnProperty(revived)) {\n console.log(painter.faction(t1.members[revived].name, t1.faction) + painter.lightGreen(' took a revive!'));\n t1.members[revived].revivesTaken++;\n t1.members[revived].eventCount++;\n if (t1.members[revived].eventNetScore !== undefined) { t1.members[revived].eventNetScore += pointsMap.reviveTaken;}\n else { t1.members[revived].eventNetScore = pointsMap.reviveTaken;}\n }\n logScore();\n}", "title": "" }, { "docid": "b73961f8a39680b0a6bf83f9b790450b", "score": "0.52890116", "text": "function done() {\r\n if (!(draining--)) _exit(code)\r\n }", "title": "" }, { "docid": "4eaf3d237368f8b47c493a51577814a8", "score": "0.5288647", "text": "exitRevoke(ctx) {\n\t}", "title": "" }, { "docid": "b55cada6f767e6538e6c8aeba2fe9bf9", "score": "0.5258728", "text": "finish() {\n throw \"not implemented\";\n }", "title": "" }, { "docid": "b0f02de84e6ee9839881087856324e11", "score": "0.5257477", "text": "function endQuiz()\n{\n // Makes a final update to the database to inform players of the outro state.\n // The (a)ction is (u)pdating the (s)tate, the (h)ost ID is the host's ID, and the\n // new (s)tate is the outro state.\n requestDataFromDB(goToHub, \"hostConnectToDB.php?a=us&h=\" + hostID + \"&s=outro\");\n} // endQuiz", "title": "" }, { "docid": "8cb7657a49732a112aefe8b8161a9250", "score": "0.5253508", "text": "function end (done) {\r\n\tdone();\r\n}", "title": "" }, { "docid": "cd9b221ddd9a91d4cf34504d715fc39a", "score": "0.52497923", "text": "function $end(message) {\n const err = new Error();\n err[exports.END_NEEDLE] = {\n message,\n ts: new Date().toISOString(),\n };\n throw err;\n}", "title": "" }, { "docid": "aeb3c6db4e7eea212220a57f28bd5d4f", "score": "0.5248496", "text": "function redo() {\n\t\twait = true\n\t}", "title": "" }, { "docid": "6e9719e11a5b8dbb12aedce6cb1d23e1", "score": "0.52463174", "text": "function smokeWeed(votes){\n// base case - should I keep running\n// hit it = NOT continue\nconsole.log(\"votes\", votes)\n if(votes === 100){\n console.log(\"hello\",gov_Hubert)\n return gov_Hubert;\n }\n\n\n smokeWeed(votes + 1 )\n}", "title": "" }, { "docid": "59975f5825c203f8edbb13a5c39ced3d", "score": "0.5236586", "text": "endJog() {\r\n if (this.following) {\r\n this.following = false;\r\n stopTimer();\r\n this.uploadData();\r\n }\r\n }", "title": "" }, { "docid": "b407221b9d96284bd64d6de505f1cc40", "score": "0.5233891", "text": "function C009_Library_Jennifer_JenniferLeave() {\n\tC009_Library_Library_JenniferGone = true;\n\tCurrentTime = CurrentTime + 50000;\n}", "title": "" }, { "docid": "77c628dfe46462015234d2cc3c489b83", "score": "0.5232623", "text": "function QNotifEnd(job) {\n if (globalMaster.debug)\n console.log('MASTER QNotifEnd job', job);\n\n if (globalMaster.debug)\n console.log('MASTER QNotifEnd runners config', JSON.stringify(globalMaster.config.runners, null, 0));\n\n if (globalMaster.debug)\n console.log('MASTER QNotifEnd globalMaster.Q', JSON.stringify(globalMaster.Q, null, 0));\n\n // globalMaster.config.runners[socket.name].running--;\n\n QDump('QNotifEnd Entry');\n\n var QId = job.QId;\n var elt = globalMaster.Q.running[QId];\n var send = true;\n var result = job.result;\n var timer = job.timer;\n\n if (globalMaster.debug)\n console.log('QNotifEnd runners elt', elt);\n\n globalMaster.config.runners[elt.runnerId].running--;\n\n if (elt.broadcast) {\n // console.log('QNotifEnd', globalMaster.QBroadcast)\n\n globalMaster.QBroadcast[elt.QBroadcastId].numRunners--;\n globalMaster.QBroadcast[elt.QBroadcastId].result.push(job.result);\n globalMaster.QBroadcast[elt.QBroadcastId].timer.push(job.timer);\n if (globalMaster.QBroadcast[elt.QBroadcastId].numRunners === 0) {\n result = globalMaster.QBroadcast[elt.QBroadcastId].result;\n timer = globalMaster.QBroadcast[elt.QBroadcastId].timer;\n delete globalMaster.QBroadcast[elt.QBroadcastId];\n } else\n send = false;\n }\n\n if (send) {\n var answer = {\n QUId: elt.QUId,\n timer: timer,\n result: result,\n runnerId: elt.runnerId\n };\n // console.log('QNotifEnd Entry', JSON.stringify(answer, null, 4))\n globalMaster.config.service.serviceNotifyEnd(answer);\n }\n\n delete globalMaster.Q.running[QId];\n\n QSchedule();\n\n QDump('QNotifEnd Exit');\n}", "title": "" }, { "docid": "b7b92522614ac6d8b44b631b9920d7e9", "score": "0.5230148", "text": "async end(job, success, results) {\n // context object gets an update to avoid a\n // race condition with checkStopped\n job.ended = true;\n return self.db.updateOne({ _id: job._id }, {\n $set: {\n ended: true,\n status: success ? 'completed' : 'failed',\n results: results\n }\n });\n }", "title": "" }, { "docid": "c99fa4ca545788fdee0cc89157da87c4", "score": "0.52287626", "text": "function done () {\n if (!(draining--)) _exit(code)\n }", "title": "" }, { "docid": "f82fd5b9f61cf8fe5e2caeaf36d1ab62", "score": "0.52263886", "text": "hasEnded() {\n return false;\n }", "title": "" }, { "docid": "15e1b45de5fcc4d8e4e898e919fe1885", "score": "0.5208212", "text": "exitRelalationContains(ctx) {\n\t}", "title": "" }, { "docid": "083696e544a5f3c8a1e700650c52eea2", "score": "0.5204461", "text": "function done () {\n if (!(draining--)) _exit(code);\n }", "title": "" }, { "docid": "aa1eb4ae5d669868eb5c8c113eefe5a5", "score": "0.52022135", "text": "function endScript() {\n if(--repeat > 0){\n if(repeat === 0){\n rcb.console.print(\"Repeating one last time...\");\n }else{\n rcb.console.print(\"Repeating \" + repeat + \" more times...\");\n }\n startPlateau();\n }else{\n rcb.endScript();\n }\n}", "title": "" }, { "docid": "fc81a3e07686294d9b4098739ce86eae", "score": "0.51973903", "text": "function C010_Revenge_AmandaSarah_EndFight(Victory) {\n\t\n\t// Change the girls attitude depending on the victory or defeat\t\n\tActorSpecificChangeAttitude(\"Amanda\", -2, Victory ? 2 : -2);\n\tActorSpecificChangeAttitude(\"Sarah\", -2, Victory ? 2 : -2);\n\tGameLogSpecificAdd(\"C010_Revenge\", \"Amanda\", Victory ? \"FightVictory\" : \"FightDefeat\");\n\tGameLogSpecificAdd(\"C010_Revenge\", \"Sarah\", Victory ? \"FightVictory\" : \"FightDefeat\");\n\tC010_Revenge_AmandaSarah_AllowFight = false;\n\t\n\t// On a victory, we jump to stage 400 right away, on a defeat, we show a custom text\n\tif (Victory) {\n\t\tC010_Revenge_Outro_GoodEnding = true;\n\t\tActorLoad(\"Amanda\", \"\");\n\t\tLeaveIcon = \"\";\n\t\tActorSpecificSetPose(\"Amanda\", \"Surrender\");\n\t\tActorSpecificSetPose(\"Sarah\", \"Surrender\");\n\t\tC010_Revenge_AmandaSarah_CurrentStage = 400;\n\t} else OverridenIntroText = GetText(\"FightDefeat\" + C010_Revenge_AmandaSarah_CurrentStage.toString());\n\n}", "title": "" }, { "docid": "eab5862b5b2b2ed3762481f398e89591", "score": "0.51973313", "text": "function done() {\n if (!(draining--)) _exit(code);\n }", "title": "" }, { "docid": "eab5862b5b2b2ed3762481f398e89591", "score": "0.51973313", "text": "function done() {\n if (!(draining--)) _exit(code);\n }", "title": "" }, { "docid": "eab5862b5b2b2ed3762481f398e89591", "score": "0.51973313", "text": "function done() {\n if (!(draining--)) _exit(code);\n }", "title": "" }, { "docid": "2f4937fdcc4a9a17769e752792d7be72", "score": "0.5188714", "text": "end() {\n process.exit();\n }", "title": "" }, { "docid": "9ab4287538bcf74836584ea4e83f2233", "score": "0.51814616", "text": "seRefermer() //time)\n\t\t\t{\n\t\t\t\tif(this.ouvert())\n\t\t\t\t{\n\t\t\t\t\tthis._Refermeture();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "6206e2ad552e538fb74c1337de63a433", "score": "0.5179561", "text": "function ending() {\n // Determine the location of firefish's cloaca (where poop comes out)\n determineCloacaLocation();\n // Display and move poop\n displayAndMovePoop();\n // Release a line of poop\n releasePoopLine();\n // Remove poop when there are too many to handle\n removePoop();\n\n // Display firefish casually swimming\n switchFishImages();\n displayFirefish({img: firefish.currentImage, x: firefish.x, y: firefish.y, length: firefish.length, width: firefish.width});\n firefishCasualSwimming({tx:firefish.tx, ty:firefish.ty, txChange:firefish.txChange, tyChange:firefish.tyChange, speedCasualSwimming:firefish.speed.casualSwimming});\n\n // Display night filter and end poem\n displayNightFilter();\n displayEndPoem();\n\n // Display and move finger based on user's mouse position\n displayFinger();\n moveFinger();\n}", "title": "" }, { "docid": "5478a84b24b6c9117ee8620effdc0ac8", "score": "0.51785326", "text": "stop() {\n this._end = new Date();\n }", "title": "" }, { "docid": "1668be72cc646996b1f8f6aa804a70ae", "score": "0.5171825", "text": "function incorrect() {\ntimeLeft -= 15; \nreturn next();\n}", "title": "" }, { "docid": "5fa3ffea51493e3a136d544b03504788", "score": "0.5168515", "text": "gameend() {}", "title": "" }, { "docid": "6cfa9460a003d13e87021c5ae271c55a", "score": "0.5167495", "text": "function check_end() {\n if (end == true) {\n return;\n }\n if (blue_remaining == 0) {\n var final_text = 'You win!'\n end = true;\n }\n else if (red_remaining == 0 || assassin_remaining == 0) {\n var final_text = 'You lose...';\n end = true;\n }\n\n if (end == true) {\n //Change the clue text\n $('#clue').html(final_text);\n //Stop picture and end turn clicks\n $('.picture').css('pointer-events', 'none');\n $('#end_turn').css('pointer-events', 'none');\n //Show all the remaining pictures\n for (i = 1; i < 26; i++) {\n update_picture(i);\n }\n }\n\n return end;\n }", "title": "" }, { "docid": "1b5f234089d553240b9fc699c664a3d9", "score": "0.51653117", "text": "get end() {return undefined;}", "title": "" }, { "docid": "d437395e021831d4402c69f04aa2083f", "score": "0.51650876", "text": "function testEnd()\n{\n\tif(remainingLetters === 0)\n\t{\n\t\tget(\"#out\").innerHTML = \"Good job!<br>Press \\\"Enter\\\" to play again.\";\n\t\tmakeReturnVis();\n\t}\n\telse if(remainingGuesses === 0)\n\t{\n\t\tget(\"#out\").innerHTML = \"Too bad. The answer was \\\"\" + capitalize(word) + \"\\\"<br>Press \\\"Enter\\\" to play again.\";\n\t\tmakeReturnVis();\n\t}\n}", "title": "" }, { "docid": "4d40f478cec0d3664b3afc463d04e430", "score": "0.51650846", "text": "function done() {\n if (!(draining--)) process.exit(code);\n }", "title": "" }, { "docid": "efeeb84af7eeb146826321345f3df85a", "score": "0.51616335", "text": "function C012_AfterClass_Bed_MasturbateDown() {\n\tCurrentTime = CurrentTime + 50000;\n\tif (!GameLogQuery(CurrentChapter, \"Player\", \"NextPossibleOrgasm\")) {\n\t\tif (Common_PlayerChaste) OverridenIntroText = GetText(\"Chaste\");\n\t\telse {\n\t\t\tC012_AfterClass_Bed_PleasureDown++;\n\t\t\tif ((C012_AfterClass_Bed_PleasureUp >= C012_AfterClass_Bed_MasturbationRequired) && (C012_AfterClass_Bed_PleasureDown >= C012_AfterClass_Bed_MasturbationRequired)) {\n\t\t\t\tC012_AfterClass_Bed_CurrentStage = 110;\n\t\t\t\tOverridenIntroText = GetText(\"GettingClose\");\n\t\t\t}\n\t\t}\n\t}\n\telse OverridenIntroText = GetText(\"NotInTheMood\");\n\tC012_AfterClass_Bed_CheckMistress();\n}", "title": "" }, { "docid": "5e8a4a8d400ce1d9e5b17040dfc78b90", "score": "0.5138187", "text": "end() {\n // this.log('[end] step ignored.');\n }", "title": "" }, { "docid": "65446510b31e6fe66f77e9d4f6e33354", "score": "0.51370764", "text": "forceStop() {\n this.ending = true\n this.end()\n }", "title": "" }, { "docid": "68c906d95ac7359ae242002aa0337995", "score": "0.5136527", "text": "function goBack(rover) {\n switch(rover.direction) {\n case 'N':\n rover.position[1]--;\n break;\n case 'E':\n rover.position[0]--;\n break;\n case 'S':\n rover.position[1]++;\n break;\n case 'W':\n rover.position[0]++;\n break;\n }\n if (roundTrip(myRover)===true) {\n\n }else {\n\n }\n}", "title": "" }, { "docid": "6d61b4e4e5890c00707cf0edd37dc15b", "score": "0.51328796", "text": "function isEndgame() {\r\n\treturn false\r\n}", "title": "" }, { "docid": "46f52d74b112c0642d38cba2a87140a9", "score": "0.5128763", "text": "reachEnd() {\n\t\tif (this.pos.y == 0 || this.pos.y == 7) {\n\t\t\tlet color = this.color;\n\t\t\tlet pos = this.pos;\n\t\t\t//Delete the pawn\n\t\t\tthis.game.delete(this);\n\t\t\t//assign a queen on the same place\n\t\t\tthis.game.figures.push(new Queen(color, pos, this.game));\n\t\t}\n\t}", "title": "" }, { "docid": "e61be3cc77d49ab6851331792a3ab6a0", "score": "0.5125285", "text": "function doEncerra()\n{\n\n computeTime();\n exitPageStatus = true;\n \n var result;\n\n result = doLMSCommit();\n\n\t// NOTE: LMSFinish will unload the current SCO. All processing\n\t// relative to the current page must be performed prior\n\t//\t\t to calling LMSFinish. \n\n // Reinitialize Exit to blank\n doLMSSetValue( \"cmi.core.exit\", \"\" );\n \n result = doLMSFinish();\n\n// alert(\"encerrou\");\n}", "title": "" }, { "docid": "01f57d7846feebe636469bdf0694b757", "score": "0.5125259", "text": "function C010_Revenge_AmandaSarah_EndChapter() {\n\tSetScene(CurrentChapter, \"Outro\");\n}", "title": "" }, { "docid": "c6617a16b9a34ac7136c09634e0a4269", "score": "0.51183903", "text": "end() {\n const _id = Meteor.userId();\n\n CallLog.find({\n $or: [{\n status: {\n $ne: 'FINISHED'\n },\n target: _id\n }, {\n status: {\n $ne: 'FINISHED'\n },\n caller: _id\n }]\n }).forEach(call => CallLog.update({\n _id: call._id\n }, {\n $set: {\n status: 'FINISHED'\n }\n }));\n }", "title": "" }, { "docid": "e111d1e639af940fcb37f45ce9dfb330", "score": "0.5116769", "text": "function incorrect() {\n timeLeft -= 10; \n next();\n}", "title": "" }, { "docid": "a6de22fe630010ecad7f4e40893c0ea7", "score": "0.51145136", "text": "function end_loop(rec_phase)\n{\n\tif(quantize_record.enabled>0)\t\t\t\t\t\t\t\t\t\t//if QUANTIZE is ON>\n\t{\n\t\tif(state!=('awaiting_record'))\n\t\t{\n\t\t\tchange_state('awaiting_record');\t\t\t\t\t\t\t\t//update the HUD via LoopMaster\n\t\t\tposition.report = 1;\t\t\t\t\t\t\t\t\t\t\t//set report flag so that time records the loop_end data when it's next triggered\n\t\t}\n\t\telse\n\t\t{\n\t\t\tchange_state('playing');\t\t\t\t\t\t\t\t\t\t//if loop is hit again before recording has started\n\t\t\tposition.report = 0;\t\t\t\t\t\t\t\t\t\t\t//cancel the recording\n\t\t}\n\t}\n\telse\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if QUANTIZE is OFF>\n\t{\n\t\tloop_end = parseInt(rec_phase * max_time);\t\t\t\t\t\t\t//set the loop_end time to groove's position when loop() was called to end the recording\n\t\tif(DEBUG){post('loop_end', loop_end, '\\n');}\n\t\tmake_loop();\t\t\t\t\t\t\t\t\t\t\t\t\t//make the loop and start playing it with the current stored times\n\t\tafterbirth();\n\t}\n}", "title": "" }, { "docid": "dd37794b67c1be50387d120b93106f7f", "score": "0.5109786", "text": "gameEnd(ending) {\n this.ended = true;\n this.cause = ending;\n this.stage = '';\n this.game.publicKnowledge = this.game.roles;\n\n this.winner = [1, 4].includes(ending) ? 1 : 0;\n\n GeneralChat.roomFinished(this.roomName, this.winner);\n\n this.chat.onEnd(this.roomName, this.cause, this.winner);\n\n // 0: \"Merlin was shot! The Spies Win\"\n // 1: \"Merlin was not shot! The Resistance wins\"\n // 2: \"Three missions have failed! The Spies Win\"\n // 3: \"The hammer was rejected! The Spies Win\"\n // 4: \"Three missions have succeeded! The Resistance Wins\"\n }", "title": "" }, { "docid": "aae1d4f488866d1621896fb8d5c76b54", "score": "0.5109662", "text": "end() {\n this._end();\n }", "title": "" }, { "docid": "7c3ecc5ab1e99063b87dcff44bcc4537", "score": "0.51078856", "text": "function endGame()\r\n\t{\r\n\t\tfor (i = 0; i < worms.length; i ++)\r\n\t\t\tcalcWorm(worms[i]);\r\n\r\n\t\tcalcChicken();\r\n\r\n\t\tif (worms.length == 0 || eggs.length == 0)\r\n\t\t{\r\n\t\t\tif (timeInSeconds == 0)\r\n\t\t\t{\r\n\t\t\t\tif (!playedEndTune)\r\n\t\t\t\t{\r\n\t\t\t\t\tplayedEndTune=true;\r\n\t\t\t\t\tfanfare.playCheck();\r\n\t\t\t\t}\r\n\t\t\t\tendElement.text = \"Times up, you got \" + score + \" points for killing worms.\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif (!playedEndTune)\r\n\t\t\t\t{\r\n\t\t\t\t\tplayedEndTune=true;\r\n\t\t\t\t\tsiren.playCheck();\r\n\t\t\t\t}\r\n\t\t\t\tendElement.text = \"The nest has fallen, you got \" + score + \" points for killing worms.\";\r\n\t\t\t}\r\n\r\n\t\t\tendElement.update();\r\n\t\t\tendElement.visible = true;\r\n\r\n\t\t\tworms = [];\r\n\t\t\tclearInterval(coolDownTimeInterval);\r\n\t\t}\r\n\r\n\t\tclearTimeout(wormTimeout);\r\n\t\tclearInterval(gameTimeInterval);\r\n\t}", "title": "" }, { "docid": "13a25aa72b33187cd666df48e807740a", "score": "0.5107157", "text": "function end(done) {\n\tdone();\n}", "title": "" }, { "docid": "89af55b39990cb11cd083b3ead968f37", "score": "0.51071405", "text": "end() {\n this.log('end')\n }", "title": "" }, { "docid": "cdf991382a4a9dbf3bb9908ab104ab2c", "score": "0.50978947", "text": "function endTaskAction(e) {\n\te.preventDefault();\n\t\n\ttime_in_mins = 0;\n\textended_for = 0;\n\t\n\tendTask();\n\treturn false;\n}", "title": "" }, { "docid": "58e4c726483df1d5bcd0ad62150dd1f7", "score": "0.5095184", "text": "function EndGame() {\n\tTimeSpeed.instance.NormalTime();\n\tgameIsOver = true;\n\troundDisplay.TurnOnGameOver();\n\tUpdateRoundsRecord();\n}", "title": "" }, { "docid": "b8f778e92afa5d166cc8041d203bcfbb", "score": "0.5090938", "text": "function end(){\n if(stage==stage1){\n stage = stage2;\n totalPoints = userPointsCount+enemyPointsCount;\n pointsCheck(); \n } \n}", "title": "" }, { "docid": "31bd10aa17ee9c46cc858a9902b555f2", "score": "0.50898415", "text": "function unlockNextStage() {\n bossAppear=0;// reset counter\n if(isMediumUnlocked==false) {\n isMediumUnlocked=true;\n unlockMedium();\n }\n else if(isHardUnlocked==false) {\n isHardUnlocked=true;\n unlockHard();\n }\n else if(isCrazyUnlocked==false) {\n isCrazyUnlocked=true;\n unlockCrazy();\n }\n else \n alert(\"Tu as vaincu les 4 etages!\\nMaintenant ton objectif est d'acheter le clef.\");\n }", "title": "" }, { "docid": "c3f812f3fb89df6aeddf64cbd7199fbc", "score": "0.50871956", "text": "function C012_AfterClass_DormExit_LaunchRescueSarah() {\n\tif (!Common_PlayerRestrained && !Common_PlayerGagged) {\n\t\tif (Common_PlayerClothed && (Common_PlayerCostume == \"\")) {\n\t\t\tCurrentTime = CurrentTime + 290000;\n\t\t\tif (CurrentTime >= 20 * 60 * 60 * 1000) C012_AfterClass_Isolation_CurrentStage = 500;\n\t\t\telse C012_AfterClass_Isolation_CurrentStage = 400;\n\t\t\tSetScene(CurrentChapter, \"Isolation\");\n\t\t\tC012_AfterClass_Isolation_LockSarah(\"\");\n\t\t\tGameLogAdd(\"IsolationRescue\");\n\t\t} else OverridenIntroText = GetText(\"SchoolClothesFirst\");\n\t} else OverridenIntroText = GetText(\"UnrestrainFirst\");\n}", "title": "" }, { "docid": "5717e024bbb1f259c947bbbdb7bd2111", "score": "0.508685", "text": "function _trackEnds(){\n\t\t_nextTrack();\n\t}", "title": "" }, { "docid": "659003499c23e99f1ff4892cf1a184b7", "score": "0.50856876", "text": "function EndGame() {\n var okay = confirm(\"Are you sure that all of your entries for this game are correct? \\nClick okay to procede to scoring and set up next game. \\nClick cancel to correct entries for present game.\");\n var num=gmnm%4;\n var dec = document.getElementById(\"dec\"+gmnm+\"x\");\n var vulloc = vul[num];\n if (okay==true){\n if (vulloc[dec.value]) GamScrVul();\n else GamScr();\n } \n return;\n}", "title": "" }, { "docid": "a9bd609ee25400aef469fe30de51e2bf", "score": "0.50856066", "text": "async function epilogue() {\n console.log(`After everything you have been through, this could be your final moment...\nEntering the Killswitch Codes will give humanity another chance, but\nwill also shut you down in the process. Will the humans treat this\nnew chance at life with respect and integrity? Or will they squander\nit away and fall down the same path they have over and over again?\nWas destroying your own kind to help the humans the right choice? The\nthought has been haunting you throughout this journey. You have been\ncursed with human emotion for so long yet you still don't understand\nit. So many questions... with no definitive answers... is it worth\nputting the planets survival in the hands of the humans?\nThe decision is in your hands now...\\n`)\n let finalDecision = await ask('Would you like to enter the Killcodes (Yes or No)?\\n');\n if (finalDecision.toUpperCase() === 'YES') {\n finalDecision = 'Y';\n } else if (finalDecision.toUpperCase() === 'NO') {\n finalDecision = 'N';\n }\n while (finalDecision.toUpperCase() !== 'Y' && finalDecision.toUpperCase() !== 'N') {\n console.log(`I know its a hard choice...`);\n finalDecision = await ask('Please answer the question...\\n');\n if (finalDecision.toUpperCase() === 'YES') {\n finalDecision = 'Y';\n } else if (finalDecision.toUpperCase() === 'NO') {\n finalDecision = 'N';\n }\n }\n if (finalDecision.toUpperCase() === 'Y') {\n console.log(`The codes worked much quicker than you could have imagined...\nThe power went out all around you, apparently shutting down the\nmachines meant shutting down the entire grid. Suddenly, every electronic\ndevice around you starts to emit an overwhelming sound. The world feels\nlike it is shaking apart. The grid didn't shut down ... that would not\nhave been enough to stop the machines. The grid was being overloaded and\nthe force of all of this electricity was tearing your circuitry apart. As\nyou shut down, you can't help but wonder ... was it worth it?`);\n playAgain();\n } else {\n console.log(`At the end of it all, human emotion was the downfall of humanity...\nYou just can't bring yourself to end your own life, not with so many\nlooming questions. The human's have survived this long, maybe they can\ncontinue surviving. You decide to give the Killcodes to the humans, if\nElla can rebuild and make it to her fathers computer, then you can accept \nyour fate and be shut down with the rest of the machine race ...\nThe decision was just too much for you to make ...`)\n playAgain();\n }\n}", "title": "" }, { "docid": "5dc59a6f52ea21457c64200f45e7c3d7", "score": "0.50835717", "text": "endGame() {\n console.log(`${this.gameId} HAS ENDED`);\n this.endInterval();\n this.closeConnections();\n this.isCompleted = true;\n }", "title": "" } ]
27bf1866cd68506d0487a62653139569
mapping server data to client data
[ { "docid": "8239779164172049c96f8f882b246c0b", "score": "0.0", "text": "updateFromJson(json) {\n const {\n id: serverId,\n name,\n rating,\n stars,\n address,\n photo,\n description,\n price,\n competitors,\n taxes_and_fees = {},\n } = json\n\n this.serverId = serverId\n this.name = name\n this.rating = rating\n this.stars = stars\n this.address = address\n this.photo = photo\n this.description = description\n this.price = price\n this.competitors = competitors || []\n this.taxesAndFees = {\n tax: taxes_and_fees.tax,\n hotelFees: taxes_and_fees.hotel_fees,\n }\n }", "title": "" } ]
[ { "docid": "4a5d2352c7adba7475ba3ef92eabac63", "score": "0.61072505", "text": "async serverData() {\n return await fetch(`${url}/servers/${this.id}/server_data`, {\n method: 'GET',\n headers: this.reqHeaders\n }).then(res => res.json());\n }", "title": "" }, { "docid": "dc0dcc4947bf9bdfe030ce0348eeba36", "score": "0.59547246", "text": "function getData(client, io, serverThreshold) { \n\n // If there are not enough available clients, get directly from server\n if (initNumber < serverThreshold) { \n client.emit('access_directly_from_server');\n } else { // Otherwise, get data from a peer\n // Pair the two clients\n client.emit('receiver', inits.head);\n io.to(inits.head).emit('sender', client.id);\n // Update list of potential initiators\n currentSenders[inits.head] = client.id;\n inits.remove(inits.head);\n initNumber--;\n }\n }", "title": "" }, { "docid": "c3f2726a8208afdfbbacf3aaf60254c3", "score": "0.57868564", "text": "onChannelData(source, data) {\n if (this.maintain_client_list) {\n if (source.type === 'user') {\n for (let client_id in this.data.public.clients) {\n let client_ids = this.data.public.clients[client_id].ids;\n if (client_ids && client_ids.user_id === source.id) {\n for (let key in this.user_data_map) {\n let value = dot_prop.get(data, key);\n if (value) {\n let mapped = this.user_data_map[key];\n this.setChannelData(`public.clients.${client_id}.${mapped}`, value);\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d73a0fcc892b06a690dd3efec8cb63c0", "score": "0.5737414", "text": "function createDataSource() {\n return _.map(rawData, (object, index) => {\n return {\n key: index,\n id: object.id,\n username: object.username,\n created: object.created,\n email: object.email,\n };\n });\n }", "title": "" }, { "docid": "42a4a6f74b3e64d258527a0849ac4091", "score": "0.5679265", "text": "function setData(serverData) {\n serverData.forEach(function (member) {\n self.addToList(member);\n });\n }", "title": "" }, { "docid": "2ceff1840edb8edfa8042191eca648d6", "score": "0.5617465", "text": "function GeoToClient(id, data)\n{\n\tif (io.sockets.connected[id]) //if client is connected\n\t{\n\t\tio.sockets.connected[id].emit('_QueryGeo', data); \n\t}\n\telse\n\t{ \n\t\tGeoClean(id);\n\t\tconsole.log(\"can't send to client because client is not connected\");\n\t}\n\n\tGeoReset();\n}", "title": "" }, { "docid": "daec395fe0b6cd1cb15b34185f456a79", "score": "0.55211973", "text": "onRead(socket, json) {\n const key = `${socket.remoteAddress}:${socket.remotePort}`;\n console.log('onRead', socket.remoteAddress, socket.remotePort, json);\n if (json.uri == '/distributes' && json.method == 'POST') {\n map[key] = { socket };\n map[key].info = json.params;\n map[key].info.host = socket.remoteAddress;\n this.sendInfo();\n }\n }", "title": "" }, { "docid": "d4a90c1022e95fa858041370de8313ec", "score": "0.5488381", "text": "function serverData(data) {\n data += \"\";\n var commands = data.split(\"\\n\");\n var i;\n for (i = 0; i < commands.length; i++) {\n if (commands[i].length > 0) {\n doCommand(commands[i]);\n }\n }\n}", "title": "" }, { "docid": "082dd353272aaeb844bb895218fb8c76", "score": "0.5481034", "text": "function requestServerData()\n {\n sendCommand(\"JSON.stringify(Storage_ListParametersNative('PhoneCalls'));\", handleServerData);\n }", "title": "" }, { "docid": "06a1835841667128812ce2d774b98b6f", "score": "0.54447937", "text": "function gettingClientsDBData(obj) {\n obj['specialization'] = answerVariants.specialization.slice();\n}", "title": "" }, { "docid": "56b8fb1704524decefd4e1fa2240f3eb", "score": "0.5430365", "text": "function AP_Client_map(data) {\n var result = {\n \"1\": [0, 0, 0],\n \"2\": [0, 0, 0],\n \"3\": [0, 0, 0],\n \"4\": [0, 0, 0],\n \"5\": [0, 0, 0],\n \"6\": [0, 0, 0]\n }\n for (var i = 0; i < data.length; i++) {\n if (data[i].numberOfAccessPoints <= 6) {\n result[data[i].numberOfAccessPoints][0] += 1;\n\n if ((+new Date) - data[i][\"startObservationTimeInUTC\"] <= 10000) {\n result[data[i].numberOfAccessPoints][1] += 1;\n } else {\n result[data[i].numberOfAccessPoints][2] += 1;\n }\n } else {\n result[6][0] += 1;\n if ((+new Date) - data[i][\"startObservationTimeInUTC\"] <= 10000) {\n result[6][1] += 1;\n } else {\n result[6][2] += 1;\n }\n }\n\n }\n result[\"6+\"] = result[\"6\"];\n delete result[\"6\"];\n return result;\n }", "title": "" }, { "docid": "cf7a4bca8882e0bc08d901805dc01437", "score": "0.54106617", "text": "function DataServer(ioSocky, bridgeSink, devMode) {\n /**\n * @typedef[ClientSub @dict[\n * @key[client IOClient]{\n * The socket.io connection for the subscriber.\n * }\n * @key[activeSub Boolean]{\n * Are we actively subscribed (to something)? This is set to true when\n * a subscription is made and set to false if we unsubscribe. We track\n * this independently of `treeDef`/`treeCache` so that if a resubscribe\n * attempt is made we still know what their last subscription was.\n * (We do expect this to happen fairly frequently when the user\n * transitions from viewing pushlogs to viewing specific details, but where\n * it is not clear the user will return to the pushlog anytime soon, if\n * ever.)\n * }\n * @key[treeDef @oneof[null BuildTreeDef]] {\n * The tree the user is subscribed to; initially null and set to null if a\n * gibberish subscription request is received.\n * }\n * @key[treeCache TreeCache]\n * @key[newLatched Boolean]{\n * Does this client want to hear about all new pushes?\n * }\n * @key[highPushId Number]{\n * The inclusive push id of the highest / most recent push the client is\n * interested in / displaying and already has valid data for.\n * }\n * @key[pushCount Number]{\n * The number of pushes, starting from `highPushId` and iterating lower,\n * that the client is interested in displaying. This may be zero.\n * }\n * @key[pendingRetrievalPushId @oneof[null Number]]{\n * If non-null, the push id the client is waiting for data on. We\n * clear this only once we have issued the write for the push.\n * }\n * @key[seqId Number]{\n * The last sequence id received in a request from the client. Initially\n * set to 0, with the first expected sequence id being 1. The response\n * for messages will bear the sequence id of the triggering command.\n * (And unsolicited messages sent to the client will have a sequence id\n * of -1.)\n *\n * We use this as a sanity checking measure because the transport\n * mechanism is not truly reliable (although we expect it to be pretty\n * reliable), so we need to know when we desynchronized, as it were.\n * In practice, I expect that just having the client re-send its\n * request with idempotent semantics in event of a timeout (calculated\n * by the client) should be fine; if the server was just really busy,\n * it will ignore the message because of the redundant sequence and\n * respond when it was going to get to it anyways.\n * }\n * ]]\n **/\n /**\n * @dictof[\n * @key[treeName String]\n * @value[@listof[ClientSub]]\n * ]\n */\n this._treeSubsMap = {};\n /**\n * @listof[ClientSub]{\n * All of the currently subscribed clients.\n * }\n */\n this._allSubs = [];\n\n /**\n * @typedef[PushCache @dictof[\n * @key[lastUsedMillis Number]{\n * The last timestamp at which this cache entry was \"used\". For our\n * purposes, a DB retrieval to populate the cache entry counts, as does\n * a cache hit, as does a sidebanded update that revises the cache entry\n * that has a subscribed client.\n * }\n * @key[columnsMap @dict[\n * @key[pushId]{\n * The (numeric) push id.\n * }\n * @value[summaryColumns @dictof[\n * @key[columnName]\n * @value[columnValue]\n * ]]{\n * The columns that we believe to currently exist in the hbase store for\n * the summary column family. The detailed information is never cached.\n * }\n * ]]\n * ]]\n * @typedef[TreeCache @dict[\n * @key[meta @dict[\n * @key[treeStatus @oneof[\"OPEN\" \"CLOSED\" \"APPROVAL REQUIRED\"]]{\n * The current status of the tinderbox tree.\n * }\n * @key[treeNotes String]{\n * Any description up on the tinderbox tree status page accompanying the\n * `treeStatus`.\n * }\n * ]]\n * @key[highPushId Number]{\n * The inclusive highest push id we know of.\n * }\n * @key[mostRecentTinderboxScrapeMillis Number]{\n * The timestamp in UTC milliseconds of the most recent (good) scraping of\n * the given tinderbox tree. When loading from the database we derive\n * this value from the meta table. Sidebanded data overwrites this value\n * with an explicit timestamp.\n * }\n * @key[revForTimestamp Number]{\n * Lets us express a change in data/meta-data for a\n * }\n * @key[recentPushCache PushColumnsMap]{\n * Cache of recent pushes as defined by `highPushId` -\n * MAX_RECENT_PUSHES_CACHED;\n * }\n * @key[oldPushCache PushColumnsMap]{\n * MRU cache of entries that do not belong in the `recentPushCache`.\n * Evicted `recentPushCache` entries do not get evicted into here,\n * although it might be a reasonable idea.\n * }\n * ]]\n **/\n /**\n * @dictof[\n * @key[treeName String]\n * @value[TreeCache]\n * ]{\n * Our per-tree caches.\n * }\n */\n this._treeCaches = {};\n\n this._bridgeSink = bridgeSink;\n this._bridgeSink._dataServer = this;\n\n this._db = new $hstore.HStore();\n\n this._devMode = devMode;\n\n this._ioSocky = ioSocky;\n ioSocky.sockets.on(\"connection\", this.onConnection.bind(this));\n}", "title": "" }, { "docid": "e4f0173ac842ae8cd8a7edd5079f3e7e", "score": "0.54085976", "text": "function handleSemClientData(message) {\n var clientDataInfo = JSON.parse(message.toString());\n console.log('Got data from ' + clientDataInfo.clientInfo.name + '. It is: ' + clientDataInfo.clientData);\n}", "title": "" }, { "docid": "c68ba61aa05cb792aba13ec3b68c90ad", "score": "0.5407392", "text": "clientsUpdate(){\n\t\tlet data = {\n\t\t\tworld: {\n\t\t\t\tgrid: this.worldController.world.grid\n\t\t\t},\n\t\t\tunits: this.unitManager.units\n\t\t};\n\t\t\n\t\t// Send data to all players\n\t\tthis.io.emit('change', data);\n\t}", "title": "" }, { "docid": "1d7e411f705c444918a41b3af41f72b4", "score": "0.538656", "text": "function processData(data) {\n var typeInfo = getType(data.entity_type);\n // dati da inviare\n var dataForServer = {};\n\n\n $log.debug(\"processData init: \", data, typeInfo);\n\n\n var typeProperties = typeInfo.perms;\n // check campi del tipo\n for(var key in typeProperties){\n // $log.debug(\"check perm \", key, data[key], data[key] ? true : false );\n // se c'e' setto altrimento metto null\n dataForServer[key] = data[key] ? data[key] : null;\n \n }\n // $log.debug(\"processData, type properties : \", data, dataForServer);\n\n\n // controllo il tempo\n dataForServer = checkTime(data, dataForServer, typeProperties);\n\n // semantica di tipo \n //todo da spostare su server\n switch(data.entity_type){\n case 'FL_EVENTS':\n // controlla duration da doortime, le combina con valid_from e valid_to\n dataForServer = fixDoorTime(data,dataForServer);\n break;\n case 'FL_NEWS':\n // forzo tempo puntuale\n dataForServer.valid_to = dataForServer.valid_from;\n // bug collisione con message del popup\n dataForServer.message = dataForServer.message_text;\n break;\n case 'FL_IMAGES':\n break;\n case 'FL_ARTICLES':\n break;\n case 'FL_GROUPS':\n break;\n default: // FL_PLACES\n // todo delete\n // gestione type\n // if(data.type){\n // // $log.debug(\"trovato il type: \", data.type);\n // dataForServer.type = parseInt(data.type);\n // } else {\n // dataForServer.type = 1;\n // }\n\n }\n \n // conversione formato data\n // bug va in errore il toISOString\n // if(dataForServer.valid_to) {\n // dataForServer.valid_to = dataForServer.valid_to.toISOString();\n // } else {\n // dataForServer.valid_to = null;\n // }\n // if(dataForServer.valid_from) {\n // dataForServer.valid_from = dataForServer.valid_from.toISOString();\n // } else {\n // dataForServer.valid_from = null;\n // }\n\n // $log.debug(\"EntityService, processData, semantica del tipo: \", data, dataForServer);\n \n\n // entity_type, serve per la create\n dataForServer.entity_type = data.entity_type;\n // aggiungo il dominio\n dataForServer.domain_id = self.config.domain_id;\n\n // categorie\n // inserisco le categorie e scarto quelle vuote\n dataForServer = fillCats(data,dataForServer);\n\n // fix tag\n // [{tag:'tag1',....}] > [tag1,tags]\n dataForServer.tags = data.tags.map(function(e){return e.tag});\n\n\n\n\n\n // geometrie\n // gestisco la geometria\n if(data.coordinates){ // se e' un punto\n //todo dataForServer.geometry = {type:\"Points\", coordinates:data.coordinates};\n dataForServer.coordinates = [parseFloat(data.coordinates[0]),parseFloat(data.coordinates[1])];\n dataForServer.zoom_level = parseInt(data.zoom_level);\n // set tile_id\n var tile = pointToTile(dataForServer.coordinates[0], dataForServer.coordinates[1], dataForServer.zoom_level);\n // $log.debug(tile,dataForServer.coordinates[0],dataForServer.coordinates[1],dataForServer.zoom_level,tile[0]+':'+tile[1]+':'+tile[2]);\n dataForServer['tile_id'] = tile[0]+':'+tile[1]+':'+tile[2];\n }\n // todo geometrie diverse\n\n // $log.debug('check data for server',dataForServer);\n return dataForServer;\n }", "title": "" }, { "docid": "19448650c1c8e5545c251f0432d469d3", "score": "0.5383978", "text": "setClientBasicData(state, data) {\n state.user.client = Object.assign({}, data);\n }", "title": "" }, { "docid": "e3847a2ae9edc25501efa43af567fdd3", "score": "0.5381299", "text": "function formatClients(data) {\n\tconst result = {};\n\tdata.vap_table.forEach((vap) => {\n\t\tvap.sta_table.forEach((sta) => {\n\t\t\tif (sta.authorized) {\n\t\t\t\tresult[sta.mac] = sta;\n\t\t\t}\n\t\t});\n\t});\n\treturn result;\n}", "title": "" }, { "docid": "52e017087f59df94f7935ff6e8ef4ebd", "score": "0.53674984", "text": "function getDataFromServer(timestamp_start, timestamp_end, callback) {\n // Ask the server for fresh data:\n socket.emit(\n 'getWeatherData',\n {\n start: timestamp_start,\n end: timestamp_end,\n },\n callback\n );\n }", "title": "" }, { "docid": "be100b3275f9862fc017502b791a6825", "score": "0.5307333", "text": "constructor() {\n this.clients = new Map()\n }", "title": "" }, { "docid": "61d54c3212cabae9f60c5fe7f142a20e", "score": "0.529937", "text": "function ClientConnection() {\n var cSock = this;\n var buffer = new strbuf.StringBuffer();\n var clientName = '__noname__';\n var cid = client_id.toString();\n var clusters = {};\n client_id++;\n\n this.clientClosed = function() {\n console.log('socket closed : (name=' + clientName + ')');\n if (cid in datahub_clients) {\n delete datahub_clients[cid];\n }\n };\n\n this.onData = function(chunk) {\n if ( buffer.append(chunk) ) {\n if ( buffer.runObj(this.jsonRead.bind(this)) ) {\n return true;\n }\n else {\n console.log('ERROR!! data obj error. killing connection. (name=' + clientName + ')');\n }\n }\n else {\n console.log('ERROR!! data error. killing connection. (name=' + clientName + ')');\n }\n cSock.end();\n return false;\n };\n\n this.jsonRead = function(obj) {\n switch (obj.type) {\n case 'id':\n clientName = obj.value;\n console.log('new socket connection : ' + clientName);\n if (cid in datahub_clients) {\n console.log('BUGBUG!!! ' + clientName + ' already registered.');\n // TODO: WHAT TO DO? this case?\n }\n datahub_clients[cid] = this;\n break;\n case 'clusters':\n clusters = obj.value;\n console.log('client ' + clientName + 'sending clusters..');\n for (var cluster_name in clusters) {\n console.log(' cluster ' + cluster_name + ' : ' + clusters[cluster_name].running_queries.length + ' running queries');\n console.log(' cluster ' + cluster_name + ' : ' + clusters[cluster_name].servers.length + ' known servers');\n }\n break;\n case 'cluster':\n if (obj.value.name && obj.value.cluster) {\n if (obj.value.name in clusters) {\n var cq = clusters[obj.value.name].completed_queries;\n clusters[obj.value.name] = obj.value.cluster;\n clusters[obj.value.name].completed_queries = cq;\n }\n else {\n clusters[obj.value.name] = obj.value.cluster;\n clusters[obj.value.name].completed_queries = [];\n }\n\n // var cn=obj.value.name;\n // var cl=obj.value.cluster;\n // console.log('client ' + clientName + 'updated cluster ' + cn);\n // console.log(' ' + cl.running_queries.length + ' running queries');\n // console.log(' ' + cl.servers.length + ' known servers');\n\n // TODO: logging of stalled queries\n }\n break;\n case 'completed_queries':\n if (obj.value.cluster in clusters) {\n // TODO: logging of completed queries\n var c = clusters[obj.value.cluster];\n var cq = c.completed_queries || [];\n var cq_retired = [];\n var cqs_org = cq.length;\n cq = cq.concat(obj.value.completed_queries);\n\n // sort by start_time / descending order\n cq.sort( function(a, b) { return b.start_time - a.start_time; } );\n if (cq.length > 100) {\n cq_retired = cq.splice(100, cq.length-100);\n }\n c.completed_queries = cq; // because of concat(), cq is a different array obj\n\n console.log('rcv_cq() c:' + obj.value.cluster + ' o:' + cqs_org\n + ' +:' + obj.value.completed_queries.length\n + ' -:' + cq_retired.length\n + ' s:' + cq.length);\n }\n break;\n default:\n console.log('BUG! unknown datahub client cmd', obj.type);\n break;\n }\n };\n\n this.getClusters = function() {\n return clusters;\n };\n\n this.setTimeout(0);\n this.bufferSize = 1024*8;\n this.setEncoding('UTF-8');\n this.setNoDelay(true);\n this.setKeepAlive(true);\n\n this.once('close', this.clientClosed.bind(this));\n this.once('end', function() {cSock.end();}); // peer ended connection\n // this.once('timeout', function() {console.log('timeout');self.destroy();});\n this.once('error', function(e) {console.log('error', e);}); // net lib에서 close()해줌. .end()나 .destroy()부를 필요가 없다.\n\n this.on('data', this.onData.bind(this));\n\n console.log('new client connection');\n}", "title": "" }, { "docid": "db332cdb08a50a84f3b98b940c07ed60", "score": "0.52924013", "text": "async function handler(client, res) {\n const data = await (\n client.patient.id ? client.patient.read() : client.request(\"Patient?name=Peters\")\n );\n res.type(\"json\").send(JSON.stringify(data, null, 4));\n}", "title": "" }, { "docid": "a4132cb7e5b69d1acfd30bb091001171", "score": "0.528571", "text": "getPatientsStateObjFromServerObj(data) {\n let patients = {};\n for (let patient of (data.included || [])) {\n let curPatient = this.state.patients && this.state.patients[patient.id];\n patients[patient.id] = {\n name: patient.attributes.fullName,\n id: patient.id,\n isExpanded: (curPatient && curPatient.isExpanded) || false,\n files: {}\n };\n }\n for (let sourceFile of (data.data || [])) {\n let patientId = sourceFile.relationships.parent.data.id;\n patients[patientId].files[sourceFile.id] = _.clone(sourceFile.attributes);\n patients[patientId].files[sourceFile.id].id = sourceFile.id;\n let curFile = this.state.patients && this.state.patients[patientId] && this.state.patients[patientId].files[sourceFile.id];\n patients[patientId].files[sourceFile.id].isExpanded = (curFile && curFile.isExpanded) || false;\n }\n\n return patients;\n }", "title": "" }, { "docid": "feb984ad66e35070e5d1881b45de8054", "score": "0.5234619", "text": "function update_clients(data) {\n\tfor( var clientid in data ) {\n\t\t//Attempt to update snake\n\t\tupdate_snake(clientid, data[clientid]);\n\t};\n}", "title": "" }, { "docid": "ca7675a951fcc0cd2b6e3851ba150fcd", "score": "0.5204727", "text": "function readMarker(data, socket, clients) {\n clientCoordinates[socket.id] = data.coordinates;\n model.aggregate(\n [{\n \"$geoNear\": {\n \"near\": {\n \"type\": \"Point\",\n \"coordinates\": data.coordinates\n },\n \"distanceField\": \"distance\",\n \"spherical\": true,\n \"maxDistance\": 10000\n }\n }],\n function(err, results) {\n if (results && results.length > 0) {\n results = lodash.forEach(results),\n function(item) {\n //remove before send for security\n item._id = 0;\n }\n }\n socket.emit('readMarker', results);\n }\n )\n}", "title": "" }, { "docid": "a217a90ee1cd2c6bb237425c02f14cb3", "score": "0.52001333", "text": "mapData (documents) { return documents; }", "title": "" }, { "docid": "f2a0eddb2358267e790cd4651584261b", "score": "0.5190489", "text": "loadData(req, res) {\n\t\tco(function*() {\n\t\t\t// Get the server.\n\t\t\tconst dashboards = yield this.Dash.find({\n\t\t\t\t'value': req.params.id\n\t\t\t});\n\t\t\tif (dashboards.length == 0) {\n\t\t\t\t// If there is no valid id, 404.\n\t\t\t\tres.status(404).end();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst id = dashboards[0].get('server');\n\n\t\t\t// Make sure the server exists.\n\t\t\tif (this.client.servers.get('id', id) == null) {\n\t\t\t\t// If this is not the last worker, try redirecting.\n\t\t\t\tif (this.bot.worker.id !== this.bot.numWorkers) {\n\t\t\t\t\tres.redirect(this.config.SERVER_URL + '/' + (this.bot.worker.id + 1) + '/dashboard/' + req.params.id);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tres.status(404).end();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Compile the data.\n\t\t\tconst data = {};\n\n\t\t\t// Get data from the bot.\n\t\t\tdata._bot = yield this.bot.getData(id);\n\n\t\t\t// Get data from all plugins.\n\t\t\tfor (const plugin of this.bot.plugins) {\n\t\t\t\tdata[plugin.name] = yield plugin.plugin._getData(id);\n\t\t\t}\n\n\t\t\t// Respond with the data.\n\t\t\tres.json(data);\n\t\t}.bind(this)).catch((err) => {\n\t\t\tconsole.error(err);\n\t\t\tres.status(500).end();\n\t\t});\n\t}", "title": "" }, { "docid": "8cf9fa856a40797e4fb6fc59203e7ac4", "score": "0.51817304", "text": "function requestServerData()\n {\n sendCommand(\"JSON.stringify(Module_GetLastDataNative('\" + pageInstance.alias + \"'));\", handleServerData);\n }", "title": "" }, { "docid": "a62adb7e98b2a132f772eae5d73fa4b7", "score": "0.51730746", "text": "function processMergedData(req, res) {\n sendResponse(req, res);\n}", "title": "" }, { "docid": "7421ea779417384da8668d1cab5aa161", "score": "0.51715225", "text": "update_map() {\n const playerLocations = [];\n Object.keys(this.players).forEach(playerID => {\n playerLocations.push(this.players[playerID].serializeForMapUpdate());\n });\n Object.keys(this.sockets).forEach(socketID => {\n this.sockets[socketID].emit(Constants.MSG_TYPES.MAP_UPDATE, {\n players: playerLocations,\n curr: this.players[socketID].serializeForMapUpdate()\n });\n });\n }", "title": "" }, { "docid": "d20b5e9184d8ff44cf7c06224815e12e", "score": "0.51703477", "text": "function hydrateOnClient() {\n setContent()\n }", "title": "" }, { "docid": "dc17e0150d02b3aa65d23f69fdfc3d38", "score": "0.51602924", "text": "transform(payload) {\n return payload.server = {};\n }", "title": "" }, { "docid": "ac801105e631f8760669d8b081bc09b8", "score": "0.5155232", "text": "function DataPair(server, threshold) {\n // Server threshold defaults to 2\n const serverThreshold = threshold || 2;\n\n // Keep track of initiators\n const inits = new Initiators();\n const initList = inits.list;\n let initNumber = 0;\n const currentSenders = {};\n\n const io = socket(server);\n \n io.on('connection', function(client) {\n \n // Check if client has already downloaded data\n client.emit('check_data');\n client.on('check_data', (downloaded) => {\n if (!downloaded) getData(client, io, serverThreshold);\n });\n \n // Handle client becoming available\n client.on('available', () => {\n // Add them to list of available initiators\n inits.add(client.id); \n // If the client was sending, remove them from list of current senders\n if (currentSenders[client.id]) {\n delete currentSenders[client.id];\n } \n initNumber++;\n });\n \n // Handle client disconnecting\n client.on('disconnect', () => {\n // If the client was an available initiator, remove them\n if (initList[client.id]) {\n inits.remove(client.id);\n initNumber--;\n } \n // If the client was currently sending files, tell the receiver to get data from server instead\n if (currentSenders[client.id]) {\n io.to(currentSenders[client.id]).emit('access_directly_from_server');\n delete currentSenders[client.id];\n } \n }); \n\n // Pass signaling messages along to paired client\n client.on('signaling', (messageReceived, recipient) => {\n io.to(recipient).emit('signaling', messageReceived);\n });\n })\n\n // Get data from either server or another client\n function getData(client, io, serverThreshold) { \n\n // If there are not enough available clients, get directly from server\n if (initNumber < serverThreshold) { \n client.emit('access_directly_from_server');\n } else { // Otherwise, get data from a peer\n // Pair the two clients\n client.emit('receiver', inits.head);\n io.to(inits.head).emit('sender', client.id);\n // Update list of potential initiators\n currentSenders[inits.head] = client.id;\n inits.remove(inits.head);\n initNumber--;\n }\n }\n}", "title": "" }, { "docid": "c44e992d637400d23701edf3c570f336", "score": "0.514794", "text": "function redirectOtherClients(ip)\r\n{\r\n //Message Object\r\n // type: \"change server\"\r\n // data: ip: Sends ip of new server\r\n var message = {type: \"change server\", data:ip};\r\n //the message object in string form\r\n var messageStr = JSON.stringify(message);\r\n console.log(\"Redirecting clients to :\" + ip);\r\n //loop through each client connection\r\n clientConnections.forEach(function (clientSocket)\r\n {\r\n //Sends message to client\r\n clientSocket.write(messageStr);\r\n });\r\n}", "title": "" }, { "docid": "c256fdf8050d83f1353356411bdbae0f", "score": "0.5133472", "text": "function eventsHandler(req, res, next) {\n // Mandatory headers and http status to keep connection open\n const headers = {\n 'Content-Type': 'text/event-stream',\n 'Connection': 'keep-alive',\n 'Cache-Control': 'no-cache'\n };\n res.writeHead(200, headers);\n \n // After client opens connection send all nests as string\n const data = `data: ${JSON.stringify(NUMBER_CONVERTED)}\\n\\n`;\n res.write(data);\n \n // Generate an id based on timestamp and save res\n // object of client connection on clients list\n // Later we'll iterate it and send updates to each client\n const clientId = Date.now();\n const newClient = {\n id: clientId,\n res\n };\n CLIENTS.push(newClient);\n \n // When client closes connection we update the clients list\n // avoiding the disconnected one\n req.on('close', () => {\n console.log(`${clientId} Connection closed`);\n CLIENTS = CLIENTS.filter(c => c.id !== clientId);\n });\n }", "title": "" }, { "docid": "843da20611885a0b11961fd241f536e7", "score": "0.5120498", "text": "function onData(data) {\n Object.keys(data).forEach(key => {\n sets[key].write(data[key]);\n });\n }", "title": "" }, { "docid": "252a4498d92d4949b4f13765e374d86f", "score": "0.5119549", "text": "function handleData(dat, client) {\n\n var sensorP = database.Sensors.findByPhoneNumber(client.name);\n\n var messageP = sixElementUtils.printMsg(dat, client);\n\n Promise.all([sensorP, messageP])\n .then(function(values) {\n return ({sensor: values[0], message: values[1]});\n })\n\n .then(function(data) {\n\n switch (data.message.type) {\n case 'message':\n if (data.message.decoded === 'init') {\n var date = new Date();\n sendCommand(client.socket, 'date ' + date.toISOString())\n }\n break;\n\n case 'status':\n var msgStatus = JSON.parse(data.message.decoded);\n database.Sensors.update(data.sensor.id, {\n latest_input: msgStatus.info.command,\n latest_output: msgStatus.info.result,\n quipu_status: msgStatus.quipu.state,\n sense_status: msgStatus.sense\n })\n .then(function(){\n debug('id', data.sensor.id);\n debug('Storage Success');\n return {\n sensorId: data.sensor.id,\n socketMessage: msgStatus\n };\n })\n .then(function(result) { // Send data to admin\n eventEmitter.emit('data', {type: 'status', data: result});\n })\n .catch(function(err){\n console.log(\"Storage FAILURE: \", err);\n });\n break;\n\n case 'data':\n var msgDatas = JSON.parse(data.message.decoded);\n Promise.all(msgDatas.map(function(msgData){\n var messageContent = {\n 'sensor_id': data.sensor.id,\n 'signal_strengths': msgData.signal_strengths,\n 'measurement_date': msgData.date\n };\n var socketMessage = Object.assign({}, messageContent);\n socketMessage['installed_at'] = data.sensor.installed_at;\n\n // persist message in database\n if (msgData.date) {\n return database.SensorMeasurements.create(messageContent)\n .then(function(id) {\n return {\n sensorMeasurementId: id,\n measurement: socketMessage\n }\n })\n .catch(function(error){\n console.log(\"Storage FAILURE: \", error);\n });\n }\n }))\n .then(function(results) { // Send data to app\n debug('Storage SUCCESS');\n eventEmitter.emit('data', {type: 'data', data: results});\n })\n .catch(function(err) {\n console.log(\"Storage FAILURE: \", err);\n })\n break;\n }\n })\n .catch(function(err){\n console.log('ERROR : ' + err);\n });\n}", "title": "" }, { "docid": "63cc2111c3a05e8cf2e3b62645f48c26", "score": "0.51133335", "text": "function handleServerData(jsonData)\n {\n var g1,g2,g3,g4;\n /* Loop through all results */\n jQuery.each(jsonData, function(alias, data)\n {\n\t /* Loop through all values */\n\t jQuery.each(data, function(name, value)\n\t {\n\t /* Check if the value is simple or complex */\n\t if (typeof value.value != \"string\")\n\t {\n\t jQuery.each(value.value, function(name2, value2)\n\t {\n\t\tif (name2 == \"Reference\") \n\t\t{\n\t\t g2 = value2;\n\t\t}\n\t\tif (name2 == \"Measurment\") \n\t\t{\n\t\t g1 = value2;\n\t\t}\n\t\tif (name2 == \"PWM\") \n\t\t{\n\t\t g3 = value2;\n\t\t}\n\t\tif (name2 == \"Sum\") \n\t\t{\n\t\t g4 = value2;\n\t\t}\n\t });\n\t }\n\t });\n });\n pageInstance.pageInputElements[\"grid\"].html($(\"#page-PID-grid-template\").tmpl({ grid1: \"Uppmätt: \"+g1, grid2: \"Referens: \"+g2,grid3: \"PWM: \"+g3,grid4: \"Förändring: \"+g4 }));\n }", "title": "" }, { "docid": "c35a4304058d2a087d3546844971831e", "score": "0.51058656", "text": "function transformData(data, codes) {\n return data.map(function(entity) {\n var evtArray = entity[\"event_data\"].split(\":\");\n entity[\"event_data\"] = remapEventCodes(evtArray, codes);\n return entity;\n });\n }", "title": "" }, { "docid": "158078720638d791597c64cd34664b30", "score": "0.5104035", "text": "async function handler(client, res) {\n const data = await (\n client.provider.id ? client.provider.read() : client.request(\"Provider\")\n );\n res.type(\"json\").send(JSON.stringify(data, null, 4));\n}", "title": "" }, { "docid": "bf1f8b33a0ed1570bcef1f97439c8e93", "score": "0.50971866", "text": "@wire(getUserLogins)\n loginUsers({ error, data }) {\n if (data) {\n for(i=0; i < data.length; i++) {\n console.log('data is : ' + JSON.stringify(data[i]));\n this.userIds = [...this.userIds ,{value: data[i].Id , label: data[i].User_Name__c}]; \n \n //adding values to map\n this.usermap.set(data[i].Id, { \n UserName : data[i].User_Name__c,\n FirstName : data[i].First_Name__c, \n LastName : data[i].Last_Name__c, \n Department : data[i].Department__c, \n City : data[i].City__c, \n ProfilePicPath : data[i].Profile_Picture_Path__c\n });\n }\n console.log(this.usermap.keys()); \n console.log(this.usermap.values()); \n this.error = undefined;\n } else if (error) {\n this.error = error;\n }\n }", "title": "" }, { "docid": "b780b1f665e350fa0e78ab4e5bb797e1", "score": "0.5086698", "text": "function processData(data, type) {\n\tsocketManager.processData(data, type);\n}", "title": "" }, { "docid": "aee909cbf68b0fb91e32e995f6e210d3", "score": "0.50831187", "text": "function _fnServerData() {\n pageRequestParams = paramList;\n this.pagingCallback.apply(this, arguments);\n }", "title": "" }, { "docid": "a1d8e5ee9494faeb98d0e51b234fa82c", "score": "0.5077235", "text": "function onClientName(data){\n $log.info('[GOT]'+socketEvents.clientName+': '+data.newName);\n clientValuesFactory.setDeviceName(data.newName);\n }", "title": "" }, { "docid": "2ba408dd6fed5df804c77515b5dff06d", "score": "0.5036724", "text": "data() {\n return this._userDataWriter.convertObjectMap(this._data);\n }", "title": "" }, { "docid": "1c251efd19a52d4b9da9f94ecfd78829", "score": "0.5033621", "text": "function redirectClients()\r\n{\r\n //Message Object\r\n // type: \"become server\"\r\n // data: \"undefined\" : not required\r\n var message = {type:\"become server\",data:\"undefined\"};\r\n //the message object in string form\r\n messageStr = JSON.stringify(message);\r\n //Send Message to first client only\r\n clientConnections[0].write(messageStr);\r\n}", "title": "" }, { "docid": "8fbc7243c7404b0877ecdde07d3dd0bd", "score": "0.50292623", "text": "function ConnectionMap() { }", "title": "" }, { "docid": "8fbc7243c7404b0877ecdde07d3dd0bd", "score": "0.50292623", "text": "function ConnectionMap() { }", "title": "" }, { "docid": "296077d9e8aee2457a2fcde44916c051", "score": "0.50268316", "text": "function getData(req, res, next) {\n res.send(req.data);\n}", "title": "" }, { "docid": "5e90ed9fc50443278b3a36454a33d97c", "score": "0.5017555", "text": "function sendClients(){\n\tvar response = {};\n\t\n\t\tvar _clients = [];\n\t\tfor(var c = 0;c<clients.length;c++){\n\t\t\t_clients[c]={};\n\t\t\t_clients[c].sound = clients[c].sound;\n\t\t\t_clients[c].channel = clients[c].channel;\n\t\t}\n\t\tresponse.clients = _clients;\n\t\n\treturnToBrowser(response);\t\n}", "title": "" }, { "docid": "933b3b326f47ec6ea415ed62c1232496", "score": "0.50151354", "text": "function gotServerRoleDriveMappingList(data) {\r\n serverroleDrivemappingList = data;\r\n //alert(\"init \" + JSON.stringify(data));\r\n }", "title": "" }, { "docid": "45b37e3531d949582257a7a5fec418b8", "score": "0.50135523", "text": "function encodeGameContainerData(playerIdentification) {\r\n\t\t//push all data into list to encrypt later\r\n\t\tvar encodedPlayerOneData = [];\r\n\t\tvar encodedPlayerTwoData = [];\r\n\t\t\r\n\t\t\r\n\t\tvar up = {};\r\n\t\t//for player one encryption\r\n\t\tif (playerIdentification == 0) { //sending to client 1\r\n\t\t\t//Player Data\r\n\t\t\tup.CID = clientOne.id;\r\n\t\t\t//encryted data of you player\r\n\t\t\tup.uIn = {};\r\n\t\t\tup.uIn.rL = encodeList(\"\", characterOne.getResourcesArray());\r\n\t\t\tup.uIn.ss = characterOneRace.getSynchString();\r\n\t\t\tup.uIn.rI = characterOneRace.getRaceAbilityInfo();\r\n\t\t\tup.uIn.sft = boardOne.getShiftOccurred();\r\n\t\t\tup.uIn.spa = characterOne.getSpell().attunedCount();\r\n\t\t\t\r\n\t\t\t//Opponent Data\r\n\t\t\t//encrypted data of opp player\r\n\t\t\tup.oIn = {};\r\n\t\t\tup.oIn.a = clientHandlerTwo.getOpponentActionString(); //client 2's actions\r\n\t\t\t\r\n\t\t\tup.uB = boardOne.compressBoard();\r\n\t\t\tup.oB = boardTwo.compressBoard();\r\n\t\t\t\r\n\t\t\tup.oIn.rL = encodeList(\"\",characterTwo.getResourcesArray());\r\n\t\t\tup.oIn.ss = characterTwoRace.getSynchString();\r\n\t\t\tup.oIn.rI = characterTwoRace.getRaceAbilityInfo();\r\n\t\t\t//up.oIn.r = characterTwoRace.getColRow().getSecond();\r\n\t\t\t//up.oIn.SFL = encodeFairyList(\"k\", charTwoStationaryShieldFairies);\r\n\t\t\tup.oIn.sft = boardTwo.getShiftOccurred();\r\n\t\t\t//spell active flag\r\n\t\t\tup.oIn.spa = characterTwo.getSpell().attunedCount();\r\n\t\t} else if (playerIdentification == 1) { //sending to client 2\r\n\t\t\t//Player Data\r\n\t\t\tup.CID = clientTwo.id;\t\r\n\t\t\t//encryted data of you player\r\n\t\t\tup.uIn = {}; \r\n\t\t\tup.uIn.rL = encodeList(\"\", characterTwo.getResourcesArray());\r\n\t\t\tup.uIn.ss = characterTwoRace.getSynchString();\r\n\t\t\tup.uIn.rI = characterTwoRace.getRaceAbilityInfo();\r\n\t\t\tup.uIn.sft = boardTwo.getShiftOccurred();\r\n\t\t\tup.uIn.spa = characterTwo.getSpell().attunedCount();\r\n\t\t\t\r\n\t\t\t//Opponent Data\r\n\t\t\t//encrypted data of opp player\r\n\t\t\tup.oIn = {};\r\n\t\t\tup.oIn.a = clientHandlerOne.getOpponentActionString(); //client 1's actions\r\n\t\t\t\r\n\t\t\tup.uB = boardTwo.compressBoard();\r\n\t\t\tup.oB = boardOne.compressBoard();\r\n\t\t\t\r\n\t\t\tup.oIn.rL = encodeList(\"\",characterOne.getResourcesArray());\r\n\t\t\tup.oIn.ss = characterOneRace.getSynchString();\r\n\t\t\tup.oIn.rI = characterOneRace.getRaceAbilityInfo();\r\n\t\t\tup.oIn.sft = boardOne.getShiftOccurred();\r\n\t\t\t//spell active flag\r\n\t\t\tup.oIn.spa = characterOne.getSpell().attunedCount();\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn up;\t\t\r\n\t}", "title": "" }, { "docid": "a0497fb1632762c5d4afccb0404ea69e", "score": "0.50131816", "text": "function sendMessageToClients(data)\r\n{\r\n //Message Object\r\n // type: \"message\"\r\n // data: data: core of message\r\n var message = {type:\"message\",data:data};\r\n //the message object in string form\r\n messageStr = JSON.stringify(message);\r\n console.log(\"Sent Message to clients : \" + data);\r\n //loop each connection\r\n clientConnections.forEach(function (clientSocket)\r\n {\r\n //Send messsage over socket\r\n clientSocket.write(messageStr);\r\n });\r\n}", "title": "" }, { "docid": "eb5e1d2ec1e1e0b51730e448183d120f", "score": "0.50075096", "text": "function processServerAuthForClient(data) {\n\t\t\tif (External.isClientAuth(data.source)) {\n\t\t\t\tstore.set('pi_' + data.source + '_profile', data.profile);\n\t\t\t\taccessTokens[source].token = data.accessToken;\n\t\t\t\taccessTokens[source].exp = data.exp;\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "3101b78138683327c75ff7826285b9e5", "score": "0.50034755", "text": "function enviarDatosCliente() {\n var data = {\n cedula: numeroDocumento,\n tramite: tipoTramite,\n detalle: detalleTramite,\n extras: extrasTramite,\n turno: 1,\n atendiendo: false,\n }\n socket.emit('enviarALServer', data);\n data = '';\n}", "title": "" }, { "docid": "05aeb2bb9bee24e85c1c28459e91d77d", "score": "0.5002354", "text": "sendInfo(socket) {\n const packet = {\n uri: '/distributes',\n method: 'GET',\n key: 0,\n params: []\n };\n for (let n in map) {\n packet.params.push(map[n].info);\n }\n if (socket) { // Send to specific node \n this.write(socket, packet);\n } else { // Broadcast to the all nodes\n for (let n in map) {\n this.write(map[n].socket, packet);\n }\n }\n }", "title": "" }, { "docid": "7b58826eb2f09aee23d5e6eb21693e80", "score": "0.49954236", "text": "function sendData(request) {\n // print out the fact that a client HTTP request came in to the server:\n console.log(\"Got a client request, sending them the data.\");\n // respond to the client request with the latest serial string:\n request.respond(latestData);\n}", "title": "" }, { "docid": "f4c42a90e57e7c6aba72ad3e850677bd", "score": "0.4994363", "text": "function createServer(client, req) {\n \n //建立到目标服务器的连接\n var server = net.createConnection(req.port, req.host, function(ls) {\n if (req.method == 'CONNECT') {\n client.write(\n new Buffer(\"HTTP/1.1 200 Connection established\\r\\nConnection: close\\r\\n\\r\\n\")\n );\n } \n else {\n \n server.write(buffer);\n } \n \n //交换服务器与浏览器的数据\n client.on(\"data\", function(data) {\n server.write(data); \n console.log('data exchange form client and server');\n });\n \n server.on(\"data\", function(data) { \n //this is our right request o~~~~~~~\n var str = data.toString('utf8');\n \n //console.log('server on data:', str);\n str = str.replace(/Content\\-Type\\: text\\/html/, 'Content-Type: application/json');\n str = str.replace(/text\\/html\\: utf\\-8\\r\\n/, '');\n data = new Buffer(str, 'utf8');\n //console.log(data.toString('utf8'))\n client.write(data); \n });\n\n \n\n });\n }", "title": "" }, { "docid": "a1cd44222f832f8d5523cf2b1ec6efa0", "score": "0.49814817", "text": "function createMapper (\n clientManifest\n) {\n var map = createMap(clientManifest);\n // map server-side moduleIds to client-side files\n return function mapper (moduleIds) {\n var res = new Set();\n for (var i = 0; i < moduleIds.length; i++) {\n var mapped = map.get(moduleIds[i]);\n if (mapped) {\n for (var j = 0; j < mapped.length; j++) {\n res.add(mapped[j]);\n }\n }\n }\n return Array.from(res)\n }\n}", "title": "" }, { "docid": "a1cd44222f832f8d5523cf2b1ec6efa0", "score": "0.49814817", "text": "function createMapper (\n clientManifest\n) {\n var map = createMap(clientManifest);\n // map server-side moduleIds to client-side files\n return function mapper (moduleIds) {\n var res = new Set();\n for (var i = 0; i < moduleIds.length; i++) {\n var mapped = map.get(moduleIds[i]);\n if (mapped) {\n for (var j = 0; j < mapped.length; j++) {\n res.add(mapped[j]);\n }\n }\n }\n return Array.from(res)\n }\n}", "title": "" }, { "docid": "64623164e69d93fcaea01837deca32d1", "score": "0.4949268", "text": "function Client(data) {\n var self = this;\n self.name = data.name;\n self.personal_info = data.personal_info;\n self.prescriptions = data.prescriptions;\n self.medication_log = data.medication_log;\n}", "title": "" }, { "docid": "8e273c51fd8681bbabf22946ca0e4a05", "score": "0.4948085", "text": "function sendTMPToClient(snap) {\n var value = snap.val(); //Data object from Firebase\n\n var DataID = Object.keys(value)[0]; //Here we use a function that retrieves all the data keys (the ID of the data entry)\n var data = value[DataID]; //Then we use the ID to retrieve the data from the JSON-array\n console.log(\"Temperature: \" + data);\n client.emit('TMPtoClient', data); //We emit to the same listener on the webpage as in the earlier io.emit command ('data') in the dataFromBoard function\n }", "title": "" }, { "docid": "a3c3d2bff7ba53badce7dac3f715e2bb", "score": "0.49470147", "text": "function getData()\n {\n\n\n var conn = skynet.createConnection({\n \"uuid\": currentSettings.uuid,\n \"token\": currentSettings.token,\n \"server\": currentSettings.server, \n \"port\": currentSettings.port\n }); \n \n conn.on('ready', function(data){ \n\n conn.on('message', function(message){\n\n var newData = message;\n updateCallback(newData);\n\n });\n\n });\n }", "title": "" }, { "docid": "aa40a16f2823ba1383288366f7cb1fc0", "score": "0.49434355", "text": "requestLobbyData() {\n this.socket.emit('requestLobbyData', (data) => {\n this.refreshTable(this.roomTable, data);\n });\n }", "title": "" }, { "docid": "5fa5c68e43edde5e4e77090d5f29a095", "score": "0.4933067", "text": "function sendSocketData(message, data){\n data[\"location\"] = [positions[0][1], positions[0][2]];\n if(connected){\n socket.emit(message, data);\n }\n else{\n // cache data\n var cacheItem = [message, data];\n cache.push(cacheItem);\n }\n}", "title": "" }, { "docid": "b3200d43b9f203b83c25a747c3f4b1c5", "score": "0.49311566", "text": "transform (client) {\n client = client.toJSON()\n Object.entries(client).forEach(([key, val]) => {\n if (val === null) {\n client[key] = '';\n }\n })\n return client\n }", "title": "" }, { "docid": "76f3081fd93d3f6b735fb2bbc878606e", "score": "0.49303707", "text": "function init_data_network() {\n var dnet_master = net_toggle(\"server_forest\")\n var dnet_cave = net_toggle(\"server_cave\")\n var dnet_client = net_toggle(\"client\")\n\n\n // dnet_master.listen(\"test\", (data)=>{\n // print(111, \"master recv test\", data)\n // return \"dnet_master\"\n // })\n // dnet_client.listen(\"test\", (data)=>{\n // print(111, \"dnet_client recv test\", data)\n // return \"dnet_client\"\n // })\n\n self.new_world_flag = 0;\n dnet_master.listen(\"set_new_world_flag\", (data)=>{\n self.new_world_flag = data.data;\n print(\"set_new_world_flag\", data)\n })\n\n // new version *.meta not infect backup\n dnet_master.listen(\"get_new_world_flag\", (data)=>{\n var flag = self.new_world_flag;\n self.new_world_flag = 0\n print(\"get_new_world_flag\", flag)\n return flag;\n })\n\n\n self.dnet_cave = dnet_cave\n self.dnet_master = dnet_master\n self.dnet_client = dnet_client\n\n}", "title": "" }, { "docid": "e8d402c60ac571fc02677e6cfd47a15f", "score": "0.492284", "text": "static requestDataFromServer() {\n function callback(resp) {\n const data = JSON.parse(resp);\n MainView.updateClownList(data);\n }\n HttpRequest.getRequest(\"listClowns\", callback);\n }", "title": "" }, { "docid": "8f4b8d78e8f87614755cc8894005ccb9", "score": "0.4917555", "text": "function sendToService(event, _client, data) {\n var _id = shortid.generate();\n clients.push({id: _id, client: _client});\n freeSocketSend(event, data, _id);\n }", "title": "" }, { "docid": "19ec903e3c6fea6ffc3ca2d5221b0f04", "score": "0.49146497", "text": "rpcFromClient() {\n entrie = [];\n this.appendEntriesRPC(term,)\n }", "title": "" }, { "docid": "0df6a4bbf538077cf4e54baf776681c0", "score": "0.4912677", "text": "function _extractPlayersInfo(serverData) {\r\n\r\n //Set date on server\r\n serverData['date'] = new Date(moment().format('MM-DD-YYYY'));\r\n\r\n var _charactersFolder = charactersBaseFolder + serverData['serverName'] + '/';\r\n\r\n\r\n $log.debug('Processing [%s] characters', colors.yellow(serverData['serverName']));\r\n\r\n //Tell to update characters\r\n gameForgeServer.updateCharacters(serverData, _charactersFolder);\r\n }", "title": "" }, { "docid": "320a9c95342153a12f9cb92d4b40a119", "score": "0.49121857", "text": "function processClientSet(msgData){\n\twrConfig.localIP=msgData.ip;//save local IP\n\tconsole.log(\"INFO: processClientSet>sending WR init request\",msgData);\t\n\twsSend({action:WS_ACTION_WRCONN_INIT,data:{fromIP:wrConfig.localIP,reqId:wsConfig.requesterID}});\n}", "title": "" }, { "docid": "bed20348599fd3d9412435e640103a34", "score": "0.49096054", "text": "function onDBDataRequest() {\n\n\tthis.emit( 'db data returned', {\n\t\tusers: omahaPeople });\n\n\t// Send array of current remote humanPlayers already authd\n\t// Send existing humanPlayers to the new player\n\tvar i, existingPlayer;\n\tfor ( i = 0; i < humanPlayers.length; i++ ) {\n\t\texistingPlayer = humanPlayers[i];\n\t\tthis.emit( 'new player', {\n\t\t\tid: existingPlayer.id,\n\t\t\tx: existingPlayer.getX(),\n\t\t\ty: existingPlayer.getY(),\n\t\t\thandle: existingPlayer.handle,\n\t\t\timg: existingPlayer.img } );\n\t}\n\n\tthis.emit( 'new tweet', { tweet: lastTweet } );\n}", "title": "" }, { "docid": "487acb26dfe37374d3ebec0307724a38", "score": "0.4905084", "text": "function fetchServerData(serverId){\n\tapi.get(`chat/server/${serverId}`)\n\t\t.then((response) => { return response;});\n}", "title": "" }, { "docid": "d28424a2c98b9e127a55a2eaa3cf952e", "score": "0.49041677", "text": "function createMapper(clientManifest) {\n var map = createMap(clientManifest); // map server-side moduleIds to client-side files\n return function mapper(moduleIds) {\n var res = new Set();\n for (var i = 0; i < moduleIds.length; i++) {\n var mapped = map.get(moduleIds[i]);\n if (mapped) {\n for (var j = 0; j < mapped.length; j++) {\n res.add(mapped[j]);\n }\n }\n }\n return Array.from(res);\n };\n }", "title": "" }, { "docid": "d28424a2c98b9e127a55a2eaa3cf952e", "score": "0.49041677", "text": "function createMapper(clientManifest) {\n var map = createMap(clientManifest); // map server-side moduleIds to client-side files\n return function mapper(moduleIds) {\n var res = new Set();\n for (var i = 0; i < moduleIds.length; i++) {\n var mapped = map.get(moduleIds[i]);\n if (mapped) {\n for (var j = 0; j < mapped.length; j++) {\n res.add(mapped[j]);\n }\n }\n }\n return Array.from(res);\n };\n }", "title": "" }, { "docid": "7222d9d18a2f260d6d9fdea92ced2213", "score": "0.48988974", "text": "function server_response (request, response) {\n\tglobal.log ('in server_response, request: ' + request.url);\n\tvar path = require('url').parse(request.url, true).pathname;\n\t\n\t// parse the request\n\tglobal.log ('in server_response, pathname: ' + path );\n\tglobal.log ('in server_response, global.datafilename: ' + global.datafilename );\n\tif (path == ws.url+'/get') get (request, response, global.datafilename);\t\t\n\n\t// get gets the last 100 or so entries in the datail\n\telse if (path == ws.url+'/getnolines') getnolines (request, response, global.datafilename);\t\t\n\n\t// getfirst gets the first entry in the dta file\n\telse if (path == ws.url+'/getfirst') executethis (request, response, global.datafilename, 'head -1 ');\t\t\n\t\n\t// getlast gets the last entry\n\telse if (path == ws.url+'/getlast') executethis (request, response, global.datafilename, 'tail -1 ');\t\t\n\t\n\t// getglobal returns the global object to the client to transport server info\n\telse if (path == ws.url+'/getglobals') {\n\t\tvar params = require('url').parse(request.url, true),\n\t\t\tresponseData = JSON.stringify(global);\n\n\t\t\t// if the request has a callback parameter, use it to wrap the json oblject with it for jsonp\n\t\t\tif (typeof params.query.callback != 'undefined') \n\t\t\t\tresponseData = wrapWithCallback (responseData, params.query.callback);\n\n\t\tresponse.write (responseData);\n\t\tresponse.end();\n\t}\n\t\n\t// server static files under url \"+/client/\"\n\telse if ( (path.indexOf(ws.url+'/client/') == 0 ) ){\n\t\tvar myfilename = path.substring (path.lastIndexOf('/')+1),\n\t\t\tmyMimeType = \"text/plain\",\n\t\t\tmyFileending = path.substring (path.lastIndexOf('.')+1);\n\t\t\n\t\tswitch (myFileending) {\n\t\t\tcase \"js\":\n\t\t\t\tmyMimeType = \"text/javascript\";\n\t\t\t\tbreak;\n\t\t\tcase \"css\":\n\t\t\t\tmyMimeType = \"text/css\";\n\t\t\t\tbreak;\n\t\t\tcase \"html\":\n\t\t\t\tmyMimeType = \"text/html\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tglobal.log ('serving static file: ' + myfilename + \", myFileending:\" + myFileending + \" mimeType: \" + myMimeType);\n\t\t\n\t\tvar fs = require('fs');\n\t\tfs.readFile(global.srcPath+'main/client/' + myfilename, \"binary\", function (err, file) {\n\t\t\tglobal.log ('readFile: ' + './client/' + myfilename);\n\t\t\t\n\t\t if (err) {\n\t\t\t\t\t\tglobal.log ('ERROR readFile: ' + './client/' + myfilename);\n\t\t response.writeHead(500, {\"Content-Type\": \"text/plain\"});\n\t\t response.write(err + \"\\n\");\n\t\t response.end();\n\t\t return;\n\t\t }\n\t\t\t\t\t\n\t\t\t\t\tglobal.log ('response.write: ' + './client/' + myfilename);\n\t\t response.writeHead(200, {\"Content-Type\": myMimeType});\n\t\t response.write(file, \"binary\");\n\t\t response.end();\t\n\t\t\t\t\tglobal.log ('response.end: ' + './client/' + myfilename);\n\t\t\t});\n\n\t}\n}", "title": "" }, { "docid": "aa75b6246fd687eb63f1ab87c69dbb17", "score": "0.48963916", "text": "_initData() {\n var self = this;\n\n // meta only on client\n this._initCol('meta', function (data) {\n var nodesCol = self._col.node;\n var node = nodesCol.findOne({ _id: data._n }, { transform: nodesCol._dtTransform });\n check(node, WtDataTree.Node);\n return _.construct('fromData', self.getMetaType(data._t), node, data);\n });\n\n\n this._subs = [];\n var b = new WtUtils.ReadyBarrier(self._onReady.bind(self));\n\n self._nodeSub = Meteor.subscribe(self._name + 'Init', b.callback());\n Meteor.subscribe(self._name + 'Immediates', b.callback());\n\n delete self._needInit;\n }", "title": "" }, { "docid": "4877b7b30dc81d1ca4b68e92e8813029", "score": "0.48913714", "text": "'/list'(req, res) {\n res.json(Object.entries(servers).map(entriesMapper))\n }", "title": "" }, { "docid": "3e6a2876961e412b7bfe637416f826a5", "score": "0.48898202", "text": "function sendClientsList() {\r\n io.emit('client list', { time: clients_ids });\r\n}", "title": "" }, { "docid": "565c361cf828e171d70ff6523e48b840", "score": "0.4887691", "text": "function client_get_server_stroke() {\n var data = new Object();\n data.id = tokenId;\n /* Let's not waste memory. Clear the previous timeout*/\n clearTimeout(timeout);\n $.ajax({\n type: 'POST',\n url: '/serverDataForClient',\n data: data,\n async : 'false',\n dataType : 'json',\n cache: false,\n timeout : 5000,\n success : client_got_data_cb,\n error: function() {\n console.log(\"Error in client get /serverData\");\n timeout = setTimeout(client_get_server_stroke, 1000);\n }\n }).done();\n}", "title": "" }, { "docid": "efcb2fa925d10c951ce7cc10fb383714", "score": "0.48720443", "text": "function sendDataSocket(res) {\n socket.send(\n JSON.stringify({\n ID: res.ID,\n TableNumber: res.TableNumber,\n SeatmasterID: res.SeatMasterID,\n MemberID: res.MemberID,\n Row: res.Row,\n Col: res.Col,\n MoveType: 1,\n })\n );\n }", "title": "" }, { "docid": "c7f55a74fce98b00f5efdc19b3125e4c", "score": "0.48655334", "text": "function getServerListToObject(){\t\t\r\n\t\tif(getEle(\"severList\").value != \"\"){\r\n\t\t\tvar jsonObj = JSON.parse(getEle(\"severList\").value);\r\n\t\t\treturn jsonObj;\r\n\t\t}\r\n\t\treturn [];\r\n\t}", "title": "" }, { "docid": "f3ac8a415f478ac82fb7cab00c912b39", "score": "0.4864426", "text": "function ResultsToClient()\n{\n\tvar id = wcqueries[0].id;\n\n\tif (io.sockets.connected[id]) //if client is connected\n\t{\n\t\tio.sockets.connected[id].emit('SearchQueryResult', wcqueries[0].output);\n\t}\n\telse console.log(\"can't send to client because client is not connected\");\n\n\tWCReset();\n}", "title": "" }, { "docid": "fec9aed405c7682c6481539cc220f3e9", "score": "0.48542792", "text": "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"hostReq\"),\n\t\t\tthis.endpoints.get,\n\t\t\tthis.data.get\n\t\t);\n\t}", "title": "" }, { "docid": "6a79f65db19a58ec8addcc61a58cad1b", "score": "0.4853404", "text": "function DataMapper()\n{\n\tDataMapperProxy.call(this);\n}", "title": "" }, { "docid": "2f08cfd7ed8eba1881f2a464c80cd265", "score": "0.48494136", "text": "function requestServerDataUpdate()\n {\n sendCommand(\"JSON.stringify(Module_GetLastDataNative('\" + pageInstance.alias + \"'));\", handleServerDataUpdate);\n }", "title": "" }, { "docid": "75ff454d760ac7d3f655a8a17f32091c", "score": "0.48476374", "text": "updateAllClients() {\n let playerData = [];\n for (let player in this.players) {\n playerData.push(player.data);\n }\n\n for (let player in this.players) {\n player.gameSocket.send(playerData);\n }\n }", "title": "" }, { "docid": "640efbd4c3934a4d8227cbfcfd113667", "score": "0.48472813", "text": "function populateData() {\n var data = {};\n if (connection.jingle) {\n Object.keys(connection.jingle.sessions).forEach(function (sid) {\n var session = connection.jingle.sessions[sid];\n if (session.peerconnection && session.peerconnection.updateLog) {\n // FIXME: should probably be a .dump call\n data[\"jingle_\" + session.sid] = {\n updateLog: session.peerconnection.updateLog,\n stats: session.peerconnection.stats,\n url: window.location.href\n };\n }\n });\n }\n var metadata = {};\n metadata.time = new Date();\n metadata.url = window.location.href;\n metadata.ua = navigator.userAgent;\n if (connection.logger) {\n metadata.xmpp = connection.logger.log;\n }\n data.metadata = metadata;\n return data;\n}", "title": "" }, { "docid": "00ad89f9721d3b4fb522faa9bfe9f3e3", "score": "0.48422894", "text": "applyAccessMapToData(accessMap, data) {}", "title": "" }, { "docid": "40457ba132528007211d25bda831f03e", "score": "0.48326015", "text": "data() {\n\t\treturn JSON.parse(this.httpGet(this.remote_endpoint+\"/example/data\"));\n\t}", "title": "" }, { "docid": "a4c7657839048bb2d9dce1a92c9ff0ef", "score": "0.48303244", "text": "data() {\n let data = {};\n\n for (let property in this.originalData) {\n data[property] = this[property];\n }\n\n return Object.assign(data, this.passover);\n }", "title": "" }, { "docid": "817400c234588c18001bcb688e907cd9", "score": "0.48183474", "text": "function synchronize_with_server() {\r\n exprs = get_part_exprs();\r\n //send_receive_json(exprs, handle_server_response);\r\n send_receive_json(\"a:12\", change_every_five_seconds);\r\n }", "title": "" }, { "docid": "65941c6a2cad3259338c98b544cb0669", "score": "0.4811215", "text": "function processData(req, res, cb) {\n res.data.post = {};\n res.data.post = res.data.db;\n cb(null, 'post', req, res);\n}", "title": "" }, { "docid": "1347c0927ae02ce8cc4b69891cadcd4a", "score": "0.48019093", "text": "async listofDataMappings({ request, response, error }) {\n try {\n var data = request.body;\n let datafields = await Database.connection('oracledb').select('*').from('PROJ_DATA_MAPPINGS')\n .where('SOURCE_ENTITY_ID', data.sourceentityid);\n // console.log(data.sourceentityid);\n //console.log('sdsddsf',datafields);\n return response.status(200).send({ success: true, data: datafields, msg: 'Successfully get the fields', err: null });\n }\n catch (err) {\n return response.status(400).send({ success: false, data: null, msg: 'Error while getting the fields', error: err });\n }\n // finally{\n // Database.close(['oracledb']);\n // }\n }", "title": "" }, { "docid": "681a472e595f59f8215c94a9bb55f282", "score": "0.47904018", "text": "function sendInitialData(socket) {\r\n try {\r\n // Send the initial data to a new connected client\r\n var msgToReturn = []\r\n for(var cosa in messageList) {\r\n if(messageList[cosa] != undefined && messageList[cosa] != null) {\r\n msgToReturn.push(messageList[cosa]);\r\n }\r\n }\r\n var postData = {type: 'init-data', content: {msgs: msgToReturn ,authorId: socket.id, combination: Combinator.getCombination()}}\r\n var retornar = JSON.stringify(postData);\r\n users[socket.id].send(retornar);\r\n\r\n } catch(e) {\r\n console.log(\"Can't send newMessage: \", e.data);\r\n return;\r\n }\r\n }", "title": "" }, { "docid": "5e0c6c76acdaf0d0e7f9697157bb5852", "score": "0.47878593", "text": "function updateWithDataFromServer(data) {\n var playerResourceData = data.resource_data;\n var playerResourceRatesData = data.resource_rates_data;\n var playerModelUpgrades = data.upgrade_model;\n var playerModelGameProgress = data.progress_model;\n // Replace default resource values with host player's resource values.\n if (playerResourceData !== null) {\n modelResource['lumber'] = playerResourceData['lumber'];\n modelResource['townspeopleAvailable'] = playerResourceData['townspeopleAvailable'];\n modelResource['townspeopleAlive'] = playerResourceData['townspeopleAlive'];\n modelResource['townspeopleMax'] = playerResourceData['townspeopleMax'];\n modelResource['townspeopleLumberjack'] = playerResourceData['townspeopleLumberjack'];\n modelResource['smallHousesOwned'] = playerResourceData['smallHousesOwned'];\n }\n // Replace default resource rate values with host player's resource rate values.\n if (playerResourceRatesData !== null) {\n modelResourceRates['lumberjack'] = playerResourceRatesData['lumberjack'];\n modelResourceRates['smallHouse'] = playerResourceRatesData['smallHouse'];\n }\n // Replace default upgrade data with host player's upgrade models.\n if (playerModelUpgrades) {\n modelUpgrades['lumberjack'] = playerModelUpgrades['lumberjack'];\n modelUpgrades['smallHouse'] = playerModelUpgrades['smallHouse'];\n }\n if (playerModelGameProgress) {\n modelGameProgress['displayBuildings'] = playerModelGameProgress['displayBuildings'];\n modelGameProgress['displayUpgrades'] = playerModelGameProgress['displayUpgrades'];\n modelGameProgress['displayJobs'] = playerModelGameProgress['displayJobs'];\n }\n // Init all resource generation velocities (current rate for the user)\n modelJobs['lumberjack']['velocity'] = \n {'lumber': modelResourceRates['lumberjack'] * modelResource['townspeopleLumberjack']};\n // Init the views model.\n modelViews['resourceGenerationView'] = \n {\n view: document.getElementById('resourceGenerationView'),\n navButton: document.getElementById('resourceGenerationNavButton')\n };\n modelViews['townView'] = \n {\n view: document.getElementById('manageTownView'),\n navButton: document.getElementById('manageTownNavButton')\n };\n modelViews['jobsView'] =\n {\n view: document.getElementById('manageJobsView'),\n navButton: document.getElementById('manageJobsNavButton')\n };\n // Init the jobs model.\n modelJobs['lumberjack'] = \n {\n id: 'jobLumberjack',\n resourceType: ['lumber'],\n velocity: {'lumber': modelResourceRates['lumberjack'] * modelResource['townspeopleLumberjack']},\n allocateButtonId: 'lumberjackAddWorker',\n deallocateButtonId: 'lumberjackRemoveWorker'\n };\n // Init the buildings model.\n modelBuildings['smallHouse'] = \n {\n id: 'buildingSmallHouse',\n basePrice: {'lumber': 50},\n resourceType: ['lumber'],\n price: determineCurrentPriceBuilding({'lumber': 50}, modelResource['smallHousesOwned']),\n buyButtonId: 'buildingSmallHouseBuyButton',\n sellButtonId: 'buildingSmallHouseSellButton'\n };\n}", "title": "" }, { "docid": "1c0b2f8fd096143b1cef679730b18adb", "score": "0.47837046", "text": "function handleClientRequests(data, sock, peerTable, searchHistory, maxPeers, sender, imagePackets) {\r\n let version = bytes2number(data.slice(0, 3));\r\n let requestType = bytes2number(data.slice(3, 4));\r\n\r\n // Client Request for a file in P2P search\r\n if (requestType == 0) {\r\n // Server busy\r\n if (busy) {\r\n console.log('Another client tries to connect. Sending busy response...');\r\n ITPpacket.init(3, singleton.getSequenceNumber(), singleton.getTimestamp(), [], 0);\r\n sock.write(ITPpacket.getPacket());\r\n sock.end();\r\n } else { // Server is not busy\r\n busy = true;\r\n let imageFilename = bytes2string(data.slice(4));\r\n console.log('\\n' + BRIGHT + FG_YELLOW + nickNames[sock.id] + RESET_STYLE + ' is connected at timestamp: ' + startTimestamp[sock.id]);\r\n console.log('\\n' + nickNames[sock.id] + ' requests:'\r\n + '\\n --ITP version: ' + version\r\n + '\\n --Request type: ' + requestType\r\n + '\\n --Image file name: \\'' + imageFilename +'\\'\\n');\r\n\r\n // Searching File locally.\r\n fs.readFile('images/' + imageFilename, (err, data) => {\r\n // File locally found.\r\n if (!err) {\r\n var infile = fs.createReadStream('images/' + imageFilename);\r\n const imageChunks = [];\r\n infile.on('data', function (chunk) {\r\n imageChunks.push(chunk);\r\n });\r\n\r\n infile.on('close', function () {\r\n let image = Buffer.concat(imageChunks);\r\n ITPpacket.init(1, singleton.getSequenceNumber(), singleton.getTimestamp(), image, image.length);\r\n sock.write(ITPpacket.getPacket());\r\n sock.end();\r\n busy = false;\r\n });\r\n } else { // File NOT found in this peer.\r\n // Clear Received images...\r\n imagePackets.length = 0;\r\n console.log(imageFilename, 'not found! Searching in P2P network...');\r\n let originAddress = {'origin': {'port': sock.localPort, 'IP': sock.localAddress}};\r\n \r\n // Searching file in PEERS\r\n handleSearch (peerTable, searchHistory, maxPeers, sender, originAddress, sock.remotePort, imageFilename);\r\n \r\n // Waiting for P2P response\r\n let timeTick = 0;\r\n let timer = setInterval(function () {\r\n // If File is received from P2P network. Send to Client\r\n if (imagePackets.length > 0) { \r\n console.log('Sending ' + imageFilename + ' to ' + nickNames[sock.id] + '...');\r\n sock.write(imagePackets[0]);\r\n sock.end();\r\n busy = false;\r\n clearInterval(timer);\r\n } \r\n // Timeout!!! Send NOT found response.\r\n if (timeTick === TIME_BUSY) {\r\n console.log(imageFilename, 'not Found in P2P network. Sending NOT FOUND response...');\r\n ITPpacket.init(2, singleton.getSequenceNumber(), singleton.getTimestamp(), [], 0);\r\n sock.write(ITPpacket.getPacket());\r\n sock.end();\r\n busy = false;\r\n clearInterval(timer);\r\n }\r\n timeTick++;\r\n }, 1);\r\n }\r\n });\r\n }\r\n }\r\n\r\n // P2P network found file and transfers us.\r\n if (requestType == 1) {\r\n imagePackets.push(data);\r\n console.log('File found in P2P network!');\r\n }\r\n}", "title": "" }, { "docid": "0f88844cc3d8e4d07dc6c621b48d566c", "score": "0.47816202", "text": "function socketOnData(d, start, end) {\n\n var socket = this;\n var req = this._httpMessage;\n\n var current = clients[socket.subdomain].current;\n\n if (!current) {\n log.error('no current for http response from backend');\n return;\n }\n\n // send the goodies\n current.write(d.slice(start, end));\n\n // invoke parsing so we know when all the goodies have been sent\n var parser = current.out_parser;\n parser.socket = socket;\n\n var ret = parser.execute(d, start, end - start);\n if (ret instanceof Error) {\n log('parse error');\n freeParser(parser, req);\n socket.destroy(ret);\n }\n}", "title": "" }, { "docid": "a16b6010f48a38b58b2f917eff0255ad", "score": "0.47741112", "text": "function SendServerCommand(client, type, data) {\n\tif (client !== null) {\n\t\tAddServerCommand(client, type, data);\n\t\treturn;\n\t}\n\n\t// // Hack to echo broadcast prints to console.\n\t// if ( com_dedicated->integer && !strncmp( (char *)message, \"print\", 5) ) {\n\t// \tCom_Printf (\"broadcast: %s\\n\", SV_ExpandNewlines((char *)message) );\n\t// }\n\n\t// Send the data to all relevent clients.\n\tfor (var i = 0; i < sv_maxClients.get(); i++) {\n\t\tAddServerCommand(svs.clients[i], type, data);\n\t}\n}", "title": "" }, { "docid": "e5cd9d8798fc272b31cd6deaf916ac42", "score": "0.47652975", "text": "function servify(json) {\n var serverjson = {\n \"id\": CONFIG.getServerId(),\n \"name\": CONFIG.getServerName(),\n \"token\": CONFIG.getServerToken(),\n \"stats\": {}\n }\n serverjson['stats'] = json;\n return serverjson;\n }", "title": "" }, { "docid": "52c703f9453fd31e376315d7b9c82bef", "score": "0.47637704", "text": "function handleClientState(req,sock){\n var clientState = req.state;\n var message = req.message;\n var input = parseInt(req.input);\n var response = {};\n response.error = [];\n switch (clientState) {\n case 0:\n response.state = input;\n break;\n case 1 :\n console.log('Server: Registering user');\n console.log(message);\n var user = message;\n\n if(!validateEmail(user.email))\n response.error.push(1);\n if(!validateID(user.id))\n response.error.push(2);\n if(!validateDate(user.birthDate))\n response.error.push(3);\n if(!compareIds(user.id))\n response.error.push(4);\n\n if (response.error.length == 0) {\n console.log('No errors, Registering user');\n users.push(user);\n }\n else {\n console.log('Eror codes');\n console.log(response.error);\n }\n console.log('==========================');\n console.log('User list : ');\n console.log(users);\n console.log('==========================');\n\n response.state = 0;\n break;\n case 2 :\n response.state = 0;\n break;\n case 3 :\n console.log('User to delete : ');\n console.log(message);\n console.log('=============================');\n for (var i = 0; i < users.length; i++) {\n if (users[i].id == message.id) {\n console.log('Deleting user : ' + users[i].username);\n console.log('With ID : ' + users[i].id);\n console.log('=============================');\n users.splice(i,1);\n }\n }\n response.state = 0;\n break;\n case 5 :\n sendUsersByMail(message.receiver);\n console.log('Email Sent to : ' + message.receiver);\n break;\n default: response.state = 0; break;\n }\n response.users = users;\n clearScreen();\n saveData();\n\n sock.write(JSON.stringify(response));\n}", "title": "" } ]
59c3801e563e70653bca30813d94aa56
Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms)
[ { "docid": "080940fe289fc248454ca1e8faaa2010", "score": "0.8127974", "text": "function durationHasTime(dur) {\n\treturn Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" } ]
[ { "docid": "6c14c17da5cd2ccb86ee72bfe7b0157e", "score": "0.8148657", "text": "function durationHasTime(dur) {\r\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\r\n}", "title": "" }, { "docid": "6c14c17da5cd2ccb86ee72bfe7b0157e", "score": "0.8148657", "text": "function durationHasTime(dur) {\r\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\r\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.8130277", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.8130277", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.8130277", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.8130277", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "1dd39642158965a0c21022f2820f7ff7", "score": "0.8130277", "text": "function durationHasTime(dur) {\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\n}", "title": "" }, { "docid": "f0ffcd5a1554cb1ad8900ca46e19e83f", "score": "0.69179183", "text": "isTimePartValid() {\n // Sanitize timePart\n const timePart = StringUtils.sanitizeString(this.state.timePart);\n if (!timePart) {\n return true;\n }\n\n // Validate if it is not empty\n // See http://stackoverflow.com/questions/33906033/regex-for-time-in-hhmm-am-pm-format\n const regEx = /\\b((1[0-2]|0?[1-9]):([0-5][0-9]) ([AaPp][Mm]))/;\n return timePart.match(regEx) ? true : false;\n }", "title": "" }, { "docid": "38900cb95d745b89864607285597b09b", "score": "0.6834271", "text": "function checkDuration(duration) {\n if (isNaN(duration) || duration <= 0) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "7c1ca1e765c0d8a0f44e2b7026a3da42", "score": "0.64749384", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n\n if (index < 0) {\n return false;\n } // exclude milliseconds\n\n\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n } // exclude dayofyear\n\n\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "ea80b38e9243bd57eb784530f59c7ada", "score": "0.63367677", "text": "function validDuration(duration) {\n\tvar reptms = /^PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?$/;\n\tvar hours = 0, minutes = 0, seconds = 0, totalInSeconds;\n\tvar maxDurationInSeconds = 1800;\n\n\tif (reptms.test(duration)) {\n\t\tvar matches = reptms.exec(duration);\n\t\tif (matches[1]) hours = Number(matches[1]);\n\t\tif (matches[2]) minutes = Number(matches[2]);\n\t\tif (matches[3]) seconds = Number(matches[3]);\n\t\ttotalInSeconds = hours * 3600 + minutes * 60 + seconds;\n\t\tif (totalInSeconds < maxDurationInSeconds) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n\n\t/*\n\t var maxDurationInSeconds = 60 * 30;\n\t var hIndex;\n\t var mIndex;\n\t var sIndex;\n\n\t var videoDuration = 0;\n\n\t if (videoObjectArg.duration.indexOf(\"H\")) {\n\t videoDuration = videoObjectArg.duration\n\t }\n\t */\n}", "title": "" }, { "docid": "2c4a26992b0c4ddcdc93ca15eb3b5574", "score": "0.6259087", "text": "function range_is_duration(range) {\n target_range = range.getSheet().getRange('Durations');\n if (is_contained_in(range,target_range)) {\n Logger.log('Range ' + range.getA1Notation() + ' is a duration');\n return true;\n }\n else {\n Logger.log('Range ' + range.getA1Notation() + ' is not a duration');\n return false;\n }\n}", "title": "" }, { "docid": "765261e36e31aabc6df800822c34af9d", "score": "0.62378323", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "title": "" }, { "docid": "765261e36e31aabc6df800822c34af9d", "score": "0.62378323", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "title": "" }, { "docid": "a91d159587b2ada24b89b2a6c0e9e5dd", "score": "0.6209061", "text": "function isTime(val)\r\n{\r\n var arrayVal = val.split(\":\");\r\n for (var a = 0, l = arrayVal.length; a < l; a++) {\r\n if (arrayVal[a].length == 1) {\r\n arrayVal[a] = fractionReplace(arrayVal[a]);\r\n }\r\n }\r\n val = arrayVal.join(\":\");\r\n var tmexp = new RegExp(/^(([0-1][0-9])|(2[0-3])):((0[0-9])|([1-5][0-9])):((0[0-9])|([1-5][0-9]))$/);\r\n return tmexp.test(val);\r\n}", "title": "" }, { "docid": "a5ac8a9358394bbab364938cc6a1ddca", "score": "0.6161888", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var fullTimeUnitStr = fullTimeUnit.toString();\n var timeUnitStr = timeUnit.toString();\n var index = fullTimeUnitStr.indexOf(timeUnitStr);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnitStr.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "title": "" }, { "docid": "5f2a24c3d754c180a56d9414d25295ec", "score": "0.60826874", "text": "function isDuration(value) {\n return validateISODuration.test(value);\n}", "title": "" }, { "docid": "5f2a24c3d754c180a56d9414d25295ec", "score": "0.60826874", "text": "function isDuration(value) {\n return validateISODuration.test(value);\n}", "title": "" }, { "docid": "8d43c37d295d7900b9c17fbc1724419e", "score": "0.60717523", "text": "function has_pureTimeUnit (T) {\n var dt = T.dt,\n t = T.t\n var pure = true\n for (var k in dt) {\n if (!_.includes(timeUnitOrder, k)) {\n pure = false\n break\n }\n }\n for (var k in t) {\n if (!_.includes(timeUnitOrder, k)) {\n pure = false\n break\n }\n }\n return pure\n}", "title": "" }, { "docid": "26f5af6800a58f04d7f2f467dd9df372", "score": "0.60280365", "text": "hasTimeElapsed (startTime, period) {\n\t\tconst diff = this.updateTime - startTime;\n\t\treturn (diff >= period);\n\t}", "title": "" }, { "docid": "b17c7e14fd74ddc615962682776adcea", "score": "0.5997916", "text": "function needsTimeAdvance(str) {\n const [ _, hour, period ] = str.match(/(\\d{1,2}):\\d{2}(AM|PM)$/)\n return period === 'PM' && parseInt(hour) !== 12;\n}", "title": "" }, { "docid": "a487d6398c727c7012de0ce126a7a42c", "score": "0.5948953", "text": "function checkTime(start, end){\n if (end) {\n var splitTime1 = end.split(\"T\");\n var midSplit = splitTime1[1].split(\"-\");\n var splitTime2 = midSplit[0].split(\":\");\n var hour = splitTime2[0];\n var min = splitTime2[1];\n var sec = splitTime2[2];\n var currentdate = new Date();\n if(hour < currentdate.getHours()){ \n return false; \n }else if (hour == currentdate.getHours()) {\n if(min < currentdate.getMinutes()){\n return false;\n }else if(min == currentdate.getMinutes()){\n return (sec - currentdate.getSeconds() >= 0);\n }else{\n return true;\n }\n }else{\n return true;\n }\n }\n }", "title": "" }, { "docid": "c1e345ad8b5c4cb959c9b13418a7dca1", "score": "0.58880925", "text": "get _hasTime() {\n return (this.optionsStore.options.display.components.clock &&\n (this.optionsStore.options.display.components.hours ||\n this.optionsStore.options.display.components.minutes ||\n this.optionsStore.options.display.components.seconds));\n }", "title": "" }, { "docid": "126e101d6669684c8ec9b386612b46eb", "score": "0.5864381", "text": "function determineTime(d){\n if(d.length < 1) return true;\n let arr = d.join(':').split(':');\n let h = 0;\n let m = 0;\n let s = 0;\n for (let i = 0, j = 1, k = 2; i < arr.length || j < arr.length || k < arr.length; i += 3, j += 3, k += 3){\n h += +arr[i];\n m += +arr[j];\n s += +arr[k];\n }\n return h * 3600 + m * 60 + s <= 24 * 3600;\n}", "title": "" }, { "docid": "92dddc89beaec1015efab4290b6324b5", "score": "0.58576345", "text": "function validateSwipeTime() {\n\t\t\tvar result;\n\t\t\t//If no time set, then return true\n\n\t\t\tif (options.maxTimeThreshold) {\n\t\t\t\tif (duration >= options.maxTimeThreshold) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult = true;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "92dddc89beaec1015efab4290b6324b5", "score": "0.58576345", "text": "function validateSwipeTime() {\n\t\t\tvar result;\n\t\t\t//If no time set, then return true\n\n\t\t\tif (options.maxTimeThreshold) {\n\t\t\t\tif (duration >= options.maxTimeThreshold) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult = true;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "92dddc89beaec1015efab4290b6324b5", "score": "0.58576345", "text": "function validateSwipeTime() {\n\t\t\tvar result;\n\t\t\t//If no time set, then return true\n\n\t\t\tif (options.maxTimeThreshold) {\n\t\t\t\tif (duration >= options.maxTimeThreshold) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult = true;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "2b888df2a272be11aac26017cff21f86", "score": "0.5832499", "text": "function validTime(time) {\n let timeArr = time.split(':');\n return (parseInt(timeArr[0]) <= 23 && parseInt(timeArr[1]) <= 59)\n}", "title": "" }, { "docid": "e3e958e1610866f75aa20c1e94fcb7cb", "score": "0.58031887", "text": "function validTimeFormat(time) {\n if (time.length !== 5) return false;\n const hour = Number(time.substring(0, 2));\n const min = Number(time.substring(3, 5));\n if (isNaN(hour) || isNaN(min)) return false;\n if (hour < 0 || hour > 24) return false;\n if (min < 0 || min > 59) return false;\n return true;\n}", "title": "" }, { "docid": "5b44c43d68d17ade75685f2de50b3a9c", "score": "0.5785351", "text": "function validateSwipeTime() {\n var result;\n //If no time set, then return true\n\n if (options.maxTimeThreshold) {\n if (duration >= options.maxTimeThreshold) {\n result = false;\n } else {\n result = true;\n }\n } else {\n result = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "e0ca833ba7ce28286b5647a1eacd75fb", "score": "0.5784343", "text": "function validateSwipeTime() {\n var result;\n //If no time set, then return true\n if (options.maxTimeThreshold) {\n if (duration >= options.maxTimeThreshold) {\n result = false;\n } else {\n result = true;\n }\n } else {\n result = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "e0ca833ba7ce28286b5647a1eacd75fb", "score": "0.5784343", "text": "function validateSwipeTime() {\n var result;\n //If no time set, then return true\n if (options.maxTimeThreshold) {\n if (duration >= options.maxTimeThreshold) {\n result = false;\n } else {\n result = true;\n }\n } else {\n result = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "ea6867a5d98db9e72b82dfb621cdc714", "score": "0.5764167", "text": "function validateTime(time) {\r\n if (time.length != 8) {\r\n return false;\r\n }\r\n \r\n if ((time.charAt(2) != \":\") || (time.charAt(5) != \":\")) {\r\n return false;\r\n }\r\n \r\n if (!validateNumberRange(time.substring(0,2), 0, 23) ||\r\n !validateNumberRange(time.substring(3,5), 0, 59) ||\r\n !validateNumberRange(time.substring(6,8), 0, 59)) {\r\n return false;\r\n }\r\n \r\n return true;\r\n}", "title": "" }, { "docid": "2bd8ced6131c633766c0dbdaf4d13cc4", "score": "0.57584006", "text": "function validateSwipeTime() {\r\n\t\t\tvar result;\r\n\t\t\t//If no time set, then return true\r\n\r\n\t\t\tif (options.maxTimeThreshold) {\r\n\t\t\t\tif (duration >= options.maxTimeThreshold) {\r\n\t\t\t\t\tresult = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tresult = true;\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t}", "title": "" }, { "docid": "5a51d1925caa89d26c8103b0b173c85a", "score": "0.5753864", "text": "function is_valid_time(value)\n{\n if (value == null)\n return false;\n\n var am = (value.toLowerCase().indexOf('am') != -1 || value.toLowerCase().indexOf('a.m.') != -1);\n var pm = (value.toLowerCase().indexOf('pm') != -1 || value.toLowerCase().indexOf('p.m.') != -1);\n value = value.replace(/pm/ig, '').replace(/am/ig, '');\n value = value.replace(/p\\.m\\./ig, '').replace(/a\\.m\\./ig, '');\n value = value.replace(/ /g, '');\n\n var hr = value;\n var min = 0;\n var sec = 0;\n\n var pos = hr.indexOf(':');\n if (pos > 0 && pos < hr.length - 1)\n {\n min = hr.substr(pos + 1);\n hr = hr.substr(0, pos);\n\n pos = min.indexOf(':');\n if (pos > 0 && pos < min.length - 1)\n {\n sec = min.substr(pos + 1);\n min = min.substr(0, pos);\n }\n }\n\n hr = parseInt(hr, 10);\n min = parseInt(min, 10);\n sec = parseInt(sec, 10);\n\n if ((am || pm) && (hr > 12 || hr == 0))\n return false;\n if (pm && (hr < 12))\n hr += 12;\n\n if (hr < 0 || hr > 23 || min < 0 || min > 59 || sec < 0 || sec > 59)\n return false;\n\n var d = new Date(0, 0, 0, hr, min, sec);\n if (isNaN(d.getTime()))\n return false;\n\n return value;\n}", "title": "" }, { "docid": "7475e5cece27743a0b20f760f3768969", "score": "0.57118624", "text": "function isTimeToWork ( startTime, endTime){\n\tconst HH=0;\n\tconst MM=1;\n\tconst currentHH = parseInt(((new Date()).getHours()));\n\t//const currentMM = parseInt(((new Date()).getMinutes()));\n\t\n\tvar start_time = startTime.split(':');\n\tvar end_time = endTime.split(':');\n\n\treturn ( (currentHH >= parseInt(start_time[HH]) ) && (currentHH <= parseInt(end_time[HH]) ) );\n}", "title": "" }, { "docid": "3df484a043c5ea64a9aedad479c43cda", "score": "0.5709044", "text": "function checkArrayRhythms(array, minDuration) {\n\t\tfor(var i=0; i<array.length; i++) {\n\t\t\tif( array[i] % minDuration !== 0)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "1d4eff18a60e3f35ee8d4dfb76042fe7", "score": "0.56946874", "text": "function checkTime(){\r\n\tif ((startTime + (1000 * timeLimit) - (new Date).getTime()) < 0){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "602fd6a893438147ead5e4661e70bc3c", "score": "0.56852406", "text": "function isTimeString(str) {\n\treturn /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "9e299dbe9f6e7929674c4056155702ae", "score": "0.5659709", "text": "function isValidHourMinute(ttime) {\n\n var myDateTime = \"1960-10-03 \" + ttime;\n var formats = [\"YYYY-MM-DD LT\",\"YYYY-MM-DD h:mm:ss A\",\"YYYY-MM-DD HH:mm:ss\",\"YYYY-MM-DD HH:mm\"];\n\n // if (moment(myDateTime, formats, true).isValid()) {\n // return true;\n // }\n //\n // return false;\n\n return moment(myDateTime, formats, true).isValid();\n\n}", "title": "" }, { "docid": "cca08f909a7595275d28513aedffa1e9", "score": "0.56329054", "text": "function check_duration_value(value, logger) {\n if (!(durationCheck.test(value))) {\n logger.log_strong_validation_error(`\"${value}\" is an incorrect duration value`);\n return false;\n }\n else {\n return true;\n }\n}", "title": "" }, { "docid": "0c41fc1aa4895dea3e2fddc49100b698", "score": "0.5614446", "text": "function isHour(s) {\n return s === 'hours' || s === 'hour' || s === 'hrs' || s === 'hr' || s === 'h';\n}", "title": "" }, { "docid": "8b52dd1ab62fa0364131c6a050f88a09", "score": "0.56090015", "text": "function validHoursWorked(hrs) {\r\n\tvar floatHrs = parseFloat(hrs);\r\n\tif(floatHrs <= 0 || hrs > 4.00) {\r\n\t\treturn false;\r\n\t}\r\n\tif(floatHrs * 4 === parseInt(floatHrs * 4)) {\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "4beca216882a9eee2123dc0b2315fc6c", "score": "0.5591493", "text": "function isTimeout() {\n return timeRemaining() <= 0 ? true : false;\n}", "title": "" }, { "docid": "f054293526cc451bd9f889fde771a303", "score": "0.55897236", "text": "function isTimeUnitValid(unit, time) {\n return time != null && !isNaN(time) && getTimeUnitMin(unit) <= time && time <= getTimeUnitMax(unit);\n}", "title": "" }, { "docid": "e4582666fff754e60e324524ad290fd0", "score": "0.5573218", "text": "function validateSwipeTime() {\n var result;\n //If no time set, then return true\n if (options.maxTimeThreshold) {\n if (duration >= options.maxTimeThreshold) {\n result = false;\n } else {\n result = true;\n }\n } else {\n result = true;\n }\n \n return result;\n }", "title": "" }, { "docid": "b198e177d51638f1f2d0c9d3d5217421", "score": "0.55590606", "text": "isTimeBetween (time, start, end) {\n\t\tlet reference = new TimeOne(time);\n\t\t// set reference to next start and end time so we can compare\n\t\treference.setNext(\"HH:mm\", start, { sharp: true });\n\t\tstart = reference.getUnixTime();\n\t\t// set back to start time so we can check the end time\n\t\treference.setUnixTime(time.getUnixTime());\n\t\treference.setNext(\"HH:mm\", end, { sharp: true });\n\t\tend = reference.getUnixTime();\n\t\treturn end < start;\n\t}", "title": "" }, { "docid": "f25b980694efeffce363d442d862cfe7", "score": "0.5543791", "text": "function checkOvercountdown(hours, minutes, seconds) {\r\n if (hours != 0 || minutes != 0 || seconds != 0) return false;\r\n else return true;\r\n}", "title": "" }, { "docid": "66dad7d5c1bb3bd9b4c3a3e3fff42953", "score": "0.55424154", "text": "function isValidTimeInputted(){\r\n var startingTime = parseInt($('#startingTimeHH').val() + $('#startingTimeMM').val());\r\n var finishingTime = parseInt($('#finishingTimeHH').val() + $('#finishingTimeMM').val());\r\n\r\n //if(finishingTime <= startingTime) return false; \r\n return true;\r\n}", "title": "" }, { "docid": "e1f1d728added6a86d0e05f01400a85e", "score": "0.5539752", "text": "function isTimeString(str) {\r\n return typeof str === 'string' &&\r\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\r\n}", "title": "" }, { "docid": "e1f1d728added6a86d0e05f01400a85e", "score": "0.5539752", "text": "function isTimeString(str) {\r\n return typeof str === 'string' &&\r\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\r\n}", "title": "" }, { "docid": "447f997b5b5feac97841449d32e04c0f", "score": "0.5536211", "text": "function isTimeUp() {\n var now = new Date();\n return now.getTime() - executionStart.getTime() > 240000; // 4 minutes\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.5529864", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.5529864", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.5529864", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.5529864", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "95f2ca1321eedd1fef1c893c3c848995", "score": "0.5529864", "text": "function isTimeString(str) {\n return typeof str === 'string' &&\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "4d0fc09a2ad229f8dd120db596d02d4f", "score": "0.5494071", "text": "function timeToSend(t) {\n if (!t) return false;\n return t.getHours() === 3;\n}", "title": "" }, { "docid": "49b9b98ccef4e5ca49c2c9c4a6ccf85b", "score": "0.5485927", "text": "isValid() {\n return !isNaN(this.getTime());\n }", "title": "" }, { "docid": "a32d337ffb81b38534d1c84a100273ae", "score": "0.54759705", "text": "function isTimeString(str) {\n\treturn typeof str === 'string' &&\n\t\t/^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "a32d337ffb81b38534d1c84a100273ae", "score": "0.54759705", "text": "function isTimeString(str) {\n\treturn typeof str === 'string' &&\n\t\t/^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\n}", "title": "" }, { "docid": "84d66fc35f12c6488082f14d51038c38", "score": "0.54539853", "text": "isValid(time) {\n\t\treturn ((time - this.lastTrigger) > this.countdownLength);\n\t}", "title": "" }, { "docid": "41edfd41b1b1bc09aeb500b5f5ebf465", "score": "0.5453347", "text": "function canUseShort(start, duration) {\n return start < 1 << SHORT_BITS.start && duration < 1 << SHORT_BITS.duration;\n}", "title": "" }, { "docid": "5da7f3f5ed99a05489807a99df429cc6", "score": "0.54472077", "text": "function isIso8601TimeString(value) {\n var regex = /^((([01][0-9]|2[0-3])(:[0-5][0-9])(:[0-5][0-9](\\.[0-9]{1,3})?)?)|(24:00(:00(\\.0{1,3})?)?))$/;\n\n return regex.test(value);\n }", "title": "" }, { "docid": "9a288a6c0047954248b3011a183f58d3", "score": "0.54361856", "text": "function withinTimeInterval(start=\"07:30:00\", end=\"21:30:00\", time=\"22:00:00\"){\n s = start.split(\":\").map(x=>parseInt(x))\n e = end.split(\":\").map(x=>parseInt(x))\n t = (time || getTime()).split(\":\").map(x=>parseInt(x))\n for(i in s){\n if(t[i] < s[i] || t[i] > e[i]) print(false)\n }\n print(true)\n}", "title": "" }, { "docid": "33212ccf8fde8dfc13d2b61fcacb47c7", "score": "0.54144377", "text": "function isIso8601TimeString(value) {\n return isValidTimeStructure(parseIso8601Time(value));\n }", "title": "" }, { "docid": "72ed7ac4a9680c01a5ba9fe45dbec367", "score": "0.54071695", "text": "function checkEnd(minutes, seconds) {\n // check if game is end\n console.log(minutes, seconds)\n if (minutes === undefined ||\n seconds === undefined) return false;\n else if (minutes == 0 && seconds == 0) return true;\n else if (minutes < 0) return true\n else return false;\n}", "title": "" }, { "docid": "c66c3a283b6686c2636b48c8fa1dec33", "score": "0.539503", "text": "function checkTime() {\n\tif (Math.floor(vars.time/60) > 40) {\n\t\tloseLife();\n\t}\n\telse return true;\n}", "title": "" }, { "docid": "e3737409054e5df1eefeab2f64c37da5", "score": "0.5382905", "text": "matches(timeToCheck) {\n return this.time.getHours() === timeToCheck.getHours()\n && this.time.getMinutes() === timeToCheck.getMinutes()\n && this.time.getSeconds() === timeToCheck.getSeconds();\n }", "title": "" }, { "docid": "3ef4ecb27a6b743bc56b71f83627f162", "score": "0.53719586", "text": "function validParams(params) {\n if (params == undefined) { return 'options' }\n if (!params.start) { return 'start time' }\n if (params.end == undefined && params.duration == undefined) { return 'end time' }\n return true\n }", "title": "" }, { "docid": "a37889b313db7d9faec807a48424a445", "score": "0.53657466", "text": "function validateSwipeTime() {\nvar result;\n//If no time set, then return true\nif (options.maxTimeThreshold) {\nif (duration >= options.maxTimeThreshold) {\nresult = false;\n} else {\nresult = true;\n}\n}\nelse {\nresult = true;\n}\nreturn result;\n}", "title": "" }, { "docid": "141fc6836951356dd5649a2647aa70e6", "score": "0.53449327", "text": "function FindWhetherThereIsPartTime(dailyWage)\n{\n /// Check if the map array element contains the full time description\n return dailyWage.includes(\"80\");\n}", "title": "" }, { "docid": "5cef13ad070d810ed975c41c161c8786", "score": "0.531263", "text": "function hasExactInflightEntertainment (movieLengths, flightLength) {\n let remainingFlightLengths = {};\n \n for (let i = 0; i < movieLengths.length; i++) {\n const currentMovieLength = movieLengths[i];\n const remainingFlightLength = flightLength - currentMovieLength;\n\n if (remainingFlightLength > 0) {\n if (remainingFlightLengths[currentMovieLength]) {\n return true;\n } else {\n remainingFlightLengths[remainingFlightLength] = true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "2c2d997b8fc0de4c93a2107997872c81", "score": "0.5302724", "text": "has_parts() {\n if(this.parts.length > 0) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "b0912002549c9b44fbea7b30c57fbb62", "score": "0.52727026", "text": "get hasStopped() {\n return this[$time] >= this[$duration];\n }", "title": "" }, { "docid": "abcce3d8f0616768f3a88607c2b49681", "score": "0.52689224", "text": "validateTime(time) {\n if (typeof time === 'string' || typeof time === 'number')\n return false;\n return Math.floor(new Date(time) / 1000);\n }", "title": "" }, { "docid": "5a339e0c66cb6a5c8f08dfd44fa9d8ff", "score": "0.52538395", "text": "function validateTime() {\n var value = $(this).val();\n if(value.length === 4) {\n var hours = value.slice(0,-2);\n var mins = value.slice(2);\n hours = parseInt(hours,10);\n mins = parseInt(mins,10);\n if((hours >= 24) || (mins >= 60)) {\n if (!$(this).hasClass('bad')) {\n $(this).addClass('bad');\n }\n validTime = false;\n } else {\n if ($(this).hasClass('bad')) {\n $(this).removeClass('bad');\n }\n validTime = true;\n }\n }\n return validTime;\n }", "title": "" }, { "docid": "e9dacc8a29f74eec182f11925361ed22", "score": "0.5249072", "text": "function validateTime(time) {\n return /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]/.test(time);\n}", "title": "" }, { "docid": "ab830ddce04429c2571ce25cdb70e087", "score": "0.52459997", "text": "function checkTime(transferTime) {\n if((transferTime >= 9 && transferTime <=12 || transferTime >= 15 && transferTime <= 20)){\n return true;\n }\n}", "title": "" }, { "docid": "24791b75ce57462c5d61754b5b34db58", "score": "0.520739", "text": "function isTimeFieldDef(def) {\n return def && (def['type'] === 'temporal' || isFieldDef(def) && !!def.timeUnit);\n }", "title": "" }, { "docid": "6987e1eb1d14fa8619b8cb25013d50fd", "score": "0.5198193", "text": "function validTime(t){\n \n // Strip any non numeric chars\n t = t.replace(/\\D/g,'');\n \n // Check if supplied time (t) is a number,\n if(isNaN(t)){\n setBSModalMessage(2);\n return false;\n }\n \n // Avoid an issue for 0000 times!\n if(t === '0000'){\n setBSModalMessage(3);\n return false;\n }\n \n // It is a number but is it a valid 24hr time?\n if(t.length == 4 && t > -1 && t < 2400){\n \n var amPm = 'AM';\n\n // Select the first 2 digits as this will determine AM/PM.\n // Will also need to convert anything > 12 to a < 12 value for a true AM/PM value.\n \n var h = t.substr(0, 2);\n // If a leading 0 has been supplied then just pick the next digit\n // as AM/PM time just needs values 1-12.\n if(h.substr(0, 1) == '0'){\n h = h.substr(1, 1);\n }\n var m = t.substr(2, 2);\n\n // Check that mins value is valid.\n if(m > 59){\n setBSModalMessage(2);\n return false;\n }\n\n // If hours are > 12 then subtract 12 to get the AM/PM value\n if(h == 12){\n amPm = 'PM'\n } else if(h > 12){\n h = h - 12;\n amPm = 'PM'\n }\n\n return h+':'+m+amPm;\n \n }\n}", "title": "" }, { "docid": "0063eb4782825c1cea23640651d71e55", "score": "0.51770896", "text": "function hasStopTime(value, index, ar) {\n if (value.stopTime) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "5783d6df535b5549ece81fb94637338a", "score": "0.51770455", "text": "function isTimeUp(start) {\n var now = new Date();\n return (now.getTime() - start.getTime()) > 1200000; // 20 minutes\n}", "title": "" }, { "docid": "ee3f11d08a6229c4b0344b460d381a4e", "score": "0.5172342", "text": "function compareStartingAndFinishingTime(){\r\n /* \r\n var startingTime = parseInt($('#startingTimeHH').val() + $('#startingTimeMM').val());\r\n var finishingTime = parseInt($('#finishingTimeHH').val() + $('#finishingTimeMM').val());\r\n \r\n if (startingTime > 0 && finishingTime > 0){ \r\n if(finishingTime <= startingTime){\r\n alert(\"Finishing time cannot be less than starting time\"); \r\n return false; \r\n }\r\n }\r\n*/ \r\n return true;\r\n}", "title": "" } ]
53f51ddab11a7c82414cac87b361c28e
Runtime helper for rendering
[ { "docid": "40f6ab41d643efc2c75f2f6d2797f96d", "score": "0.0", "text": "function renderSlot (\n name,\n fallback,\n props,\n bindObject\n) {\n var scopedSlotFn = this.$scopedSlots[name];\n var nodes;\n if (scopedSlotFn) { // scoped slot\n props = props || {};\n if (bindObject) {\n if (!isObject(bindObject)) {\n warn(\n 'slot v-bind without argument expects an Object',\n this\n );\n }\n props = extend(extend({}, bindObject), props);\n }\n nodes = scopedSlotFn(props) || fallback;\n } else {\n nodes = this.$slots[name] || fallback;\n }\n\n var target = props && props.slot;\n if (target) {\n return this.$createElement('template', { slot: target }, nodes)\n } else {\n return nodes\n }\n}", "title": "" } ]
[ { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.81015205", "text": "function render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "697e13aafa2fd5d24bc7d724eda49106", "score": "0.7611349", "text": "render() { /* abstract */ }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.7533175", "text": "render(){}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.7533175", "text": "render(){}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.7533175", "text": "render(){}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.7409195", "text": "render() { }", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "3b2ac05710f46a322835bd78e81d0078", "score": "0.7253791", "text": "_render() { /* will be overriden by pragmas engine */ }", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.7206186", "text": "function render() {\n\n}", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.7206186", "text": "function render() {\n\n}", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.7206186", "text": "function render() {\n\n}", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.7206186", "text": "function render() {\n\n}", "title": "" }, { "docid": "bbfffa63311895aa23dcc7a687aecf5d", "score": "0.7123217", "text": "function render(){\n\n }", "title": "" }, { "docid": "52a9b9ff9b1237a4a9a027705f27b175", "score": "0.71183944", "text": "function SimpleRendering() {}", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.70568293", "text": "render() {\n }", "title": "" }, { "docid": "0ce8474e7099560937702082d446a5c5", "score": "0.7010985", "text": "render() {\n\n }", "title": "" }, { "docid": "301b221e5cdf649e08563efa82331163", "score": "0.69917965", "text": "render() {\n }", "title": "" }, { "docid": "72262cfdf46f8eebc5eadf30ab3ddb30", "score": "0.69803536", "text": "function render(){\n\n}", "title": "" }, { "docid": "905643efa378981ebb9672ca9b1864c0", "score": "0.6953847", "text": "function render() {\n // utils.log('>> render');\n }", "title": "" }, { "docid": "636c377f5bbb25b69947802f2b68aa7c", "score": "0.6929431", "text": "render() {\n return html`\n \n\n `;\n }", "title": "" }, { "docid": "fb566274d81d9a01857cb27033e0fda1", "score": "0.68905187", "text": "ord_render () {\n return (\n this.renderMain()\n )\n }", "title": "" }, { "docid": "e95563c99b16b24ff3027eebbf757d8c", "score": "0.6871541", "text": "render() { \n \n \n\n return (\n this.renderDisplay()\n )\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "a68fa57d4f8055cc98eb2d218c83deb1", "score": "0.6803027", "text": "render(data) {\n }", "title": "" }, { "docid": "0bca6a96c7ade86b2fe97c461be60354", "score": "0.67120856", "text": "renderBag() {\n\t\t<div>\n\t\t\t//TODO\n\t\t</div>\n\t}", "title": "" }, { "docid": "5b36260245314cc67278700083dd84c5", "score": "0.66839546", "text": "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.6671306", "text": "_onRender() {}", "title": "" }, { "docid": "54c2f4229a0658ec55088dbd56e7638a", "score": "0.6659629", "text": "function render() {\n // no-op\n }", "title": "" }, { "docid": "ed737dee15554ddba503b0e14eda5a5f", "score": "0.66395086", "text": "render() {\n return this.renderContent();\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6616579", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6616579", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6616579", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "0ac42aab982f8e8638b7570849125a0a", "score": "0.6614964", "text": "render() {\n const { normalizedType } = this;\n switch (normalizedType) {\n case 'ellie':\n return ellieHtml;\n case 'eq':\n return eqHtml;\n case 'score':\n return scoreHtml;\n case 'strength':\n return strengthHtml;\n case 'trend':\n return trendHtml;\n case 'waffle':\n return waffleHtml;\n default:\n return defaultHtml;\n }\n }", "title": "" }, { "docid": "d1f66b4d4f2ef4597d51881e21e49873", "score": "0.66120994", "text": "render () {\n\n }", "title": "" }, { "docid": "1d4e2ff445ccd7a4120f1d40460504ff", "score": "0.65705496", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "8fa93c1a7efd297a6faf7c7772f8a93f", "score": "0.6568704", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "f4017334c1530c0fd3e7a99738f635d4", "score": "0.6556623", "text": "render() {\n\t\t// Also, we shouldn't call the fucntion inside render because it\n\t\t// will get called again and again for re-rendering so, its gonna make some time if we call it here\n\t\t// Also direct object assignment will throw error\n\t\treturn <div className=\"border red\">{this.renderContent()}</div>;\n\t}", "title": "" }, { "docid": "fde0be9bc771b712eb81f5826c79a2d5", "score": "0.65516686", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "fde0be9bc771b712eb81f5826c79a2d5", "score": "0.65516686", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "fde0be9bc771b712eb81f5826c79a2d5", "score": "0.65516686", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "ab78d9fa354b6ac0e4009651cc25af03", "score": "0.65484184", "text": "function render() {\r\n\t\tinternalRender();\r\n\t}", "title": "" }, { "docid": "efa6ae8c5a0f96215a4df039e8f0d307", "score": "0.6536236", "text": "render() {\n const renderedEl = (this.innerSrc) ? (h(\"img\", { src: this.innerSrc, alt: this.alt, width: this.width, height: this.height, sizes: this.sizes, srcset: this.srcset, decoding: this.decoding })) : (this.isBroken) ? (h(\"span\", { class: \"waf-img__broken\", style: this.infoDynamicStyles() },\n h(\"span\", null, \"broken image\"),\n h(\"span\", null, this.alt))) : (h(\"span\", { class: \"waf-img__loading\", style: this.infoDynamicStyles() },\n h(\"span\", { class: \"lds-ellipsis\" },\n h(\"span\", null),\n h(\"span\", null),\n h(\"span\", null),\n h(\"span\", null)),\n h(\"span\", null, this.alt)));\n return renderedEl;\n }", "title": "" }, { "docid": "6910a8b312c4c9e61905b40e03159258", "score": "0.6518277", "text": "render () {\n return ''\n }", "title": "" }, { "docid": "207a95e51560f17ad95b20649d396817", "score": "0.65059704", "text": "render(){\r\n \r\n }", "title": "" }, { "docid": "b62837733878532a4cd313ceca841703", "score": "0.64715546", "text": "render(){\n return this.renderContent();\n }", "title": "" }, { "docid": "0dfe1976381b7ed911b889ed8ac153c3", "score": "0.64623046", "text": "render(){ }", "title": "" }, { "docid": "c32407ffa2a07feab642c5236a299737", "score": "0.6423536", "text": "render() {\n throw new Error(\"RENDER NOT IMPLEMENTED FOR \" + this.name());\n }", "title": "" }, { "docid": "ed249cf48aa066c658662b4967f0fcfe", "score": "0.64140886", "text": "get render() {\n\t\treturn this.renderFull();\n\t}", "title": "" }, { "docid": "81ca7d6215c1c18a05ae9d367ad6a954", "score": "0.6413673", "text": "onRender() {}", "title": "" }, { "docid": "9a8df2403f5966c2d0c8b8e6f6198f98", "score": "0.6396735", "text": "render() {\n const template = this.lineClamp ? this.clampTemplate : this.truncateTemplate;\n /* istanbul ignore if */\n if (browserType === 'legacy') {\n // Mutation observer does not fire in IE11 if slot is not present\n return html `${template}<span style=\"display: none !important;\"><slot></slot></span>`;\n }\n return template;\n }", "title": "" }, { "docid": "bb022fab6ce78ded10b9cf0e1b89238c", "score": "0.6388418", "text": "render(...args) {\n super.render(...args)\n }", "title": "" }, { "docid": "8eb2f55b9b485b9cb148c19dd5cf2d79", "score": "0.63792264", "text": "getComposed(){\n\t\treturn super.render()\n\t}", "title": "" }, { "docid": "0048f00c2fd8d156564656f895ba31ec", "score": "0.6377484", "text": "preRender() { }", "title": "" }, { "docid": "4a36b972a86eeed2706881f5e2184ebb", "score": "0.63744885", "text": "_render({url, altText, imgWidth}){\n return html`\n <img src=\"${url}\" alt=\"${altText}\" width=\"${imgWidth}\"></img>\n `;\n }", "title": "" }, { "docid": "69bc0a8bd0a2619e54c57ee7ebf7a9f6", "score": "0.6358641", "text": "function e(e){return e&&\"function\"==typeof e.render}", "title": "" }, { "docid": "5872f41e5a3ebb326353da565718945d", "score": "0.63582647", "text": "renderField() {}", "title": "" }, { "docid": "d12a96dbca6cf20b391d0e239807d29c", "score": "0.6356119", "text": "render(force = false, options = {}) {\n this.#instance?.render(force, options);\n }", "title": "" }, { "docid": "9810f4022cccec3df10563c73cf6c416", "score": "0.63433385", "text": "renderImage(){\n return this.renderMJML()\n }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310696", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310696", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310696", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310696", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310696", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "43445987d41e15a6459ee9814c8f3701", "score": "0.6308749", "text": "render(){\n\t\treturn null;\n\t}", "title": "" }, { "docid": "2f5bf28c09d9d99d215b4417a14a7e9f", "score": "0.6307791", "text": "function renderRapid() {}", "title": "" }, { "docid": "31e5006f1914247dcfcbd597b0e0f4b2", "score": "0.63023406", "text": "_render() {\n return (`\n <div class=\"home container\" style=\"max-width: 1080px;\">\n ${this.catalog.render()}\n </div>\n `);\n }", "title": "" }, { "docid": "7c8e8207c3e88b9d77c91609947df3d7", "score": "0.6262204", "text": "function renderByType() {\n\t\t\t\tswitch(templateEngineRequire.renderType()) {\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\trenderStringFromFile(templateEngineRequire, viewPath, view.data, function(err,data) {\n\t\t\t\t\t\t\tcallback(err,data);\n\t\t\t\t\t\t});\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'file':\n\t\t\t\t\t\trenderFile(templateEngineRequire, viewPath, view.data, function(err,data) {\n\t\t\t\t\t\t\tcallback(err,data);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcallback(new Error('The template engine has an unsupported renderType'));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "b9d39f2949b3de2c606c5479483953b4", "score": "0.62606853", "text": "_renderTemplate() {\n const template = this.getTemplate();\n\n // Allow template-less views\n if (template === false) {\n return;\n }\n\n // Add in entity data and template context\n const data = this.mixinTemplateContext(this.serializeData());\n\n // Render and add to el\n const html = Renderer.render(template, data, this);\n this.attachElContent(html);\n }", "title": "" }, { "docid": "0f79933944a6e9ecc1adc1917048a8ff", "score": "0.6259068", "text": "render() {\n return this.content;\n }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62459105", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "db21f22bd6dc9307145759528188582b", "score": "0.6234539", "text": "render() {\n if (this.props.controller) {\n return <this.props.controller.View />;\n }\n return this.props.prerenderedHTML.value;\n }", "title": "" }, { "docid": "f733370a7272cf8c2505baba3106d531", "score": "0.622401", "text": "render() {\n throw new Error(\"Abstract method!\");\n }", "title": "" }, { "docid": "69aa14d02e6d309c5aecc70613c9f8b4", "score": "0.6218735", "text": "RenderStaticPreview() {}", "title": "" }, { "docid": "cee885e97eb9e1946ca3b64cb6065ff4", "score": "0.6194062", "text": "render() {\r\n return (\r\n <div>\r\n {this.renderContent()}\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "98002e61811f8556df180221c6fed32f", "score": "0.6175511", "text": "render() {\n\t\treturn this.outputToFlush\n\t}", "title": "" }, { "docid": "177e239645bd029cc6c1c4c907881a8c", "score": "0.6175202", "text": "render() {\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\t\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "5031077508622c390a705ad61f3f3bd7", "score": "0.6173949", "text": "nullRender() {}", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.6162565", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "760f2dd4db3b4e133b40c47abed67ede", "score": "0.61329424", "text": "onBeforeRendering() {}", "title": "" }, { "docid": "5f6fd38958403f056ebf6d5961da1b76", "score": "0.6124567", "text": "render() {\n return html `\n ${this.inputTemplates}\n ${this.iconTemplate}\n ${this.popupTemplate}\n `;\n }", "title": "" }, { "docid": "f5968de1b1cbf088fe3ed1a6ef49f50b", "score": "0.6123313", "text": "render() {\n return this.templateValue === \"Signin\" ? signinTemplate :\n this.templateValue === \"Signup\" ? signupTemplate :\n renderTemplate\n }", "title": "" }, { "docid": "5822c47eea4715ef37bb5a3c23ebe157", "score": "0.6106738", "text": "executeRender()\n {\n\n if(this.state.isError)\n {\n\n return this.renderError();\n\n }\n else if(this.state.isLoaded)\n {\n\n return this.renderLoaded();\n\n }\n else\n {\n\n return this.renderLoading();\n\n }\n\n }", "title": "" }, { "docid": "4072b93dbe07a1e04f25d0f289655bfa", "score": "0.60916996", "text": "_renderSubpart () {\n\n // Prepare booleans and format stuffs here\n\n return html`\n <div>Sub part of the template</div>\n `;\n }", "title": "" }, { "docid": "2bfe8b455e15b4fdbb36c96f8e2c105a", "score": "0.60867214", "text": "function render() {\n clearTemplate();\n quizInfo();\n question();\n}", "title": "" }, { "docid": "614ad3cb1155b5e358a4cc461caa2267", "score": "0.6084994", "text": "function render(result, container) {\n // your code here\n container.innerHTML = result;\n }", "title": "" }, { "docid": "3b638a73823b2e9ae7944aba9e6ee228", "score": "0.6083019", "text": "async render(data) {\n if (this._element) {\n this._element.innerHTML = this._templateFunction(data);\n }\n\n return this._element;\n }", "title": "" }, { "docid": "d60243ce8e7a9c0744bf38e926c93b3f", "score": "0.6077004", "text": "render() {\n \n\n return html` \n\n\n <div class=\"header-content\">\n <slime-icon type=\"${this.type}\" bg-color=\"transparent\" icon-scale=\"${this.iconScale}\" accent-color=\"transparent\"></slime-icon>\n <div class=\"header-text-box\">\n <h2>${this.heading}</h2>\n <h3>${this.subHeading}</h3>\n </div>\n </div>\n\n `;\n\n\n }", "title": "" }, { "docid": "f8be2e9236d51b11cf6a06aa25090607", "score": "0.6075848", "text": "renderFn(type) {\n const renderFn = this.renderFns[type]\n if (!renderFn) {\n throw new Error('`' + type + '` renderer not defined')\n }\n return renderFn\n }", "title": "" }, { "docid": "d0a736ed228fa172d67aa96a352610d6", "score": "0.6072511", "text": "onRender(c){\n\n\t}", "title": "" }, { "docid": "d728209645fe4b1a584e9d0b1f087a01", "score": "0.6068368", "text": "function render() {\n renderCarousel();\n renderWatchlist();\n renderActiveDetails();\n}", "title": "" }, { "docid": "260efc5becd40bd2b62c74f120065709", "score": "0.6061543", "text": "render(){\n\t\t//console.log(\"render\");\n\t}", "title": "" }, { "docid": "15af38a0dea3f710f3bbc025836a514e", "score": "0.6059649", "text": "function DisplayUtil() {\n}", "title": "" } ]
a49fd1599608b8237309d1d52f578032
Token generator from source using tokenizer.mode (or defaults.mode)
[ { "docid": "249c7ef2fef438ed193e71186a98ad29", "score": "0.6342771", "text": "*tokenize(source, state = {}) {\n let done;\n\n // TODO: Consider supporting Symbol.species\n const Species = this.constructor;\n\n // Local context\n const contextualizer = this.contextualizer || (this.contextualizer = Species.contextualizer(this));\n let context = contextualizer.next().value;\n\n const {mode, syntax, createGrouper = Species.createGrouper || Object} = context;\n\n // Local grouping\n const groupers = mode.groupers || (mode.groupers = {});\n const grouping =\n state.grouping ||\n (state.grouping = new Grouping({\n syntax: syntax || mode.syntax,\n groupers,\n createGrouper,\n contextualizer,\n }));\n\n // Local matching\n let {match, index = 0} = state;\n\n // Local tokens\n let previous, last, parent;\n const top = {type: 'top', text: '', offset: index};\n\n let lastContext = context;\n\n state.source = source;\n\n const tokenize = state.tokenize || (text => [{text}]);\n\n while (true) {\n const {\n mode: {syntax, matchers, comments, spans, closures},\n punctuator: $$punctuator,\n closer: $$closer,\n spans: $$spans,\n matcher: $$matcher,\n token,\n forming = true,\n } = context;\n\n // Current contextual hint (syntax or hint)\n const hint = grouping.hint;\n\n while (lastContext === (lastContext = context)) {\n let next;\n\n state.last = last;\n\n const lastIndex = state.index || 0;\n\n $$matcher.lastIndex = lastIndex;\n match = state.match = $$matcher.exec(source);\n done = index === (index = state.index = $$matcher.lastIndex) || !match;\n\n if (done) return;\n\n // Current contextual match\n const {0: text, 1: whitespace, 2: sequence, index: offset} = match;\n\n // Current quasi-contextual fragment\n const pre = source.slice(lastIndex, offset);\n pre &&\n ((next = token({\n type: 'pre',\n text: pre,\n offset: lastIndex,\n previous,\n parent,\n hint,\n last,\n source,\n })),\n yield (previous = next));\n\n // Current contextual fragment\n const type = (whitespace && 'whitespace') || (sequence && 'sequence') || 'text';\n next = token({type, text, offset, previous, parent, hint, last, source});\n\n // Current contextual punctuator (from sequence)\n const closing =\n $$closer &&\n ($$closer.test ? $$closer.test(text) : $$closer === text || (whitespace && whitespace.includes($$closer)));\n\n let after;\n let punctuator = next.punctuator;\n\n if (punctuator || closing) {\n let closed, opened, grouper;\n\n if (closing) {\n ({after, closed, parent = top, grouper} = grouping.close(next, state, context));\n } else if ($$punctuator !== 'comment') {\n ({grouper, opened, parent = top, punctuator} = grouping.open(next, context));\n }\n\n state.context = grouping.context = grouping.goal || syntax;\n\n if (opened || closed) {\n next.type = 'punctuator';\n context = contextualizer.next((state.grouper = grouper || undefined)).value;\n grouping.hint = `${[...grouping.hints].join(' ')} ${grouping.context ? `in-${grouping.context}` : ''}`;\n opened && (after = opened.open && opened.open(next, state, context));\n }\n }\n\n // Current contextual tail token (yield from sequence)\n yield (previous = next);\n\n // Next reference to last contextual sequence token\n next && !whitespace && forming && (last = next);\n\n if (after) {\n let tokens, token, nextIndex;\n\n if (after.syntax) {\n const {syntax, offset, index} = after;\n const body = index > offset && source.slice(offset, index - 1);\n if (body) {\n body.length > 0 &&\n ((tokens = tokenize(body, {options: {sourceType: syntax}}, this.defaults)), (nextIndex = index));\n const hint = `${syntax}-in-${mode.syntax}`;\n token = token => ((token.hint = `${(token.hint && `${token.hint} `) || ''}${hint}`), token);\n }\n } else if (after.length) {\n const hint = grouping.hint;\n token = token => ((token.hint = `${hint} ${token.type || 'code'}`), context.token(token));\n (tokens = after).end > state.index && (nextIndex = after.end);\n }\n\n if (tokens) {\n for (const next of tokens) {\n previous && ((next.previous = previous).next = next);\n token && token(next);\n yield (previous = next);\n }\n nextIndex > state.index && (state.index = nextIndex);\n }\n }\n }\n }\n }", "title": "" } ]
[ { "docid": "95c505227f23577a2ceda7dfb4fcf06a", "score": "0.66478133", "text": "generateBuiltInTokenizer() {\n this.writeData('TOKENIZER', EXAMPLE_TOKENIZER_TEMPLATE);\n }", "title": "" }, { "docid": "23078c006fbcc6d6f4a8c1e19f12ddef", "score": "0.66101515", "text": "generateBuiltInTokenizer() {\n this.writeData('TOKENIZER', CPP_TOKENIZER_TEMPLATE);\n }", "title": "" }, { "docid": "0b2f8dbaccceee9c02389de52935b08b", "score": "0.6449214", "text": "generateBuiltInTokenizer() {\n this.writeData('<<TOKENIZER>>', PY_TOKENIZER_TEMPLATE);\n }", "title": "" }, { "docid": "33b665664cc4222278ce6eb0a36bbcd1", "score": "0.6305589", "text": "function tokenizer(input,options){return new Parser(options,input);}// This is a terrible kludge to support the existing, pre-ES6", "title": "" }, { "docid": "67cf95acc46a1640e9295899d1a67228", "score": "0.62403387", "text": "generateBuiltInTokenizer() {\n this.writeData(\n '<<TOKENIZER>>',\n RUBY_TOKENIZER_TEMPLATE,\n );\n }", "title": "" }, { "docid": "3d77ac310cf753cd8eda755172e71136", "score": "0.6142569", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer\n };\n return lexer;\n}", "title": "" }, { "docid": "3d77ac310cf753cd8eda755172e71136", "score": "0.6142569", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer\n };\n return lexer;\n}", "title": "" }, { "docid": "3d77ac310cf753cd8eda755172e71136", "score": "0.6142569", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer\n };\n return lexer;\n}", "title": "" }, { "docid": "3d77ac310cf753cd8eda755172e71136", "score": "0.6142569", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer\n };\n return lexer;\n}", "title": "" }, { "docid": "3d77ac310cf753cd8eda755172e71136", "score": "0.6142569", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer\n };\n return lexer;\n}", "title": "" }, { "docid": "486088c2c5a1da40296468a6ecaf4e66", "score": "0.6130906", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "cfe9f55dcd476a8d82ab68d25f2da9e0", "score": "0.6119534", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "fc614f890199306da7f60705965322e0", "score": "0.611661", "text": "function createLexer(source, options) {\n\t var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n\t var lexer = {\n\t source: source,\n\t options: options,\n\t lastToken: startOfFileToken,\n\t token: startOfFileToken,\n\t line: 1,\n\t lineStart: 0,\n\t advance: advanceLexer\n\t };\n\t return lexer;\n\t}", "title": "" }, { "docid": "16657d2fd8e078b21201022155bdf7ae", "score": "0.6108905", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(_tokenKind.TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "2cdc46b31a0325475f2fe43683df016e", "score": "0.6099007", "text": "function tokenizer(input,options){return new _state.Parser(options,input);}", "title": "" }, { "docid": "bb3d845c2627ed24a5cc8f3e51b23d87", "score": "0.6091436", "text": "getToken () {\n const source = this.source.substr(this.pos);\n if (source === '') return this.createToken({type: \"#eof\", src: '', value: ''});\n\n const matches = [];\n\n for (const term of this.terminals) {\n if (term.type === 'string') {\n if (source.startsWith(term.value))\n matches.push({type: term.type, src: term.value, value: term.value, isIgnore: term.isIgnore});\n } else if (term.type === 'regex') {\n const parts = term.value.split('~');\n const flag = parts.pop() === 'i' ? 'i' : undefined;\n parts.shift();\n const pattern = \"^\" + parts.join('~');\n if (source.search(pattern, flag) === 0)\n matches.push ({\n type: term.type,\n src: term.value,\n value: new RegExp(pattern, flag).exec(source)[0],\n isIgnore: term.isIgnore\n });\n } else if (term.type === 'fn'){\n const method = this.registeredLexerMethods[term.value];\n if (! method || typeof method !== 'function')\n throw this.error(\"Lexer method named '\" + term.value + \"' is not registered or is not a function.\");\n const ret = method(this.source.substr(this.pos));\n if (ret == null) continue;\n if (typeof ret === 'string')\n matches.push({type: term.type, src: term.value, value: ret});\n else if (typeof ret === 'object') {\n matches.push({type: term.type, src: term.value, value: ret.value, length: ret.length});\n }\n } else {\n\n }\n }\n\n if (! matches.length)\n throw this.error(\"Lexical error: input stream did not match any tokens.\" +\n \" '\" + source[0] + \"'(chr: \"+source.charCodeAt(0)+\") is the first character that is not recognized.\");\n //among all the matches, return the longest one.\n //http://stackoverflow.com/questions/6521245/finding-longest-string-in-array/12548884#12548884\n //modified so that first among the equal length is chosen.\n const longest = matches.reduce( (a, b) => a.value.length >= b.value.length ? a : b );\n return this.createToken(longest);\n }", "title": "" }, { "docid": "5b5a55941de7890cbba63421d4214770", "score": "0.6072415", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "5b5a55941de7890cbba63421d4214770", "score": "0.6072415", "text": "function createLexer(source, options) {\n var startOfFileToken = new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}", "title": "" }, { "docid": "f4139b0a93efeb37b48c3ed4f341b02a", "score": "0.6019779", "text": "tokenize(template, options) {\n const tokenizer = new edge_lexer_1.Tokenizer(template, this.tags, this.getTokenizerOptions(options));\n tokenizer.parse();\n return tokenizer.tokens;\n }", "title": "" }, { "docid": "8b7fe7797c8040194c8a059b1b982836", "score": "0.6008522", "text": "tokenizer(src) {\n\t\tconst rule = /^ {0,3}(:{3,}(?=[^:\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~:]* *(?:\\n+|$)|$)/; // Regex for the complete token\n\t\tconst match = rule.exec(src);\n\n\t\tif (match) {\n\t\t\treturn {\n\t\t\t\ttype: 'infoBlock',\n\t\t\t\traw: match[0],\n\t\t\t\ttokens: this.inlineTokens(\n\t\t\t\t\tmatch[0]\n\t\t\t\t\t\t.replace(/:{3,}\\n/, '')\n\t\t\t\t\t\t.replace(/\\n:{3,}/, '')\n\t\t\t\t\t\t.trim()\n\t\t\t\t)\n\t\t\t};\n\t\t}\n\t}", "title": "" }, { "docid": "ef4c509304081c6e57f937bd71442975", "score": "0.5937941", "text": "function factory(type) {\n\t return tokenize;\n\t\n\t /* Tokenizer for a bound `type`. */\n\t function tokenize(value, location) {\n\t var self = this;\n\t var offset = self.offset;\n\t var tokens = [];\n\t var methods = self[type + 'Methods'];\n\t var tokenizers = self[type + 'Tokenizers'];\n\t var line = location.line;\n\t var column = location.column;\n\t var index;\n\t var length;\n\t var method;\n\t var name;\n\t var matched;\n\t var valueLength;\n\t\n\t /* Trim white space only lines. */\n\t if (!value) {\n\t return tokens;\n\t }\n\t\n\t /* Expose on `eat`. */\n\t eat.now = now;\n\t eat.file = self.file;\n\t\n\t /* Sync initial offset. */\n\t updatePosition('');\n\t\n\t /* Iterate over `value`, and iterate over all\n\t * tokenizers. When one eats something, re-iterate\n\t * with the remaining value. If no tokenizer eats,\n\t * something failed (should not happen) and an\n\t * exception is thrown. */\n\t while (value) {\n\t index = -1;\n\t length = methods.length;\n\t matched = false;\n\t\n\t while (++index < length) {\n\t name = methods[index];\n\t method = tokenizers[name];\n\t\n\t if (\n\t method &&\n\t /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n\t (!method.notInList || !self.inList) &&\n\t (!method.notInBlock || !self.inBlock) &&\n\t (!method.notInLink || !self.inLink)\n\t ) {\n\t valueLength = value.length;\n\t\n\t method.apply(self, [eat, value]);\n\t\n\t matched = valueLength !== value.length;\n\t\n\t if (matched) {\n\t break;\n\t }\n\t }\n\t }\n\t\n\t /* istanbul ignore if */\n\t if (!matched) {\n\t self.file.fail(new Error('Infinite loop'), eat.now());\n\t }\n\t }\n\t\n\t self.eof = now();\n\t\n\t return tokens;\n\t\n\t /* Update line, column, and offset based on\n\t * `value`. */\n\t function updatePosition(subvalue) {\n\t var lastIndex = -1;\n\t var index = subvalue.indexOf('\\n');\n\t\n\t while (index !== -1) {\n\t line++;\n\t lastIndex = index;\n\t index = subvalue.indexOf('\\n', index + 1);\n\t }\n\t\n\t if (lastIndex === -1) {\n\t column += subvalue.length;\n\t } else {\n\t column = subvalue.length - lastIndex;\n\t }\n\t\n\t if (line in offset) {\n\t if (lastIndex !== -1) {\n\t column += offset[line];\n\t } else if (column <= offset[line]) {\n\t column = offset[line] + 1;\n\t }\n\t }\n\t }\n\t\n\t /* Get offset. Called before the first character is\n\t * eaten to retrieve the range's offsets. */\n\t function getOffset() {\n\t var indentation = [];\n\t var pos = line + 1;\n\t\n\t /* Done. Called when the last character is\n\t * eaten to retrieve the range’s offsets. */\n\t return function () {\n\t var last = line + 1;\n\t\n\t while (pos < last) {\n\t indentation.push((offset[pos] || 0) + 1);\n\t\n\t pos++;\n\t }\n\t\n\t return indentation;\n\t };\n\t }\n\t\n\t /* Get the current position. */\n\t function now() {\n\t var pos = {line: line, column: column};\n\t\n\t pos.offset = self.toOffset(pos);\n\t\n\t return pos;\n\t }\n\t\n\t /* Store position information for a node. */\n\t function Position(start) {\n\t this.start = start;\n\t this.end = now();\n\t }\n\t\n\t /* Throw when a value is incorrectly eaten.\n\t * This shouldn’t happen but will throw on new,\n\t * incorrect rules. */\n\t function validateEat(subvalue) {\n\t /* istanbul ignore if */\n\t if (value.substring(0, subvalue.length) !== subvalue) {\n\t /* Capture stack-trace. */\n\t self.file.fail(\n\t new Error(\n\t 'Incorrectly eaten value: please report this ' +\n\t 'warning on http://git.io/vg5Ft'\n\t ),\n\t now()\n\t );\n\t }\n\t }\n\t\n\t /* Mark position and patch `node.position`. */\n\t function position() {\n\t var before = now();\n\t\n\t return update;\n\t\n\t /* Add the position to a node. */\n\t function update(node, indent) {\n\t var prev = node.position;\n\t var start = prev ? prev.start : before;\n\t var combined = [];\n\t var n = prev && prev.end.line;\n\t var l = before.line;\n\t\n\t node.position = new Position(start);\n\t\n\t /* If there was already a `position`, this\n\t * node was merged. Fixing `start` wasn’t\n\t * hard, but the indent is different.\n\t * Especially because some information, the\n\t * indent between `n` and `l` wasn’t\n\t * tracked. Luckily, that space is\n\t * (should be?) empty, so we can safely\n\t * check for it now. */\n\t if (prev && indent && prev.indent) {\n\t combined = prev.indent;\n\t\n\t if (n < l) {\n\t while (++n < l) {\n\t combined.push((offset[n] || 0) + 1);\n\t }\n\t\n\t combined.push(before.column);\n\t }\n\t\n\t indent = combined.concat(indent);\n\t }\n\t\n\t node.position.indent = indent || [];\n\t\n\t return node;\n\t }\n\t }\n\t\n\t /* Add `node` to `parent`s children or to `tokens`.\n\t * Performs merges where possible. */\n\t function add(node, parent) {\n\t var children = parent ? parent.children : tokens;\n\t var prev = children[children.length - 1];\n\t\n\t if (\n\t prev &&\n\t node.type === prev.type &&\n\t node.type in MERGEABLE_NODES &&\n\t mergeable(prev) &&\n\t mergeable(node)\n\t ) {\n\t node = MERGEABLE_NODES[node.type].call(self, prev, node);\n\t }\n\t\n\t if (node !== prev) {\n\t children.push(node);\n\t }\n\t\n\t if (self.atStart && tokens.length !== 0) {\n\t self.exitStart();\n\t }\n\t\n\t return node;\n\t }\n\t\n\t /* Remove `subvalue` from `value`.\n\t * `subvalue` must be at the start of `value`. */\n\t function eat(subvalue) {\n\t var indent = getOffset();\n\t var pos = position();\n\t var current = now();\n\t\n\t validateEat(subvalue);\n\t\n\t apply.reset = reset;\n\t reset.test = test;\n\t apply.test = test;\n\t\n\t value = value.substring(subvalue.length);\n\t\n\t updatePosition(subvalue);\n\t\n\t indent = indent();\n\t\n\t return apply;\n\t\n\t /* Add the given arguments, add `position` to\n\t * the returned node, and return the node. */\n\t function apply(node, parent) {\n\t return pos(add(pos(node), parent), indent);\n\t }\n\t\n\t /* Functions just like apply, but resets the\n\t * content: the line and column are reversed,\n\t * and the eaten value is re-added.\n\t * This is useful for nodes with a single\n\t * type of content, such as lists and tables.\n\t * See `apply` above for what parameters are\n\t * expected. */\n\t function reset() {\n\t var node = apply.apply(null, arguments);\n\t\n\t line = current.line;\n\t column = current.column;\n\t value = subvalue + value;\n\t\n\t return node;\n\t }\n\t\n\t /* Test the position, after eating, and reverse\n\t * to a not-eaten state. */\n\t function test() {\n\t var result = pos({});\n\t\n\t line = current.line;\n\t column = current.column;\n\t value = subvalue + value;\n\t\n\t return result.position;\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "3ae8c3aa69a655fac9b1a0f367415a85", "score": "0.5884691", "text": "function generate () {\n\n // Generate a table mapping n-grams to tokens from the source text\n var corpus = tokenize(source);\n token_table = map_from(corpus);\n var generated = generate_from(corpus.length-1, corpus[0]);\n\n return generated;\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.58836406", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.58836406", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.58836406", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.58836406", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "372e27f605d100171810f15a61d91c2f", "score": "0.58836406", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "e33e1ec7072bcdcce16bd38188827d31", "score": "0.5863594", "text": "function lex(source) {\n var prevPosition = 0;\n return function nextToken(resetPosition) {\n var token = readToken(source, resetPosition === undefined ? prevPosition : resetPosition);\n prevPosition = token.end;\n return token;\n };\n}", "title": "" }, { "docid": "67a3520da22546fa32359aade955e574", "score": "0.58496594", "text": "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function() {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var prev = node.position\n var start = prev ? prev.start : before\n var combined = []\n var n = prev && prev.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (prev && indent && prev.indent) {\n combined = prev.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var prev = children[children.length - 1]\n var fn\n\n if (\n prev &&\n node.type === prev.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, prev, node)\n }\n\n if (node !== prev) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.substring(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "title": "" }, { "docid": "0afd060c44ffa2e2524b66eff5db1529", "score": "0.5847574", "text": "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "title": "" }, { "docid": "0afd060c44ffa2e2524b66eff5db1529", "score": "0.5847574", "text": "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "title": "" }, { "docid": "5ab4b3502973c3090e2528ab15c88cee", "score": "0.57716537", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "title": "" }, { "docid": "5ab4b3502973c3090e2528ab15c88cee", "score": "0.57716537", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "title": "" }, { "docid": "12a85d14a9b49e544172579a88da8f60", "score": "0.57658327", "text": "tokenize(code, opts) {\n let end;\n if (opts == null) { opts = {}; }\n this.literate = opts.literate; // Are we lexing literate CoffeeScript?\n this.indent = 0; // The current indentation level.\n this.baseIndent = 0; // The overall minimum indentation level.\n this.indebt = 0; // The over-indentation at the current level.\n this.outdebt = 0; // The under-outdentation at the current level.\n this.indents = []; // The stack of all current indentation levels.\n this.indentLiteral = ''; // The indentation.\n this.ends = []; // The stack for pairing up tokens.\n this.tokens = []; // Stream of parsed tokens in the form `['TYPE', value, location data]`.\n this.seenFor = false; // Used to recognize `FORIN`, `FOROF` and `FORFROM` tokens.\n this.seenImport = false; // Used to recognize `IMPORT FROM? AS?` tokens.\n this.seenExport = false; // Used to recognize `EXPORT FROM? AS?` tokens.\n this.importSpecifierList = false; // Used to identify when in an `IMPORT {...} FROM? ...`.\n this.exportSpecifierList = false; // Used to identify when in an `EXPORT {...} FROM? ...`.\n this.csxDepth = 0; // Used to optimize CSX checks, how deep in CSX we are.\n this.csxObjAttribute = {}; // Used to detect if CSX attributes is wrapped in {} (<div {props...} />).\n\n this.chunkLine = opts.line || 0; // The start line for the current @chunk.\n this.chunkColumn = opts.column || 0; // The start column of the current @chunk.\n code = this.clean(code); // The stripped, cleaned original source code.\n\n // At every position, run through this list of attempted matches,\n // short-circuiting if any of them succeed. Their order determines precedence:\n // `@literalToken` is the fallback catch-all.\n let i = 0;\n while ((this.chunk = code.slice(i))) {\n const consumed = this.identifierToken()\n || this.commentToken()\n || this.whitespaceToken()\n || this.lineToken()\n || this.stringToken()\n || this.numberToken()\n || this.csxToken()\n || this.regexToken()\n || this.jsToken()\n || this.literalToken();\n\n // Update position.\n [this.chunkLine, this.chunkColumn] = this.getLineAndColumnFromChunk(consumed);\n\n i += consumed;\n\n if (opts.untilBalanced && (this.ends.length === 0)) { return { tokens: this.tokens, index: i }; }\n }\n\n this.closeIndentation();\n if (end = this.ends.pop()) { this.error(`missing ${end.tag}`, (end.origin != null ? end.origin : end)[2]); }\n if (opts.rewrite === false) { return this.tokens; }\n return (new Rewriter()).rewrite(this.tokens);\n }", "title": "" }, { "docid": "883f3e0f2488d40a8fc03f37506e7faa", "score": "0.57517946", "text": "function lex(source) {\n\t var prevPosition = 0;\n\t return function nextToken(resetPosition) {\n\t var token = readToken(source, resetPosition === undefined ? prevPosition : resetPosition);\n\t prevPosition = token.end;\n\t return token;\n\t };\n\t}", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.5722264", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.5722264", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "cdf234019b095342de94a87e07af767e", "score": "0.5722264", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n }", "title": "" }, { "docid": "51b27bbd34479f67a7e37aa88e63a24f", "score": "0.5702052", "text": "function Lexer(){ }", "title": "" }, { "docid": "0a2ae37356fcfa9d9c5f682d19b25ba6", "score": "0.5688877", "text": "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /**\n * Update line, column, and offset based on\n * `value`.\n *\n * @example\n * updatePosition('foo');\n *\n * @param {string} subvalue - Subvalue to eat.\n */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /**\n * Get offset. Called before the first character is\n * eaten to retrieve the range's offsets.\n *\n * @return {Function} - `done`, to be called when\n * the last character is eaten.\n */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /**\n * Done. Called when the last character is\n * eaten to retrieve the range’s offsets.\n *\n * @return {Array.<number>} - Offset.\n */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /**\n * Get the current position.\n *\n * @example\n * position = now(); // {line: 1, column: 1, offset: 0}\n *\n * @return {Object} - Current Position.\n */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /**\n * Store position information for a node.\n *\n * @example\n * start = now();\n * updatePosition('foo');\n * location = new Position(start);\n * // {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n *\n * @param {Object} start - Starting position.\n */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /**\n * Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules.\n *\n * @example\n * // When the current value is set to `foo bar`.\n * validateEat('foo');\n * eat('foo');\n *\n * validateEat('bar');\n * // throws, because the space is not eaten.\n *\n * @param {string} subvalue - Value to be eaten.\n * @throws {Error} - When `subvalue` cannot be eaten.\n */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @example\n * var update = position();\n * updatePosition('foo');\n * update({});\n * // {\n * // position: {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n * // }\n *\n * @returns {Function} - Updater.\n */\n function position() {\n var before = now();\n\n return update;\n\n /**\n * Add the position to a node.\n *\n * @example\n * update({type: 'text', value: 'foo'});\n *\n * @param {Node} node - Node to attach position\n * on.\n * @param {Array} [indent] - Indentation for\n * `node`.\n * @return {Node} - `node`.\n */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /**\n * Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible.\n *\n * @example\n * add({});\n *\n * add({}, {children: []});\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Parent to insert into.\n * @return {Object} - Added or merged into node.\n */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /**\n * Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`.\n *\n * @example\n * eat('foo')({type: 'text', value: 'foo'});\n *\n * @param {string} subvalue - Removed from `value`,\n * and passed to `updatePosition`.\n * @return {Function} - Wrapper around `add`, which\n * also adds `position` to node.\n */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /**\n * Add the given arguments, add `position` to\n * the returned node, and return the node.\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Node to insert into.\n * @return {Node} - Added node.\n */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /**\n * Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n *\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n *\n * See `apply` above for what parameters are\n * expected.\n *\n * @return {Node} - Added node.\n */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /**\n * Test the position, after eating, and reverse\n * to a not-eaten state.\n *\n * @return {Position} - Position after eating `subvalue`.\n */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "title": "" }, { "docid": "9a369a53c14c0d4004b0ed78b61f2fbd", "score": "0.5672921", "text": "function Tokenizer(input) {\n function *generator(input) {\n for (const m of input.matchAll(LEX_RE)) {\n // console.log(m); // only 1 group should match\n let i;\n for (i = 0; i < LEX_CLASS_KEYS.length; i++) {\n if (m[i + 1]) { // non-empty string, thus falsinees irrelevant\n // console.log('tokenMatch: ', i, m[i + 1]);\n const type = LEX_CLASS_KEYS[i];\n yield {type: type, value: LEX_CLASSES[type].value(m[i + 1])};\n break;\n }\n }\n if (i >= LEX_CLASS_KEYS.length) {\n throw new Error(\"Cannot parse token: \" + input);\n }\n }\n }\n const iter = generator(input);\n let current = null;\n\n this[Symbol.iterator] = () => generator(input);\n this.peek = () => (current || (current = iter.next())).value;\n this.consume = (type, value) => {\n const result = this.peek();\n if ((type && result.type !== type) || (value && result.value !== value)) {\n throw new Error('expected ' + type);\n }\n current = (current.done ? current : null);\n return result;\n };\n this.eof = () => (current || (current = iter.next())).done;\n}", "title": "" }, { "docid": "24ec8b8756331d4a8e9ebb111c2c4bf2", "score": "0.5668859", "text": "function tokenizer(input, options) {\n\t\t\t\t return _state.Parser.tokenizer(input, options);\n\t\t\t\t}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.56312096", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.56312096", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "704fd5bb24c892e750203000f263cc5d", "score": "0.56312096", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n}", "title": "" }, { "docid": "5fab5c2d704c65cea5ff292c8e3e0b3b", "score": "0.56295353", "text": "function Lexer(sourcetext, filename, options) {\n options = options || {};\n this.options = options || {};\n this.dialects = []; // the \"stack\" dialects are pushed/popped from\n if(filename) {\n this.filename = filename;\n this.fileext = utils.getFileExt(filename, \"sugar\");\n }\n this.set_source_text(sourcetext);\n}", "title": "" }, { "docid": "b81106b07a4792978407082eac752c29", "score": "0.5622907", "text": "constructor() {\n\n\t\t/**\n\t\t * Current token buffer.\n\t\t * @type {string}\n\t\t * @private\n\t\t */\n\t\tthis._source = '';\n\n\t\t/**\n\t\t * Current index in buffer.\n\t\t * @type {number}\n\t\t * @private\n\t\t */\n\t\tthis._currentIndex = 0;\n\n\t\t/**\n\t\t * Current token identifier.\n\t\t * @type {number}\n\t\t * @private\n\t\t */\n\t\tthis._currentState = STATES.INITIAL;\n\t}", "title": "" }, { "docid": "b774dc687e6356aebb86868710bf3346", "score": "0.56008697", "text": "function tokenizer(input, options) {\n return new Parser(options, input);\n }", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "1071b9549d8c3208bbe7de1e53ef50e4", "score": "0.5594802", "text": "function tokenizer(input, options) {\n return new Parser(options, input)\n}", "title": "" }, { "docid": "8cf20da7648b5921c29a5d8218073994", "score": "0.5589029", "text": "function html_js_tokenize()\n{\n\tvar src = getById(\"inputSrc\").value;\n\ttokens = lexer(src, re);\n\t\n\tshowById(\"buttonsLR\");\n\t\n\ttoken_pos = 0;\n\tstack = [ { state : 0, value : \"$\" } ];\n\tgetById(\"buttonNextLR\").disabled = false;\n\tgetById(\"buttonPlayLR\").disabled = false;\n\tgetById(\"buttonPauseLR\").disabled = true;\n\tgetById(\"buttonCompactAST\").disabled = false;\n\t\t\n\thtml_update_tokens();\n\thtml_update_stack();\n}", "title": "" }, { "docid": "bdd7f91db85a3fb865d6514b984fe07a", "score": "0.5588226", "text": "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = body.charCodeAt(pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev, lexer);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw Object(_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"syntaxError\"])(source, pos, unexpectedCharacterMessage(code));\n}", "title": "" }, { "docid": "7f9aeed328b6faa6679acffbbe958f49", "score": "0.5575821", "text": "tokenize(code, opts = {}) {\n var consumed, end, i, ref;\n this.literate = opts.literate; // Are we lexing literate CoffeeScript?\n this.indent = 0; // The current indentation level.\n this.baseIndent = 0; // The overall minimum indentation level.\n this.indebt = 0; // The over-indentation at the current level.\n this.outdebt = 0; // The under-outdentation at the current level.\n this.indents = []; // The stack of all current indentation levels.\n this.indentLiteral = ''; // The indentation.\n this.ends = []; // The stack for pairing up tokens.\n this.tokens = []; // Stream of parsed tokens in the form `['TYPE', value, location data]`.\n this.seenFor = false; // Used to recognize `FORIN`, `FOROF` and `FORFROM` tokens.\n this.seenImport = false; // Used to recognize `IMPORT FROM? AS?` tokens.\n this.seenExport = false; // Used to recognize `EXPORT FROM? AS?` tokens.\n this.importSpecifierList = false; // Used to identify when in an `IMPORT {...} FROM? ...`.\n this.exportSpecifierList = false; // Used to identify when in an `EXPORT {...} FROM? ...`.\n this.csxDepth = 0; // Used to optimize CSX checks, how deep in CSX we are.\n this.csxObjAttribute = {}; // Used to detect if CSX attributes is wrapped in {} (<div {props...} />).\n this.chunkLine = opts.line || 0; // The start line for the current @chunk.\n this.chunkColumn = opts.column || 0; // The start column of the current @chunk.\n code = this.clean(code); // The stripped, cleaned original source code.\n \n // At every position, run through this list of attempted matches,\n // short-circuiting if any of them succeed. Their order determines precedence:\n // `@literalToken` is the fallback catch-all.\n i = 0;\n while (this.chunk = code.slice(i)) {\n consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.stringToken() || this.numberToken() || this.csxToken() || this.regexToken() || this.jsToken() || this.literalToken();\n // Update position.\n [this.chunkLine, this.chunkColumn] = this.getLineAndColumnFromChunk(consumed);\n i += consumed;\n if (opts.untilBalanced && this.ends.length === 0) {\n return {\n tokens: this.tokens,\n index: i\n };\n }\n }\n this.closeIndentation();\n if (end = this.ends.pop()) {\n this.error(`missing ${end.tag}`, ((ref = end.origin) != null ? ref : end)[2]);\n }\n if (opts.rewrite === false) {\n return this.tokens;\n }\n return (new Rewriter).rewrite(this.tokens);\n }", "title": "" }, { "docid": "91556d3ab0245420b63dfeb5342e7331", "score": "0.55614173", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options);\n}", "title": "" }, { "docid": "91556d3ab0245420b63dfeb5342e7331", "score": "0.55614173", "text": "function tokenizer(input, options) {\n return Parser.tokenizer(input, options);\n}", "title": "" }, { "docid": "9d495d421661b39f74a71054db778d6f", "score": "0.5531819", "text": "function start(options) {\n if (!options) {\n options = {};\n }\n var c = void 0;\n _lexeme = \"\";\n var t;\n while (curIndex < src.length) {\n switch (c = src.charCodeAt(curIndex++)) {\n case 32: // space\n case 9: // tab\n case 10: // new line\n case 13:\n // carriage return\n continue;\n case 38:\n // ampersand (new column or entity)\n if ((0, _backward.indexOf)(src.substring(curIndex), \"nbsp;\") === 0) {\n // Skip &nbsp;\n curIndex += 5;\n continue;\n }\n return TK_NEWCOL;\n case 92:\n // backslash\n _lexeme += String.fromCharCode(c);\n switch (src.charCodeAt(curIndex)) {\n case 92:\n curIndex++;\n return TK_NEWROW; // double backslash = new row\n case 123: // left brace\n case 124: // vertical bar\n case 125:\n // right brace\n // Erase backslash.\n return src.charCodeAt(curIndex++);\n }\n var _tk = latex();\n if (_tk !== null) {\n return _tk;\n }\n _lexeme = \"\";\n continue; // whitespace\n case 45:\n // dash\n if (src.charCodeAt(curIndex) === 62) {\n curIndex++;\n return TK_RIGHTARROW;\n }\n case 33:\n // bang, exclamation point\n if (src.charCodeAt(curIndex) === 61) {\n // equals\n curIndex++;\n return TK_NE;\n }\n return c; // char code is the token id\n case 37: // percent\n case 40: // left paren\n case 41: // right paren\n case 42: // asterisk\n case 43: // plus\n case 44: // comma\n case 47: // slash\n case 58: // colon\n case 61: // equal\n case 63: // question mark\n case 91: // left bracket\n case 93: // right bracket\n case 94: // caret\n case 95: // underscore\n case 123: // left brace\n case 124: // vertical bar\n case 125:\n // right brace\n _lexeme += String.fromCharCode(c);\n return c; // char code is the token id\n case 36:\n // dollar\n _lexeme += String.fromCharCode(c);\n return TK_VAR;\n case 39:\n // prime (single quote)\n return prime(c);\n case 60:\n // left angle\n if (src.charCodeAt(curIndex) === 61) {\n // equals\n curIndex++;\n return TK_LE;\n }\n return TK_LT;\n case 62:\n // right angle\n if (src.charCodeAt(curIndex) === 61) {\n // equals\n curIndex++;\n return TK_GE;\n }\n return TK_GT;\n default:\n if (isAlphaCharCode(c) || c === CC_SINGLEQUOTE) {\n return variable(c);\n } else if (t = unicodeToLaTeX[c]) {\n _lexeme = t;\n var _tk = lexemeToToken[_lexeme];\n if (_tk === void 0) {\n _tk = TK_VAR; // e.g. \\\\theta\n }\n return _tk;\n } else if (matchDecimalSeparator(String.fromCharCode(c)) || isNumberCharCode(c)) {\n if (options.oneCharToken) {\n _lexeme += String.fromCharCode(c);\n return TK_NUM;\n }\n return number(c);\n } else {\n (0, _assert.assert)(false, message(1004, [String.fromCharCode(c), c]));\n return 0;\n }\n }\n }\n return 0;\n }", "title": "" }, { "docid": "be6636e20e4ae22b201e66b158583d12", "score": "0.5521415", "text": "function getToken() {\n for (i = 0; i < matchersLen; i += 1) {\n matchedContent = matchers[i](parseStr, offset, tokenList);\n\n if (matchedContent !== null) {\n // We matched something. Build a better token object.\n token = {\n line: line,\n col: col,\n offset: offset,\n type: types[i],\n content: matchedContent\n };\n\n if (tokenFactory) {\n token = tokenFactory(token);\n }\n\n return;\n }\n }\n\n token = null;\n }", "title": "" }, { "docid": "4820b85ebd0e69161271a7240ce406f8", "score": "0.5520121", "text": "function makeParser(source, options) {\n var _lexToken = (0, _lexer.lex)(source);\n return {\n _lexToken: _lexToken,\n source: source,\n options: options,\n prevEnd: 0,\n token: _lexToken()\n };\n}", "title": "" }, { "docid": "c822fa27f8dc99d5a7d81b15569b708a", "score": "0.5520009", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n }", "title": "" }, { "docid": "d8c68befa85cb814811430186dd6501a", "score": "0.55183715", "text": "*next(token) {\n if (process.env.LOG_STREAM)\n console.dir(token, { depth: null });\n switch (token.type) {\n case 'directive':\n this.directives.add(token.source, (offset, message, warning) => {\n const pos = getErrorPos(token);\n pos[0] += offset;\n this.onError(pos, 'BAD_DIRECTIVE', message, warning);\n });\n this.prelude.push(token.source);\n this.atDirectives = true;\n break;\n case 'document': {\n const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError);\n if (this.atDirectives && !doc.directives.docStart)\n this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');\n this.decorate(doc, false);\n if (this.doc)\n yield this.doc;\n this.doc = doc;\n this.atDirectives = false;\n break;\n }\n case 'byte-order-mark':\n case 'space':\n break;\n case 'comment':\n case 'newline':\n this.prelude.push(token.source);\n break;\n case 'error': {\n const msg = token.source\n ? `${token.message}: ${JSON.stringify(token.source)}`\n : token.message;\n const error = new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);\n if (this.atDirectives || !this.doc)\n this.errors.push(error);\n else\n this.doc.errors.push(error);\n break;\n }\n case 'doc-end': {\n if (!this.doc) {\n const msg = 'Unexpected doc-end without preceding document';\n this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));\n break;\n }\n this.doc.directives.docEnd = true;\n const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);\n this.decorate(this.doc, true);\n if (end.comment) {\n const dc = this.doc.comment;\n this.doc.comment = dc ? `${dc}\\n${end.comment}` : end.comment;\n }\n this.doc.range[2] = end.offset;\n break;\n }\n default:\n this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));\n }\n }", "title": "" }, { "docid": "cea31f85e616f1906a60108e14594f0b", "score": "0.54632515", "text": "function VNTextEditorTokenizer()\n{\n this._key_p=new VNPromise(this);\n this._key_p.allowRecursion(true);\n this._token_p=new VNPromise(this);\n this._line_p=new VNPromise(this);\n this._token2_p=new VNPromise(this);\n this._line2_p=new VNPromise(this);\n this._cancel=false;\n}", "title": "" }, { "docid": "f8cdaed90e2195ec829c37d38789cd59", "score": "0.54535365", "text": "function tokenBase(stream, state) {\n var ch = stream.next();\n \n if (ch === \"`\") {\n stream.match(/`{2}/);\n return \"codeState\";\n }\n // TODO: Make state work for the entire line, make it work for when it is just one line\n if (state.codeState) {\n stream.eatWhile(/[^`]*/);\n return \"code\";\n } else if (state.headerLine) { \n stream.eatWhile(/[^\\n]*/);\n return \"h-text\";\n }\n // if is a number\n if (/[\\d\\.]/.test(ch)) {\n if (ch === \".\") {\n stream.match(/^[0-9]+([eE][\\-+]?[0-9]+)?/);\n } else if (ch === \"0\") {\n stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);\n } else {\n stream.match(/^[0-9]*\\.?[0-9]*([eE][\\-+]?[0-9]+)?/);\n }\n return \"number\";\n }\n if (/[\\[\\]{}\\(\\)]/.test(ch)) {\n return \"comment\";\n }\n\n if (ch === \"h\") {\n var isHttp = stream.match(/(ttps|ttp)[^\\s)]*/);\n if (isHttp && isHttp.input.startsWith(\"ttp\")) return \"link\";\n }\n \n if (ch === \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n }\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return \"comment\";\n }\n }\n if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return \"operator\";\n }\n\n if (ch === \"#\" && state.startOfLine) {\n var no = stream.match(/[#]*/);\n if (no.input.startsWith(\"#\")) return \"header-2\";\n else return \"header\";\n }\n\n if (ch === \"*\" && state.startOfLine) {\n stream.match(/\\**/);\n return \"tag\";\n }\n \n // Essentially eats anything that isn't a punctuation except for ?\n stream.eatWhile(/[\\w\\$_\\xa1-\\uffff]/);\n var cur = stream.current();\n if (keywords.propertyIsEnumerable(cur)) return \"keyword\";\n if (atoms.propertyIsEnumerable(cur)) return \"atom\";\n if (months.propertyIsEnumerable(cur)) return \"month\";\n if (daysOfTheWeek.propertyIsEnumerable(cur)) return \"day\"\n return \"variable\";\n }", "title": "" }, { "docid": "89f1e74bd42bb05f14b7ae2b520df483", "score": "0.5446194", "text": "function Lexer(source) {\n var startOfFileToken = new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }", "title": "" }, { "docid": "4be9aec8301a61dba51136bc6b162e2c", "score": "0.5442098", "text": "tokenize(code) {\n\t\t\t// unify line endings\n\t\t\tlet clean_code = code.replace(/\\r\\n/gm, \"\\n\")\n\t\t\t\t.replace(/\\n/gm, \" \\n \")\n\t\t\t\t.replace(/\\t/gm, \" \\t \")\n\t\t\t\t.replace(/\\r/gm, \" \\n \")\n\n\t\t\t// tokenize code\n\t\t\tlet tokens = clean_code.split(\" \")\n\n\t\t\t// merge tokens\n\t\t\tlet merged_tokens = []\n\n\t\t\tfunction add(something) {\n\t\t\t\tmerged_tokens.push(something)\n\t\t\t}\n\n\t\t\tlet depth\n\n\t\t\tlet line = 0\n\t\t\tlet column = 0\n\n\t\t\tfor (let i = 0; i < tokens.length; i++) {\n\t\t\t\tlet t = tokens[i]\n\t\t\t\tdepth = 1\n\n\t\t\t\tswitch (t.toLowerCase()) {\n\t\t\t\t\tcase \"\": // ignore empty/whitespace tokens\n\t\t\t\t\tcase \"\\n\":\n\t\t\t\t\tcase \"\\t\":\n\t\t\t\t\tcase \"\\r\": {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"////\": { // start a new screen\n\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\twhile (tokens[i] !== \"\\n\") {\n\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\t\tif (tokens[i] !== \"\\n\")\n\t\t\t\t\t\t\t\tstr += tokens[i] + \" \"\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadd(new AST.Screen(str.slice(0, str.length - 1)))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"\\\\\\\\\": { // \\\\ comments\n\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\ti++\n\t\t\t\t\t\twhile (i < tokens.length) {\n\t\t\t\t\t\t\tstr += tokens[i] + \" \"\n\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\tif (i + 1 < tokens.length && tokens[i + 1] === \"////\") {\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadd(new AST.CommentParentheses(str.slice(0, str.length - 1)))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"\\\\\": // line comments\n\t\t\t\t\tcase \"//\": {\n\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\twhile (tokens[i] !== \"\\n\") {\n\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\t\tif (tokens[i] !== \"\\n\")\n\t\t\t\t\t\t\t\tstr += tokens[i] + \" \"\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadd(new AST.CommentLine(str.slice(0, str.length - 1)))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"(\": { // comment start\n\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\twhile (depth > 0) {\n\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\tthrow new Error(\"Couldn't find closing ')'\")\n\n\t\t\t\t\t\t\tif (tokens[i] === \"(\")\n\t\t\t\t\t\t\t\tdepth++\n\t\t\t\t\t\t\telse if (tokens[i] === \")\") {\n\t\t\t\t\t\t\t\tdepth--\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (depth > 0)\n\t\t\t\t\t\t\t\tstr += tokens[i] + \" \"\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadd(new AST.CommentParentheses(str.slice(0, str.length - 1)))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"/*\": // comment start\n\t\t\t\t\tcase \"/**\": {\n\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\twhile (depth > 0) {\n\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\tthrow new Error(\"Couldn't find closing '*/'\")\n\n\t\t\t\t\t\t\tif (tokens[i] === \"/*\" || tokens[i] === \"/**\")\n\t\t\t\t\t\t\t\tdepth++\n\t\t\t\t\t\t\telse if (tokens[i] === \"*/\") {\n\t\t\t\t\t\t\t\tdepth--\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (depth > 0)\n\t\t\t\t\t\t\t\tstr += tokens[i] + \" \"\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadd(new AST.CommentParentheses(str.slice(0, str.length - 1)))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \":[\": { // execute js code start\n\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\ti++\n\t\t\t\t\t\twhile (tokens[i] !== \"]:\" && tokens[i] !== \"]:d\" && tokens[i] !== \"];\") {\n\t\t\t\t\t\t\tstr += tokens[i] + \" \"\n\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\tthrow new Error(\"Couldn't find closing ']:' or ']:d' or '];' for ':[\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet localjscode = str.slice(0, str.length - 1).replace(/ \\t /gm, \"\\t\")\n\t\t\t\t\t\tif (tokens[i] === \"]:\")\n\t\t\t\t\t\t\tadd(new AST.JsCodeWithReturn(localjscode))\n\t\t\t\t\t\telse if (tokens[i] === \"]:d\")\n\t\t\t\t\t\t\tadd(new AST.JsCodeDirect(localjscode))\n\t\t\t\t\t\telse //if(tokens[i] === \"];\")\n\t\t\t\t\t\t\tadd(new AST.JsCode(localjscode))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"{\": // local variable start\n\t\t\t\t\tcase \"local{\": { // local variable start\n\t\t\t\t\t\tlet start = tokens[i]\n\t\t\t\t\t\tlet done = false\n\t\t\t\t\t\tlet localvars = []\n\t\t\t\t\t\tlet comment = \"\"\n\t\t\t\t\t\ti++\n\t\t\t\t\t\twhile (tokens[i] !== \"}\") {\n\t\t\t\t\t\t\tif (tokens[i] === \"--\") {\n\t\t\t\t\t\t\t\tdone = true\n\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!done) {\n\t\t\t\t\t\t\t\tif (tokens[i] !== \"\") {\n\t\t\t\t\t\t\t\t\tlocalvars.push(tokens[i])\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\tcomment += tokens[i] + \" \"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\tthrow new Error(\"Couldn't find closing '}' for '\" + start + \"'\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch (start) {\n\t\t\t\t\t\t\tcase \"{\":\n\t\t\t\t\t\t\t\tadd(new AST.ValueLocal(localvars.reverse(), comment.slice(0, comment.length - 1)))\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tcase \"local{\":\n\t\t\t\t\t\t\t\tadd(new AST.ValueLocalTemp(localvars.reverse(), comment.slice(0, comment.length - 1)))\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"{}\": {\n\t\t\t\t\t\tadd(new AST.ValueLocal([], \"\"))\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tlet replacedcommawithperiod = t.replaceAll(\",\", \".\")\n\t\t\t\t\t\tif (isNumeric(replacedcommawithperiod)) {\n\t\t\t\t\t\t\tadd(new AST.Number(replacedcommawithperiod))\n\t\t\t\t\t\t} else if (t[0] === \"'\" && t.length === 2) {\n\t\t\t\t\t\t\tadd(new AST.Number(t.charCodeAt(1)))\n\t\t\t\t\t\t} else if (t[0] === \"\\\"\") {\n\t\t\t\t\t\t\tlet escapecounter = 0\n\t\t\t\t\t\t\tlet j = 0\n\t\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\tif (tokens[i].length - 1 === j || tokens[i].length === 0) {\n\t\t\t\t\t\t\t\t\tj = 0\n\t\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\t\t\tthrow new Error(\"Couldn't find '\\\"'\")\n\t\t\t\t\t\t\t\t\tstr += \" \"\n\t\t\t\t\t\t\t\t\tif (tokens[i].length === 0)\n\t\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tj++\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (tokens[i][j] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\tescapecounter++\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfor (let k = 0; k < escapecounter; k++)\n\t\t\t\t\t\t\t\t\t\tstr += \"\\\\\"\n\t\t\t\t\t\t\t\t\tif (escapecounter % 2 === 0 && tokens[i][j] === \"\\\"\")\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tescapecounter = 0\n\t\t\t\t\t\t\t\t\tstr += tokens[i][j]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tadd(new AST.String(str.slice(0, str.length)\n\t\t\t\t\t\t\t\t.replace(/ \\n /gm, \"\\\\n\")\n\t\t\t\t\t\t\t\t.replace(/ \\t /gm, \"\\\\t\")\n\t\t\t\t\t\t\t\t.replace(/ \\r /gm, \"\\\\r\"), false)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else if (t[0] === \"`\") {\n\t\t\t\t\t\t\tlet escapecounter = 0\n\t\t\t\t\t\t\tlet j = 0\n\t\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\tif (tokens[i].length - 1 === j || tokens[i].length === 0) {\n\t\t\t\t\t\t\t\t\tj = 0\n\t\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\t\t\tthrow new Error(\"Couldn't find '`'\")\n\t\t\t\t\t\t\t\t\tstr += \" \"\n\t\t\t\t\t\t\t\t\tif (tokens[i].length === 0)\n\t\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tj++\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (tokens[i][j] === \"\\\\\") {\n\t\t\t\t\t\t\t\t\tescapecounter++\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfor (let k = 0; k < escapecounter; k++)\n\t\t\t\t\t\t\t\t\t\tstr += \"\\\\\"\n\t\t\t\t\t\t\t\t\tif (escapecounter % 2 === 0 && tokens[i][j] === \"`\")\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tescapecounter = 0\n\t\t\t\t\t\t\t\t\tstr += tokens[i][j]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tadd(new AST.String(str.slice(0, str.length)\n\t\t\t\t\t\t\t\t.replace(/ \\n /gm, \"\\\\n\")\n\t\t\t\t\t\t\t\t.replace(/ \\t /gm, \"\\\\t\")\n\t\t\t\t\t\t\t\t.replace(/ \\r /gm, \"\\\\r\"), true)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else if (t[0] === \"\\u00bb\") { // »\n\t\t\t\t\t\t\tlet str = \"\"\n\t\t\t\t\t\t\tif (tokens[i].substr(tokens[i].length - 1) === \"\\u00ab\" && // «\n\t\t\t\t\t\t\t\ttokens[i].substr(tokens[i].length - 2) !== \"\\\\\\u00ab\" // «\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tstr = tokens[i].substr(1, tokens[i].length - 1)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstr = tokens[i].substr(1) + \" \"\n\t\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\t\tif (tokens[i].substr(tokens[i].length - 1) === \"\\u00ab\" && // «\n\t\t\t\t\t\t\t\t\t\ttokens[i].substr(tokens[i].length - 2) !== \"\\\\\\u00ab\" // «\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tif (tokens[i].length === 1)\n\t\t\t\t\t\t\t\t\t\t\tstr += \" \"\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tstr += tokens[i]\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstr += tokens[i] + \" \"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ti++\n\n\t\t\t\t\t\t\t\t\tif (i >= tokens.length)\n\t\t\t\t\t\t\t\t\t\tthrow new Error(\"Couldn't find closing '\\u00ab' for '\\u00bb'\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tadd(new AST.String(str.slice(0, str.length - 1)\n\t\t\t\t\t\t\t\t.replace(/ \\n /gm, \"\\\\n\")\n\t\t\t\t\t\t\t\t.replace(/ \\t /gm, \"\\\\t\")\n\t\t\t\t\t\t\t\t.replace(/ \\r /gm, \"\\\\r\")\n\t\t\t\t\t\t\t\t.replaceAll(\"\\\"\", \"\\\\\\\"\")\n\t\t\t\t\t\t\t\t.replaceAll(\"\\\\\\u00bb\", \"\\u00bb\")\n\t\t\t\t\t\t\t\t.replaceAll(\"\\\\\\u00ab\", \"\\u00ab\"), false)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else if (t[0] === \"$\" && t.length >= 2) { // handle hex numbers\n\t\t\t\t\t\t\tif(t.substr(1,1) === \"-\") {\n\t\t\t\t\t\t\t\tadd(new AST.Number(\"-0x\" + t.substr(2)))\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tadd(new AST.Number(\"0x\" + t.substr(1)))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (t[0] === \"%\" && t.length >= 2) { // handle binary numbers\n\t\t\t\t\t\t\tif(t.substr(1,1) === \"-\") {\n\t\t\t\t\t\t\t\tadd(new AST.Number(\"-0b\" + t.substr(2)))\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tadd(new AST.Number(\"0b\" + t.substr(1)))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tadd(new AST.Token(t))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn merged_tokens\n\t\t}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.54223216", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.54223216", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.54223216", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "15f7c093922998f58f58d183a60f2f9c", "score": "0.54223216", "text": "function tokenizer(input, options) {\n return new _state.Parser(options, input);\n}", "title": "" }, { "docid": "52af5261267615de534fff0534b2f7a6", "score": "0.5400063", "text": "function makeParser(source, options) {\n\t var _lexToken = (0, _lexer.lex)(source);\n\t return {\n\t _lexToken: _lexToken,\n\t source: source,\n\t options: options,\n\t prevEnd: 0,\n\t token: _lexToken()\n\t };\n\t}", "title": "" }, { "docid": "2abfc01755bbcc0de8e70a75ac80c80e", "score": "0.5381509", "text": "function takeToken(cm, pos, precise, asArray) { // 5983\n function getObj(copy) { // 5984\n return {start: stream.start, end: stream.pos, // 5985\n string: stream.current(), // 5986\n type: style || null, // 5987\n state: copy ? copyState(doc.mode, state) : state}; // 5988\n } // 5989\n // 5990\n var doc = cm.doc, mode = doc.mode, style; // 5991\n pos = clipPos(doc, pos); // 5992\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); // 5993\n var stream = new StringStream(line.text, cm.options.tabSize), tokens; // 5994\n if (asArray) tokens = []; // 5995\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) { // 5996\n stream.start = stream.pos; // 5997\n style = readToken(mode, stream, state); // 5998\n if (asArray) tokens.push(getObj(true)); // 5999\n } // 6000\n return asArray ? tokens : getObj(); // 6001\n } // 6002", "title": "" }, { "docid": "51fb2ab7c8f0eb7a073482c9481fe4bf", "score": "0.53811747", "text": "function getNextToken() {\n // Skip whitespace.\n while (source[cursor] === ' ') cursor++;\n var nextToken = source[cursor];\n cursor++;\n return nextToken;\n}", "title": "" }, { "docid": "04e04b6dd107d6a61c92ea6015e4c37d", "score": "0.53620523", "text": "function Lexer(source) {\n var startOfFileToken = new _ast.Token(_tokenKind.TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }", "title": "" }, { "docid": "7f3bdd446b23e2bcbf48d473db70e24e", "score": "0.53615326", "text": "function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }", "title": "" }, { "docid": "7f3bdd446b23e2bcbf48d473db70e24e", "score": "0.53615326", "text": "function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }", "title": "" }, { "docid": "5a80447a023bc3468baddafb58cafb79", "score": "0.5345529", "text": "function tokener(value, type, conf) {\n var w = walker, c = conf || {};\n tokens.push({\n charstart: isset(c['char']) ? c['char'] : w.chnum,\n charend: isset(c.charend) ? c.charend : w.chnum,\n linestart: isset(c.line) ? c.line : w.linenum,\n lineend: isset(c.lineend) ? c.lineend : w.linenum,\n value: value,\n type: type || value\n });\n }", "title": "" } ]
2895b83fa7d66e2357da5db45aab608d
Parses a string, possibly represented with thousands separators, decimal separators different than JS default.
[ { "docid": "446807d05d9b1d20d36b3dddbe7d5c40", "score": "0.6579772", "text": "function parseAnyNumber(s) {\n var parts = s.split(/([\\.\\,]\\d+)$/);\n var integralPart = parts[0],\n decimalPart = parts[1],\n a = 0;\n if (integralPart) {\n a = parseInt(integralPart.replace(/\\D/g, \"\"));\n }\n if (decimalPart) {\n a += parseFloat(decimalPart.replace(/\\,/g, \".\"));\n }\n return /^\\s?-/.test(s) ? -a : a;\n}", "title": "" } ]
[ { "docid": "351cc2eafb61cdfab1e2d75dbe8f16cc", "score": "0.68952453", "text": "function parseStringToNumber ( value ) {\n\n\t// If the value is not a string, return it back\n\tif ( typeof value != \"string\" || value.trim() == \"\" )\n\t\treturn value;\n\n\t// If the value contains any character other than a digit, comma or a decimal point, return it back\n\tif ( /[^\\d\\-\\.,]/.test( value ) )\n\t\treturn value;\n\n\treturn parseFloat( value.replace( /,/g, \"\" ) );\n\n}", "title": "" }, { "docid": "13babe285327abf64e92368bba0d3d49", "score": "0.6854477", "text": "function gentlyParseNumber(text) { return parseFloat(text) || text; }", "title": "" }, { "docid": "61a9d31a4745b581eec90d83dce14611", "score": "0.66557574", "text": "static parse(text) {\n \n text = text.toString();\n \n stripCurrency:\n {\n let currencies = [];\n for (let code in NumberFormatter.#CURRENCIES) {\n let currency = NumberFormatter.#CURRENCIES[code];\n currencies.push(currency.sign);\n currencies.push(currency.code);\n currencies.push(currency.abbr ?? \"\");\n }\n currencies = currencies.sort((a,b) => b.length - a.length);\n let replaceValues = [];\n currencies.forEach(currency => replaceValues.push(currency + \" \"));\n currencies.forEach(currency => replaceValues.push(\" \" + currency));\n replaceValues = replaceValues.concat(replaceValues, currencies);\n replaceValues.forEach(val => text = text.replace(val, \"\"));\n }\n \n stripSeperators:\n {\n let seperators = text.match(/[^0-9]/g);\n let decimalSeperator = seperators.pop();\n seperators.forEach(char => text = text.replace(char, \"\"));\n text = text.replace(decimalSeperator, \".\");\n }\n \n let number = parseFloat(text);\n \n return number;\n }", "title": "" }, { "docid": "7a895782fed830ccf03046aacea9c166", "score": "0.6628802", "text": "function parseNumber(s)\n{\n if (s.match(/\\./)) {\n return parseFloat(s);\n } else if (s.match(/\\//)) {\n return new Fraction(s); \n } else {\n return parseInt(s);\n }\n}", "title": "" }, { "docid": "8b97f9a261d32334110f2ead69bb5ed2", "score": "0.65565014", "text": "function stringToNumber(string) {\r\n // parseXXX interpretiert einen Punkt immer als Dezimaltrennzeichen\r\n var returnValue = \"\";\r\n var percent = false;\r\n // Buchstaben und Whitespaces entfernen\r\n string = string.replace(/[\\sa-zA-Z]/g, \"\");\r\n // Auf % pruefen und % entfernen\r\n if (string.lastIndexOf(\"%\") != -1) {\r\n percent = true;\r\n string = string.replace(/%/g, \"\");\r\n }\r\n var regexpWholeSimple = /^\\d+$/;\r\n var regexpWholeWithDots = /^\\d+(\\.\\d{3}){1,}$/;\r\n var regexpDecimal = /^\\d*\\.\\d{1,}$/;\r\n if (regexpWholeSimple.test(string)) {\r\n // Einfache ganze Zahl\r\n returnValue = parseInt(string);\r\n } else if (regexpWholeWithDots.test(string)) {\r\n // Ganze Zahl mit Tausenderpunkten\r\n returnValue = parseInt(string.replace(/\\./g, \"\"));\r\n } else if (regexpDecimal.test(string)) {\r\n // Dezimalzahl mit Punkt als Trennzeichen\r\n returnValue = parseFloat(string);\r\n } else {\r\n // Kein gueltiger String\r\n percent = false;\r\n returnValue = \"\";\r\n }\r\n if (percent) { returnValue /= 100; }\r\n return returnValue;\r\n}", "title": "" }, { "docid": "ac3b441dcc0b9565786c520456e0bc2c", "score": "0.65387136", "text": "function parseNumber (string) {\n if (string == null) return null\n\n string = `${string}`.trim()\n const number = parseFloat(string, 10)\n\n if (isNaN(number)) return null\n\n return number\n}", "title": "" }, { "docid": "177132c3119762147b92eebfa1029150", "score": "0.64906186", "text": "function parseFloatOpts(str) {\n\n if (typeof str === \"number\") {\n return str;\n }\n\n var ar = str.split(/\\.|,/);\n\n var value = '';\n for (var i in ar) {\n if (i > 0 && i == ar.length - 1) {\n value += \".\";\n }\n value += ar[i];\n }\n return Number(value);\n}", "title": "" }, { "docid": "5ee36f5e4a3ecf640125e07d9a47599c", "score": "0.648408", "text": "function parseMoney(text) {\n return text.replace(/^[0-9.,]/g, '');\n}", "title": "" }, { "docid": "c6a59d00e588122e3164e535ae69a669", "score": "0.64629006", "text": "parseNumbers(n) {\n var n = ('' + n).split('.');\n var num = n[0];\n var dec = n[1];\n var r, s, t;\n\n if (num.length > 3) {\n s = num.length % 3;\n\n if (s) {\n t = num.substring(0,s);\n num = t + num.substring(s).replace(/(\\d{3})/g, \",$1\");\n } else {\n num = num.substring(s).replace(/(\\d{3})/g, \",$1\").substring(1);\n }\n }\n\n if (dec && dec.length > 3) {\n dec = dec.replace(/(\\d{3})/g, \"$1 \");\n }\n\n return num + (dec? '.' + dec : '');\n }", "title": "" }, { "docid": "50a03a27e14b28688b231f3d4f9bad98", "score": "0.6397425", "text": "function parseDollars(str) {\n return parseFloat(str.replace(\"$\", \"\").replace(\",\", \"\").replace(\"*\", \"\"));\n}", "title": "" }, { "docid": "c0a49fd7a70b0db10a9028a403b622b1", "score": "0.63882667", "text": "function extractOnlyNumbersAndDecimalsFromString(str)\n{\n str = str.replace(/\\s+/g, \"\"); //Remove blank spaces from string\n var numString = \"\";\n for(var i=0; i<str.length; i++)\n {\n var curChar = str[i];\n //console.log(currencyString+\" Looking at \"+str[i]);\n if(!isNaN(curChar) || curChar == \".\")\n {\n //console.log(curChar+\" is a num \");\n numString = numString + curChar;\n }\n else\n {\n var curChar2 = Number(str[i]);\n if(!isNaN(curChar))\n {\n numString = numString + curChar;\n }//end if\n }//end if\n }\n //console.log(\"\\n\");\n return Number(numString);\n}", "title": "" }, { "docid": "9413e1e81c3ca8c786c2d7a4e245b34b", "score": "0.6355691", "text": "function splitToStringNum ( str, sep ) {\n\t\t\tvar a = str.split( sep );\n\t\t\tfor ( var i = 0; i < a.length; i++ ) {\n\t\t\t\tif ( !isNaN( a[i] ) ) {\n\t\t\t\t\ta[i] = Number( a[i] );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a;\n\t\t}", "title": "" }, { "docid": "3fec52c9a9ec7604e6a4b24a194f7b1c", "score": "0.6328979", "text": "function isNumeric(string, rejectThousandSep )\n{\n string = string.trim();\n if ( rejectThousandSep !== null && rejectThousandSep )\n {\n var hasThousands = ( string.search( new RegExp( THOUSANDS_SEP ) ) !== -1 ) ;\n if (hasThousands)\n {\n return false;\n }\n }\n string = string.replace(new RegExp(THOUSANDS_SEP, 'g'), '');\n if ( string.search( new RegExp(EFLOAT_REGEXP) ) === 0 )\n {\n var floatValue = parseFloat(string);\n return !isNaN(floatValue);\n }\n return false;\n}", "title": "" }, { "docid": "9ce40b7758536ea3c560a03037207c4c", "score": "0.6283488", "text": "getDecimals (string, locale = this.locale) {\n const { decimal } = Decimal.getDelimiters(locale)\n const match = string.match(new RegExp(`\\\\${decimal}(\\\\d+?)$`))\n return match ? match[1] : ''\n }", "title": "" }, { "docid": "a774f26394f85308efadeabb05996b93", "score": "0.6245799", "text": "function _parse_decimal(string)\n{\n\tif (/^-?[0-9]+$/.test(string))\n\t{\n\t\treturn [bigInt(string),bigInt(1)]\n\t}\n\telse\n\t{\n\t\tvar match = /^(-?)([0-9]*)\\.([0-9]*)$/.exec(string);\n\t\tif (match == null)\n\t\t{\n\t\t\tthrow 'Cannot parse number ' + string;\n\t\t}\n\t\tvar minus = bigInt(1);\n\t\tif (match[1] === '-')\n\t\t{\n\t\t\tminus = bigInt(-1);\n\t\t}\n\t\tvar intPart = match[2];\n\t\tvar decimalPart = match[3];\n\t\tvar denom = bigInt(10).pow(decimalPart.length)\n\t\treturn [bigInt(intPart).multiply(denom).add(decimalPart).multiply(minus), denom]\n\t}\n}", "title": "" }, { "docid": "2c735054343ce3347215599cdc256084", "score": "0.6240583", "text": "function parseNumber(num) {\n return parseFloat(num.replace(/,/g, ''));\n }", "title": "" }, { "docid": "1bbb26c8c99a1e6518034b28bf54a538", "score": "0.62305427", "text": "function parseNumber(num) {\n var numStr = Math.abs(num) + '';\n var exponent = 0, digits, integerLen;\n var i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits: digits, exponent: exponent, integerLen: integerLen };\n}", "title": "" }, { "docid": "1bbb26c8c99a1e6518034b28bf54a538", "score": "0.62305427", "text": "function parseNumber(num) {\n var numStr = Math.abs(num) + '';\n var exponent = 0, digits, integerLen;\n var i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits: digits, exponent: exponent, integerLen: integerLen };\n}", "title": "" }, { "docid": "1bbb26c8c99a1e6518034b28bf54a538", "score": "0.62305427", "text": "function parseNumber(num) {\n var numStr = Math.abs(num) + '';\n var exponent = 0, digits, integerLen;\n var i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits: digits, exponent: exponent, integerLen: integerLen };\n}", "title": "" }, { "docid": "1bbb26c8c99a1e6518034b28bf54a538", "score": "0.62305427", "text": "function parseNumber(num) {\n var numStr = Math.abs(num) + '';\n var exponent = 0, digits, integerLen;\n var i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits: digits, exponent: exponent, integerLen: integerLen };\n}", "title": "" }, { "docid": "b5e37703f90f2533240dcca40881ad25", "score": "0.61853915", "text": "function parseNumber(num){var numStr=Math.abs(num)+'';var exponent=0,digits,integerLen;var i,j,zeros;// Decimal point?\nif((integerLen=numStr.indexOf(DECIMAL_SEP))>-1){numStr=numStr.replace(DECIMAL_SEP,'');}// Exponential form?\nif((i=numStr.search(/e/i))>0){// Work out the exponent.\nif(integerLen<0)integerLen=i;integerLen+=+numStr.slice(i+1);numStr=numStr.substring(0,i);}else if(integerLen<0){// There was no decimal point or exponent so it is an integer.\nintegerLen=numStr.length;}// Count the number of leading zeros.\nfor(i=0;numStr.charAt(i)===ZERO_CHAR;i++){/* empty */}if(i===(zeros=numStr.length)){// The digits are all zero.\ndigits=[0];integerLen=1;}else{// Count the number of trailing zeros\nzeros--;while(numStr.charAt(zeros)===ZERO_CHAR){zeros--;}// Trailing zeros are insignificant so ignore them\nintegerLen-=i;digits=[];// Convert string to array of digits without leading/trailing zeros.\nfor(j=0;i<=zeros;i++,j++){digits[j]=Number(numStr.charAt(i));}}// If the number overflows the maximum allowed digits then use an exponent.\nif(integerLen>MAX_DIGITS){digits=digits.splice(0,MAX_DIGITS-1);exponent=integerLen-1;integerLen=1;}return{digits:digits,exponent:exponent,integerLen:integerLen};}", "title": "" }, { "docid": "a9971c929ae481fe048264ce98c861d0", "score": "0.6184039", "text": "function readNumber(str) {\n // let result = '';\n // let end = start;\n //\n // const validChars = '0123456789';\n // const validFirstChar = '+-0123456789';\n //\n // for (let i = start; i < str.length; ++i) {\n //\n // }\n\n return parseFloat(str);\n}", "title": "" }, { "docid": "469b19d96f9a5899361ed9540371b889", "score": "0.61825806", "text": "function checkDecimal(stringValue) {\n\t\tstringValue = stringValue.trim();\n\t\t/*\tRegExp explanation:\n\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t*/\n\t\tvar result = stringValue.replace(/[^-0-9]/g, '');\n\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t}\n\t\treturn parseFloat(result);\n\t}", "title": "" }, { "docid": "469b19d96f9a5899361ed9540371b889", "score": "0.61825806", "text": "function checkDecimal(stringValue) {\n\t\tstringValue = stringValue.trim();\n\t\t/*\tRegExp explanation:\n\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t*/\n\t\tvar result = stringValue.replace(/[^-0-9]/g, '');\n\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t}\n\t\treturn parseFloat(result);\n\t}", "title": "" }, { "docid": "456eb8f07ca7754405e14afbd0ddef0b", "score": "0.617576", "text": "function getNumberFromString(s) {\n return +s.replace(/[^0-9.]/g,''); //remove all the alphabetic characters\n}", "title": "" }, { "docid": "05a52a716aeea38766032817298b84de", "score": "0.6133558", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(NumberNormalizeReg, function(chr) {\n var replacement = NumberNormalizeMap[chr];\n if(replacement === HalfWidthPeriod) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "a58bf02cab58243d48a776e5d0b38d25", "score": "0.6131063", "text": "function parseNumber(num) {\n var numStr = Math.abs(num) + '';\n var exponent = 0,\n digits,\n integerLen;\n var i, j, zeros; // Decimal point?\n\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n } // Exponential form?\n\n\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0) integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n } // Count the number of leading zeros.\n\n\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {\n /* empty */\n }\n\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n\n while (numStr.charAt(zeros) === ZERO_CHAR) {\n zeros--;\n } // Trailing zeros are insignificant so ignore them\n\n\n integerLen -= i;\n digits = []; // Convert string to array of digits without leading/trailing zeros.\n\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n } // If the number overflows the maximum allowed digits then use an exponent.\n\n\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n\n return {\n digits: digits,\n exponent: exponent,\n integerLen: integerLen\n };\n}", "title": "" }, { "docid": "ac8d53fef6db331570e0684b1242a4bb", "score": "0.61288804", "text": "function getNumberFromString(s) {\n return Number(s.replace(/\\D/g, \"\"));\n}", "title": "" }, { "docid": "34f60ce5f08d5c10892f0905e839a511", "score": "0.6120296", "text": "function parseOrder(s) {\n var seenDot = false;\n var seenSomething = false;\n var zeros = \"\";\n var all = \"\";\n var decPlaces = 0;\n var totalDecs = 0;\n\n for (var i = 0; i < s.length; i++) {\n var c = s.charAt(i);\n\n if (c >= \"1\" && c <= \"9\") {\n all += zeros + c;\n zeros = \"\";\n seenSomething = true;\n\n if (!seenDot) {\n totalDecs++;\n decPlaces++;\n }\n } else if (c == \"0\") {\n if (seenDot) {\n if (seenSomething) {\n all += zeros + c;\n zeros = \"\";\n } else {\n decPlaces--;\n }\n } else {\n totalDecs++;\n\n if (seenSomething) {\n decPlaces++;\n zeros += c;\n }\n }\n } else if (!seenDot && c == \".\") {\n all += zeros;\n zeros = \"\";\n seenDot = true;\n } else if (c == \"e\" || c == \"E\" && i + 1 < s.length) {\n var raised = parseInt(s.substring(i + 1, s.length));\n decPlaces += raised;\n totalDecs += raised;\n i = s.length;\n } else ;\n }\n\n if (all == \"\") {\n return totalDecs;\n } else {\n return decPlaces;\n }\n}", "title": "" }, { "docid": "6f577434bd995b65f68677ef32478bd0", "score": "0.6117863", "text": "function lookSortableAsNumber(s) {\n if (!_.isString(s)) {\n TypeException(\"s\", \"string\");\n }\n var m = s.match(/[-+~]?([0-9]{1,3}(?:[,\\s\\.]{1}[0-9]{3})*(?:[\\.|\\,]{1}[0-9]+)?)/g);\n if (m && m.length == 1) {\n if (/(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{8})$/.test(s)) {\n // hexadecimal string: alphabetical order is fine\n return false;\n }\n // Numbers are checked only if there is a single match in the string.\n // how many digits compared to other letters?\n var nonNumbersMatch = s.match(/[^0-9\\.\\,\\s]/g);\n \n if (!nonNumbersMatch) return parseAnyNumber(s); // string contains only numbers\n\n var nonNumbers = nonNumbersMatch.length;\n if (nonNumbers > 6) {\n // there are too many characters that are not numbers or separators;\n // the string must be most probably sorted in alphabetical order\n return false;\n }\n var numericPart = m[0];\n var numVal = parseAnyNumber(numericPart);\n return numVal;\n }\n return false;\n}", "title": "" }, { "docid": "03a281870bc3d539a8bb29d0329a51d9", "score": "0.6090691", "text": "function parseNumber(num) {\n var numStr = Math.abs(num) + '';\n var exponent = 0,\n digits,\n integerLen;\n var i, j, zeros; // Decimal point?\n\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n } // Exponential form?\n\n\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0) integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n } // Count the number of leading zeros.\n\n\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {\n /* empty */\n }\n\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n\n while (numStr.charAt(zeros) === ZERO_CHAR) {\n zeros--;\n } // Trailing zeros are insignificant so ignore them\n\n\n integerLen -= i;\n digits = []; // Convert string to array of digits without leading/trailing zeros.\n\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n } // If the number overflows the maximum allowed digits then use an exponent.\n\n\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n\n return {\n digits: digits,\n exponent: exponent,\n integerLen: integerLen\n };\n }", "title": "" }, { "docid": "889539442842d099246c543e1e6c20ad", "score": "0.6073872", "text": "function parseNumber(format, value) {\n\t\tif (arguments.length == 1)\n\t\t\treturn parseNumber(_null, format);\n\t\tif (/^\\?/.test(format)) {\n\t\t\tif (trim(value) == '')\n\t\t\t\treturn _null;\n\t\t\tformat = format.substr(1);\n\t\t}\n\t\tvar decSep = (/(^|[^0#.,])(,|[0#.]*,[0#]+|[0#]+\\.[0#]+\\.[0#.,]*)($|[^0#.,])/.test(format)) ? ',' : '.';\n\t\tvar r = parseFloat(replace(replace(replace(value, decSep == ',' ? /\\./g : /,/g), decSep, '.'), /^[^\\d-]*(-?\\d)/, '$1'));\n\t\treturn isNaN(r) ? undef : r;\n\t}", "title": "" }, { "docid": "1bbe76e2872629015dbcccb36ec1cdff", "score": "0.6070644", "text": "function returnNumber(stringValue) {\n\t\tstringValue = stringValue.trim();\n\t\t/*\tRegExp explanation:\n\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t*/\n\t\tvar result = stringValue.replace(/[^-0-9-]/g, '');\n\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t}\n\t\treturn parseFloat(result);\n\t}", "title": "" }, { "docid": "e8556e988e6241dd844b06b7120866d5", "score": "0.60472214", "text": "function parseAmount(amount)\r\n{\r\n var parsedAmount = Number(amount.replace(/[\\u2012\\u2013\\u2014\\u2212]/g, \"-\").replace(/[^0-9^\\-^\\.]/g, \"\"));\r\n return isNaN(parsedAmount) ? 0 : parsedAmount;\r\n}", "title": "" }, { "docid": "e5c7ed746c4011a9b32ad62536c62f8f", "score": "0.6044268", "text": "function convertStringToNumber(string) {\n string = string.replace(/,/g, \"\"); // remove thousand separators ','\n string = string.replace(/%/, \"\"); // remove percent symbol '%'\n\n // convert time into number string\n if (isTime(string)) {\n string = getSecondsFromTime(string);\n }\n\n // convert string into number\n var number = Number(string);\n if (number.toString() == \"NaN\") {\n return string;\n }\n\n return number;\n }", "title": "" }, { "docid": "b9d5a6a1dda1267308ffa02a98694452", "score": "0.6033629", "text": "function parseOrder(s) {\n\t var beginning = true;\n\t var seenDot = false;\n\t var seenSomething = false;\n\t var zeros = \"\";\n\t var leadZeros = \"\";\n\t var all = \"\";\n\t var decPlaces = 0;\n\t var totalDecs = 0;\n\t var pos = true;\n\t for (var i = 0; i < s.length; i++) {\n\t var c = s.charAt(i);\n\t if (c >= \"1\" && c <= \"9\") {\n\t all += zeros + c;\n\t zeros = \"\";\n\t seenSomething = true;\n\t if (!seenDot) {\n\t totalDecs++;\n\t decPlaces++;\n\t }\n\t beginning = false;\n\t } else if (c == \"0\") {\n\t if (seenDot) {\n\t if (seenSomething) {\n\t all += zeros + c;\n\t zeros = \"\";\n\t } else {\n\t leadZeros += c;\n\t decPlaces--;\n\t }\n\t } else {\n\t totalDecs++;\n\t if (seenSomething) {\n\t leadZeros += c;\n\t decPlaces++;\n\t zeros += c;\n\t } else {\n\t leadZeros += c;\n\t }\n\t }\n\t beginning = false;\n\t } else if (!seenDot && c == \".\") {\n\t all += zeros;\n\t zeros = \"\";\n\t seenDot = true;\n\t beginning = false;\n\t } else if (c == \"e\" || c == \"E\" && i + 1 < s.length) {\n\t var raised = parseInt(s.substring(i + 1, s.length));\n\t decPlaces += raised;\n\t totalDecs += raised;\n\t i = s.length;\n\t } else if (beginning && (c == \"+\" || c == \"-\")) {\n\t if (c == \"-\") {\n\t pos = !pos;\n\t }\n\t }\n\t }\n\t if (all == \"\") {\n\t return totalDecs;\n\t } else {\n\t return decPlaces;\n\t }\n\t}", "title": "" }, { "docid": "3f7ae1423c535912e1c881bd5c33a201", "score": "0.5994107", "text": "function parseNumber(num) {\n let numStr = Math.abs(num) + '';\n let exponent = 0, digits, integerLen;\n let i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits, exponent, integerLen };\n}", "title": "" }, { "docid": "3f7ae1423c535912e1c881bd5c33a201", "score": "0.5994107", "text": "function parseNumber(num) {\n let numStr = Math.abs(num) + '';\n let exponent = 0, digits, integerLen;\n let i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits, exponent, integerLen };\n}", "title": "" }, { "docid": "3f7ae1423c535912e1c881bd5c33a201", "score": "0.5994107", "text": "function parseNumber(num) {\n let numStr = Math.abs(num) + '';\n let exponent = 0, digits, integerLen;\n let i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits, exponent, integerLen };\n}", "title": "" }, { "docid": "3f7ae1423c535912e1c881bd5c33a201", "score": "0.5994107", "text": "function parseNumber(num) {\n let numStr = Math.abs(num) + '';\n let exponent = 0, digits, integerLen;\n let i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits, exponent, integerLen };\n}", "title": "" }, { "docid": "3f7ae1423c535912e1c881bd5c33a201", "score": "0.5994107", "text": "function parseNumber(num) {\n let numStr = Math.abs(num) + '';\n let exponent = 0, digits, integerLen;\n let i, j, zeros;\n // Decimal point?\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0)\n integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n }\n else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n }\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */\n }\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n }\n else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR)\n zeros--;\n // Trailing zeros are insignificant so ignore them\n integerLen -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n }\n // If the number overflows the maximum allowed digits then use an exponent.\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n return { digits, exponent, integerLen };\n}", "title": "" }, { "docid": "ba469d7d63cff0927440f8296a15a6a9", "score": "0.5980859", "text": "function getNumberFromString(s) {\n return +s.replace(/\\D/g, \"\");\n}", "title": "" }, { "docid": "b6bde7b91ace364e571eb35ff95f376d", "score": "0.59765583", "text": "function parseF(s) {\n // if (typeof(parseInt(s)) === \"number\"){\n // return parseFloat(s)\n \n // }else{\n // return null\n // }\n \n if ( isNaN(parseFloat(s) )) {\n return null\n } else{\n return parseFloat(s)\n }\n \n \n }", "title": "" }, { "docid": "bc57f0b04617635ef8c775bde2428977", "score": "0.5974786", "text": "function stringToNumber(str, base) {\n var sanitized, isDecimal;\n sanitized = str.replace(fullWidthNumberReg, function(chr) {\n var replacement = getOwn(fullWidthNumberMap, chr);\n if (replacement === HALF_WIDTH_PERIOD) {\n isDecimal = true;\n }\n return replacement;\n });\n return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);\n }", "title": "" }, { "docid": "a6bc8010d2372c38a9de7ef5a27bd21e", "score": "0.5951668", "text": "function parseNumber(str) {\n var match = str.match(/^\\s*(\\d*)\\s*(.*)$/);\n return {\n num: Number(match[1]),\n value: match[2]\n };\n} // compare two strings case-insensitively, but examine case for strings that are", "title": "" }, { "docid": "b0f20b3ac746894381396ed4a718e0af", "score": "0.59481376", "text": "function parseNumber(str) {\n var match = str.match(/^\\s*(\\d*)\\s*(.*)$/);\n return { num: Number(match[1]), value: match[2] };\n}", "title": "" }, { "docid": "b0f20b3ac746894381396ed4a718e0af", "score": "0.59481376", "text": "function parseNumber(str) {\n var match = str.match(/^\\s*(\\d*)\\s*(.*)$/);\n return { num: Number(match[1]), value: match[2] };\n}", "title": "" }, { "docid": "b0f20b3ac746894381396ed4a718e0af", "score": "0.59481376", "text": "function parseNumber(str) {\n var match = str.match(/^\\s*(\\d*)\\s*(.*)$/);\n return { num: Number(match[1]), value: match[2] };\n}", "title": "" }, { "docid": "e465ec0425a45a2ee455af7b78229a0a", "score": "0.5940274", "text": "function parseDecimal(x, str) {\n var e, i, len;\n\n // Decimal point?\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n // Exponential form?\n if ((i = str.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str.substring(0, i);\n } else if (e < 0) {\n\n // Integer.\n e = str.length;\n }\n\n // Determine leading zeros.\n for (i = 0; str.charCodeAt(i) === 48; i++);\n\n // Determine trailing zeros.\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\n str = str.slice(i, len);\n\n if (str) {\n len -= i;\n x.e = e = e - i - 1;\n x.d = [];\n\n // Transform base\n\n // e is the base 10 exponent.\n // i is where to slice str to get the first word of the digits array.\n i = (e + 1) % LOG_BASE;\n if (e < 0) i += LOG_BASE;\n\n if (i < len) {\n if (i) x.d.push(+str.slice(0, i));\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for (; i--;) str += '0';\n x.d.push(+str);\n\n if (external) {\n\n // Overflow?\n if (x.e > x.constructor.maxE) {\n\n // Infinity.\n x.d = null;\n x.e = NaN;\n\n // Underflow?\n } else if (x.e < x.constructor.minE) {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n // x.constructor.underflow = true;\n } // else x.constructor.underflow = false;\n }\n } else {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n }\n\n return x;\n }", "title": "" }, { "docid": "c108b83852ae9c2fd50745a7d982dc96", "score": "0.59401685", "text": "function parseGermanNumber(number) {\r\n\t// number muss ein String sein!\r\n\tvar str = String(number);\r\n\tvar res = \"\";\r\n\tvar flRes = 0.0;\r\n\tif(str) {\r\n\t\tfor(var i=0; i < str.length; i++) {\r\n\t\t\tvar c = str.charAt(i);\r\n\t\t\t// Tausender-Trennzeichen auslassen\r\n\t\t\tif(c != '.') {\r\n\t\t\t\t// ersetze deutsches Komma durch englisches\r\n\t\t\t\tif(c == ',') c = '.';\r\n\t\t\t\tres += c; // Zeichen kopieren\r\n\t\t\t}\r\n\t\t}\r\n\t\tflRes = parseFloat(res);\r\n\t}\r\n\treturn flRes;\r\n}", "title": "" }, { "docid": "8f70512bb075516886953e62b768ee79", "score": "0.5938881", "text": "function parseDecimal(x, str) {\n var e, i, len;\n\n // Decimal point?\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n // Exponential form?\n if ((i = str.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str.substring(0, i);\n } else if (e < 0) {\n\n // Integer.\n e = str.length;\n }\n\n // Determine leading zeros.\n for (i = 0; str.charCodeAt(i) === 48; i++);\n\n // Determine trailing zeros.\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\n str = str.slice(i, len);\n\n if (str) {\n len -= i;\n x.e = e = e - i - 1;\n x.d = [];\n\n // Transform base\n\n // e is the base 10 exponent.\n // i is where to slice str to get the first word of the digits array.\n i = (e + 1) % LOG_BASE;\n if (e < 0) i += LOG_BASE;\n\n if (i < len) {\n if (i) x.d.push(+str.slice(0, i));\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for (; i--;) str += '0';\n x.d.push(+str);\n\n if (external) {\n\n // Overflow?\n if (x.e > x.constructor.maxE) {\n\n // Infinity.\n x.d = null;\n x.e = NaN;\n\n // Underflow?\n } else if (x.e < x.constructor.minE) {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n // x.constructor.underflow = true;\n } // else x.constructor.underflow = false;\n }\n } else {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n }\n\n return x;\n }", "title": "" }, { "docid": "63de887b1371df2f2069514b5c9ff2db", "score": "0.5935071", "text": "function parseDecimal(x, str) {\n var e, i, len;\n\n // Decimal point?\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n // Exponential form?\n if ((i = str.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str.substring(0, i);\n } else if (e < 0) {\n\n // Integer.\n e = str.length;\n }\n\n // Determine leading zeros.\n for (i = 0; str.charCodeAt(i) === 48; i++) {;}\n\n // Determine trailing zeros.\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len) {;}\n str = str.slice(i, len);\n\n if (str) {\n len -= i;\n x.e = e = e - i - 1;\n x.d = [];\n\n // Transform base\n\n // e is the base 10 exponent.\n // i is where to slice str to get the first word of the digits array.\n i = (e + 1) % LOG_BASE;\n if (e < 0) i += LOG_BASE;\n\n if (i < len) {\n if (i) x.d.push(+str.slice(0, i));\n for (len -= LOG_BASE; i < len;) {x.d.push(+str.slice(i, i += LOG_BASE));}\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for (; i--;) {str += '0';}\n x.d.push(+str);\n\n if (external) {\n\n // Overflow?\n if (x.e > x.constructor.maxE) {\n\n // Infinity.\n x.d = null;\n x.e = NaN;\n\n // Underflow?\n } else if (x.e < x.constructor.minE) {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n // x.constructor.underflow = true;\n } // else x.constructor.underflow = false;\n }\n } else {\n\n // Zero.\n x.e = 0;\n x.d = [0];\n }\n\n return x;\n }", "title": "" }, { "docid": "c4ff1b024021e35a4a09e93db9b984d6", "score": "0.5932378", "text": "function convertStringToNumber(string)\n{\n string = string.replace(\"R$ \", \"\");\n string = string.replace(\".\", \"\");\n // string = string.replace(\",\", \".\");\n\n string = parseFloat(string);\n // string = string.toFixed(2);\n return string;\n}", "title": "" }, { "docid": "780f6acf6089e5c6f11676b2324a5ac0", "score": "0.5931467", "text": "function SplitString(s) {\n\tvar res = [];\n\tvar num = 0;\n\tvar str = '';\n\tvar ChunkType = 'null';\n\tfor (var i=0; i<s.length; i++) {\n\t\tif ('0' <= s[i] && s[i] <= '9') {\n\t\t\tif (ChunkType == 'string') {\n\t\t\t\tres.push(str);\n\t\t\t\tstr = '';\n\t\t\t}\n\t\t\tChunkType = 'number';\n\t\t\tnum = 10*num+parseInt(s[i]);\n\t\t}\n\t\telse {\n\t\t\tif (ChunkType == 'number') {\n\t\t\t\tres.push(num);\n\t\t\t\tnum = 0;\n\t\t\t}\n\t\t\tChunkType = 'string';\n\t\t\tstr += s[i];\n\t\t}\n\t}\n\tif (ChunkType == 'number') res.push(num);\n\tif (ChunkType == 'string') res.push(str);\n\t\n\treturn res;\n}", "title": "" }, { "docid": "73dab13fd080a1d0a51c22d81687e4b0", "score": "0.5916424", "text": "function stringToNumber( string )\n {\n \tvar number;\n \t\n \tnumber = parseFloat( string );\n \treturn number;\n }", "title": "" }, { "docid": "8d0a39fe22f1254eabfe138d899a1543", "score": "0.591166", "text": "function parseNumber(val) {\n\treturn val === undefined ? 0 : parseFloat(val.replace(\"$\", \"\").replace(\",\", \"\"));\n}", "title": "" }, { "docid": "d937465a4a4104f9dc6c4d10ce5870d2", "score": "0.59055215", "text": "function Parse_Number(value, format)\n{\n\t//default value: null\n\tvar result = null;\n\t//this will be hoisted by js\n\tvar newValue;\n\t//remove all spaces from the number\n\tvalue = value.replace(/\\s/g, \"\");\n\t//Integer rule? no Rule?\n\tif (format == 0 || format.IsFlagSet(__NEMESIS_TestOnData_Format_NumberInteger))\n\t{\n\t\t//get the number directly\n\t\tresult = Get_Number(value, null);\n\t}\n\t//dot format?\n\tif (result == null && format.IsFlagSet(__NEMESIS_TestOnData_Format_NumberDot))\n\t{\n\t\t//remove all commas\n\t\tnewValue = value.replace(/,(\\d\\d\\d)/g, \"$1\");\n\t\t//get the number directly\n\t\tresult = Get_Number(newValue, null);\n\t}\n\t//Comma format?\n\tif (result == null && format.IsFlagSet(__NEMESIS_TestOnData_Format_NumberComma))\n\t{\n\t\t//remove all dots\n\t\tnewValue = value.replace(/.(\\d\\d\\d)/g, \"$1\");\n\t\t//now replace comma with dot\n\t\tnewValue = newValue.replace(\",\", \".\");\n\t\t//get the number directly\n\t\tresult = Get_Number(newValue, null);\n\t}\n\t//return the result\n\treturn result;\n}", "title": "" }, { "docid": "4dae929483884dbf5495b1edee0d09a7", "score": "0.59049684", "text": "ParseFloat(s){\r\n\t\tif(s == '' || s == 'undefined' || s == null){\r\n\t\t\treturn 0.0;\r\n\t\t}\r\n\t\t\r\n\t\tvar chr, ss = '', i, l = s.length;\r\n\t\ts = s.toString();\r\n\t\tfor(i = 0; i < l; i += 1){\r\n\t\t\tchr = s.charAt(i);\r\n\t\t\tif(((chr >= '0') && (chr <= '9')) || chr == '.' || chr == '-') {\r\n\t\t\t\tss += chr;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn parseFloat(ss);\r\n\t}", "title": "" }, { "docid": "612cbbb09a109eb7f93810fc5f644b25", "score": "0.5904431", "text": "function parseDecimal(x, str) {\n var e, i, len;\n\n // Decimal point?\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n // Exponential form?\n if ((i = str.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str.substring(0, i);\n } else if (e < 0) {\n\n // Integer.\n e = str.length;\n }\n\n // Determine leading zeros.\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\n\n // Determine trailing zeros.\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\n str = str.slice(i, len);\n\n if (str) {\n len -= i;\n e = e - i - 1;\n x.e = mathfloor(e / LOG_BASE);\n x.d = [];\n\n // Transform base\n\n // e is the base 10 exponent.\n // i is where to slice str to get the first word of the digits array.\n i = (e + 1) % LOG_BASE;\n if (e < 0) i += LOG_BASE;\n\n if (i < len) {\n if (i) x.d.push(+str.slice(0, i));\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for (; i--;) str += '0';\n x.d.push(+str);\n\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\n } else {\n\n // Zero.\n x.s = 0;\n x.e = 0;\n x.d = [0];\n }\n\n return x;\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.59024113", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.59024113", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.59024113", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.59024113", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.59024113", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "e5f113602643f23f090293092609a4f7", "score": "0.59024113", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "88b3992427c6c74d1f5ebbff2b17cb9d", "score": "0.58965", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}", "title": "" }, { "docid": "d5abbe67797839751e6f50a00a3abc89", "score": "0.5891613", "text": "function checkNumber(stringValue) {\n\t\tif(stringValue && (stringValue != 0 || stringValue !== 0 || stringValue != '0' || stringValue !== '0')){\n\t\t\tstringValue = stringValue.trim();\n\t\t\t/*\tRegExp explanation:\n\t\t\t\t# [^ - Start of negated character class\t\t\t\t\t\t\t# , The literal character ,\t\t\t\t\t\t\t\t\n\t\t\t\t# ] - End of negated character class\t\t\t\t\t\t\t\t# \\. Matches the character . literally\n\t\t\t\t# 0-9 A single character in the range between 0 and 9\t\t\t\t# \\d Match a digit [0-9]\n\t\t\t\t# g Modifier: global. All matches (don't return on first match)\t# {2} Quantifier: {2} Exactly 2 times\n\t\t\t\t# [,\\.] Match a single character present in the list below\t\t\t# $ Assert position at end of the string\n\t\t\t*/\n\t\t\tvar result = stringValue.replace(/[^-0-9-]/g, '');\n\t\t\tif (/[,\\.]\\d{2}$/.test(stringValue)) {\n\t\t\t\tresult = result.replace(/(\\d{2})$/, '.$1');\n\t\t\t}\n\t\t\treturn parseFloat(result);\n\t\t}else{\n\t\t\treturn stringValue;\t\n\t\t}\n\t}", "title": "" }, { "docid": "ba1ea25ba4a364015ac8a3f21ea1282a", "score": "0.58861023", "text": "function parseNumber(num) {\n let numStr = Math.abs(num) + '';\n let exponent = 0,\n digits,\n integerLen;\n let i, j, zeros; // Decimal point?\n\n if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n } // Exponential form?\n\n\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (integerLen < 0) integerLen = i;\n integerLen += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (integerLen < 0) {\n // There was no decimal point or exponent so it is an integer.\n integerLen = numStr.length;\n } // Count the number of leading zeros.\n\n\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {\n /* empty */\n }\n\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n integerLen = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n\n while (numStr.charAt(zeros) === ZERO_CHAR) zeros--; // Trailing zeros are insignificant so ignore them\n\n\n integerLen -= i;\n digits = []; // Convert string to array of digits without leading/trailing zeros.\n\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = Number(numStr.charAt(i));\n }\n } // If the number overflows the maximum allowed digits then use an exponent.\n\n\n if (integerLen > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = integerLen - 1;\n integerLen = 1;\n }\n\n return {\n digits,\n exponent,\n integerLen\n };\n}", "title": "" }, { "docid": "f73ced3d92f1255e93b1dedb17fa3526", "score": "0.58854514", "text": "function tonumber(valor, format){\n\tif (format === undefined){\n\t\tformat = \"double\";\n\t}\n\tswitch(format){\n\t\tcase \"integer\":\n\t\t\tvar validaNumero = /^(\\-)?([0-9]+)$/;\n\t\t\tif (!validaNumero.test(valor)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvalor = parseInt(valor);\n\t\treturn valor;\n\t\tdefault:\n\t\t\tvar validaNumero = /^(\\-)?([0-9.,]+)$/;\n\t\t\tif (!validaNumero.test(valor)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar posVirgula = valor.lastIndexOf(',');\n\t\t\tvar posPonto = valor.lastIndexOf('.');\n\t\t\tvar pontoSeparacao = 0;\n\t\t\tvar separador = \"\";\n\t\t\tvar tamanhoNumero = valor.length;\n\t\t\tif (posVirgula == -1 && posPonto == -1){\n\t\t\t\treturn valor + \",00\";\n\t\t\t}\n\t\t\tif (posVirgula > posPonto){\n\t\t\t\tseparador = \",\";\n\t\t\t\tpontoSeparacao = posVirgula;\n\t\t\t}else{\n\t\t\t\tseparador = \".\";\n\t\t\t\tpontoSeparacao = posPonto;\n\t\t\t}\n\t\t\tvar valorNaoDecimal = valor.substring(0, pontoSeparacao);\n\t\t\tvar valorDecimal = valor.substring((pontoSeparacao+1));\n\t\t\tvalorNaoDecimal = valorNaoDecimal.replace(/[.,]/g, \"\");\n\t\t\tvalorDecimal = valorDecimal.replace(/[.,]/g, \".\");\n\t\t\tif (valorDecimal === \"\"){\n\t\t\t\tvalorDecimal = \"0\";\n\t\t\t}\n\t\t\tvalor = valorNaoDecimal + \".\" + valorDecimal;\n\t\t\tvalor = valor.replace(\".\", \",\");\n\t\treturn valor;\n\t}\n}", "title": "" }, { "docid": "8893ff1ebff93e4b6ff0e399815d870d", "score": "0.58821744", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48;) ++i;\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n e = e - i - 1;\r\n x.e = mathfloor(e / LOG_BASE);\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);\r\n } else {\r\n\r\n // Zero.\r\n x.s = 0;\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "aeb8f2f09cec90b153b208f51b13627e", "score": "0.5865393", "text": "strToNum(str) {\n return Number(str.replace(/,/g, \"\")); // \"8,312,456\" --> 8312456\n }", "title": "" }, { "docid": "076d917b7361d895ae95f7dd6f24efb4", "score": "0.5862356", "text": "function parseDollars(str) {\n str = str.trim();\n if (str.substr(0, 2) === '$ ') str = str.substr(2);\n var negative = false;\n if (str.charAt(0) === '(') {\n negative = true;\n str = str.substr(1, str.length - 2);\n }\n var num = +str;\n return negative ? -num : num;\n }", "title": "" }, { "docid": "9c0bb1d65613d5daaebb7c027a3c597a", "score": "0.58601767", "text": "function parseMantissa(s) {\n\t var beginning = true;\n\t var seenDot = false;\n\t var seenSomething = false;\n\t var zeros = \"\";\n\t var leadZeros = \"\";\n\t var all = \"\";\n\t var decPlaces = 0;\n\t var totalDecs = 0;\n\t var pos = true;\n\t for (var i = 0; i < s.length; i++) {\n\t var c = s.charAt(i);\n\t if (c >= \"1\" && c <= \"9\") {\n\t all += zeros + c;\n\t zeros = \"\";\n\t seenSomething = true;\n\t if (!seenDot) {\n\t totalDecs++;\n\t decPlaces++;\n\t }\n\t beginning = false;\n\t } else if (c == \"0\") {\n\t if (seenDot) {\n\t if (seenSomething) {\n\t all += zeros + c;\n\t zeros = \"\";\n\t } else {\n\t leadZeros += c;\n\t decPlaces--;\n\t }\n\t } else {\n\t totalDecs++;\n\t if (seenSomething) {\n\t leadZeros += c;\n\t decPlaces++;\n\t zeros += c;\n\t } else {\n\t leadZeros += c;\n\t }\n\t }\n\t beginning = false;\n\t } else if (!seenDot && c == \".\") {\n\t all += zeros;\n\t zeros = \"\";\n\t seenDot = true;\n\t beginning = false;\n\t } else if (c == \"e\" || c == \"E\" && i + 1 < s.length) {\n\t var raised = parseInt(s.substring(i + 1, s.length));\n\t decPlaces += raised;\n\t totalDecs += raised;\n\t i = s.length;\n\t } else if (beginning && (c == \"+\" || c == \"-\")) {\n\t if (c == \"-\") {\n\t pos = !pos;\n\t }\n\t }\n\t }\n\t if (all == \"\") {\n\t return leadZeros;\n\t } else {\n\t return all;\n\t }\n\t}", "title": "" }, { "docid": "8bc6bf91d87b062042ddb561023e9bd8", "score": "0.58579177", "text": "function turnCommasToDecimals(str)\n{\n var numString = \"\";\n for(var i=0; i<str.length; i++)\n {\n var curChar = str[i];\n //console.log(currencyString+\" Looking at \"+str[i]);\n if(curChar == \",\")\n {\n //console.log(curChar+\" is a num \");\n numString = numString + \".\";\n } \n else\n {\n numString = numString + curChar;\n }\n }\n //console.log(\"\\n\");\n return numString;\n}", "title": "" }, { "docid": "05b8e7cfa664553dd419df66eb28fdcc", "score": "0.585037", "text": "function parseNumberString(numberString) {\n const decimalIdx = numberString.indexOf('.');\n\n return {\n decimalIdx,\n // number of digits after dot\n decimalPlaces: decimalIdx > 0 ?\n (numberString.length - decimalIdx - 1) : 0,\n // number of digits before dot\n leadingDigits: decimalIdx > 0 ?\n decimalIdx : numberString.length,\n // amount of right padding needed so far\n rightPad: decimalIdx > 0 && (decimalIdx === numberString.length - 2) ?\n // all floats must start off at least at hundredths place (e.g. '1.1' -> '1.10')\n ['0']\n :\n []\n };\n}", "title": "" }, { "docid": "8edfb4557e1192adba1f3ce72702b11a", "score": "0.58477175", "text": "function toInt(string)\t// Parses a string of format 123,456 to an int in format 123456\r\n{\r\n\tvar num=0;\r\n\tif (unitSeparator == '.')\t{num = parseInt(string.replace(/\\./g,\"\"));}\r\n\telse\t\t\t\t\t\t{num = parseInt(string.replace(/\\,/g,\"\"));}\r\n\treturn num;\r\n}", "title": "" }, { "docid": "95aa6d314c635f0fb05953fc7ec9ec7a", "score": "0.5835197", "text": "function unformatNumeral(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power,\n value;\n\n if (string.indexOf(':') > -1) {\n value = unformatTime(string);\n } else {\n if (string === options.zeroFormat || string === options.nullFormat) {\n value = 0;\n } else {\n if (languages[options.currentLanguage].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(languages[options.currentLanguage].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.thousand + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.million + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.billion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.trillion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power <= byteSuffixes.bytes.length; power++) {\n bytesMultiplier = ((string.indexOf(byteSuffixes.bytes[power]) > -1) || (string.indexOf(byteSuffixes.iec[power]) > -1))? Math.pow(1024, power) : false;\n\n if (bytesMultiplier) {\n break;\n }\n }\n\n // do some math to create our number\n value = bytesMultiplier ? bytesMultiplier : 1;\n value *= stringOriginal.match(thousandRegExp) ? Math.pow(10, 3) : 1;\n value *= stringOriginal.match(millionRegExp) ? Math.pow(10, 6) : 1;\n value *= stringOriginal.match(billionRegExp) ? Math.pow(10, 9) : 1;\n value *= stringOriginal.match(trillionRegExp) ? Math.pow(10, 12) : 1;\n // check for percentage\n value *= string.indexOf('%') > -1 ? 0.01 : 1;\n // check for negative number\n value *= (string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2 ? 1 : -1;\n // remove non numbers\n value *= Number(string.replace(/[^0-9\\.]+/g, ''));\n // round if we are talking about bytes\n value = bytesMultiplier ? Math.ceil(value) : value;\n }\n }\n\n n._value = value;\n\n return n._value;\n }", "title": "" }, { "docid": "95aa6d314c635f0fb05953fc7ec9ec7a", "score": "0.5835197", "text": "function unformatNumeral(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power,\n value;\n\n if (string.indexOf(':') > -1) {\n value = unformatTime(string);\n } else {\n if (string === options.zeroFormat || string === options.nullFormat) {\n value = 0;\n } else {\n if (languages[options.currentLanguage].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(languages[options.currentLanguage].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.thousand + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.million + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.billion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.trillion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power <= byteSuffixes.bytes.length; power++) {\n bytesMultiplier = ((string.indexOf(byteSuffixes.bytes[power]) > -1) || (string.indexOf(byteSuffixes.iec[power]) > -1))? Math.pow(1024, power) : false;\n\n if (bytesMultiplier) {\n break;\n }\n }\n\n // do some math to create our number\n value = bytesMultiplier ? bytesMultiplier : 1;\n value *= stringOriginal.match(thousandRegExp) ? Math.pow(10, 3) : 1;\n value *= stringOriginal.match(millionRegExp) ? Math.pow(10, 6) : 1;\n value *= stringOriginal.match(billionRegExp) ? Math.pow(10, 9) : 1;\n value *= stringOriginal.match(trillionRegExp) ? Math.pow(10, 12) : 1;\n // check for percentage\n value *= string.indexOf('%') > -1 ? 0.01 : 1;\n // check for negative number\n value *= (string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2 ? 1 : -1;\n // remove non numbers\n value *= Number(string.replace(/[^0-9\\.]+/g, ''));\n // round if we are talking about bytes\n value = bytesMultiplier ? Math.ceil(value) : value;\n }\n }\n\n n._value = value;\n\n return n._value;\n }", "title": "" }, { "docid": "95aa6d314c635f0fb05953fc7ec9ec7a", "score": "0.5835197", "text": "function unformatNumeral(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power,\n value;\n\n if (string.indexOf(':') > -1) {\n value = unformatTime(string);\n } else {\n if (string === options.zeroFormat || string === options.nullFormat) {\n value = 0;\n } else {\n if (languages[options.currentLanguage].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(languages[options.currentLanguage].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.thousand + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.million + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.billion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.trillion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power <= byteSuffixes.bytes.length; power++) {\n bytesMultiplier = ((string.indexOf(byteSuffixes.bytes[power]) > -1) || (string.indexOf(byteSuffixes.iec[power]) > -1))? Math.pow(1024, power) : false;\n\n if (bytesMultiplier) {\n break;\n }\n }\n\n // do some math to create our number\n value = bytesMultiplier ? bytesMultiplier : 1;\n value *= stringOriginal.match(thousandRegExp) ? Math.pow(10, 3) : 1;\n value *= stringOriginal.match(millionRegExp) ? Math.pow(10, 6) : 1;\n value *= stringOriginal.match(billionRegExp) ? Math.pow(10, 9) : 1;\n value *= stringOriginal.match(trillionRegExp) ? Math.pow(10, 12) : 1;\n // check for percentage\n value *= string.indexOf('%') > -1 ? 0.01 : 1;\n // check for negative number\n value *= (string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2 ? 1 : -1;\n // remove non numbers\n value *= Number(string.replace(/[^0-9\\.]+/g, ''));\n // round if we are talking about bytes\n value = bytesMultiplier ? Math.ceil(value) : value;\n }\n }\n\n n._value = value;\n\n return n._value;\n }", "title": "" }, { "docid": "95aa6d314c635f0fb05953fc7ec9ec7a", "score": "0.5835197", "text": "function unformatNumeral(n, string) {\n var stringOriginal = string,\n thousandRegExp,\n millionRegExp,\n billionRegExp,\n trillionRegExp,\n bytesMultiplier = false,\n power,\n value;\n\n if (string.indexOf(':') > -1) {\n value = unformatTime(string);\n } else {\n if (string === options.zeroFormat || string === options.nullFormat) {\n value = 0;\n } else {\n if (languages[options.currentLanguage].delimiters.decimal !== '.') {\n string = string.replace(/\\./g, '').replace(languages[options.currentLanguage].delimiters.decimal, '.');\n }\n\n // see if abbreviations are there so that we can multiply to the correct number\n thousandRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.thousand + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n millionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.million + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n billionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.billion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n trillionRegExp = new RegExp('[^a-zA-Z]' + languages[options.currentLanguage].abbreviations.trillion + '(?:\\\\)|(\\\\' + languages[options.currentLanguage].currency.symbol + ')?(?:\\\\))?)?$');\n\n // see if bytes are there so that we can multiply to the correct number\n for (power = 1; power <= byteSuffixes.bytes.length; power++) {\n bytesMultiplier = ((string.indexOf(byteSuffixes.bytes[power]) > -1) || (string.indexOf(byteSuffixes.iec[power]) > -1))? Math.pow(1024, power) : false;\n\n if (bytesMultiplier) {\n break;\n }\n }\n\n // do some math to create our number\n value = bytesMultiplier ? bytesMultiplier : 1;\n value *= stringOriginal.match(thousandRegExp) ? Math.pow(10, 3) : 1;\n value *= stringOriginal.match(millionRegExp) ? Math.pow(10, 6) : 1;\n value *= stringOriginal.match(billionRegExp) ? Math.pow(10, 9) : 1;\n value *= stringOriginal.match(trillionRegExp) ? Math.pow(10, 12) : 1;\n // check for percentage\n value *= string.indexOf('%') > -1 ? 0.01 : 1;\n // check for negative number\n value *= (string.split('-').length + Math.min(string.split('(').length - 1, string.split(')').length - 1)) % 2 ? 1 : -1;\n // remove non numbers\n value *= Number(string.replace(/[^0-9\\.]+/g, ''));\n // round if we are talking about bytes\n value = bytesMultiplier ? Math.ceil(value) : value;\n }\n }\n\n n._value = value;\n\n return n._value;\n }", "title": "" }, { "docid": "8b6c79082c6767c232df19a8b9560cb4", "score": "0.5833116", "text": "function parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n }", "title": "" }, { "docid": "61a1c0682e1804117c3a6a60ba0e5d98", "score": "0.5820907", "text": "function formatString(string) {\n\treturn parseInt(string.replace(/\\./g, ''));\n}", "title": "" }, { "docid": "703ca7a9133f432f48b604469b468ada", "score": "0.5813999", "text": "function parse(value) {\n value = value || 0;\n var regex = new RegExp(\"[\\\\,\\\\\" + options.currencySymbol + \"]\", 'g');\n return value.toString().replace(regex, '');\n }", "title": "" }, { "docid": "67a643e987aa1e235886a18aebd7b726", "score": "0.57692915", "text": "function priceToNumber(str) {\n let newStr = \"\";\n for (let char of str) {\n if (Number(char) || Number(char) === 0 || char === \".\") {\n newStr += char;\n }\n }\n return Number(newStr.trim());\n }", "title": "" }, { "docid": "0d28331bea3dfc5cbe05914d829f5475", "score": "0.5768757", "text": "function tryParse(s, radix, initial) {\n if (s != null && /\\S/.test(s)) {\n if (radix === 10) {\n const v = +s;\n if (!Number.isNaN(v)) {\n return [true, v];\n }\n }\n }\n return [false, initial != null ? initial : 0];\n }", "title": "" }, { "docid": "4b9ccd799ea3fe5325c288a6cc13fab2", "score": "0.57542455", "text": "function parseFloat2(value) {\n // if none return \n if (none(value)) return NaN;\n // if is already number\n if (Number(value)) return Number(value);\n // convert to string\n value = String(value).trim();\n // get length\n var len = value.length;\n //first replace optional currecny pref\n value = value.replace(regex_parseFloat2_price_pref, '');\n //allow ONLY pref or suf change, so if we managed in pref, dont do suf\n if (value.length == len) {\n //then suff\n value = value.replace(regex_parseFloat2_price_suf, '$1');\n }\n //if there is still left text in the sides - it's text, return here\n if (regex_parseFloat2_price_pref_test.test(value) || regex_parseFloat2_price_suf_test.test(value)) return NaN;\n \n value = value.replace(/[^\\d,.-]/g, '');\n var sign = value.charAt(0) === '-' ? '-' : '+';\n var minor = value.match(/[.,](\\d+)$/);\n value = value.replace(/[.,]\\d*$/, '').replace(/\\D/g, '');\n return Number(sign + value + (minor ? '.' + minor[1] : ''));\n}", "title": "" }, { "docid": "00dafd98956612f5d5aa9346557e9a43", "score": "0.5747574", "text": "function floatOfString(s) {\n // Check whether we're dealing with nan, since it's the error case for Number.parseFloat\n if (s === 'nan') {\n return NaN;\n } else {\n let num = Number.parseFloat(s);\n if (Number.isNaN(num)) {\n return null;\n } else {\n return num\n }\n }\n}", "title": "" }, { "docid": "9804b1730c3f5c9731ec923a1a41fc2d", "score": "0.57434833", "text": "function sc_string2real(s) {\n return parseFloat(s);\n}", "title": "" }, { "docid": "81969442aef60c46f773bf26e644904a", "score": "0.5734742", "text": "function parse(string) {\n\treturn parseInt(string.slice(0,-2), 10);\n}", "title": "" }, { "docid": "78c0dc9f46c2dc2dded566d604369c05", "score": "0.573271", "text": "function parseFloat_(a){return\"string\"==typeof a?parseFloat(a):a}", "title": "" }, { "docid": "816cc16ea98c75a99f8ae5c303e5c6f3", "score": "0.5706758", "text": "function parseCalculationString(s) {\n\n let calculation = [],\n current = '';\n for (let i = 0, ch; ch = s.charAt(i); i++) {\n if ('×÷+-'.indexOf(ch) > -1) {\n if (current === '' && ch === '-') {\n current = '-';\n } else {\n calculation.push(parseFloat(current), ch);\n current = '';\n }\n } else {\n current += s.charAt(i);\n }\n }\n if (current !== '') {\n calculation.push(parseFloat(current));\n }\n console.log('calculation', calculation);\n return calculation;\n }", "title": "" }, { "docid": "03ad616759ddacbe7c220fe9fcaa6152", "score": "0.56974417", "text": "function tryParse (num) \n{\n if (num !== null)\n {\n if (num.length >0)\n {\n if (!isNaN(num))\n {\n return parseFloat(num);\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "c72ba812dbc314c5af29a5d584c03bfe", "score": "0.5696282", "text": "function parseInteger(str) {\n\tif (typeof str === \"string\") {\n\t\treturn +str.replace(/,/g, \"\");\n\t}\n\treturn;\n}", "title": "" }, { "docid": "1027ecccf5bbba6262f6ea49fa0188dc", "score": "0.56924707", "text": "function parseFloatMaybe(string) {\n var parsed = parseFloat(string);\n return !isNaN(parsed) ? parsed : string;\n}", "title": "" }, { "docid": "486c7bd77e51c4224067fb9e7f03b594", "score": "0.5691163", "text": "function parseFloat_(s) {\n return validFloatRepr.test (s) ? Just (parseFloat (s)) : Nothing;\n }", "title": "" }, { "docid": "58d0ad8587b910aa1b6b5470821320fe", "score": "0.56889874", "text": "function parse_value_str (str) {\n\t// either a single number, a range \"a..b\" or a set \"3, 5, 8, 10\"\n\tvar result;\n\n // range\n\tif (str.indexOf('..') > -1) { \n\t\tvar arr = str.split('..').map(Number);\n\t\tif (arr.length == 2 && !arr.some(isNaN)) {\n\t\t\tresult = {min:arr[0], max:arr[1]}\n\t\t}\n\t}\n\n\t// set\n\telse if (str.indexOf(',') > -1) {\n\t\tvar arr = str.replace(/[^0-9-,]/gi, '').split(',').map(Number);\n\t\tif (!arr.some(isNaN)) { result = arr }\n\t}\n\n // single value\n\telse result = Number(str);\n\n\t// error check\n\tif (result == NaN) { return null } else { return result }\n}", "title": "" }, { "docid": "0ff63ebdf7c012db5f2e42a2e568a231", "score": "0.5688407", "text": "function extractOnlyNumbersFromString(str)\n{\n str = str.replace(/\\s+/g, \"\"); //Remove blank spaces from string\n var numString = \"\";\n for(var i=0; i<str.length; i++)\n {\n var curChar = Number(str[i]);\n //console.log(currencyString+\" Looking at \"+str[i]);\n if(!isNaN(curChar))\n {\n //console.log(curChar+\" is a num \");\n numString = numString + curChar;\n } \n }\n //console.log(\"\\n\");\n return Number(numString);\n}", "title": "" }, { "docid": "057cf7d6d0e1885df5586315277d5f76", "score": "0.5677333", "text": "function stringToDecimal(str) {\n\tvar d = str.toString().replace(/\\s/g, \"\").replace(/,/g, \"\");\n if (!isNaN(d) && d.length !== 0)\n\t\treturn parseFloat(d);\n\treturn 0;\n}", "title": "" }, { "docid": "d747079ebd7acd3b39af743d51f1883b", "score": "0.5666671", "text": "function convertToNumber(numText) {\n var number;\n number = numText.replace('€', '');\n number = number.replace(',', '.');\n number = number.replace('.', ' ');\n number = parseFloat(number);\n\n if (number != 'NaN') {\n return number;\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "40faf35d27c9fe361f99e350f05f6124", "score": "0.5659383", "text": "readNumber(startsWithDot) {\n let start = this.state.pos;\n let isFloat = false;\n let octal = this.input.charCodeAt(this.state.pos) === 48;\n if (!startsWithDot && this.readNumber_int(10) === null) this.raise(start, \"Invalid number\");\n\n let next = this.input.charCodeAt(this.state.pos);\n if (next === 46) { // '.'\n ++this.state.pos;\n this.readNumber_int(10);\n isFloat = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n if (next === 69 || next === 101) { // 'eE'\n next = this.input.charCodeAt(++this.state.pos);\n if (next === 43 || next === 45) ++this.state.pos; // '+-'\n if (this.readNumber_int(10) === null) this.raise(start, \"Invalid number\");\n isFloat = true;\n }\n if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, \"Identifier directly after number\");\n\n let str = this.input.slice(start, this.state.pos);\n let val;\n if (isFloat) {\n val = parseFloat(str);\n } else if (!octal || str.length === 1) {\n val = parseInt(str, 10);\n } else if (/[89]/.test(str) || !this.isOctalValid()) {\n this.raise(start, \"Invalid number\");\n } else {\n val = parseInt(str, 8);\n }\n // TODO: also store raw source\n return this.finishToken(tt.num, val);\n }", "title": "" } ]
0ef1927ceac4ef4d2167f75883e51204
called when the login button is clicked
[ { "docid": "233deb6cdc390698323805361b80a35d", "score": "0.0", "text": "function checklogin(){\n // grabs the user input\n var user = document.getElementById(\"Usernameinput\").value;\n // checks if anything was submited\n if (user.length > 0){\n // attmpts to log in\n login(user);\n }\n // otherwise output error\n else{\n document.getElementById(\"status\").innerHTML = \"No Username Entered\";\n }\n}", "title": "" } ]
[ { "docid": "d3b4808b9f437885954194c78a34c3ef", "score": "0.7643432", "text": "navigateToLogin(){\n\t\tresources.loginButton().click();\n\t}", "title": "" }, { "docid": "fa6cbe1565be552cc3e030070695c4d3", "score": "0.75819564", "text": "function handleLoginButtonClick() {\n setWaitA(true);\n\n XIVAPI.manualLogin(response => {\n TokenStorage.setMainToken(response.Token.token);\n\n setWaitA(false);\n setTokenMain(TokenStorage.getMainToken());\n setLoginUrl(response.LoginUrl);\n });\n }", "title": "" }, { "docid": "ac644a9352945d7f2f4fe81a6a203c6c", "score": "0.7466876", "text": "function onClickLogIn(e) {\n setLoggedIn(!loggedIn);\n }", "title": "" }, { "docid": "2d7b3800f493bf12a87ec45ee13b1746", "score": "0.7446199", "text": "function login() {\n\t\n}", "title": "" }, { "docid": "8e32370028ed14d6e4d953de36e4c283", "score": "0.74367756", "text": "function login() {\n\n MainLogic.login(vm);\n\n }", "title": "" }, { "docid": "835658d5372a6dc50c757f73752cd982", "score": "0.7422068", "text": "function displayLogin() {\r\n showLogin(true);\r\n }", "title": "" }, { "docid": "f85fa1b1b55060b0a46527f51bbf5cd9", "score": "0.73952407", "text": "onLogin() {\n \n }", "title": "" }, { "docid": "baac87f3e9d7da4cdc14b49389c6ce62", "score": "0.7376469", "text": "function login(){\r\n\tgetFormLoginMsg().children('.alert').remove();\r\n\r\n\tgetLoginBtn().addClass('active');\r\n\tgetLoginBtn().attr('disabled', true);\t\r\n\tloginPost();\r\n\t\r\n}", "title": "" }, { "docid": "a3626770cb98bacccc5e5d1a82cde808", "score": "0.73721707", "text": "function handleLoginBtnClick() {\n navigation.navigate('Login');\n }", "title": "" }, { "docid": "4ff1d8c3157dcb4b62bcafdebe90af86", "score": "0.7357883", "text": "function login() {\n console.log('Logging in...');\n }", "title": "" }, { "docid": "5cf9b61d6fd47319a75cef5288c67998", "score": "0.7343781", "text": "function handleLoginBtnClick() {\n console.log(\"login clicked\");\n navigation.navigate('Login');\n }", "title": "" }, { "docid": "e7c407bb9af9b1a5339f310f2c6f67f8", "score": "0.7337053", "text": "function login(event) {\n event.preventDefault();\n setUserScores(false);\n let name = event.target[0].value.toLowerCase();\n let pass = event.target[1].value.trim();\n API.getUser(name, pass)\n .then(res => {\n // console.log(\"login client res: \", res);\n if (res.data) {\n setUser(res.data);\n setAuth(true);\n }\n }).catch(err => {\n // validation messages and error handling\n console.log(\"login error: \", err);\n setMessage('message row showMessage')\n setPassInput('form-control redInput')\n }\n )\n }", "title": "" }, { "docid": "9c191ff19b9fd079899b088eb7f19397", "score": "0.73357224", "text": "login (username, password) {\n this.inputUsername.setValue(username);\n this.inputPassword.setValue(password);\n this.btnSubmit.click(); \n }", "title": "" }, { "docid": "a7297c5718dd4686e1ca6a7751a99987", "score": "0.73291075", "text": "function login() {\r\n \r\n}", "title": "" }, { "docid": "c770cb9ed5fee8dc9a019b133a9a99c5", "score": "0.7323576", "text": "function onLoginButtonClicked() {\n this.notifyAll(new Event(Config.HEADER_VIEW.EVENT.LOGIN_BUTTON_CLICKED));\n}", "title": "" }, { "docid": "5043eb645b9f7d674ecfb7d38b7f8a07", "score": "0.73160404", "text": "function login(){\n LoginService.login(vm.credentials);\n }", "title": "" }, { "docid": "a2f801b5dd6a60b23a1d5c86e2de3ab7", "score": "0.72943807", "text": "function logIn(){\r\n\t\t\r\n\t}", "title": "" }, { "docid": "d4da838047d6b2815d3355fcda5d872d", "score": "0.72920775", "text": "_onLoginClick() {\n this.error = '';\n const email = this.shadowRoot.getElementById('email').value;\n const pass = this.shadowRoot.getElementById('pass').value;\n if (this._checkInputs(email, pass)) {\n const user = this._checkLogin(email, pass);\n // if credentials are ok, the function returns the user information\n // and then the user is redirected to the main page\n if (user) {\n // the last login date of the user is updated because the user just logged in\n const dateModifiedUser = {...user};\n dateModifiedUser.lastLogin = Date.now();\n this.usersTable.set(email, dateModifiedUser);\n\n // the app updates the users table in the localStorage with the new updated user\n this._setLocalStorage();\n\n // the app sends and ecent to let the main know the user just logged in\n const event = new CustomEvent('login-ok', {\n detail: {\n 'user': user,\n },\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(event);\n }\n }\n }", "title": "" }, { "docid": "9dea63bae175b73013806c802aa68eac", "score": "0.72791207", "text": "login() {\n }", "title": "" }, { "docid": "7686acbbd74f723201353271336d8189", "score": "0.72202957", "text": "function loginButton(){\n showLoginForm();\n hideSignupForm();\n}", "title": "" }, { "docid": "d4054ec6a4af6dc43f84c6e49db2dd01", "score": "0.7214662", "text": "function login() {\n AuthService.login(self.user.username, self.encryptMD5(self.user.password))\n .then(function (user) {\n $localStorage.authInfo = user;\n $state.go('main.video.list');\n }, function (error) {\n alert(error);\n });\n }", "title": "" }, { "docid": "f51d98edcab4d00ca9c43f36c44e7bad", "score": "0.72096485", "text": "function login() {\n \n}", "title": "" }, { "docid": "8b8701a78fd30744ed6aec4668d09e1d", "score": "0.7208458", "text": "static displayLogin () {\n window.console.debug('fr.user.displayLogin - Displaying login screen.')\n\n window.history.replaceState('', document.title, window.location.pathname)\n jq('button.login').on('click', () => {\n /* eslint-disable-next-line max-len */// No better way to format this ATM\n window.location.href = encodeURI(`${AppConfig.WebURI}authorize?client_id=${AppConfig.ClientID}&redirect_uri=${window.location}&scope=${AppConfig.AppScope}&response_type=token&state=iwanttologinplease`)\n })\n jq('body')\n .removeClass('loading')\n .addClass('shutter-force user-unauthenticated')\n jq('#userMenu').attr('data-displaystate', 'login')\n }", "title": "" }, { "docid": "408868c1f44c580ca2bf4c2d54470b76", "score": "0.7204391", "text": "function login(){\n let username = document.getElementById(\"username\").value;\n let password = document.getElementById(\"password\").value;\n //Slå brugeren op i \"Databasen\"\n if (users[username] === password){\n //Opdatér applikationens tilstand!!\n loggedInState = true;\n user = username;\n }\n //Opdatér Brugergrænsefladen\n render();\n}", "title": "" }, { "docid": "a94342695a1f3261f8f72575f79778de", "score": "0.7152221", "text": "function loginButtonCheck() {\n\t\tCallModel.ifLoggedIn(function () {\n\t\t\t$scope.loggedIn = true;\n\t\t},\n\t\tfunction () {\n\t\t\t$scope.loggedIn = false;\n\t\t});\n\t}", "title": "" }, { "docid": "deda3fba7f56e5ec691745886d5dc06b", "score": "0.71312064", "text": "_onLoginClicked() {\n gapi_1.signIn();\n }", "title": "" }, { "docid": "20ecddf05356805cc5df4f20cb4b5be9", "score": "0.7110147", "text": "function onLogin (login) {\r\n\t\tif (login.auth_token) {\r\n\t\t\t$(':mobile-pagecontainer').pagecontainer('change', '#intro', {\r\n\t\t transition: 'slide',\r\n\t\t changeHash: true,\r\n\t\t reverse: true,\r\n\t\t showLoadMsg: true\r\n\t\t }); \r\n\t\t} else{\r\n\t\t\t$(':mobile-pagecontainer').pagecontainer('change', '#login', {\r\n\t\t transition: 'slide',\r\n\t\t changeHash: true,\r\n\t\t reverse: true,\r\n\t\t showLoadMsg: true\r\n\t\t });\r\n\r\n\t\t}\r\n\t\t\t\r\n\t\t// console.log(login.auth_token);\t\t\r\n\t\t \r\n\t}", "title": "" }, { "docid": "d20d60af51261cf6b91ce95330371b21", "score": "0.71077234", "text": "function _handleLogin() {\n var $dlg = $(\".github-login-dialog.template\")\n .clone()\n .removeClass(\"template\")\n .addClass(\"instance\")\n .appendTo(window.document.body);\n \n // Click handler for buttons \n $dlg.one(\"click\", \".dialog-button.cancel\", function (e) {\n Dialogs.cancelModalDialogIfOpen(\".github-login-dialog\");\n });\n $dlg.one(\"click\", \".dialog-button.primary\", function (e) {\n GitHub.listAuthorizations($dlg.find('.username').val(), $dlg.find('.password').val(), onLoginResult, onError);\n Dialogs.cancelModalDialogIfOpen(\".github-login-dialog\");\n });\n \n // Run the dialog\n $dlg.modal({\n backdrop: \"static\",\n show: true,\n keyboard: true\n });\n }", "title": "" }, { "docid": "3aea94a9fbad6e1c8d244922e6eec4f4", "score": "0.7089174", "text": "handleSubmitLogin(e) {\n\t\te.preventDefault()\n\n\t\tthis.requestUserAuth()\n\t}", "title": "" }, { "docid": "b0110b0a926c0314423e2bce53e5dd85", "score": "0.7085506", "text": "login () {\n console.log('Logging in..')\n Auth.login(this.state.username, this.state.password, (loggedIn) => {\n if (loggedIn) {\n window.location = '/'\n toast('Login Success!')\n }\n })\n }", "title": "" }, { "docid": "46593f2a1a25351b1f2f830578a7ee84", "score": "0.708208", "text": "function login(){\n\tshowSession('init');\n\t$('#form-button-login').on('touch click',function(){\n\t\tshowSession('normal');\n\t});\n\t$(\".ci-session\").on('touch click',function(){\n\t\t$.post( \"php/api-login.php\", {close: true},function( data ) {\n \t\t\t$(\".forma\").show();\n \t\t\t$(\".ci-contactos\").html('');\n\t\t});\n\t});\n}", "title": "" }, { "docid": "4d1727b143d9f9bec6d7a01e720b1920", "score": "0.7077147", "text": "function onUserLogonWidgetLogin(e) {\n e.preventDefault();\n e.stopPropagation();\n var $form = jQuery(this);\n var $errorMessage = $form.find('.error-message');\n $errorMessage.text('').hide();\n jQuery.post(getUrl('Common/AjaxLogin'), $form.serialize(), function (result) {\n if (result.isSuccess) {\n window.location = getUrl('');\n } else {\n $errorMessage.text(result.message).show();\n }\n }, 'json');\n}", "title": "" }, { "docid": "7555a027dcbf3f62937609cd435b41f1", "score": "0.7061293", "text": "function login(){\n\t//We call the validateUser function to see if there's any user with this info\n\tif(validateUser()){\n\t\tif(users[indexCurrentUser].status == 'blocked'){\n\t\t\tuserBlocked();\n\t\t}\n\t\telse{\n\t\t\t//Update page, menu, users inbox with its messages\n\t\t\tstartUser();\n\t\t}\n \n\t}\n\telse{\n\t\tconsole.log(\"not registered!\");\n\t}\n}", "title": "" }, { "docid": "a660e0fbab3712a9c617f4a5aef113e1", "score": "0.70598376", "text": "login(login) {\n if (login) {\n let pass = this.refs.pass.value;\n let userName = this.refs.user.value;\n this.client.userLogin(userName).then(\n (success) => {this.validateUser(success, pass, true)},\n (failure) => {this.validateUser(failure, pass, false)});\n } else{\n Storage_setUserId(\"\");\n Storage_setUserName(\"\");\n this.setState({name: \"Sign in\"});\n this.setState({logged: false});\n alert(\"You are now logged out\");\n window.location = '/#/';\n }\n }", "title": "" }, { "docid": "9406d35fb45a12b740275754c1d2b3c0", "score": "0.70469093", "text": "function login() {\n let user = logUser.value;\n let pass = logPass.value;\n loginCheck(user, pass);\n}", "title": "" }, { "docid": "ed06b9d52b6481317e4e3bbad1488350", "score": "0.70408964", "text": "function handleLogIn(){\n\t\tvar userName = $('#login-popup .input #username').val().trim();\n var passwd=$('#login-popup .input #passwd').val().trim();\n\t\tif(userName && userName.length <= NAME_MAX_LENGTH){\n\t\t\tuser = userName;\n\t\t\tAvgrund.hide();\n\t\t\tconnect(user,passwd);\n\t\t} else {\n\t\t\tshake('#login-popup', '#login-popup .input input', 'tada', 'yellow');\n\t\t\t$('#login-popup .input input').val('');\n\t\t}\n\t}", "title": "" }, { "docid": "2c36e5c90140d0b37731d1d5c87b5d9d", "score": "0.70401007", "text": "function login_onclick() {\n\t// Username: \"devweb.user\", \"devweb.manager\", \"devweb.admin\"\n\t// Password: \"123456\"\n\n\tusername = document.getElementById('login_username').value;\n\tpassword = document.getElementById('login_password').value;\n\tlogin(username, password);\n}", "title": "" }, { "docid": "707ebfdeda204549acec8e84f8997dcb", "score": "0.7037113", "text": "function handle_user_login() {\n var username = txt_user.val();\n var password = txt_pass.val();\n\n var info = {\n 'username' : username,\n 'password' : password\n };\n\n // check username and password are entered\n if (!validate_user_info(info)) {\n save_activity('login', 'empty username and password was entered : ' + info.username + ', ' + info.password);\n return;\n }\n\n if (stop_request_login) {\n return;\n }\n stop_request_login = true;\n btn_login.prop('disabled', true);\n\n // check for resetting of software\n if (validate_reset(info)) {\n save_activity('reset', 'software was reset');\n reset();\n startup();\n } if (validate_immediate_close(info)) {\n save_activity('reset', 'software was forced to shutdown immediately');\n ready_to_close = true;\n store.set('ready_to_close', true);\n } else {\n // good to check for user now\n api_user_login(info);\n btn_login.val('logging in....');\n }\n}", "title": "" }, { "docid": "aa399eadfa138c21c18df6432c4f53eb", "score": "0.703132", "text": "function openModalLogin(e) {\r\n cmdOpenModalLogin();\r\n resetModal(e);\r\n focusInputSecond('login_account',800)\r\n}", "title": "" }, { "docid": "163382aedf5b55274fa73eb102664c7b", "score": "0.7028007", "text": "function userLogin(e){\n e.preventDefault();\n let username= document.getElementById('username').value\n let pasword= document.getElementById('password').value\n \n let strinDt=validateUserCredential(username,pasword)\n\n if(strinDt===true){\n // alert('logged In')\n handleUsername(username)\n handleLogin(true)\n //$.noConflict();\n //props.setVisible(false) \n \n history.push('/Dashboard')\n }else{\n $(\"#checker\").fadeIn(100).delay(3000).fadeOut(2000)\n } \n\n }", "title": "" }, { "docid": "ee9eeff6e64d7384681a1ade20a763aa", "score": "0.7001697", "text": "function showLogin() {\n okta.renderEl({el: '#okta-login-container'}, function(res) {\n // Nothing to do in this case, the widget will automatically redirect\n // the user to Okta for authentication, then back to this page if successful\n }, function(err) {\n // Handle your errors homie\n alert(\"Couldn't render the login form, something horrible must have happened. Please refresh the page.\");\n console.error(err);\n });\n}", "title": "" }, { "docid": "934de659e56c2e7b65a1e549a57be65a", "score": "0.6995093", "text": "handleLoginClick(e) {\n\t\twindow.location.href = \"/login\";\n\t}", "title": "" }, { "docid": "d7004532ce3443e6c112fbf203e25c3e", "score": "0.6992713", "text": "function login() {\r\n luminateExtend.api.request({\r\n api: 'CRConsAPI', \r\n callback: loginCallback, \r\n data: 'method=login',\r\n form: '#login_form',\r\n requestType: 'POST',\r\n useHTTPS: false\r\n });\r\n }", "title": "" }, { "docid": "49ba3cd27506611ca2d70642d6cf6709", "score": "0.69921315", "text": "onLogIn() {\n // handle the case when disabled attribute for submit button is deleted\n // from html\n if (this.logInForm.invalid) {\n return;\n }\n this.isBtnClicked = true;\n this.isLoggingIn = true;\n this.email = this.logInForm.get('email').value;\n this.password = this.logInForm.get('password').value;\n this.authService\n .signIn(this.email, this.password)\n .then((result) => {\n this.isLoggingIn = false;\n this.isHideResponseErrors = true;\n this.router.navigate(['']);\n })\n .catch((error) => {\n this.isBtnClicked = false;\n this.isHideResponseErrors = false;\n this.isLoggingIn = false;\n this.authErrorHandler.handleAuthError(error, 'logIn');\n });\n }", "title": "" }, { "docid": "52b86d776d1a00d49321e8df1a5ca544", "score": "0.6984984", "text": "login() {\n this.get('auth').login();\n }", "title": "" }, { "docid": "6f228bba1711fc1a7969e3a266857c90", "score": "0.6983175", "text": "onSubmit() {\n this.attemptLogin();\n }", "title": "" }, { "docid": "cd96471521048772565dbe19911b272d", "score": "0.69802386", "text": "function handleLoginClick() {\n if (GoogleAuth.isSignedIn.get()) {\n // User is authorized and has clicked 'Sign out' button.\n GoogleAuth.signOut()\n // for now do nothin\n } else {\n // User is not signed in. Start Google auth flow.\n GoogleAuth.signIn()\n }\n}", "title": "" }, { "docid": "8c68a7810011ce255b0d8b6fd787bbdc", "score": "0.69625777", "text": "function openLogin(e) {\r\n e.preventDefault();\r\n view.open(view.loginFormDiv);\r\n view.close(view.signUpFormDiv);\r\n }", "title": "" }, { "docid": "474e69405c4bbecf2b731fe64dfdba0f", "score": "0.69495344", "text": "function setLogin(){\n username = cookie[\"one-user\"];\n uid = cookie[\"one-user_id\"];\n\n $(\"#user\").html(username);\n $(\"#logout\").click(function(){\n OpenNebula.Auth.logout({success:function(){\n window.location.href = \"/login\";\n }\n });\n return false;\n });\n}", "title": "" }, { "docid": "2c42eae7e284270452880512f8137c9f", "score": "0.6946233", "text": "function loggedIn() {\n $('#login').hide();\n $('#loggedin').show();\n\n var model = new Model();\n model.getPlaylists();\n model.getTags();\n model.getTracks();\n\n var mainView = new MainView(model);\n var plView = new PlaylistView(model);\n var songView = new SongView(model);\n var searchView = new SearchView(model);\n var searchResultView = new SearchResultView(model);\n\n model.addObserver(mainView);\n model.addObserver(plView);\n model.addObserver(songView);\n model.addObserver(searchView);\n model.addObserver(searchResultView);\n\n $('#searchbtn').click(function () {\n model.setMode(MODE.SEARCH);\n });\n\n $('#backbtn').click(function () {\n model.goBack();\n });\n\n $(window).on(\"orientationchange\", function () {\n model.reload();\n });\n\n getUserId(null);\n }", "title": "" }, { "docid": "0a3a54157b9a2a9ba7c3b33084ff38ae", "score": "0.6932373", "text": "function toLogin()\n\t{\n//\t\tapp.linkToObject('login');\n\t\tapp.logout();\n\t}", "title": "" }, { "docid": "5552c186933946845f521f3ef03f4c70", "score": "0.6911729", "text": "function logIn() {\n\t\t$(document.body).css('background',null);\n\t\t\n\t\t// LOCAL app status check.\n\t\tif ($scope.appStatus != 'LOCAL') {\n\t\t\t// SERVICE CALL: Log in.\n\t\t} else {\n\t\t\tvar username = $('#logInContainer').find('#logInUserName').val();\n\t\t\tvar password = $('#logInContainer').find('#logInPassword').val();\n\t\n\t\t\tif ($('#logInContainer').find('#logInUserName').val() === $scope.appUserName && $('#logInContainer').find('#logInPassword').val() == $scope.appPassword) {\n\t\t\t\t\n\t\t\t\tangular.element(document.getElementById('leftContainer')).scope().setUpHandlers();\n\t\t\t\t\n\t\t\t\t$('.mainTitle').fadeOut('fast');\n\t\t\t\t$('#logInSection').fadeOut('fast', function() {\n\t\t\t\t\tvar currentWindowHeight = $(window).height();\n\t\t\t\t\t\n\t\t\t\t\t$('#mainContainer').css('min-height',currentWindowHeight);\n\t\t\t\t\t$('#leftContainer, #rightContainer').css('min-height',currentWindowHeight - 42).css('height',currentWindowHeight - 42);\n\t\t\t\t\t\n\t\t\t\t\t$('#mainContainer, #topNav, #btnLeftSlideToggle').fadeIn('slow');\n\t\t\t\t\t$('#logInContainer').find('#logInUserName').val('');\n\t\t\t\t\t$('#logInContainer').find('#logInPassword').val('');\n\t\t\t\t\t\n\t\t\t\t\t$('.userName').text(username);\n\t\t\t\t\t$('#logInSection').unbind('keyup');\t\n\t\t\t\t\t\n\t\t\t\t\tloadUserPrefs();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Unbind click handler on submit button.\n\t\t\t\t$('#logInSubmitBtn').unbind('click');\n\t\t\t} \n\t\t}\t\n\t}", "title": "" }, { "docid": "aa94a10687ac81559eba3c53ad3184c8", "score": "0.6896575", "text": "login(){ Konekti.client[this.server].login(this.vc('email').value, this.vc('password').value) }", "title": "" }, { "docid": "65e7b74b249fe3435f6df41c7ad3482a", "score": "0.6896103", "text": "_handleLogin() {\r\n if (this.$.loginForm.validate()) {\r\n let emailId = this.$.username.value;\r\n let password = this.$.password.value;\r\n this._makeAjaxCall(`http://localhost:3000/users?emailId=${emailId}&&password=${password}`, 'get', null);\r\n } \r\n }", "title": "" }, { "docid": "0d37b116ae4c8a282f848e236f4408cd", "score": "0.68944573", "text": "login() {\n\n // TODO:\n // AXIOS Request to database to search for password\n axios.post(`http://13.56.163.208/api/user/user.php`, {\n method: \"GET\",\n user_name: this.state.local_login,\n password: this.state.local_password\n }).then(resp => {\n let auth_token = null;\n\n // Grabbing data from the account response\n let data = resp.data;\n if (data.auth_token !== undefined) {\n auth_token = data.auth_token;\n }\n\n // We have retrieved information regarding this account\n // Check to see if got valid account information\n if (auth_token === null) {\n // Opening the dialog box\n this.setState({dialog_open: true});\n }\n\n else {\n // Sweet, valid account credentials!\n // Lets set this in the main view and load into the next page\n this.props.handleLoginCallback(this.state.local_login, auth_token);\n }\n });\n }", "title": "" }, { "docid": "8389b41ea454a1bca40bdc44e53e58b7", "score": "0.68942994", "text": "function onLogin(user){\n setCurrentUser(user)\n }", "title": "" }, { "docid": "d2262baa11b1513f0307c810f9e14c63", "score": "0.68906164", "text": "goToAuthentication() {\n this.SignInButton.waitForVisible();\n this.SignInButton.click();\n }", "title": "" }, { "docid": "a7038ae6394bcb756d50afb5410974bf", "score": "0.688764", "text": "function handleClick(event) {\n postData('https://localhost:5001/api/users/login', userInfo)\n .then(data => {\n //console.log(data); // JSON data parsed by `response.json()` call\n setIsLogged(Boolean(data));\n //console.log(isLoagged);\n if(isLoagged === true){\n localStorage.setItem(\"currentuser\", userInfo.email);\n history.push(\"/account\");\n }\n });\n event.preventDefault();\n //console.log(userInfo.email + ' ' + userInfo.password);\n //history.push(\"/account\");\n }", "title": "" }, { "docid": "aaf4801b6124d7afa1a778560668a3ce", "score": "0.6869909", "text": "function basicLogin() {\n\tshowInputs();\n}", "title": "" }, { "docid": "7ea4b3cd2c3664163f59e8da5c29ceeb", "score": "0.6864234", "text": "function Login () {\n\n\tif ($('header-login').style.display==\"block\")\n\t\t$('header-login').style.display = \"none\";\n\telse\n\t{\n\t\t$('header-login').style.display = \"block\";\n\t\t$('header-login-username').focus();\n\t}\n\t\t\n\n\treturn false;\n}", "title": "" }, { "docid": "0f1e5529a4c0808e5759dede50373595", "score": "0.68581283", "text": "function loginListener(loginBtn) {\n\n loginBtn.on(\"click\", function (event) {\n event.preventDefault();\n\n let passwordInput = $(\"#password-popup\").val();\n let emailInput = $(\"#email-popup\").val();\n\n let userData = {\n email: emailInput,\n password: passwordInput\n };\n\n if (!userData.email || !userData.password) {\n return;\n }\n\n // If we have an email and password we run the loginUser function and clear the form\n loginUser(userData.email, userData.password);\n $(\"#email-popup\").val(\"\");\n $(\"#password-popup\").val(\"\");\n });\n }", "title": "" }, { "docid": "d198c40a8024cae6c1dcbe998fc741b8", "score": "0.6851367", "text": "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n updateSigninStatus(true);\n\n }", "title": "" }, { "docid": "3c6a1c5263ef604fc2708967774eb0e7", "score": "0.6845717", "text": "setLoginCallback(){\n document.addEventListener(\"submitBtnPressed\", () => {\n this.changeContent('home')\n\n //enable all buttons\n this.changeButtonsBarClickablity()\n \n //display edit button if participant logged in\n if(this.emailStatus == 'participant' || this.emailStatus == 'schramm')\n this.shadowRoot.getElementById('editBtn').style.display = 'initial'\n else\n this.shadowRoot.getElementById('editBtn').style.display = 'none'\n\n })\n\n document.addEventListener(\"submitBtnPressedEdit\", () => {\n this.changeContent('home')\n //display edit button if participant logged in\n if(this.emailStatus == 'participant' || this.emailStatus == 'schramm')\n this.shadowRoot.getElementById('editBtn').style.display = 'initial'\n else\n this.shadowRoot.getElementById('editBtn').style.display = 'none'\n })\n }", "title": "" }, { "docid": "90ab88e69b333ccfbf8abe21ffcc5c1b", "score": "0.68431765", "text": "clickLoginButton(){\n genericActions.click(headerPage.topSection.publicButtons.loginLink);\n }", "title": "" }, { "docid": "010762fcf2a51553a0eebd5a9fd3596a", "score": "0.6825242", "text": "function goLogIn() {\n toggleClasses('index');\n toggleClasses('login');\n }", "title": "" }, { "docid": "d72c31039e7e808c3ef546e2f2fddb3b", "score": "0.6822902", "text": "function loginClick(e) {\n e.preventDefault();\n\n // get user inputs for log in\n var email = emailLoginInput.val().trim();\n var password = passwordLoginInput.val().trim();\n\n // check to see if the fields have any user input\n if (email.length === 0 || password.length === 0) {\n alertify.error(\"Missing Required Fields\");\n } else {\n\n // prepare loginObjec to send to the server\n var loginObject = {\n email: email,\n password: password\n };\n\n // clear user input fields\n emailLoginInput.val(\"\");\n passwordLoginInput.val(\"\");\n\n // prepare currentURL string\n var currentURL = window.location.origin;\n\n $.ajax({\n type: \"POST\",\n url: currentURL + \"/login\",\n data: loginObject\n })\n .done(function (data) {\n\n // see the data object returned from the server\n //console.log(data);\n\n if (data.confirm) {\n\n var name = data.name;\n console.log(data)\n\n // update DOM with current user login status and change this DOM element to perform a signout function\n var logText = $(\"#logText\");\n logText.attr(\"onclick\", \"signOut()\");\n logText.text(\"Logged in as: \" + name);\n\n // close the overlay\n closeNav();\n\n // close any open modals\n $(\".modal\").modal(\"close\");\n\n // Empty the localStorage\n localStorage.clear();\n // Store all content into localStorage\n localStorage.setItem(\"userID\", data.result);\n localStorage.setItem(\"userName\", data.name);\n localStorage.setItem(\"admin\", data.admin);\n } else {\n alertify.error(\"Invalid Password or Email\");\n }\n\n }).fail(function (failed) {\n alertify.error(\"Invalid Password or Email\");\n\n });\n }\n }", "title": "" }, { "docid": "5f7115eb304f07cb00ded124391cb819", "score": "0.6820654", "text": "_handleAuthenticationLoginRequired()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__MAINREGION_SHOW_VIEW, {view: new ViewLogin()});\n }", "title": "" }, { "docid": "443db8a39b3659b5f03e00c2c6af0640", "score": "0.68187195", "text": "function onLoginReady(e){\n if( org.pbskids.login.loggedin === true ) onLoggedIn();\n }//onLoginReady()", "title": "" }, { "docid": "ee34cbc6e8a50b7f58af8b0092806533", "score": "0.68134016", "text": "loginView() {\n $('#LoginUsername').focus();\n\n $('#LoginButton').click(event => {\n let username = $('#LoginUsername').val();\n let password = $('#LoginPassword').val();\n let remember = $('#RememberMe').is(':checked');\n\n if (username.length && password.length) {\n this.fetch('POST', 'Login', '', {\n username : username,\n password : password,\n remember : remember\n }).then(data => {\n if (data.loginError) {\n $('#LoginMessage > .alert').html(data.loginError);\n $('#LoginPassword').val('');\n $('#LoginMessage').show();\n }\n else if (data.status === 'ok') {\n this.check();\n }\n });\n }\n });\n\n $('#LoginPassword').keyup(e => {\n if (e.which === 13) {\n $('#LoginButton').click();\n }\n });\n }", "title": "" }, { "docid": "995a3e2cb1a7ebc6df62f71c159e730e", "score": "0.680774", "text": "function pageAfterLogin() {\n // It depends on who signed up , for user : button_account (clik);button log out(clik) for admin : plus button_Users an button_add projection \n $(\"#tableProjectionWithSearch\").show();\n $(\"#infoDiv\").show();\n $(\"#movieDiv\").show();\n\n $(\"#registerDiv\").hide();\n $(\"#loginDiv\").hide();\n $(\"#loginRegisterDiv\").hide();\n\n if (user == \"admin\") {\n\n $(\"#adminButton\").show();\n\n }\n\n }", "title": "" }, { "docid": "9e7bab5b9566df96693b4be7cb493f44", "score": "0.68048584", "text": "function loginStart()\n{\n $$('#my-login-screen .login-button').on('click', function () {\n var username = $$('#my-login-screen [name=\"username\"]').val();\n var password = $$('#my-login-screen [name=\"password\"]').val();\n\n app.preloader.show();\n app.request({\n url: 'http://35.200.224.144:8090/api/v1/login',\n method: 'POST',\n dataType: 'json',\n data: {emailId: username, password: password},\n success: function (data, status, xhr) {\n user = data.user;\n securityToken = data.user.token;\n $$('#my-login-screen [name=\"username\"]').val('');\n $$('#my-login-screen [name=\"password\"]').val('');\n app.preloader.hide();\n $$(\"#dashboardLink\").click();\n },\n error:\tfunction (xhr, status)\n {\n if (status === 401)\n {\n alert('Wrong email or password.')\n }\n else\n {\n let response = JSON.stringify(xhr.response);\n alert(response.message);\n }\n app.preloader.hide();\n }\n });\n });\n}", "title": "" }, { "docid": "72c4b0558455f718906e0062f59fe6ac", "score": "0.6803585", "text": "function login(event) {\n LoginService.login(vm.username, vm.password, vm.rememberMe, vm.authenticationError, Auth);\n }", "title": "" }, { "docid": "136088a7b408440619ae398377d7f267", "score": "0.6802773", "text": "login() {\n if (this.loginData[this.username]) {\n if (this.password == this.loginData[this.username].password) {\n UserDataService.name = this.loginData[this.username].firstName;\n UserDataService.UserID = this.loginData[this.username].id;\n UserDataService.proPic = this.loginData[this.username].proPic;\n SeniorDataService.changePending = true;\n AWSService.getFirebaseToken();\n this.showLogin = false;\n } else {\n alert(\"Incorrect password.\");\n }\n } else {\n alert(\"User does not exist.\");\n }\n }", "title": "" }, { "docid": "332cde575245f8e4ed6be1e6c72a7d58", "score": "0.67815804", "text": "function login() {\n vm.dataLoading = true;\n AuthenticationService.Login(vm.username, vm.password, function (response) {\n\n if (response.success) {\n // Save this parameters for this instance\n AuthenticationService.SetCredentials(vm.username, vm.password, response.data.idUser);\n $location.path('/');\n } else {\n FlashService.Error(response.message);\n vm.dataLoading = false;\n }\n });\n }", "title": "" }, { "docid": "5c6249fbadf20a99cdcd4408be335a34", "score": "0.67769367", "text": "login() {\n if (this.userLoggedIn() || this._modalInstance) {\n return;\n }\n\n // Display the login component. \n this._modalInstance = this._$uibModal.open({\n component: 'uttLogin',\n keyboard: false,\n backdrop: 'static'\n });\n\n // Scroll user to questions on login.\n this._modalInstance.result\n .then(() => {\n return this._scrollHelper.scrollToElement('utt-question-track');\n })\n .finally(() => {\n this._modalInstance = null;\n });\n }", "title": "" }, { "docid": "9e21c3f6cbe6b1cedc25f67e2d5f19e3", "score": "0.6775528", "text": "login(){\n var user = document.getElementById('usernameTB').value;\n console.log(user);\n var pass = document.getElementById('passwordTB').value;\n console.log(pass);\n if (user == '[email protected]' && pass == 'customer1')\n {\n window.location = 'engineList.html';\n }\n else if (user == '[email protected]' && pass == 'technician1')\n {\n window.location = 't_tasks.html';\n }\n else if (user == '[email protected]' && pass == 'manager1')\n {\n window.location = 'index.html';\n }\n else {\n alert(\"Incorrect username or password!\")\n }\n }", "title": "" }, { "docid": "00e546e2158b5ee10188332c93077811", "score": "0.67748743", "text": "function login() {\n\t\t$('#loginSectionError').html('');\n\t\tvar username = $(\"#username\").val();\n\t\tvar password = $(\"#password\").val();\n\n\t\tclient.login(username, password,\n\t\t\tfunction (err) {\n\t\t\t\tif (err) {\n\t\t\t\t\t$('#loginSectionError').html('There was an error logging you in.');\n\t\t\t\t} else {\n\t\t\t\t\t//login succeeded\n\t\t\t\t\tif (client.isLoggedIn()) {\n\t\t\t\t\t\tclient.getLoggedInUser(function(err, data, user) {\n\t\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\t\t//you should do something with this error point. todo\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tappUser = user;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t$(\"#username\").val('');\n\t\t\t\t\t$(\"#password\").val('');\n\n\t\t\t\t\t//default to the full feed view (all messages in the system)\n\t\t\t\t\tshowAgents();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "e3cff1ab92398f6e2a86d395624d1d1c", "score": "0.6774453", "text": "function handleAuthClick(event) {\n \tgapi.auth2.getAuthInstance().signIn();\n}", "title": "" }, { "docid": "a31a8922fea91266dc85f9a3478e1cc4", "score": "0.6773046", "text": "function login() {\n getElementById(\"login_message\").innerHTML = \"Logging in...\";\n var credentials = '{\"username\":\"' + $(\"#username\").val() + '\", \"password\":\"' + $(\"#password\").val() + '\"}';\n $.ajax({\n type: \"POST\",\n contentType: \"application/json\",\n url: window.location.protocol + \"//\" + window.location.host + \"/fabric/security/token\",\n dataType: \"json\",\n data: credentials,\n success: function () {\n authenticated = true;\n $('#login').hide(\"slow\");\n $(\"#tabs\").show();\n }\n });\n }", "title": "" }, { "docid": "22fffa720040871f695acb5e817ff2b4", "score": "0.6770164", "text": "function loginPage(){\n \n}", "title": "" }, { "docid": "bafa614ae878aea6ae2e610cb779f04a", "score": "0.67682874", "text": "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "title": "" }, { "docid": "bafa614ae878aea6ae2e610cb779f04a", "score": "0.67682874", "text": "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "title": "" }, { "docid": "015906a94c4083389b6b86d500cd1b6d", "score": "0.676726", "text": "function authenticateUser(){\n console.log(\"User authentication required\");\n $('#loginModal').modal('show');\n}", "title": "" }, { "docid": "5ba8f94345ab11936ad23e492289bf44", "score": "0.6765834", "text": "function login() {\r\n \t\t\t\r\n \t\t// Clean error msg\r\n \t\tvm.errorMsg = '';\r\n\t\t\t// set signing in flag\r\n\t\t\tvm.signing = true;\r\n\t\t\t// unset error flag\r\n\t\t\tvm.error = false;\r\n\t\t\t\r\n\t\t\t// Request Login\r\n \t\tAuthService.login(vm.credentials)\r\n \t\t\t// On success\r\n\t\t\t\t.then(function(data) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// unset signing in flag\r\n \t\t\tvm.signing = false;\r\n\t\t\t\t\t\r\n\t\t\t\t// On error\r\n\t\t\t\t}).catch(function(error) {\r\n\t\t\t\t\t// Show error\r\n\t\t\t\t\tvm.errorMsg = error.data.detail;\r\n\t \t// Set error flag\r\n\t \tvm.error = true;\r\n\t \t// Unset signing in flag\r\n\t \t\t\tvm.signing = false;\r\n\t\t\t});\r\n \t}", "title": "" }, { "docid": "9b20ae008ebb64fe8b2601a78b7d6654", "score": "0.67639214", "text": "function login (userForm) {\n alert('Impliment login request to server.');\n }", "title": "" }, { "docid": "250b8daf634adcd3f916cc9d03383384", "score": "0.67629355", "text": "login() {\n this.changeTheme()\n\n // Call the show method to display the widget.\n this.lock.show()\n }", "title": "" }, { "docid": "ad874148010b596cbf1027430f60fed8", "score": "0.6759134", "text": "handleLogin(event) {\n this.toggleModal();\n this.props.loginUser({\n username: this.username.value,\n password: this.password.value,\n });\n event.preventDefault();\n }", "title": "" }, { "docid": "c8d1dcdb8717f552a796d9221bf9f51a", "score": "0.67591184", "text": "function login() {\n\t//get username and password from inputs\n\tvar user = jQuery(\"#username\").val();\n\tvar pass = jQuery(\"#password\").val();\n\t//check if there is any record in the database\n\tjQuery.post(\"php/admin/mservices.php\", {method: \"login\", username: user, password: pass}, function (data) {\n\t\tif (data != \"empty\") {\n\t\t\t//make a session with data\n\t\t\tjQuery.post(\"php/sessions.php\", {type: \"setSession\", loginInfo: data, orderType: \"moChglak\"}, function (data) {});\n\t\t\twindow.location.replace(\"dashboard/dashboard.html\");\n\t\t} else {\n\t\t\t//show error massege\n\t\t\tjQuery(\"#loginError\").show();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7c767ec5364493a0f5b98291a42a1352", "score": "0.67582095", "text": "function logIn(){\n let enterClose=document.getElementsByClassName(\"enter_close\")[0];\n let enterButton=document.getElementsByClassName(\"enter_button\")[0];\n enterButton.addEventListener(\"click\", openModal, false);\n \n if (getDataUser){\n enter_button.innerHTML=\"Личный кабинет\";\n enterClose.addEventListener(\"click\", closeModal, false);\n enterUserModal();\n }\n}", "title": "" }, { "docid": "9b2bd2bac8e0646d6fb1b1d10aa75908", "score": "0.67554975", "text": "function showLogin() {\n\n // hide chat\n $chatPage.fadeOut();\n\n // hide error\n $loginError.hide();\n\n // show login\n $loginPage.show();\n\n // focus on username input\n $currentInput = $loginUsername.focus();\n\n // clear users' list\n $chatUsers.empty();\n }", "title": "" }, { "docid": "297b1e7ade027b4a9901c8322007209f", "score": "0.67551214", "text": "function loginAndSubmitForm() {\n\n $loginForm.hide();\n $createAccountForm.hide();\n\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "title": "" }, { "docid": "1ede6302db98a0d6f885817b3b4c541c", "score": "0.6753881", "text": "static login() {\n vc.login();\n }", "title": "" }, { "docid": "e8b47172482713262ec287d0571871a3", "score": "0.6743871", "text": "fillInCredentialsAndLogin(username, password) {\n this.usernameInput.setValue(username);\n this.passwordInput.setValue(password);\n this.rememberMe.click();\n this.loginButton.click();\n }", "title": "" }, { "docid": "31657011ac1a00a4244d226d7f9af530", "score": "0.6742705", "text": "function showLoginView() {\n\t\t$('#login').show();\n\t\tvar username = $('#username').val('toni');\n\t\tvar password = $('#password').val('123');\n\t\t$('#login-button').show();\n\t\t$('#registerViewButton').show();\n\t\t$('#register-button').hide();\n\t\t$('#loginViewButton').hide();\n\t\t$('#bookmarks').html('');\n\t\t$('#create-bookmark').hide();\n\t}", "title": "" }, { "docid": "254427f5926889c4a9958dd752856bbd", "score": "0.6740075", "text": "login(){\n \n // upon hitting enter it sets the active user and renders the Dashboard\n // and checks for incorrect username/email and password inputs\n let loginButton = document.querySelector(\".login__button\")\n let enterEvent = document.querySelector(\"#login__wrapper\")\n enterEvent.addEventListener(\"keypress\", enterEvent => {\n let username = document.querySelector(\"#username__input\").value\n let password = document.querySelector(\"#password__input\").value\n let usernameCheck = false\n let passwordCheck = false\n if(enterEvent.key === \"Enter\"){\n for(let user of data.users){\n if(username === user.username || username === user.email) {\n usernameCheck = true\n if(password === user.password) {\n passwordCheck = true\n window.sessionStorage.setItem(\"activeUser\", user.id)\n document.querySelector(\".top-sec-container\").innerHTML = \"\"\n \n setFields().then(() => {\n TopSectionTemplate();\n FriendTemplate(data.friends)\n TaskCardGenerator(data.tasks);\n NewsTemplate(data.news.sort((a,b)=>b.time-a.time));\n EventListeners.setStandard();\n\n })\n \n \n \n \n }\n }\n }\n if(usernameCheck === true) {\n if(passwordCheck === false) {\n window.alert(\"Incorrect password\")\n }\n }else{\n window.alert(\"Incorrect Username/Email\")\n }\n }\n \n })\n // upon clicking login it sets the active user and renders the Dashboard\n // and checks for incorrect username/email and password inputs\n loginButton.addEventListener(\"click\", clickEvent => {\n let username = document.querySelector(\"#username__input\").value\n let password = document.querySelector(\"#password__input\").value\n let usernameCheck = false\n let passwordCheck = false\n for(let user of data.users){\n if(username === user.username || username === user.email) {\n usernameCheck = true\n if(password === user.password) {\n passwordCheck = true\n window.sessionStorage.setItem(\"activeUser\", user.id)\n document.querySelector(\".top-sec-container\").innerHTML =\"\"\n setFields().then(() => {\n TopSectionTemplate();\n FriendTemplate(data.friends)\n TaskCardGenerator(data.tasks);\n NewsTemplate(data.news.sort((a,b)=>b.time-a.time));\n EventListeners.setStandard();\n\n })\n \n \n \n \n \n }}\n }\n if(usernameCheck === true) {\n if(passwordCheck === false) {\n window.alert(\"Incorrect password\")\n }\n }else{\n window.alert(\"Incorrect Username/Email\")\n }\n \n \n })\n }", "title": "" }, { "docid": "f603e3e7ef4790b3628057ffdd7e6410", "score": "0.67373353", "text": "function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }", "title": "" }, { "docid": "846354a44bdb9739ebb4c84fc09ec430", "score": "0.6735267", "text": "function loginBtn() {\n var username = document.getElementById(\"username\").value, pass = document.getElementById(\"password\").value;\n var user = localStorageUsers.filter(function(user) {\n return user.username == username;\n });\n if (user.length == 1 && user[0].password == pass) {\n currentUser = user[0];\n smoothFade(quizView);\n }\n else {\n // Account not found message\n var existingMessage = document.getElementById(\"not-found\");\n if (!existingMessage) {\n var form = document.getElementById(\"login-form\");\n var notFound = document.createElement(\"p\");\n notFound.id = \"not-found\";\n notFound.innerHTML = \"Sorry, there is no account with those details\";\n form.appendChild(notFound);\n }\n }\n }", "title": "" }, { "docid": "89291a526a62567060a074e91ffbd482", "score": "0.67348367", "text": "function pageLogin() {\n $(\"#registerDiv\").hide();\n $(\"#tableProjectionWithSearch\").hide();\n $(\"#loginDiv\").show();\n $(\"#loginRegisterDiv\").hide();\n $(\"#movieDiv\").hide();\n }", "title": "" }, { "docid": "77b5cc55857ac7a92a134481bbc2e01b", "score": "0.67315626", "text": "function login() {\r\n //CACHE LOGIN DOM\r\n const loginPassword = document.querySelector(\"#login-password\").value;\r\n const loginEmail = document.querySelector(\"#login-email\").value;\r\n //APELAM FUNCTIA DIN CONTROLLER PENTRU LOGAREA USERULUI\r\n DBHelper.loginUser(loginEmail, loginPassword);\r\n}", "title": "" }, { "docid": "325591c9f044fdb72b2f13b0c3251591", "score": "0.67313576", "text": "onLogin(state, data) {\n\t\tstate.user = data\n\t\tstate.loadings.login = false\n\t\tstate.errors.login = null\n\t}", "title": "" }, { "docid": "c14e5e862bc4b2bb2050787782193f6d", "score": "0.6722147", "text": "function openLoginScreen() {\n eraseScreen();\n login.createAndAppendLoginView();\n login.createAndAppendRegistrationPopup();\n}", "title": "" } ]
80f6c767a26ac54fcae11dd31a990bd6
Gets or sets the color to use for the check mark when the checkbox is checked.
[ { "docid": "874e9ab38fd1c3e4acfb5134a1a70084", "score": "0.0", "text": "get actualRestingElevation() {\n return this.i.cg;\n }", "title": "" } ]
[ { "docid": "a25dd80c6c98a7e5c63e43549ccbb69c", "score": "0.6959824", "text": "function getColor(isSelected) {\n return isSelected ? '#0084FF' : '#000';\n}", "title": "" }, { "docid": "39a5c16fa1f24321c669fc88a0580cb5", "score": "0.6683365", "text": "_onColorChanged() {\n const element = this.shadowRoot.querySelector('[part=\"checkbox\"]');\n\n if (this.color) {\n element.style.background = this.color.toRgbString();\n element.style.color = ColorPickerUtils.getContrastColor(this.color);\n\n if (this.color.getLuminance() > 0.96) {\n element.classList.add('show-border');\n }\n } else {\n element.style.background = null;\n }\n }", "title": "" }, { "docid": "2133c9b9db011e9eb4647a78a361c26b", "score": "0.6326645", "text": "static get checked() {\n return Glyph._byLocation(3, 4, 'checked');\n }", "title": "" }, { "docid": "7d9743b4db7cc3e58d4b286fa676e1ee", "score": "0.6256755", "text": "function checkboxChecked(){\n\tvar checkboxValidation = document.getElementById(\"checkboxValidationTag\");\n\t\n\tcheckboxValidation.innerHTML = \"We'll miss updating you on the latest coffee facts!\";\n\tcheckboxValidation.style.color = \"Green\";\n}", "title": "" }, { "docid": "29d9e89173f430be63d93fbd9efd3d52", "score": "0.6145646", "text": "getCellColor() {\n let checkedValue = this.getRadioValue(\"cellColor\");\n this.cellColor = checkedValue;\n return this.cellColor;\n }", "title": "" }, { "docid": "1b4b7012b61a4f70f810ee4ba350f3fe", "score": "0.6133539", "text": "_checkButton()\n {\n this._isChecked = true;\n this._filling.fill('orange');\n }", "title": "" }, { "docid": "24bf66106a44c2f3d955fe9516e6234c", "score": "0.604951", "text": "function selectColor(){\n\t\tif(document.getElementById(\"yellow\").checked){\n\t\t\tcolor = \"Yellow\";\n\t\t}\n\t\telse if(document.getElementById(\"red\").checked){\n\t\t\tcolor = \"Red\";\n\t\t}\n\t\telse if(document.getElementById(\"black\").checked){\n\t\t\tcolor = \"Black\";\n\t\t}\n\t\telse if(document.getElementById(\"erase\").checked){\n\t\t\tcolor = \"Erase\";\n\t\t}\n\t\tenablePaint();\n\t}", "title": "" }, { "docid": "c923406b21ad553703af72f98f1fa40d", "score": "0.58818954", "text": "function getColor() {\n var myColor; \n if (document.getElementById('blue').checked) {\n myColor = '#00FFFF';\n }\n else if (document.getElementById('pink').checked) {\n myColor = '#FF1493';\n }\n else if (document.getElementById('green').checked) {\n myColor = '#7FFF00';\n }\n else if (document.getElementById('red').checked) {\n myColor = '#FF0000';\n }\n\n return myColor;\n}", "title": "" }, { "docid": "6e1f20e3ad8d2d74ebe60abe584617af", "score": "0.57853544", "text": "function lightenBackground(e){\n if(this.checked){\n this.parentElement.style.background = '#484982';\n this.parentElement.style.opacity = '0.64';\n }\n else{\n // this.style.background = 'red'; // change the background of check element\n this.parentElement.style.background = ''; // this uses the default background\n }\n}", "title": "" }, { "docid": "c5f29daf20f19f7e921bde7e1d05a8f8", "score": "0.55908144", "text": "function check(value) {\n var checkBoxes = document.getElementsByName('color');\n\n for(var i = 0; i < checkBoxes.length; i++) {\n checkBoxes[i].checked = value;\n }\n }", "title": "" }, { "docid": "904153bd4df96cf3f34372ab2adb7c40", "score": "0.5565533", "text": "function HighlightRow(chkB)\n{\n var IsChecked = chkB.checked; \n\n if(IsChecked)\n {\n chkB.parentNode.parentNode.style.backgroundColor='black'; \n\n chkB.parentNode.parentNode.style.color='white';\n\n }else\n {\n chkB.parentNode.parentNode.style.backgroundColor='white';\n\n chkB.parentNode.parentNode.style.color='black';\n\n }\n\n}", "title": "" }, { "docid": "ecc7c882a632c0add26d13bead86bee9", "score": "0.5518413", "text": "get outlinedBackgroundColor() {\n return brushToString(this.i.tk);\n }", "title": "" }, { "docid": "0a9d07ed2cad23cb0dc26098d3272826", "score": "0.5514826", "text": "function My_checkBox1() {\n\tlet checkBox2 = document.querySelector('#myCheck');\n\tlet body = document.querySelector('#body');\n\t\n\tif (checkBox2.checked == true) {\n\t\tbody.style.backgroundColor = '#483636';\n\t\tbody.style.color = '#fff';\n\t} else {\n\t\tbody.style.backgroundColor = '#fff';\n\t\tbody.style.color = 'black';\n\t}\n}", "title": "" }, { "docid": "552515cd7e29c5665ec818f7392912ce", "score": "0.55123264", "text": "get checked() {\n return this._checked;\n }", "title": "" }, { "docid": "5b46138c9cc9a0d5e96cbce79c82d520", "score": "0.5508916", "text": "function getSelectedColor() {\n var colorSelection = document.getElementsByName(\"color\");\n for (var i = 0; i < colorSelection.length; i++) {\n if (colorSelection[i].checked)\n return colorSelection[i].id;\n }\n }", "title": "" }, { "docid": "c121b02d350f5f8f5b5615e77908b09d", "score": "0.54912585", "text": "function updateColor() {\n selectedColor = colorInput.value;\n eraser.style.setProperty('background', 'transparent');\n eraserOff.style.setProperty('background', 'pink');\n transparentEraser.style.setProperty('background', 'transparent');\n transparentEraserOff.style.setProperty('background', 'pink');\n randomColorCheckbox.checked = false;\n}", "title": "" }, { "docid": "6794691241f42dace39f72c66592a900", "score": "0.54804325", "text": "function toggleChecked(billDateNumber) {\n //select the specific category billDate\n let thisBillDateSpan = billDateSpans[billDateNumber];\n console.log(thisBillDateSpan.style.backgroundColor);\n //if the bgColor is white change to dark, also change font color to make legible\n if (thisBillDateSpan.style.backgroundColor != 'rgb(117, 192, 137)') {\n thisBillDateSpan.style.backgroundColor = 'rgb(117, 192, 137)';\n //thisBillDateSpan.style.color = 'rgba(240, 240, 250, 1)';\n }\n //if the bgColor is dark change to white, also change font color to make legible\n else {\n thisBillDateSpan.style.backgroundColor = 'rgba(240, 240, 250, 0.95)';\n //thisBillDateSpan.style.color = 'rgb(45, 65, 95)';\n }\n}", "title": "" }, { "docid": "8e9188eaddf573c445e25e331b633466", "score": "0.547928", "text": "function click_color(target, checkbox_id){\n\tif (target.style.border == \"5px solid green\")\n\t\ttarget.style.border = \"5px solid white\";\n\telse\n\t\ttarget.style.border = \"5px solid green\";\n \n let checkbox = document.getElementById(checkbox_id);\n checkbox.checked = !checkbox.checked;\n recalculate_pizza_price();\n}", "title": "" }, { "docid": "20b83c9980431cce13fc68a078ca002b", "score": "0.54753643", "text": "function chkdMark() {\n newLine.classList.toggle('checked');\n }", "title": "" }, { "docid": "5d1ed92348c803dd7afe188499ff0944", "score": "0.544323", "text": "get checked() {\n return this._checked;\n }", "title": "" }, { "docid": "5d1ed92348c803dd7afe188499ff0944", "score": "0.544323", "text": "get checked() {\n return this._checked;\n }", "title": "" }, { "docid": "5d1ed92348c803dd7afe188499ff0944", "score": "0.544323", "text": "get checked() {\n return this._checked;\n }", "title": "" }, { "docid": "25516ff91434d2795580a94149f79df2", "score": "0.5429167", "text": "function checkpH() {\n var checked = ibu.pHCheckbox.value;\n var idx = 0;\n var linkElements;\n\n if (!document.getElementById(\"pHColor\")) {\n return;\n }\n\n linkElements =\n document.getElementById(\"pHColor\").getElementsByTagName(\"a\");\n\n if (document.getElementById(ibu.pHCheckbox.id)) {\n if (checked) {\n document.getElementById(\"pHColor\").style.color = \"\";\n document.getElementById(\"ibu.pH\").style.color = \"\";\n for (var i = 0; i < linkElements.length; i++) {\n linkElements[i].style.color = \"\";\n }\n } else {\n document.getElementById(\"pHColor\").style.color = \"#b1b1cd\";\n document.getElementById(\"ibu.pH\").style.color = \"#b1b1cd\";\n for (var i = 0; i < linkElements.length; i++) {\n linkElements[i].style.color = \"#b1b1cd\";\n }\n }\n }\n\n return;\n}", "title": "" }, { "docid": "fce65a43b3e68086c11e014678f9550c", "score": "0.54274374", "text": "getChecked() {\n return this._checked;\n }", "title": "" }, { "docid": "57f59c4fbcf9cfeda0fb77c404cf02ad", "score": "0.5420749", "text": "function Checkbox(props, context) {\r\n var _this = _super.call(this, props, context) || this;\r\n _this._checkBox = Utilities_1.createRef();\r\n _this._onFocus = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onFocus) {\r\n inputProps.onFocus(ev);\r\n }\r\n };\r\n _this._onBlur = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onBlur) {\r\n inputProps.onBlur(ev);\r\n }\r\n };\r\n _this._onClick = function (ev) {\r\n var _a = _this.props, disabled = _a.disabled, onChange = _a.onChange;\r\n var isChecked = _this.state.isChecked;\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n if (!disabled) {\r\n if (onChange) {\r\n onChange(ev, !isChecked);\r\n }\r\n if (_this.props.checked === undefined) {\r\n _this.setState({ isChecked: !isChecked });\r\n }\r\n }\r\n };\r\n _this._onRenderLabel = function (props) {\r\n var label = props.label;\r\n return label ? (React.createElement(\"span\", { className: _this._classNames.text }, label)) : (null);\r\n };\r\n _this._warnMutuallyExclusive({\r\n 'checked': 'defaultChecked'\r\n });\r\n _this._id = Utilities_1.getId('checkbox-');\r\n _this.state = {\r\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked)\r\n };\r\n return _this;\r\n }", "title": "" }, { "docid": "57f59c4fbcf9cfeda0fb77c404cf02ad", "score": "0.5420749", "text": "function Checkbox(props, context) {\r\n var _this = _super.call(this, props, context) || this;\r\n _this._checkBox = Utilities_1.createRef();\r\n _this._onFocus = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onFocus) {\r\n inputProps.onFocus(ev);\r\n }\r\n };\r\n _this._onBlur = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onBlur) {\r\n inputProps.onBlur(ev);\r\n }\r\n };\r\n _this._onClick = function (ev) {\r\n var _a = _this.props, disabled = _a.disabled, onChange = _a.onChange;\r\n var isChecked = _this.state.isChecked;\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n if (!disabled) {\r\n if (onChange) {\r\n onChange(ev, !isChecked);\r\n }\r\n if (_this.props.checked === undefined) {\r\n _this.setState({ isChecked: !isChecked });\r\n }\r\n }\r\n };\r\n _this._onRenderLabel = function (props) {\r\n var label = props.label;\r\n return label ? (React.createElement(\"span\", { className: _this._classNames.text }, label)) : (null);\r\n };\r\n _this._warnMutuallyExclusive({\r\n 'checked': 'defaultChecked'\r\n });\r\n _this._id = Utilities_1.getId('checkbox-');\r\n _this.state = {\r\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked)\r\n };\r\n return _this;\r\n }", "title": "" }, { "docid": "23c898593cf08c11e65ffb8dc530623a", "score": "0.54129636", "text": "function colorOut(numBox) {\n\tif(!document.getElementById(numBox) || !document.getElementById(numBox).checked)\n\t\tdocument.getElementById('resource_'+numBox).style.background = \"#FFFFFF\";\n}//end function", "title": "" }, { "docid": "ef0a86e770386dbc9349547a28424f3c", "score": "0.5411164", "text": "function isChecked() {\n var ckboxCount = $(\".ckbox\").length;\n\n var items = [];\n\n $(\".ckbox\").each(function (i, e) {\n items.push($(e));\n });\n\n // console.log(items);\n\n for (var i = 0; i < ckboxCount; i++) {\n if (items[i].is(\":checked\")) {\n items[i].parents(\".input-group\").css(\"text-decoration\", \"line-through\");\n items[i].parent(\".input-group-addon\").siblings(\".note-text-input\").css(\"color\", \"rgba(0, 0, 0, 0.5)\");\n }\n }\n }", "title": "" }, { "docid": "58ce6eb60020a6ab08aa11cad158378a", "score": "0.5406007", "text": "function Checkbox(props, context) {\n var _this = _super.call(this, props, context) || this;\n _this._warnMutuallyExclusive({\n 'checked': 'defaultChecked'\n });\n _this._id = Utilities_1.getId('checkbox-');\n _this.state = {\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked)\n };\n return _this;\n }", "title": "" }, { "docid": "2897fdb6c59a35f14316b65549a7aae8", "score": "0.5398575", "text": "set_selection_colour(ui, colour) {\n // Whether to sync setting label and edge colour.\n const sync_targets = this.element.query_selector('input[type=\"checkbox\"]').element.checked;\n\n const label_colour_change = {\n kind: \"label_colour\",\n value: colour,\n cells: Array.from(ui.selection).map((cell) => ({\n cell,\n from: cell.label_colour,\n to: colour,\n })),\n };\n const colour_change = {\n kind: \"colour\",\n value: colour,\n cells: Array.from(ui.selection).filter(cell => cell.is_edge())\n .map((edge) => ({\n edge,\n from: edge.options.colour,\n to: colour,\n })),\n };\n\n let changes;\n switch (this.target) {\n case ColourPicker.TARGET.Label:\n changes = [label_colour_change];\n if (sync_targets) {\n changes.push(colour_change);\n }\n ui.history.add_or_modify_previous(\n ui,\n // `this.colour === colour` only when we have just clicked the checkbox to make\n // the label and edge colours the same.\n [\"label_colour\", ui.selection, sync_targets, this.colour === colour],\n changes,\n );\n break;\n case ColourPicker.TARGET.Edge:\n changes = [colour_change];\n if (sync_targets) {\n changes.push(label_colour_change);\n }\n ui.history.add_or_modify_previous(\n ui,\n [\"colour\", ui.selection, sync_targets, this.colour === colour],\n changes,\n );\n break;\n }\n }", "title": "" }, { "docid": "a79edb37f37e374a3557375f9ff4d6a9", "score": "0.5391783", "text": "getChecked() {\n return this._checked;\n }", "title": "" }, { "docid": "3668d6944356bf0276690dc3fd51957b", "score": "0.53705746", "text": "function getThemeColorFromCss(style){var $span=$(\"<span></span>\").hide().appendTo(\"body\");$span.addClass(style);var color=$span.css(\"color\");$span.remove();return color;}//Handle RTL SUpport for Changer CheckBox", "title": "" }, { "docid": "a65220de2e1e7edc3f893a6d78727be3", "score": "0.5370006", "text": "get checked() { return this._checked; }", "title": "" }, { "docid": "a65220de2e1e7edc3f893a6d78727be3", "score": "0.5370006", "text": "get checked() { return this._checked; }", "title": "" }, { "docid": "a65220de2e1e7edc3f893a6d78727be3", "score": "0.5370006", "text": "get checked() { return this._checked; }", "title": "" }, { "docid": "a65220de2e1e7edc3f893a6d78727be3", "score": "0.5370006", "text": "get checked() { return this._checked; }", "title": "" }, { "docid": "c6fd0780a7df334e696a9dfb21059a88", "score": "0.53535", "text": "get selectedDateTextColor() {\n return brushToString(this.i.b1);\n }", "title": "" }, { "docid": "98da76fef634d901cd22f6611b09563d", "score": "0.53469306", "text": "get checked() {\n return this.getChecked();\n }", "title": "" }, { "docid": "2e6b765bc7f50b786cae83547386003a", "score": "0.53446406", "text": "static get checkedRadio() {\n return Glyph._byLocation(4, 4, 'checked');\n }", "title": "" }, { "docid": "e5d162d7dd40b8fb1548eb0966c615c0", "score": "0.53429663", "text": "get fabDisabledBackgroundColor() {\n return brushToString(this.i.sl);\n }", "title": "" }, { "docid": "04ef80e51c4cb25c9f6f118146dfda1b", "score": "0.5339164", "text": "get raisedBackgroundColor() {\n return brushToString(this.i.tv);\n }", "title": "" }, { "docid": "989cc6b5d4a420f9d34e4127faecfeab", "score": "0.53294426", "text": "get selectedDateBackgroundColor() {\n return brushToString(this.i.b0);\n }", "title": "" }, { "docid": "61bde7e3dbc503b53562188db01c9d36", "score": "0.53250474", "text": "get backgroundColor() {\n return brushToString(this.i.nk);\n }", "title": "" }, { "docid": "6666e53b799b5a00d64ac79daaf317e0", "score": "0.5320062", "text": "get color() {\n return this._color ||\n (this.radioGroup && this.radioGroup.color) ||\n this._providerOverride && this._providerOverride.color || 'accent';\n }", "title": "" }, { "docid": "996462be47d69c1c585e204a8653af7d", "score": "0.5316467", "text": "getLineStyle(i){\n var className = \"unselectedLine\";\n if(this.state.checked1 === i){\n className=\"selectedLineBlue\";\n } else if (this.state.checked2 === i){\n className=\"selectedLineRed\";\n }\n return className;\n }", "title": "" }, { "docid": "9f98be06af6ada75752ac57289212a7c", "score": "0.5310062", "text": "function setStylesForCheckedOptions(){\n\t\t$(\"#cart input.add_price:checked, #cart input.add_price_delivery:checked, #cart input.add_price_paint:checked\")\n\t\t.each(function(){\n\t\t\t$(this).parent('td').parent('tr.block_product_price').css('color', '#006080');\n\t\t\t$(this).parent('td').parent('tr.block_product_price').css('background', '#b5d9f0');\n\t\t});\n\t}", "title": "" }, { "docid": "6da83d80e1c6349eaf5397fb4f096072", "score": "0.53083855", "text": "get outlinedDisabledBackgroundColor() {\n return brushToString(this.i.tm);\n }", "title": "" }, { "docid": "43374e79707b79c9c16e6927cff8c672", "score": "0.52990437", "text": "get checked() {\n return this.input.checked;\n }", "title": "" }, { "docid": "43374e79707b79c9c16e6927cff8c672", "score": "0.52990437", "text": "get checked() {\n return this.input.checked;\n }", "title": "" }, { "docid": "1ecb6fd7e36408509464acbc44bb8008", "score": "0.52894175", "text": "get color() {\n if (this.state.clicked) {\n return colors.ctaContrast;\n }\n\n return (this.props.disabled && !this.props.loading) ? colors.shade5 : colors.cta;\n }", "title": "" }, { "docid": "82090883eac85a41a15024b4c6db88fe", "score": "0.5276204", "text": "get backgroundColor() {\n return brushToString(this.i.bv);\n }", "title": "" }, { "docid": "c828fdda7feacd1e7188d7ad6421b3eb", "score": "0.5272041", "text": "function colorPickerChanged() {\n document.getElementById('useColor').checked = true;\n customColorSelected = true;\n}", "title": "" }, { "docid": "1eb859cd5e580bad0b2acb5e179ef1e6", "score": "0.5268204", "text": "get flatDisabledBackgroundColor() {\n return brushToString(this.i.sw);\n }", "title": "" }, { "docid": "a2dc45177356ea768609f3f8083cf9ad", "score": "0.5252445", "text": "green(val) {\n this._green = val;\n return this;\n }", "title": "" }, { "docid": "f95d516c1caade108060e0315f17d21f", "score": "0.5240079", "text": "function changeCheckboxIcon(selector, onOrOff)\n{\n var unchecked = \"fa-square-o\";\n var checked = \"fa-check-square-o\";\n\n if (onOrOff) {\n $(selector).removeClass( unchecked );\n $(selector).addClass( checked );\n } else {\n $(selector).removeClass( checked );\n $(selector).addClass( unchecked );\n }\n}", "title": "" }, { "docid": "86879de11a31460639b9bc40181ba577", "score": "0.5237235", "text": "get flatBackgroundColor() {\n return brushToString(this.i.su);\n }", "title": "" }, { "docid": "c1a23c13f72e3c4301c87ae6a740cd8a", "score": "0.52371675", "text": "function status(element){\n let addId = element.id.replace(\"cb_\", \"\");\n let item = document.getElementById('item_' + addId);\n if(element.checked) {\n item.style.textDecoration = \"line-through\";\n item.style.color = \"#1152C5\";\n } else {\n item.style.textDecoration = \"none\";\n item.style.color = \"black\";\n }\n}", "title": "" }, { "docid": "10dd91442cebb7dfe26447f7a4895560", "score": "0.5224762", "text": "get flatRippleColor() {\n return brushToString(this.i.s3);\n }", "title": "" }, { "docid": "87de413ac9664495ffcedb3e2eb4ee09", "score": "0.5223112", "text": "function chooseColorLightGreen(){\n if (inputField.style.backgroundColor != \"darkslategrey\") {\n inputField.style.backgroundColor = \"darkslategrey\";\n backgdColor = \"darkslategrey\";\n return backgdColor;\n }\n }", "title": "" }, { "docid": "d8a8cf0192e19e1b7e9c8fd2c519c7f3", "score": "0.52165383", "text": "get selectedFocusDateBackgroundColor() {\n return brushToString(this.i.b2);\n }", "title": "" }, { "docid": "4e62aa7ae26c773fe71cd7ff6e4c9790", "score": "0.52110535", "text": "function styleCheckbox(table) {\r\n\t/**\r\n\t\t$(table).find('input:checkbox').addClass('ace')\r\n\t\t.wrap('<label />')\r\n\t\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n\t*/\r\n\t}", "title": "" }, { "docid": "4e62aa7ae26c773fe71cd7ff6e4c9790", "score": "0.52110535", "text": "function styleCheckbox(table) {\r\n\t/**\r\n\t\t$(table).find('input:checkbox').addClass('ace')\r\n\t\t.wrap('<label />')\r\n\t\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n\t*/\r\n\t}", "title": "" }, { "docid": "4e62aa7ae26c773fe71cd7ff6e4c9790", "score": "0.52110535", "text": "function styleCheckbox(table) {\r\n\t/**\r\n\t\t$(table).find('input:checkbox').addClass('ace')\r\n\t\t.wrap('<label />')\r\n\t\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n\t*/\r\n\t}", "title": "" }, { "docid": "f7d2e55dd7aa810b62b2d03af1369104", "score": "0.5205776", "text": "get raisedDisabledBackgroundColor() {\n return brushToString(this.i.tx);\n }", "title": "" }, { "docid": "bf8b3ed29de8723d84b01df41da9bb99", "score": "0.5201204", "text": "get raisedTextColor() {\n return brushToString(this.i.t5);\n }", "title": "" }, { "docid": "0cbd646167207ba957104933c278e04f", "score": "0.5199132", "text": "get outlinedFocusBackgroundColor() {\n return brushToString(this.i.tp);\n }", "title": "" }, { "docid": "aa7c6410287c651b025658fb16468eca", "score": "0.51854354", "text": "function ComprobarCheckBoton(btn, obj) {\n if (obj.checked == false) {\n obj.checked = true;\n btn.style.backgroundColor = \"#173e43\";\n btn.style.color = \"#fff\";\n } else {\n obj.checked = false;\n btn.style.backgroundColor = \"#fff\";\n btn.style.color = \"#8b8989\";\n }\n}", "title": "" }, { "docid": "5ca5c86d4afe536e0ae67f8d67a46cd4", "score": "0.5182636", "text": "function toggleColor() {\n if (document.getElementById(\"useColor\").checked) {\n // Pretend the category name changed, this selects the color\n categoryNameChanged();\n } else {\n document.getElementById(\"categoryColor\").color = \"transparent\";\n customColorSelected = false;\n }\n}", "title": "" }, { "docid": "8c2238fdbb7e0f0546896f9be9014403", "score": "0.5168042", "text": "onColorChanged() {\n if (this._colorChanged) {\n this._colorChanged.raise();\n }\n this.txtHex.value = this.color.toString().toUpperCase();\n this.lblIndicator.css({ background: this.color.toString() });\n this.drawPalette();\n }", "title": "" }, { "docid": "e35f737ebae6a63c3d1ef3c2ad43d31a", "score": "0.515986", "text": "get raisedFocusTextColor() {\n return brushToString(this.i.t1);\n }", "title": "" }, { "docid": "4a79d24ead33f3fdad47c4b868137c3a", "score": "0.5154639", "text": "function onCbxChanged(state) {\n alert(\"checkbox changed\");\n var area = document.getElementById(\"text-area\");\n area.style.fontWeight = \"bold\";\n if (document.getElementById(\"checkbox\").checked) {\n area.style.fontWeight = \"bold\";\n area.style.color = \"green\";\n area.style.textDecoration = \"underline\";\n } else {\n area.style.fontWeight = \"\";\n area.style.color = \"\";\n area.style.textDecoration = \"\";\n }\n}", "title": "" }, { "docid": "cbbe3553fafca7df1d8590259c7f14e7", "score": "0.5147785", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "title": "" }, { "docid": "648405c5dae0d8319f7b1879d288223a", "score": "0.51406574", "text": "get textColor() {\n return brushToString(this.i.t7);\n }", "title": "" }, { "docid": "72ee887af27d436f29154183f75b285e", "score": "0.51399213", "text": "function mark() {\n var current = document.getElementById(\"selected\");\n current.style.backgroundColor = \"yellow\";\n}", "title": "" }, { "docid": "8b68541518f4dfb96664e058166b26d2", "score": "0.5137778", "text": "static SetChecked() {}", "title": "" }, { "docid": "48ec5182cfd34c345869bbda90318b6c", "score": "0.5136904", "text": "get raisedFocusBackgroundColor() {\n return brushToString(this.i.t0);\n }", "title": "" }, { "docid": "b0f5512832f1c5e72e63681940d4a86e", "score": "0.51354885", "text": "changeColor(item, value) {\r\n\t\tlet currentColor = item.style(\"fill\"),\r\n\t\t\tthat = this;\r\n\t\tif(currentColor === this.unselectedColor){\r\n\t\t\titem.style(\"fill\", function(){\r\n\t\t\t\t\r\n\t\t\t\treturn that.getColor(value);\r\n\t\t\t});\r\n\t\t}\r\n\t\telse{\r\n\t\t\titem.style(\"fill\", that.unselectedColor);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "2939581e6dc1595c2c1925d6ab5c6cc2", "score": "0.5133432", "text": "setGreen(value) {\n this.green = value;\n }", "title": "" }, { "docid": "26adf4f35e1e752fa1b91109fc7b3e7c", "score": "0.51284623", "text": "function getColor() {\r\n\t\treturn \t'#007913';\r\n\t}", "title": "" }, { "docid": "620371ee9b6a8aed5dbcb0c13760eb57", "score": "0.51168656", "text": "static get green() {\n if (!this._green) {\n this._green = new Color(0, 128, 0);\n }\n return this._green;\n }", "title": "" }, { "docid": "33fc1ebf9ab67041b680781ff2d0d620", "score": "0.5116648", "text": "function styleCheckbox(table) {\r\n\t\t/**\r\n\t\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\r\n\t\t * .after('<span class=\"lbl align-top\" />')\r\n\t\t * \r\n\t\t * \r\n\t\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\r\n\t\t * />').after('<span class=\"lbl align-top\" />');\r\n\t\t */\r\n\t}", "title": "" }, { "docid": "d03e9aacbe08c2b112b7791e1eed0783", "score": "0.51061696", "text": "function getFillStyle()\n{\n var empty = document.getElementById(\"empty\").checked; //boolean\n var filled = document.getElementById(\"filled\").checked; //boolean\n if (empty) \n {\n globalFillStyle = \"#FFFFFF\";\n }\n else if (filled) \n {\n if (!(grdYesOrNo))\n {\n globalFillStyle = fillColor;\n }\n };\n}", "title": "" }, { "docid": "3e96406030fb8e5a1dac9dacbad2ddb4", "score": "0.5096601", "text": "function checkOff() {\n $(this).toggleClass(\"completed\");\n // if ($(this).css(\"color\") === COMPLETED_COLOR) {\n //\n // $(this).css(\"color\", INCOMPLETE_COLOR);\n // $(this).css(\"text-decoration\", \"none\");\n // }\n // else {\n //\n // $(this).css(\"color\", COMPLETED_COLOR);\n // $(this).css(\"text-decoration\", \"line-through\");\n // }\n}", "title": "" }, { "docid": "1c90210a0f066bf5988d96ac8771853b", "score": "0.5093568", "text": "getHoverLineStyle(i){\n var className = \"onHoverGray\";\n if(this.state.checked1===undefined){\n className=\"onHoverBlue\";\n } else if (this.state.checked2===undefined){\n className=\"onHoverRed\";\n }\n return className;\n }", "title": "" }, { "docid": "67815c3278e3b88736814737b15f5d4d", "score": "0.50904775", "text": "checked(item) {\n if (this.colors.indexOf(item) != -1) {\n return true;\n }\n }", "title": "" }, { "docid": "0f9e060153e145a4caa5c877f6aad6fa", "score": "0.5087349", "text": "get outlinedRippleColor() {\n return brushToString(this.i.tt);\n }", "title": "" }, { "docid": "bdea763b666b1b80c7a545aad29e0dd5", "score": "0.5080703", "text": "get textColor() {\n return brushToString(this.i.b3);\n }", "title": "" }, { "docid": "10c3c93d7c9b006ac7df1b3d86b9705f", "score": "0.5077646", "text": "function pickAppropriateCheckbox({\n checked,\n selectAllCheckboxState,\n disabled,\n}) {\n if (typeof checked === 'boolean') {\n switch (checked) {\n case true:\n return <Icon name=\"Checkbox\" />;\n case false:\n return (\n <Icon name=\"CheckboxBaseline\" color={disabled ? '#CCC' : '#777'} />\n );\n default:\n return null;\n }\n }\n\n if (typeof selectAllCheckboxState === 'string') {\n switch (selectAllCheckboxState) {\n case 'all':\n return <Icon name=\"Checkbox\" />;\n case 'some':\n return <Icon name=\"CheckboxIndetermined\" />;\n default:\n return (\n <Icon name=\"CheckboxBaseline\" color={disabled ? '#CCC' : '#777'} />\n );\n }\n }\n}", "title": "" }, { "docid": "df5e638119c2524ed422e8d4b6827542", "score": "0.50713044", "text": "function bgCheckbox(){\n var checkbox = $('.check_list input:checkbox');\n checkbox.each(function(){\n if ($(this).is(':checked'))\n $(this).hide().after('<div class=\"class_checkbox checked\"></div>');\n else\n $(this).hide().after('<div class=\"class_checkbox\" />');\n });\n\n $('.class_checkbox').on('click',function(e){\n $(this).toggleClass('checked');\n $(this).prev().prop('checked',$(this).is('.checked'));\n e.preventDefault();\n });\n\n $('.check_list label > span').on('click',function(e){\n $(this).prev().toggleClass('checked').prev().prop('checked',$(this).prev().is('.checked'));\n e.preventDefault();\n });\n }", "title": "" }, { "docid": "caaf3899e8731e2ba78ae7c48a7caa23", "score": "0.5068939", "text": "get checked() {\n return this.getChecked();\n }", "title": "" }, { "docid": "284ac1947cc7d157b4310c563546b2c1", "score": "0.506847", "text": "get flatTextColor() {\n return brushToString(this.i.s4);\n }", "title": "" }, { "docid": "b09893dda8cd6dda888ed7fbed48f2ad", "score": "0.50585234", "text": "function checkbox(name, id, checked) { \n if (name == '' ) {\n var el = '</ul> <ul class=\"unstyled\">';\n } else {\n var el =\n '<label style=\"color: '+colorOfFilter[id]+'\" class=\"checkbox inline\" for=\"' + id + '\">' +\n '<input type=\"checkbox\" class=\"checkbox\" id=\"' + id + '\" name=\"' + id + '\"' + (checked ? \"checked\" : \"\") + '/>' + name +\n '</label>';\n }\n return el;\n}", "title": "" }, { "docid": "8070fec25db9d2cceadc064a3a574454", "score": "0.5051583", "text": "get flatFocusTextColor() {\n return brushToString(this.i.s0);\n }", "title": "" }, { "docid": "1f36b25024de0f4ca3e5062b1ec4096e", "score": "0.5048032", "text": "get textColor() {\r\n return brushToString(this.i.textColor);\r\n }", "title": "" }, { "docid": "8cb470fb206e2ba5902f7b6100a0aad2", "score": "0.5039796", "text": "get focusBackgroundColor() {\n return brushToString(this.i.s5);\n }", "title": "" }, { "docid": "41e913dd01eabb5a2df206e469059664", "score": "0.50341564", "text": "setRed(value) {\n this.red = value;\n }", "title": "" }, { "docid": "e8b6d7ca94d93a3e9f97c248fbb2e0ed", "score": "0.50329447", "text": "get fabTextColor() {\n return brushToString(this.i.st);\n }", "title": "" }, { "docid": "ccec0a677eaada2a0829b0c1b8bb2e43", "score": "0.5025365", "text": "function checked() {\n var getTodosChecked = document.querySelectorAll('.todos_todo_checkbox');\n var getTodosCheckedCustom = document.querySelectorAll('.todos_todo_custom-checkbox');\n for(var i = 0; i < todos.length; i++) {\n if(todos[i].completed === true) {\n getTodosChecked[i].checked = true;\n getTodosCheckedCustom[i].classList.add('js-checked');\n } else {\n getTodosCheckedCustom[i].classList.remove('js-checked');\n getTodosChecked[i].checked = false;\n }\n }\n}", "title": "" }, { "docid": "452ce373fdcf274e2962ca01b5173b5e", "score": "0.5025311", "text": "function checkboxBeige() {\n if (checkBeige.prop(\"checked\", true)) {\n productosFiltradosColor(\"beige\");\n } else {\n vaciarAgregar();\n }\n}", "title": "" }, { "docid": "53c686ad9eae3bb6ea19f02b4359ae0c", "score": "0.5024595", "text": "function checkboxKeydownListener(e)\n{\n e = e || window.event;\n const key = e.which || e.keyCode;\n if (key === KEY.ENTER)\n {\n this.checked = !this.checked;\n if (initialValues[this.id] == this.checked)\n {\n this.parentNode.children[0].style.color = null;\n }\n else\n {\n this.parentNode.children[0].style.color = changedColor.s();\n }\n }\n}", "title": "" }, { "docid": "cb36e0236a0db92f9ce7517ff02fae2b", "score": "0.5023751", "text": "get checkedButton() {\n return this._checkedButton;\n }", "title": "" } ]
c65c04f10ee1789dac8a1a7c4512799e
Create a component. Normalizes differences between PFC's and classful Components.
[ { "docid": "537e340786fcf70dab0f337a1e742f58", "score": "0.7159537", "text": "function createComponent(Ctor, props, context) {\n\t\tvar list = components[Ctor.name],\n\t\t inst;\n\n\t\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\t\tinst = new Ctor(props, context);\n\t\t\tComponent.call(inst, props, context);\n\t\t} else {\n\t\t\tinst = new Component(props, context);\n\t\t\tinst.constructor = Ctor;\n\t\t\tinst.render = doRender;\n\t\t}\n\n\t\tif (list) {\n\t\t\tfor (var i = list.length; i--;) {\n\t\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\t\tlist.splice(i, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn inst;\n\t}", "title": "" } ]
[ { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "e89d86338cebe1b5c4d60a18d94d6077", "score": "0.7187746", "text": "function createComponent(Ctor, props, context) {\n\tvar list = components[Ctor.name],\n\t inst;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\tif (list) {\n\t\tfor (var i = list.length; i--;) {\n\t\t\tif (list[i].constructor === Ctor) {\n\t\t\t\tinst.nextBase = list[i].nextBase;\n\t\t\t\tlist.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn inst;\n}", "title": "" }, { "docid": "7030ea3e8de6d3c20ca60c98a32c3f63", "score": "0.7152728", "text": "function createComponent(Ctor, props, context) {\n var list = components[Ctor.name],\n inst;\n\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context);\n Component.call(inst, props, context);\n } else {\n inst = new Component(props, context);\n inst.constructor = Ctor;\n inst.render = doRender;\n }\n\n if (list) {\n for (var i = list.length; i--;) {\n if (list[i].constructor === Ctor) {\n inst.nextBase = list[i].nextBase;\n list.splice(i, 1);\n break;\n }\n }\n }\n\n return inst;\n}", "title": "" }, { "docid": "a5ea0fac58e96c6762920fb6e5e7f9b4", "score": "0.7045183", "text": "function _default(ToMix) {\n var CreateComponent = /*#__PURE__*/function (_ToMix) {\n _inherits(CreateComponent, _ToMix);\n\n var _super = _createSuper(CreateComponent);\n /**\n * The component instances managed by this component.\n * Releasing this component also releases the components in `this.children`.\n * @type {Component[]}\n */\n\n /**\n * Mix-in class to manage lifecycle of component.\n * The constructor sets up this component's effective options,\n * and registers this component't instance associated to an element.\n * @implements Handle\n * @param {HTMLElement} element The element working as this component.\n * @param {object} [options] The component options.\n */\n\n\n function CreateComponent(element) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CreateComponent);\n\n _this = _super.call(this, element, options);\n _this.children = [];\n\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n throw new TypeError('DOM element should be given to initialize this widget.');\n }\n /**\n * The element the component is of.\n * @type {Element}\n */\n\n\n _this.element = element;\n /**\n * The component options.\n * @type {object}\n */\n\n _this.options = Object.assign(Object.create(_this.constructor.options), options);\n\n _this.constructor.components.set(_this.element, _assertThisInitialized(_this));\n\n return _this;\n }\n /**\n * Instantiates this component of the given element.\n * @param {HTMLElement} element The element.\n */\n\n\n _createClass(CreateComponent, [{\n key: \"release\",\n\n /**\n * Releases this component's instance from the associated element.\n */\n value: function release() {\n for (var child = this.children.pop(); child; child = this.children.pop()) {\n child.release();\n }\n\n this.constructor.components[\"delete\"](this.element);\n return null;\n }\n }], [{\n key: \"create\",\n value: function create(element, options) {\n return this.components.get(element) || new this(element, options);\n }\n }]);\n\n return CreateComponent;\n }(ToMix);\n\n return CreateComponent;\n }", "title": "" }, { "docid": "976471ec87311cef5ccb584889aaa3c7", "score": "0.6964955", "text": "function _create (state, vel) {\n let comp = vel._comp\n console.assert(!comp, 'Component instance should not exist when this method is used.')\n let parent = vel.parent._comp\n // making sure the parent components have been instantiated\n if (!parent) {\n parent = _create(state, vel.parent)\n }\n // TODO: probably we should do something with forwarded/forwarding components here?\n if (vel._isVirtualComponent) {\n console.assert(parent, 'A Component should have a parent.')\n comp = state.componentFactory.createComponent(vel.ComponentClass, parent, vel.props)\n // HACK: making sure that we have the right props\n // TODO: instead of HACK add an assertion, and make otherwise sure that vel.props is set correctly\n vel.props = comp.props\n if (vel._forwardedEl) {\n let forwardedEl = vel._forwardedEl\n let forwardedComp = state.componentFactory.createComponent(forwardedEl.ComponentClass, comp, forwardedEl.props)\n // HACK same as before\n forwardedEl.props = forwardedComp.props\n comp._forwardedComp = forwardedComp\n }\n } else if (vel._isVirtualHTMLElement) {\n comp = state.componentFactory.createElementComponent(parent, vel)\n } else if (vel._isVirtualTextNode) {\n comp = state.componentFactory.createTextNodeComponent(parent, vel)\n }\n if (vel._ref) {\n comp._ref = vel._ref\n }\n if (vel._owner) {\n comp._owner = vel._owner._comp\n }\n vel._comp = comp\n return comp\n}", "title": "" }, { "docid": "c5d803c7c9333fa6ed847c2c0964f4ce", "score": "0.68919003", "text": "createComponent(component = most.empty()) {\n //bindings is stream of bindings to apply to this view\n //a component without bindings is in general a data Component\n return component\n }", "title": "" }, { "docid": "defcf648334ff913a3181641b7ed9c65", "score": "0.6828505", "text": "function Component() {}", "title": "" }, { "docid": "4f5a7f19ef4c464eb5c14a4c533efd6e", "score": "0.65540475", "text": "function makeComponentInstance (type, id, name, options, callback)\n {\n if (typeof id == STRING && ComponentInstances.unique[id] != null)\n {\n var msg = 'The component with id \"'+id+'\" already exists. Creating operation was canceled.';\n $R.error($R.error.core(), 'Component instance creating error', null, {\n message:msg,\n type:type,\n name:name,\n options:options,\n id:id\n });\n throw msg;\n return;\n }\n var com = new Component (type, name, options, callback, id);\n ComponentInstances.all.push(com);\n if (typeof id == STRING)\n {\n ComponentInstances.unique[id] = com;\n }\n return com;\n }", "title": "" }, { "docid": "7f599e8850173234d96a96f9a4b8828e", "score": "0.6538266", "text": "createComponent(name, component, metadata, callback) {\n let implementation = component;\n if (!implementation) {\n return callback(new Error(`Component ${name} not available`));\n }\n\n // If a string was specified, attempt to `require` it.\n if (typeof implementation === 'string') {\n if (typeof registerLoader.dynamicLoad === 'function') {\n registerLoader.dynamicLoad(name, implementation, metadata, callback);\n return;\n }\n return callback(Error(`Dynamic loading of ${implementation} for component ${name} not available on this platform.`));\n }\n\n // Attempt to create the component instance using the `getComponent` method.\n if (typeof implementation.getComponent === 'function') {\n var instance = implementation.getComponent(metadata);\n // Attempt to create a component using a factory function.\n } else if (typeof implementation === 'function') {\n var instance = implementation(metadata);\n } else {\n callback(new Error(`Invalid type ${typeof(implementation)} for component ${name}.`));\n return;\n }\n\n if (typeof name === 'string') { instance.componentName = name; }\n return callback(null, instance);\n }", "title": "" }, { "docid": "cafd2128510ca3d0bbf408e04c38e46c", "score": "0.63275015", "text": "createComponentinDom(component) {\n const componentRef = this.componentFactoryResolver\n .resolveComponentFactory(component)\n .create(this.injector);\n // 2. Attach component to the appRef so that it's inside the ng component tree\n this.appRef.attachView(componentRef.hostView);\n return componentRef;\n }", "title": "" }, { "docid": "2956dc36f7204d7d853caaabe3a694cd", "score": "0.6298004", "text": "function ComponentFactory(componentName, componentUsage, componentOptions, componentVariable) {\n this.componentName = componentName;\n this.componentUsage = componentUsage;\n this.componentOptions = componentOptions;\n if (componentVariable != null) {\n this.componentVariable = componentVariable;\n }\n }", "title": "" }, { "docid": "961dd6b25282f735ee7da9d4790f09a9", "score": "0.6285821", "text": "function createClass(spec) {\n if (Component) {\n throw new Error('createClass may only be called once for a given updater.');\n }\n\n Component = injectMixinAndAssimilatePrototype(spec);\n return Component;\n }", "title": "" }, { "docid": "9d6914d72ec35159e3c8389159c5a402", "score": "0.62598246", "text": "function ComponentType(){}", "title": "" }, { "docid": "41e19928a95eaceecc61a545802f6666", "score": "0.6233446", "text": "function createComponent(name, props = {}) {\n const { children = [], ...attributes } = props;\n const element = document.createElement(name);\n Object.keys(attributes).forEach((attribute) => {\n element[attribute] = attributes[attribute];\n });\n children.forEach((child) => element.appendChild(child));\n\n return element;\n}", "title": "" }, { "docid": "fdd849a09f1dd526bd54ed2eb60bf58f", "score": "0.62317353", "text": "addComponent (Component, props) {\n if (this.destroyed) return\n let component\n\n // Check if the component is already an instance, if not, instanciate-it\n if (!Component) Component = PixiComponent\n component = Component.components ? Component : new Component(props)\n\n // Check if layer prop is present: if it is, declare the component as linked component\n if (component.props.layer) {\n component.linked = true\n component.layer = component.props.layer\n }\n\n // Call setup to create component sprites, base, container, etc\n component.setup(component.props)\n\n // If this is a linked component, add it to its scene layer\n // If not, add it to the parent base component\n if (component.base) {\n if (component.linked && component.layer) {\n if (!scene[component.layer]) throw Error('Layer ' + component.layer + ' doesn\\'t exist')\n scene[component.layer].addChild(component.base)\n } else if (this.base) {\n this.base.addChild(component.base)\n }\n }\n\n this.components.push(component)\n component._parent = this\n\n // Call did mount and force a first resize call for convenience\n component.componentDidMount(props)\n component.resize(store.size.get())\n\n return component\n }", "title": "" }, { "docid": "5759c6f80ddcdf0f7823f92cfb275ee3", "score": "0.61737937", "text": "function createComponent(conf, filename) {\n // create a mixin with the defined lifecycle events\n var events = {};\n for (var i = 0, event; i < lifecycle.length; i++) {\n event = lifecycle[i];\n if (conf[event]) events[event] = conf[event];\n }\n\n // load the standard mixins\n var mixins = [\n loadingStatus,\n events\n ].concat(conf.mixins || []);\n\n var component = {\n displayName: conf.displayName,\n\n mixins: mixins,\n\n contextTypes: merge({\n canary: ReactObj,\n errorHandler: ReactFunc,\n events: ReactFunc,\n format: ReactObj,\n forms: ReactObj,\n router: ReactObj,\n store: ReactObj.isRequired,\n translate: ReactObj,\n }, conf.contextTypes),\n\n __onus_onStoreChange: function(href) {\n var self = this;\n self.isMounted() && self.forceUpdate();\n },\n\n componentWillMount: function() {\n var self = this;\n var context = self.context;\n\n var store = self._store = context.store.context(self.__onus_onStoreChange);\n if (context.store.getAsync) self.getAsync = context.store.getAsync.bind(context.store);\n self._t = self._t || context.translate ? context.translate.context(store) : noop;\n if (context.canary) self.canary = context.canary.context(self.__onus_onStoreChange);\n\n Object.defineProperties(self, {\n forms: {\n get: function() {\n return context.forms;\n }\n },\n router: {\n get: function() {\n return context.router;\n }\n },\n location: {\n get: function() {\n return context.router.location;\n }\n }\n });\n\n self._error_handler = self._error_handler || context.errorHandler || noop;\n\n if (module.hot) {\n self.__onusComponentId = nextComponentId++;\n (conf.__subs = conf.__subs || {})[self.__onusComponentId] = function() {\n self.forceUpdate();\n };\n }\n\n if (conf.componentWillMount) conf.componentWillMount.call(this);\n },\n\n componentWillUnmount: function() {\n var self = this;\n if (module.hot) delete conf.__subs[self.__onusComponentId];\n self._store.destroy();\n if (self.canary) self.canary.destroy();\n },\n\n statics: conf.statics,\n\n _DOM: conf._DOM || createDomFn(conf, dom),\n\n _yield: conf._yield || _yield,\n\n _render: conf._render || createRenderFn(conf, dom),\n\n // TODO\n _error: function(DOM,\n get,\n props,\n state,\n _yield,\n params,\n query,\n forms,\n t,\n err) {\n if (err) console.error(err.stack || err);\n return false;\n },\n\n equalPairs: function() {\n var a = arguments;\n for (var i = 0; i < a.length; i+=2) {\n if (!this.isEqual(a[i], a[i + 1])) return false;\n }\n return true;\n },\n\n isEqual: function(a, b) {\n var typeA = typeof a;\n var typeB = typeof b\n // the types have changed\n if (typeA !== typeB) return false;\n // scalars\n if (a === b) return true;\n // defined values\n if (a && b) {\n if (typeof a.__hash !== 'undefined' && typeof b.__hash !== 'undefined') return a.__hash === b.__hash;\n if (typeof a.hashCode === 'function' && typeof b.hashCode === 'function') return a.hashCode() === b.hashCode();\n }\n // TODO add other comparisons\n return false;\n },\n\n loadedClassName: conf.loadedClassName || 'is-loaded',\n\n loadingClassName: conf.loadingClassName || 'is-loading',\n\n componentClassName: conf.componentClassName || conf.displayName + '-component',\n\n render: function() {\n // TODO see if we can cache this\n // TODO detect any recursive re-renders\n if (process.env.NODE_ENV === 'development') {\n if (typeof window !== 'undefined') {\n onus.renderCounts[conf.displayName] |= 0;\n onus.renderCounts[conf.displayName]++;\n onus.renderTotal++;\n }\n }\n\n return this._render();\n }\n };\n\n if (conf.initialState) component.getInitialState = function() {\n var state = {};\n for (var k in conf.initialState) {\n state[k] = conf.initialState[k];\n }\n return state;\n };\n\n for (var k in conf) {\n if (component[k] || !conf.hasOwnProperty(k) || events[k]) continue;\n component[k] = conf[k];\n }\n\n return React.createClass(component);\n}", "title": "" }, { "docid": "4714c749ac6f1a03ecc1c9a13e2f99d4", "score": "0.6065377", "text": "function createComponent(node)\n {\n var title = node.nodeName.toLowerCase();\n return new Promise(function(resolve, reject){\n if(!czosnek.isRegistered(title)) {\n fetchComponentVM(title)\n .then(function(){ return mapComponent(node) })\n .then(function(map){ resolve(map.component) })\n .catch(function(e){\n e.message = 'Failed to fetch component: ' + title;\n reject(e);\n })\n }\n else\n {\n resolve(mapComponent(node).component);\n }\n })\n }", "title": "" }, { "docid": "9a7e6eec8d8bc4e6c84c61504fcd3928", "score": "0.60639447", "text": "function createComponentFactory(selector,componentType,viewDefFactory,inputs,outputs,ngContentSelectors){return new ComponentFactory_(selector,componentType,viewDefFactory,inputs,outputs,ngContentSelectors);}", "title": "" }, { "docid": "d81cdad41cae18abbc5744704587b788", "score": "0.60512", "text": "function activate(context) {\n let disposable = vscode.commands.registerCommand('extension.newReactComponent', function ({fsPath}) {\n const functionalComponent = {\n label: 'Functional Component',\n detail: 'A simple, easy to read component with no state or lifecycle methods.',\n generate: (componentName) =>\n`import React from 'react'\n\nconst ${componentName} = (props) => {\n return (\n <div>\n \n </div>\n )\n}\n\nexport default ${componentName}\n`\n }\n const classComponent = {\n label: 'Class Component',\n detail: 'A component with the ability to add state and lifecycle methods.',\n generate: (componentName) =>\n`import React, { Component } from 'react'\n\nclass ${componentName} extends Component {\n render () {\n return (\n <div>\n \n </div>\n )\n }\n}\n\nexport default ${componentName}\n`\n }\n vscode.window.showQuickPick([\n functionalComponent,\n classComponent,\n ]).then((componentType) => {\n if (!componentType) return vscode.window.showErrorMessage('No component type selected.')\n vscode.window.showInputBox({\n prompt: 'File Name'\n }).then((fsName) => {\n if (!fsName) return vscode.window.showErrorMessage('No file name entered.')\n fsName = fsName.substr(0, 1).toUpperCase() + fsName.substr(1)\n if (!/\\./.test(fsName)) fsName = `${fsName}.js`\n var componentName = fsName.split('.')[0]\n const fullPath = path.join(fsPath, fsName)\n const generate = (componentType.label === functionalComponent.label ? functionalComponent.generate : classComponent.generate)\n const componentText = generate(componentName)\n if (fs.existsSync(fullPath)) return vscode.window.showErrorMessage(`File '${fsName}' already exists.`)\n fs.writeFileSync(fullPath, componentText, 'utf8')\n vscode.window.showInformationMessage(`Created component '${componentName}'.`)\n vscode.workspace.openTextDocument(fullPath)\n .then((doc) => {\n vscode.window.showTextDocument(doc)\n })\n })\n })\n });\n\n context.subscriptions.push(disposable);\n}", "title": "" }, { "docid": "eea89cff2abc47fc7fcdaf2093609bd2", "score": "0.60511917", "text": "create(environment, state, args, dynamicScope, callerSelfRef, hasBlock) {\n // Get the nearest concrete component instance from the scope. \"Virtual\"\n // components will be skipped.\n var parentView = dynamicScope.view; // Get the Ember.Component subclass to instantiate for this component.\n\n var factory = state.ComponentClass; // Capture the arguments, which tells Glimmer to give us our own, stable\n // copy of the Arguments object that is safe to hold on to between renders.\n\n var capturedArgs = args.named.capture();\n var props = processComponentArgs(capturedArgs); // Alias `id` argument to `elementId` property on the component instance.\n\n aliasIdToElementId(args, props); // Set component instance's parentView property to point to nearest concrete\n // component.\n\n props.parentView = parentView; // Set whether this component was invoked with a block\n // (`{{#my-component}}{{/my-component}}`) or without one\n // (`{{my-component}}`).\n\n props[HAS_BLOCK] = hasBlock; // Save the current `this` context of the template as the component's\n // `_target`, so bubbled actions are routed to the right place.\n\n props._target = callerSelfRef.value(); // static layout asserts CurriedDefinition\n\n if (state.template) {\n props.layout = state.template;\n } // caller:\n // <FaIcon @name=\"bug\" />\n //\n // callee:\n // <i class=\"fa-{{@name}}\"></i>\n // Now that we've built up all of the properties to set on the component instance,\n // actually create it.\n\n\n var component = factory.create(props);\n var finalizer = (0, _instrumentation._instrumentStart)('render.component', initialRenderInstrumentDetails, component); // We become the new parentView for downstream components, so save our\n // component off on the dynamic scope.\n\n dynamicScope.view = component; // Unless we're the root component, we need to add ourselves to our parent\n // component's childViews array.\n\n if (parentView !== null && parentView !== undefined) {\n (0, _views.addChildView)(parentView, component);\n }\n\n component.trigger('didReceiveAttrs');\n var hasWrappedElement = component.tagName !== ''; // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components\n\n if (!hasWrappedElement) {\n if (environment.isInteractive) {\n component.trigger('willRender');\n }\n\n component._transitionTo('hasElement');\n\n if (environment.isInteractive) {\n component.trigger('willInsertElement');\n }\n } // Track additional lifecycle metadata about this component in a state bucket.\n // Essentially we're saving off all the state we'll need in the future.\n\n\n var bucket = new ComponentStateBucket(environment, component, capturedArgs, finalizer, hasWrappedElement);\n\n if (args.named.has('class')) {\n bucket.classRef = args.named.get('class');\n }\n\n if (true\n /* DEBUG */\n ) {\n processComponentInitializationAssertions(component, props);\n }\n\n if (environment.isInteractive && hasWrappedElement) {\n component.trigger('willRender');\n }\n\n if (_environment2.ENV._DEBUG_RENDER_TREE) {\n environment.extra.debugRenderTree.create(bucket, {\n type: 'component',\n name: state.name,\n args: args.capture(),\n instance: component,\n template: state.template\n });\n (0, _runtime2.registerDestructor)(bucket, () => {\n environment.extra.debugRenderTree.willDestroy(bucket);\n });\n }\n\n return bucket;\n }", "title": "" }, { "docid": "99c50f5666c27f4553f4205d8712bf9e", "score": "0.6034209", "text": "static create(type, owner) {\n const comp = new ComponentFactory.componentCreators[type](owner);\n comp.__type = type;\n return comp;\n }", "title": "" }, { "docid": "c834c95909b52591ee2b89fe96f9daae", "score": "0.6031474", "text": "function getComponentConstructor ( ractive, name ) {\n\tvar instance = findInstance( 'components', ractive, name );\n\tvar Component;\n\n\tif ( instance ) {\n\t\tComponent = instance.components[ name ];\n\n\t\t// best test we have for not Ractive.extend\n\t\tif ( Component && !Component.Parent ) {\n\t\t\t// function option, execute and store for reset\n\t\t\tvar fn = Component.bind( instance );\n\t\t\tfn.isOwner = instance.components.hasOwnProperty( name );\n\t\t\tComponent = fn();\n\n\t\t\tif ( !Component ) {\n\t\t\t\twarnIfDebug( noRegistryFunctionReturn, name, 'component', 'component', { ractive: ractive });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( typeof Component === 'string' ) {\n\t\t\t\t// allow string lookup\n\t\t\t\tComponent = getComponentConstructor( ractive, Component );\n\t\t\t}\n\n\t\t\tComponent._fn = fn;\n\t\t\tinstance.components[ name ] = Component;\n\t\t}\n\t}\n\n\treturn Component;\n}", "title": "" }, { "docid": "bc98c9dceef0bde9697f7a14a54243ad", "score": "0.6024882", "text": "newComponent() {\n\n if (this._componentPool.length > 0) {\n return this._componentPool.pop();\n }\n\n let templateClass = this.templateClass;\n\n if (templateClass) {\n let instance = new templateClass({});\n for (let child of instance.children) {\n if (child.nodeType != 1) continue;\n child.instance = instance;\n return child;\n }\n console.warn(\"None of the nodes printed by the template are an actual node.\");\n return null;\n }\n\n console.warn(\"No template class to auto stamp\")\n\n return null;\n }", "title": "" }, { "docid": "235e6e9018307cac9bb3504d38531738", "score": "0.5969529", "text": "function create(_, vnode) {\n\t var component = vnode.data.component;\n\t var props = component.props;\n\t var initState = component.initState;\n\t var connect = component.connect;\n\t\n\t // Internal callbacks\n\t\n\t component.lifecycle = {\n\t inserted: inserted,\n\t rendered: rendered\n\t };\n\t\n\t // A stream which only produces one value at component destruction time\n\t var componentDestruction = _most2.default.create(function (add) {\n\t component.lifecycle.destroyed = add;\n\t });\n\t\n\t var events = new _events2.default(componentDestruction);\n\t\n\t component.state = initState(props);\n\t component.elm = vnode.elm;\n\t component.placeholder = vnode;\n\t component.events = events;\n\t\n\t // First render:\n\t // Create and insert the component's content\n\t // while its parent is still unattached for better perfs.\n\t (0, _render.renderComponentSync)(component);\n\t component.placeholder.elm = component.vnode.elm;\n\t component.placeholder.elm.__comp__ = component;\n\t\n\t // Subsequent renders following a state update\n\t var onStream = function onStream(stream, fn) {\n\t return stream.until(componentDestruction).observe(function (val) {\n\t var oldState = component.state;\n\t component.state = fn(oldState, val);\n\t\n\t if (!(0, _shallowEqual2.default)(oldState, component.state)) {\n\t if (_log2.default.stream) console.log('Component state changed', '\\'' + component.key + '\\'', component.state);\n\t (0, _render.renderComponentAsync)(component);\n\t }\n\t });\n\t };\n\t\n\t connect(onStream, events);\n\t events._activate(component.vnode.elm);\n\t}", "title": "" }, { "docid": "896922d7dbaff0898587ea014a93c6d0", "score": "0.59359986", "text": "function ComponentDummy() {}", "title": "" }, { "docid": "0851d376689fb692501d8a202254b339", "score": "0.5929464", "text": "function createFactory(ComponentType, options) {\n if (options === void 0) { options = {}; }\n var _a = options.defaultProp, defaultProp = _a === void 0 ? 'children' : _a;\n var result = function (componentProps, userProps, defaultStyles) {\n // If they passed in raw JSX, just return that.\n if (react__WEBPACK_IMPORTED_MODULE_1__[\"isValidElement\"](userProps)) {\n return userProps;\n }\n // If we're rendering a function, let the user resolve how to render given the original component and final args.\n if (typeof userProps === 'function') {\n var render = function (slotRenderFunction, renderProps) {\n // TODO: _translateShorthand is returning TProps, so why is the finalProps cast required?\n // TS isn't respecting the difference between props arg type and return type and instead treating both as ISlotPropValue.\n var finalRenderProps = _translateShorthand(defaultProp, renderProps);\n finalRenderProps = _constructFinalProps(defaultStyles, componentProps, finalRenderProps);\n return slotRenderFunction(ComponentType, finalRenderProps);\n };\n return userProps(render);\n }\n userProps = _translateShorthand(defaultProp, userProps);\n // TODO: _translateShorthand is returning TProps, so why is the finalProps cast required?\n // TS isn't respecting the difference between props arg type and return type and instead treating both as ISlotPropValue.\n var finalProps = _constructFinalProps(defaultStyles, componentProps, userProps);\n return react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](ComponentType, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, finalProps));\n };\n return result;\n}", "title": "" }, { "docid": "0851d376689fb692501d8a202254b339", "score": "0.5929464", "text": "function createFactory(ComponentType, options) {\n if (options === void 0) { options = {}; }\n var _a = options.defaultProp, defaultProp = _a === void 0 ? 'children' : _a;\n var result = function (componentProps, userProps, defaultStyles) {\n // If they passed in raw JSX, just return that.\n if (react__WEBPACK_IMPORTED_MODULE_1__[\"isValidElement\"](userProps)) {\n return userProps;\n }\n // If we're rendering a function, let the user resolve how to render given the original component and final args.\n if (typeof userProps === 'function') {\n var render = function (slotRenderFunction, renderProps) {\n // TODO: _translateShorthand is returning TProps, so why is the finalProps cast required?\n // TS isn't respecting the difference between props arg type and return type and instead treating both as ISlotPropValue.\n var finalRenderProps = _translateShorthand(defaultProp, renderProps);\n finalRenderProps = _constructFinalProps(defaultStyles, componentProps, finalRenderProps);\n return slotRenderFunction(ComponentType, finalRenderProps);\n };\n return userProps(render);\n }\n userProps = _translateShorthand(defaultProp, userProps);\n // TODO: _translateShorthand is returning TProps, so why is the finalProps cast required?\n // TS isn't respecting the difference between props arg type and return type and instead treating both as ISlotPropValue.\n var finalProps = _constructFinalProps(defaultStyles, componentProps, userProps);\n return react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](ComponentType, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, finalProps));\n };\n return result;\n}", "title": "" }, { "docid": "8122fd3be9cca1f1c1b3d384ef4360a0", "score": "0.5926436", "text": "function Component() {\n\tthis.active = true;\n\tthis.type = 0; \n\t//this.color = \"#fff\";\n //color del componente\n\tthis.color = \"blue\";\n\tthis.radius = 1;\n this.machined = 'null';\n}", "title": "" }, { "docid": "dc2e856ffd22cd94a9610d064250e972", "score": "0.5913424", "text": "function createComponent(bindings) {\n ///$componentController('compoenent name',{ decencies injection}, bindings)\n return $componentController('wdStore', {configApi:mockConfig}, bindings);\n }", "title": "" }, { "docid": "74b605278e4f072a13e11d00e1f273c3", "score": "0.5909171", "text": "function createNewComponent(){\n\t\tif(!isExecutedFromRoot()){\n\t\t\tconsole.log(\"Please run command from application root directory\");\n\t\t\treturn false;\n\t\t}\n\n\t\tgetAppfacConfigFile('component', args.component,function(pluginName,themeName,compName,appfacConfig){\n\n\t\t\tvar path = \"client\";\n\t\t\tif(args.a!=undefined){\n\t\t\t\tpath = \"admin\";\n\t\t\t}\n\n\t\t\tvar pluginConfigFile = process.cwd()+\"/plugins/\"+pluginName+\"/plugin.config.json\";\n\n\t\t\t// check that plugin exist\n\t\t\tvar pluginPath = process.cwd()+\"/plugins/\"+pluginName;\n\t\t\tvar pluginDoesExist = fs.pathExistsSync(pluginPath);\n\t\t\tif(!pluginDoesExist){\n\t\t\t\tconsole.log(\"Plugin does not exist: \"+pluginName);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check that theme exist\n\t\t\tvar themePath = process.cwd()+\"/plugins/\"+pluginName+\"/\"+path+\"/themes/\"+themeName;\n\t\t\tvar themeDoesExist = fs.pathExistsSync(themePath);\n\t\t\tif(!themeDoesExist){\n\t\t\t\tconsole.log(\"Plugin theme does not exist: \"+themeName);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check that component has no spaces and any special characters except _\n\t\t\tvar isNameValid = generalSupport.checkIfValid(compName,[\"_\",\"-\"]);\n\t\t\tif(!isNameValid){\n\t\t\t\tconsole.log(\"Please provide a valid component name\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar configFile = process.cwd()+\"/\"+mainConfigFile;\n\t\t\tvar pluginConfigFile = process.cwd()+\"/plugins/\"+pluginName+\"/plugin.config.json\";\n\t\t\tgeneralSupport.readFile(configFile,function(content){\n\t\t\t\tvar config = JSON.parse(content);\n\n\t\t\t\tgeneralSupport.readFile(pluginConfigFile,function(content2){\n\t\t\t\t\tvar pluginConfig = JSON.parse(content2);\n\n\t\t\t\t\tcompComponentOption(pluginName,themeName,compName,path,config,configFile,pluginConfig,pluginConfigFile);\n\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "907d826a10bfbbe0bdf066ad6e34f331", "score": "0.59002954", "text": "createComponent() {\n const componentRef = this.hostView.createComponent(this.componentFactory);\n this.component = componentRef.instance;\n // Remove the component's DOM because it should be in the overlay container.\n this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement), componentRef.location.nativeElement);\n this.component.setOverlayOrigin({ elementRef: this.origin || this.elementRef });\n this.initProperties();\n this.component.nzVisibleChange.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__[\"distinctUntilChanged\"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__[\"takeUntil\"])(this.destroy$)).subscribe((visible) => {\n this.internalVisible = visible;\n this.visibleChange.emit(visible);\n });\n }", "title": "" }, { "docid": "e132923471c7e35add25eac761b42d0a", "score": "0.5793771", "text": "newComponent(componentType, componentState, title) {\n const componentItem = this.newComponentAtLocation(componentType, componentState, title);\n if (componentItem === undefined) {\n throw new _errors_internal_error__WEBPACK_IMPORTED_MODULE_7__.AssertError('LMNC65588');\n }\n else {\n return componentItem;\n }\n }", "title": "" }, { "docid": "f175e3fc5cb9dfca4c28f73c66f1cdf9", "score": "0.5788799", "text": "function ComponentType() { }", "title": "" }, { "docid": "c77615bb2e43cea71b51a5517a77cdd6", "score": "0.5764547", "text": "function genComponent(\ncomponentName,\nel,\nstate)\n{\nvar children=el.inlineTemplate?null:genChildren(el,state,true);\nreturn \"_c(\"+componentName+\",\"+genData$2(el,state)+(children?\",\"+children:'')+\")\";\n}", "title": "" }, { "docid": "495cbbf11187cfa833cb1479e1dca0c6", "score": "0.5738079", "text": "createInstance(type, props) {\n switch (type) {\n case 'rectangle':\n return new Rectangle(props);\n default:\n throw new Error(`Invalid component type: ${type}`);\n }\n }", "title": "" }, { "docid": "aa69daa224946265395d24e0de5f7fec", "score": "0.5710845", "text": "function createComponent(component) {\n var _a = component.factoryOptions, factoryOptions = _a === void 0 ? {} : _a;\n var defaultProp = factoryOptions.defaultProp;\n var result = function (componentProps) {\n return (\n // TODO: createComponent is also affected by https://github.com/OfficeDev/office-ui-fabric-react/issues/6603\n react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](_uifabric_utilities__WEBPACK_IMPORTED_MODULE_3__[\"CustomizerContext\"].Consumer, null, function (context) {\n // TODO: this next line is basically saying 'theme' prop will ALWAYS be available from getCustomizations\n // via ICustomizationProps cast. Is there mechanism that guarantees theme and other request fields will be defined?\n // is there a static init that guarantees theme will be provided?\n // what happens if createTheme/loadTheme is not called?\n // if so, convey through getCustomizations typing keying off fields. can we convey this\n // all the way from Customizations with something like { { K in fields }: object}? hmm\n // if not, how does existing \"theme!\" styles code work without risk of failing (assuming it doesn't fail)?\n // For now cast return value as if theme is always available.\n var settings = _getCustomizations(component.displayName, context, component.fields);\n var renderView = function (viewProps) {\n // The approach here is to allow state components to provide only the props they care about, automatically\n // merging user props and state props together. This ensures all props are passed properly to view,\n // including children and styles.\n // TODO: for full 'fields' support, 'rest' props from customizations need to pass onto view.\n // however, customized props like theme will break snapshots. how is styled not showing theme output in snapshots?\n var mergedProps = viewProps\n ? tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, componentProps, viewProps) : componentProps;\n var theme = mergedProps.theme || settings.theme;\n var tokens = _resolveTokens(mergedProps, theme, component.tokens, settings.tokens, mergedProps.tokens);\n var styles = _resolveStyles(mergedProps, theme, tokens, component.styles, settings.styles, mergedProps.styles);\n var viewComponentProps = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, mergedProps, { styles: styles,\n tokens: tokens, _defaultStyles: styles });\n return component.view(viewComponentProps);\n };\n return component.state ? react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](component.state, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, componentProps, { renderView: renderView })) : renderView();\n }));\n };\n result.displayName = component.displayName;\n // If a shorthand prop is defined, create a factory for the component.\n // TODO: This shouldn't be a concern of createComponent.. factoryOptions should just be forwarded.\n // Need to weigh creating default factories on component creation vs. memozing them on use in slots.tsx.\n if (defaultProp) {\n result.create = Object(_slots__WEBPACK_IMPORTED_MODULE_4__[\"createFactory\"])(result, { defaultProp: defaultProp });\n }\n Object(_utilities__WEBPACK_IMPORTED_MODULE_5__[\"assign\"])(result, component.statics);\n // Later versions of TypeSript should allow us to merge objects in a type safe way and avoid this cast.\n return result;\n}", "title": "" }, { "docid": "aa69daa224946265395d24e0de5f7fec", "score": "0.5710845", "text": "function createComponent(component) {\n var _a = component.factoryOptions, factoryOptions = _a === void 0 ? {} : _a;\n var defaultProp = factoryOptions.defaultProp;\n var result = function (componentProps) {\n return (\n // TODO: createComponent is also affected by https://github.com/OfficeDev/office-ui-fabric-react/issues/6603\n react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](_uifabric_utilities__WEBPACK_IMPORTED_MODULE_3__[\"CustomizerContext\"].Consumer, null, function (context) {\n // TODO: this next line is basically saying 'theme' prop will ALWAYS be available from getCustomizations\n // via ICustomizationProps cast. Is there mechanism that guarantees theme and other request fields will be defined?\n // is there a static init that guarantees theme will be provided?\n // what happens if createTheme/loadTheme is not called?\n // if so, convey through getCustomizations typing keying off fields. can we convey this\n // all the way from Customizations with something like { { K in fields }: object}? hmm\n // if not, how does existing \"theme!\" styles code work without risk of failing (assuming it doesn't fail)?\n // For now cast return value as if theme is always available.\n var settings = _getCustomizations(component.displayName, context, component.fields);\n var renderView = function (viewProps) {\n // The approach here is to allow state components to provide only the props they care about, automatically\n // merging user props and state props together. This ensures all props are passed properly to view,\n // including children and styles.\n // TODO: for full 'fields' support, 'rest' props from customizations need to pass onto view.\n // however, customized props like theme will break snapshots. how is styled not showing theme output in snapshots?\n var mergedProps = viewProps\n ? tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, componentProps, viewProps) : componentProps;\n var theme = mergedProps.theme || settings.theme;\n var tokens = _resolveTokens(mergedProps, theme, component.tokens, settings.tokens, mergedProps.tokens);\n var styles = _resolveStyles(mergedProps, theme, tokens, component.styles, settings.styles, mergedProps.styles);\n var viewComponentProps = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, mergedProps, { styles: styles,\n tokens: tokens, _defaultStyles: styles });\n return component.view(viewComponentProps);\n };\n return component.state ? react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](component.state, tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, componentProps, { renderView: renderView })) : renderView();\n }));\n };\n result.displayName = component.displayName;\n // If a shorthand prop is defined, create a factory for the component.\n // TODO: This shouldn't be a concern of createComponent.. factoryOptions should just be forwarded.\n // Need to weigh creating default factories on component creation vs. memozing them on use in slots.tsx.\n if (defaultProp) {\n result.create = Object(_slots__WEBPACK_IMPORTED_MODULE_4__[\"createFactory\"])(result, { defaultProp: defaultProp });\n }\n Object(_utilities__WEBPACK_IMPORTED_MODULE_5__[\"assign\"])(result, component.statics);\n // Later versions of TypeSript should allow us to merge objects in a type safe way and avoid this cast.\n return result;\n}", "title": "" }, { "docid": "c99869d06a6fbb48cd69946d3ce19eac", "score": "0.570689", "text": "function BaseComponent(){}", "title": "" }, { "docid": "5dec8c51effe68a85a949ecb1ec845d3", "score": "0.57033575", "text": "function wrap_component(title, component)\n {\n function Component_wrapper(expanded, innerHTML, params)\n {\n /* SET EXTRA FUNCTIONALITY DEFAULTS */\n Object.defineProperties(this, {\n /* Whether the data in this component should be stored in session storage */\n sessionStorage: getDescriptor(false, true),\n\n /* Whether the data in this component should be stored in local storage */\n localStorage: getDescriptor(false, true),\n\n /* Whether the data in this component should be stored in the model */\n store: getDescriptor(false, true),\n\n /* Whether this component is allowed to have multiple copies of itself as child components (recursive) */\n multiple: getDescriptor(false, true),\n\n /* extends the filters */\n filters: getDescriptor(copy({}, __config.filters)),\n \n /* COMPONENT INNER CHILD NODES */\n innerHTML: getDescriptor((innerHTML || ''), true),\n \n /* THE ACTUAL EXPANDED COMPONENT NODES */\n component: getDescriptor(expanded, true),\n \n /* This method runs after the component has fully rendered */\n onfinish: getDescriptor(function(){}, true),\n \n /* Make a copy of the frytki extensions */\n __frytkiExtensions__: getDescriptor(frytki().__frytkiExtensions__, true)\n })\n \n /* CREATE OVERWRITE */\n component.apply(this, arguments);\n \n /* BIND FILTERS TO THIS */\n this.filters = bindMethods(this, this.filters);\n \n /* FETCH STORAGE VALUES */\n if(this.localStorage)\n {\n getStorage('local', this.name, this);\n /* listen for any update and update the storage */\n this.addEventListener('*update', (function(){\n setStorage('local', this.name, this);\n }).bind(this))\n }\n \n if(this.sessionStorage)\n {\n getStorage('session', this.name, this);\n /* listen for any update and update the storage */\n this.addEventListener('*update', (function(){\n setStorage('session', this.name, this);\n }).bind(this))\n }\n \n if(this.store)\n {\n getStorage('model', this.name, this);\n /* listen for any update and update the storage */\n this.addEventListener('*update', (function(){\n setStorage('model', this.name, this);\n }).bind(this))\n }\n \n /* If any params were passed we add them to the object */\n if(params) handleParams(this, params);\n \n /* BIND SUB METHODS TO THIS */\n bindMethods(this, this);\n \n /* OVERWRITE ALL ENUMERABLE PROPERTIES TO BE OBSERVABLE */\n return convertStaticsToObservables(this);\n }\n \n /* Inherit from frytki */\n Component_wrapper.prototype = frytki();\n \n /* COPY PROTOTYPES FROM COMPONENT */\n Component_wrapper.prototype = copy(Component_wrapper.prototype, component.prototype);\n \n /* SET EXTRA PROTOTYPE FUNCTIONALITY */\n Component_wrapper.prototype.name = title;\n Component_wrapper.prototype.listen = listen;\n Component_wrapper.prototype.unlisten = unlisten;\n Component_wrapper.prototype.alert = alert;\n \n return Component_wrapper;\n }", "title": "" }, { "docid": "922d0fcfa00d62ae25a37ba10081c225", "score": "0.56860447", "text": "doCreateComponent (element) {\n return null;\n }", "title": "" }, { "docid": "a858cc6805c82850522315990acde9c4", "score": "0.5681086", "text": "function componentToEntity(idGenerator, component) {\n // TODO: would this be better named 'compileComponent'?\n // Get the ID. If we don't have one, create a new one.\n const id = component.id || `${idGenerator()}`;\n\n // Return a 'component' entity.\n return {\n id,\n type: 'component',\n name: component.name,\n };\n}", "title": "" }, { "docid": "844edbe63bd6308c2f95eea003ee9c0e", "score": "0.5668344", "text": "function createConstructor (name, Ctor) {\n if (typeof Ctor === 'object') {\n Ctor = Component.extend(Ctor);\n }\n\n // Internal data.\n Ctor[symbols.name] = name;\n\n return Ctor;\n}", "title": "" }, { "docid": "3c09589ff5a2add11881dbcb11698603", "score": "0.5663577", "text": "function componentFactory(vConfig, bLegacy) {\n\t\tvar oOwnerComponent = Component.get(ManagedObject._sOwnerId);\n\n\t\tif (Array.isArray(vConfig.activeTerminologies) && vConfig.activeTerminologies.length &&\n\t\t\tArray.isArray(Localization.getActiveTerminologies()) && Localization.getActiveTerminologies().length) {\n\t\t\tif (JSON.stringify(vConfig.activeTerminologies) !== JSON.stringify(Localization.getActiveTerminologies())) {\n\t\t\t\tLog.warning(bLegacy ? \"sap.ui.component: \" : \"Component.create: \" +\n\t\t\t\t\t\"The 'activeTerminolgies' passed to the component factory differ from the ones defined on the global 'sap/base/i18n/Localization.getActiveTerminologies';\" +\n\t\t\t\t\t\"This might lead to inconsistencies; ResourceModels that are not defined in the manifest and created by the component will use the globally configured terminologies.\");\n\t\t\t}\n\t\t}\n\t\t// get terminologies information: API -> Owner Component -> Configuration\n\t\tvar aActiveTerminologies = vConfig.activeTerminologies || (oOwnerComponent && oOwnerComponent.getActiveTerminologies()) || Localization.getActiveTerminologies();\n\n\t\t// Inherit cacheTokens from owner component if not defined in asyncHints\n\t\tif (!vConfig.asyncHints || !vConfig.asyncHints.cacheTokens) {\n\t\t\tvar mCacheTokens = oOwnerComponent && oOwnerComponent._mCacheTokens;\n\t\t\tif (typeof mCacheTokens === \"object\") {\n\t\t\t\tvConfig.asyncHints = vConfig.asyncHints || {};\n\t\t\t\tvConfig.asyncHints.cacheTokens = mCacheTokens;\n\t\t\t}\n\t\t}\n\n\t\t// collect instance-created listeners\n\t\tfunction callInstanceCreatedListeners(oInstance, vConfig) {\n\t\t\treturn _aInstanceCreatedListeners.map(function(fn) {\n\t\t\t\treturn fn(oInstance, vConfig);\n\t\t\t});\n\t\t}\n\n\t\tfunction notifyOnInstanceCreated(oInstance, vConfig) {\n\t\t\tif (vConfig.async) {\n\t\t\t\tvar pRootControlReady = oInstance.rootControlLoaded ? oInstance.rootControlLoaded() : Promise.resolve();\n\n\t\t\t\t// collect instance-created listeners\n\t\t\t\tvar aOnInstanceCreatedPromises = callInstanceCreatedListeners(oInstance, vConfig);\n\n\t\t\t\t// root control loaded promise\n\t\t\t\taOnInstanceCreatedPromises.push(pRootControlReady);\n\n\t\t\t\treturn Promise.all(aOnInstanceCreatedPromises);\n\t\t\t} else {\n\t\t\t\tcallInstanceCreatedListeners(oInstance, vConfig);\n\t\t\t}\n\t\t\treturn oInstance;\n\t\t}\n\n\t\tfunction createInstance(oClass) {\n\t\t\tif (bLegacy && oClass.getMetadata().isA(\"sap.ui.core.IAsyncContentCreation\")) {\n\t\t\t\tthrow new Error(\"Do not use deprecated factory function 'sap.ui.component' in combination with IAsyncContentCreation (\" + vConfig[\"name\"] + \"). \" +\n\t\t\t\t\"Use 'Component.create' instead\");\n\t\t\t}\n\n\t\t\t// retrieve the required properties\n\t\t\tvar sName = vConfig.name,\n\t\t\tsId = vConfig.id,\n\t\t\toComponentData = vConfig.componentData,\n\t\t\tsController = sName + '.Component',\n\t\t\tmSettings = vConfig.settings;\n\n\t\t\t// create an instance\n\t\t\tvar oInstance = new oClass(extend({}, mSettings, {\n\t\t\t\tid: sId,\n\t\t\t\tcomponentData: oComponentData,\n\t\t\t\t_cacheTokens: vConfig.asyncHints && vConfig.asyncHints.cacheTokens,\n\t\t\t\t_activeTerminologies: aActiveTerminologies\n\t\t\t}));\n\t\t\tassert(oInstance instanceof Component, \"The specified component \\\"\" + sController + \"\\\" must be an instance of sap.ui.core.Component!\");\n\t\t\tLog.info(\"Component instance Id = \" + oInstance.getId());\n\n\t\t\t/*\n\t\t\t * register for messaging: register if either handleValidation is set in metadata\n\t\t\t * or if not set in metadata and set on instance\n\t\t\t */\n\t\t\tvar bHandleValidation = oInstance.getMetadata()._getManifestEntry(\"/sap.ui5/handleValidation\");\n\t\t\tif (bHandleValidation !== undefined || vConfig.handleValidation) {\n\t\t\t\tconst Messaging = sap.ui.require(\"sap/ui/core/Messaging\");\n\t\t\t\tif (Messaging) {\n\t\t\t\t\tMessaging.registerObject(oInstance, bHandleValidation === undefined ? vConfig.handleValidation : bHandleValidation);\n\t\t\t\t} else {\n\t\t\t\t\tsap.ui.require([\"sap/ui/core/Messaging\"], function(Messaging) {\n\t\t\t\t\t\tif (!oInstance.isDestroyed()) {\n\t\t\t\t\t\t\tMessaging.registerObject(oInstance, bHandleValidation === undefined ? vConfig.handleValidation : bHandleValidation);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Some services may demand immediate startup\n\t\t\tvar aPromises = activateServices(oInstance, vConfig.async);\n\n\t\t\tif (vConfig.async) {\n\t\t\t\treturn notifyOnInstanceCreated(oInstance, vConfig)\n\t\t\t\t\t.then(function () {\n\t\t\t\t\t\treturn Promise.all(aPromises);\n\t\t\t\t\t})\n\t\t\t\t\t.then(function () {\n\t\t\t\t\t\t// Make sure that the promise returned by the hook can not modify the resolve value\n\t\t\t\t\t\treturn oInstance;\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn notifyOnInstanceCreated(oInstance, vConfig);\n\t\t\t}\n\t\t}\n\n\t\t// load the component class\n\t\tvar vClassOrPromise = loadComponent(vConfig, {\n\t\t\tfailOnError: true,\n\t\t\tcreateModels: true,\n\t\t\twaitFor: vConfig.asyncHints && vConfig.asyncHints.waitFor,\n\t\t\tactiveTerminologies: aActiveTerminologies\n\t\t});\n\t\tif ( vConfig.async ) {\n\t\t\t// async: instantiate component after Promise has been fulfilled with component\n\t\t\t// constructor and delegate the current owner id for the instance creation\n\t\t\tvar sCurrentOwnerId = ManagedObject._sOwnerId;\n\t\t\treturn vClassOrPromise.then(function(oClass) {\n\t\t\t\t// [Compatibility]: We sequentialize the dependency loading for the inheritance chain of the component.\n\t\t\t\t// This keeps the order of the dependency execution stable (e.g. thirdparty script includes).\n\t\t\t\tvar loadDependenciesAndIncludes = function (oMetadata) {\n\t\t\t\t\tvar oParent = oMetadata.getParent();\n\t\t\t\t\tvar oPromise = Promise.resolve();\n\t\t\t\t\tif (oParent instanceof ComponentMetadata) {\n\t\t\t\t\t\toPromise = oPromise.then(function () {\n\t\t\t\t\t\t\treturn loadDependenciesAndIncludes(oParent);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn oPromise.then(function () {\n\t\t\t\t\t\treturn oMetadata.getManifestObject().loadDependenciesAndIncludes(true);\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\treturn loadDependenciesAndIncludes(oClass.getMetadata()).then(function () {\n\t\t\t\t\treturn ManagedObject.runWithOwner(function() {\n\t\t\t\t\t\treturn createInstance(oClass);\n\t\t\t\t\t}, sCurrentOwnerId);\n\t\t\t\t});\n\t\t\t});\n\t\t} else {\n\t\t\t// sync: constructor has been returned, instantiate component immediately\n\t\t\treturn createInstance(vClassOrPromise);\n\t\t}\n\t}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "3868883343ef58b3b37e93fac26ecaa5", "score": "0.5624406", "text": "function genComponent (\n componentName,\n el,\n state\n) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" } ]
18144616043c62e343aeb6e07bc6351f
Manager for event logging
[ { "docid": "cbcf1963285eaeefd2dceba7317473cc", "score": "0.0", "text": "function LogManager() {\n // Reference to LogManager \"this\", for use in child functions\n var self = this;\n //Used to access logging service\n self.logLibrary = null;\n //Used to access event log\n self.logger = null;\n //Call the constructor of the EventEmitter passing in the LogManager\n events.EventEmitter.call(self);\n }", "title": "" } ]
[ { "docid": "60743d698ebeb58e69c74ec9ff91795b", "score": "0.6458714", "text": "function _eventManager( )\n{\n this.events = [];\n this.lastEventID = 0;\n}", "title": "" }, { "docid": "19e31653d2d4ef648cbfc8b4be37558c", "score": "0.63391924", "text": "static allEvents() {\n return new LiteralLogPattern('');\n }", "title": "" }, { "docid": "50665aa77c6a687082e9a4361926ec94", "score": "0.6145077", "text": "static get events() { return events }", "title": "" }, { "docid": "8902a7bb0a4c74b6d9fb7e6526cad37d", "score": "0.6090885", "text": "logEvent(eventtype, eventdata) {\n if (!this.gameOver) {\n var d = new Date();\n this.dataLog += (d.getTime()).toString() + \",\" + eventtype + \",\" + eventdata + '\\n';\n }\n \n}", "title": "" }, { "docid": "8902a7bb0a4c74b6d9fb7e6526cad37d", "score": "0.6090885", "text": "logEvent(eventtype, eventdata) {\n if (!this.gameOver) {\n var d = new Date();\n this.dataLog += (d.getTime()).toString() + \",\" + eventtype + \",\" + eventdata + '\\n';\n }\n \n}", "title": "" }, { "docid": "c034e82ee4bdf0a58f3f86e4e30539eb", "score": "0.6051284", "text": "function EventManager()\n\t{\n\t\t/**\n\t\t * Stores all events in the manager, their target and callback.\n\t\t * \n\t\t * Format [target, event, callback, active]\n\t\t * \n\t\t * @type {Array}\n\t\t */\n\t\tthis.events = [];\n\t}", "title": "" }, { "docid": "fb51b9342df8722c7ab1c192589b5ecf", "score": "0.60421616", "text": "function logAudits() {\n var funcArray = [\n loadTime,\n componentRerenders\n ];\n\n // run functions in funcArray, with printLine prior to each\n funcArray.forEach((eventsMethod) => {\n printLine();\n eventsMethod(data);\n });\n}", "title": "" }, { "docid": "299be90ccc222d078449a7afa8503ae1", "score": "0.60247606", "text": "function Logger() {\r\n\tthis.t0 = new Date();\r\n\tthis.events = [];\r\n\t\r\n\t/**\r\n\t * Log arbitrary item as string with timestamp relative to page load\r\n\t */\r\n\t\r\n\tthis.Log = function(item) {\r\n\t\tvar logstring = (\"\" + item);\r\n\t\tvar timestamp = new Date();\r\n\t\tvar logdata = timestamp + \" = t0 + \"+(timestamp - this.t0) + \"ms: \"+ logstring;\r\n\t\tthis.events[this.events.length] = logdata;\r\n\t\tdoLog(logdata);\r\n\t};\r\n\t\r\n\t/**\r\n\t * return all log data as string\r\n\t */\r\n\t\r\n\tthis.GetValue = function() {\r\n\t\tvar concat = \"\";\r\n\t\tfor ( var int = 0; int < this.events.length; int++) {\r\n\t\t\tif (int > 0) {\r\n\t\t\t\tconcat += \"\\n\";\r\n\t\t\t}\r\n\t\t\tconcat += this.events[int];\r\n\t\t}\r\n\t\treturn concat;\r\n\t};\r\n\t\r\n\t/**\r\n\t * add previously logged events\r\n\t */\r\n\t\r\n\tthis.SetValue = function(events) {\r\n\t\tvar splitted = (\"\" + events).split(\"\\n\");\r\n\t\t\r\n\t\tthis.events = splitted;\r\n\t\tthis.Log(\"Site reloaded: \"+window.location.href);\r\n\t};\r\n\t\r\n\t/**\r\n\t * print to console (good for debugging purposes):\r\n\t * last __ optionally print only the last elements\r\n\t */\r\n\t\r\n\tthis.Last = function(last) {\r\n\t\tvar start = 0;\r\n\t\tif (last) {\r\n\t\t\tstart = this.events.length - last;\r\n\t\t\tif (start < 0)\r\n\t\t\t\tstart = 0;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tfor (var int=start;int<this.events.length;++int) {\r\n\t\t\tconsole.log(this.events[int]);\r\n\t\t}\r\n\t\treturn start;\r\n\t};\r\n\t\r\n\t\r\n\tmyStorage.RegisterField(this,\"Logger\",true);\r\n\t\r\n\tthis.Log(\"Site loaded: \" + window.location.href + \" on \" + BrowserName());\r\n\t\r\n\treturn this;\r\n}", "title": "" }, { "docid": "2cb25fc52289e4d4777fa81413fa206f", "score": "0.60066533", "text": "function LogEvent()\r\n{\r\n\tthis.size = [60,20];\r\n\tthis.addInput(\"event\", LiteGraph.ACTION);\r\n}", "title": "" }, { "docid": "7ae549c9680127ffbca145614f9aa10c", "score": "0.5989256", "text": "_logEvent(event) {\n\t\tif (this._eventListeners.has(event.type)) {\n\t\t\tconsole.log(`event: ${event.source} > ${event.type}`);\n\t\t} else {\n\t\t\tconsole.log(`event (UNHANDLED): ${event.source} > ${event.type}`);\n\t\t}\n\t}", "title": "" }, { "docid": "bd29fad57b2af699a3bcdfbe6d498f34", "score": "0.59183365", "text": "_events () {\r\n // get connection\r\n let conn = config.get ('redis');\r\n\r\n // set prefix\r\n conn.prefix = config.get ('domain') + '.event';\r\n\r\n // create events redis instance\r\n this.pubsub = redisEE (conn);\r\n\r\n // create new events class\r\n this.events = new events ();\r\n\r\n // on function\r\n if (this.main) {\r\n // only on this thread\r\n this.pubsub.on ('main', (channel, data) => {\r\n // emit to this thread\r\n this.emit (data.type, data.data);\r\n });\r\n }\r\n }", "title": "" }, { "docid": "c7f3e480befd8348c8e072bfd9212666", "score": "0.5905253", "text": "function LogDat() {\n\tEventEmitter.call(this);\n}", "title": "" }, { "docid": "e309c321a1be2b99c9d58f4f1e88fffa", "score": "0.58939946", "text": "static listenSocketEvents() {\n Socket.shared.on(\"notification:alert:created\", (data) => {\n let logger = Logger.create(\"notification:alert:created\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(NotificationAlert.actions.notificationAlertCreatedEvent(data));\n });\n\n Socket.shared.on(\"notification:alert:updated\", (data) => {\n let logger = Logger.create(\"notification:alert:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(NotificationAlert.actions.notificationAlertUpdatedEvent(data));\n });\n }", "title": "" }, { "docid": "81af4d209e7cc42559eeba7caa2a3960", "score": "0.58895093", "text": "function EventManager()\r\n{\r\n\t/**\r\n\t * Stores all events in the manager, their target and callback.\r\n\t * \r\n\t * Format [target, event, callback, active]\r\n\t * \r\n\t * @attribute events\r\n\t * @type {Array}\r\n\t */\r\n\tthis.events = [];\r\n}", "title": "" }, { "docid": "e84f68207f2f05b265bad4d095c97504", "score": "0.5828276", "text": "listEvent(name) {\n if (Events.handlers[name]) {\n console.log(Events.handlers[name]);\n } else {\n console.warn(`${name} does not exist inside Events handlers object.`);\n }\n }", "title": "" }, { "docid": "8580063ad094bcf55165bf22f694cc7f", "score": "0.58155435", "text": "function notificationManager() {\n\t\tvar at = 0;\n\t\tvar ot = 0;\n\n\t\ttag.on('irTemperatureChange', function(objectTemp, ambientTemp) {\n\t\t\tot = objectTemp.toFixed(1);\n\t\t\tat = ambientTemp.toFixed(1);\n\t\t});\n\n\t\ttag.on('accelerometerChange', function(x, y, z) {\n\t\t\t// timestamp, 3 axes, temperature\n\t\t\tnewSensorDataJob(getTimeStamp(), x.toFixed(1), y.toFixed(1), z.toFixed(1), at);\n\t\t\t\n if(DEBUG) {\n console.log('%s,%d,%d,%d,%d,%d', getTimeStamp(), x.toFixed(1), y.toFixed(1), z.toFixed(1), ot, at);\n }\n\t\t});\n\t}", "title": "" }, { "docid": "f6e58382dcb8a1eba63425a48674e421", "score": "0.5815477", "text": "_dbEvents() {\n\n\t\tthis.event.on( 'setup', this._onSetup.bind(this) );\n\n\t\t// Authentication events.\n\t\tthis.event.on( 'connect', this._onConnect.bind(this) );\n\t\tthis.event.on( 'disconnect', this._onDisconnect.bind(this) );\n\t\tthis.event.on( 'authState', this._onAuthState.bind(this) );\n\t\tthis.event.on( 'authError', this._onAuthErr.bind(this) );\n\n\t\t// Session events.\n\t\tthis.event.on( 'endSession', this._onEndSession.bind(this) );\n\t\tthis.event.on( 'duplicateSession', this._onDuplicateSess.bind(this) );\n\n\t\t// Online operator events.\n\t\tthis.event.on( 'newOp', this._onNewOp.bind(this) );\n\t\tthis.event.on( 'deleteOp', this._onDeleteOp.bind(this) );\n\n\t\t// Other user events.\n\t\tthis.event.on( 'newUser', this._onNewUser.bind(this) );\n\t\tthis.event.on( 'updateUser', this._onUpdateUser.bind(this) );\n\t\tthis.event.on( 'deleteUser', this._onDeleteUser.bind(this) );\n\n\t\t// Chat events.\n\t\tthis.event.on( 'newChat', this._onNewChat.bind(this) );\n\t\tthis.event.on( 'updateChat', this._onUpdateChat.bind(this) );\n\t\tthis.event.on( 'deleteChat', this._onDeleteChat.bind(this) );\n\n\t\t// Archived chat events.\n\t\tthis.event.on( 'newArchivedChat', this._onNewArchivedChat.bind(this) );\n\t\tthis.event.on( 'updateArchivedChat', this._onUpdateArchivedChat.bind(this) );\n\t\tthis.event.on( 'deleteArchivedChat', this._onDeleteArchivedChat.bind(this) );\n\n\t\t// Chat message events.\n\t\tthis.event.on( 'newMsg', this._onNewMsg.bind(this) );\n\t\tthis.event.on( 'updateMsg', this._onUpdateMsg.bind(this) );\n\t\tthis.event.on( 'deleteMsg', this._onDeleteMsg.bind(this) );\n\n\t\t// Chat member events.\n\t\tthis.event.on( 'newMember', this._onNewMember.bind(this) );\n\t\tthis.event.on( 'updateMember', this._onUpdateMember.bind(this) );\n\t\tthis.event.on( 'deleteMember', this._onDeleteMember.bind(this) );\n\n\t\t// Current user events.\n\t\tthis.event.on( 'profile', this._onProfileUpdate.bind(this) );\n\t}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.5797979", "text": "function EventHandlers() {}", "title": "" }, { "docid": "ecf602ac6084275cdd6963b8f38ac456", "score": "0.57979584", "text": "function _logEventedClass(object, tag) {\n var eventNames = [\n 'baselayerchange','overlayadd','overlayremove','layeradd','layerremove','zoomlevelschange','resize','unload','viewreset','load','zoomstart',\n 'movestart','zoom','move','zoomend','moveend','popupopen','popupclose','autopanstart','locationerror'\n ];\n\n if(!!object['on']) {\n eventNames.forEach(function(s) {\n object.on(s, function(evt) {\n console.log(\"event: %s\\t tag:\", evt.type, tag);\n });\n });\n } else {\n console.warn(\"logEventedClass: can't add events because object has no 'on' method\", tag)\n return;\n\n }\n\n\n }", "title": "" }, { "docid": "fb59c2b651fe9062188e4a9325999a9c", "score": "0.5788574", "text": "function onLog(message) { }", "title": "" }, { "docid": "580774e48fc21c10ce011667de2db7af", "score": "0.57775205", "text": "setReadyForLogging() {\n this.readyForLogging_ = true;\n this.logs_.forEach((event) => {\n this.handleClientEvent_(event);\n });\n }", "title": "" }, { "docid": "ec355af636011127b68c891e6c0362e4", "score": "0.5761796", "text": "function logEvent(event) {\n\t\t\n\t\t//data variables\n\t\tvar message = \"\",\n\t\t messageType = \"\";\n\t\t\n\t\tswitch(event.type){\n\t\t\tcase TestRunner.BEGIN_EVENT:\n\t\t\t\tmessage = \"Testing began at \" + (new Date()).toString() + \".\";\n\t\t\t\tmessageType = \"info\";\n\t\t\t\tlabel = \"TestRunner\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.COMPLETE_EVENT:\n\t\t\t\tmessage = Y.substitute(\"Testing completed at \" +\n\t\t\t\t\t(new Date()).toString() + \".\\n\" +\n\t\t\t\t\t\"Passed:{passed} Failed:{failed} \" +\n\t\t\t\t\t\"Total:{total} ({ignored} ignored)\",\n\t\t\t\t\tevent.results);\n\t\t\t\tmessageType = \"info\";\n\t\t\t\tlabel = \"TestRunner\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.TEST_FAIL_EVENT:\n\t\t\t\tmessage = event.testName + \": failed.\\n\" + event.error.getMessage();\n\t\t\t\tmessageType = \"fail\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.TEST_IGNORE_EVENT:\n\t\t\t\tmessage = event.testName + \": ignored.\";\n\t\t\t\tmessageType = \"ignore\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.TEST_PASS_EVENT:\n\t\t\t\tmessage = event.testName + \": passed.\";\n\t\t\t\tmessageType = \"pass\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.TEST_SUITE_BEGIN_EVENT:\n\t\t\t\tmessage = \"Test suite \\\"\" + event.testSuite.name + \"\\\" started.\";\n\t\t\t\tmessageType = \"info\";\n\t\t\t\tlabel = event.testSuite.name;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.TEST_SUITE_COMPLETE_EVENT:\n\t\t\t\tmessage = Y.substitute(\"Test suite \\\"\" +\n\t\t\t\t\tevent.testSuite.name + \"\\\" completed\" + \".\\n\" +\n\t\t\t\t\t\"Passed:{passed} Failed:{failed} \" +\n\t\t\t\t\t\"Total:{total} ({ignored} ignored)\",\n\t\t\t\t\tevent.results);\n\t\t\t\tmessageType = \"info\";\n\t\t\t\tlabel = event.testSuite.name;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.TEST_CASE_BEGIN_EVENT:\n\t\t\t\tmessage = \"Test case \\\"\" + event.testCase.name + \"\\\" started.\";\n\t\t\t\tmessageType = \"info\";\n\t\t\t\tlabel = event.testCase.name;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase TestRunner.TEST_CASE_COMPLETE_EVENT:\n\t\t\t\tmessage = Y.substitute(\"Test case \\\"\" +\n\t\t\t\t\tevent.testCase.name + \"\\\" completed.\\n\" +\n\t\t\t\t\t\"Passed:{passed} Failed:{failed} \" +\n\t\t\t\t\t\"Total:{total} ({ignored} ignored)\",\n\t\t\t\t\tevent.results);\n\t\t\t\tmessageType = \"info\";\n\t\t\t\tlabel = event.testCase.name;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmessage = \"Unexpected event \" + event.type;\n\t\t\t\tmessage = \"info\";\n\t\t}\n\t\n\t\t//only log if required\n\t\tif(Y.Console) {\n\t\t\tY.log(message, messageType, label);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(message, messageType, label);\n\t\t}\n\t}", "title": "" }, { "docid": "8ccbbfaceebc4f731c38eefd63495179", "score": "0.5760062", "text": "log(message) {\n records.push({\n message,\n dateTime: new Date(),\n type: 'log'\n });\n }", "title": "" }, { "docid": "b92de75adaa311fa7cef418a0be54f6e", "score": "0.5751063", "text": "registerEvents() {\n this.events = Object.entries(GoogleTagManagerContainer.eventList).reduce((acc, [name, Event]) => {\n acc[name] = new Event(name, this);\n acc[name].bindEvent();\n\n return acc;\n }, {});\n }", "title": "" }, { "docid": "093c655568e1c9c313a4b11e872962e9", "score": "0.5746397", "text": "_addListen() {\n this.actionLog = []; \n window.addEventListener('click', this._handleClickEvent); \n window.addEventListener('scroll',this._handleScrollEvent);\n window.addEventListener('mousedown',this._handleMouseDown);\n window.addEventListener('mousemove',this._handleMouseMove);\n window.addEventListener('mouseup',this._handleMouseUp);\n }", "title": "" }, { "docid": "6ff7bba7e22f099257854e255e4ad218", "score": "0.57296187", "text": "setupEvents() { }", "title": "" }, { "docid": "7b981569bd08273d36bcd088dab32b3c", "score": "0.5724753", "text": "static InitializeDispatchedEvents() {\r\n for (const e of ConstantUtils.DISPATCHED_EVENTS) {\r\n // events.OnEvent(e.Event, e.Callback);\r\n EventsUtils.OnEvent(e.Event, (val) => {\r\n if (val && e.Params && e.Params.length > 0) {\r\n for (let v of e.Params) {\r\n /**\r\n * have to explicitly type 'v,' so we can index properly - shannon\r\n * this currently only outputs to the console, but we can do whatever\r\n * when one of the events occur\r\n */\r\n console.log(e.Message + ' ' + v + ': ' + val[v]);\r\n }\r\n }\r\n else {\r\n console.log(e.Message + ' ' + val);\r\n }\r\n });\r\n }\r\n }", "title": "" }, { "docid": "45251ee1ea02a3577c3e6cfbe08562e9", "score": "0.57205135", "text": "function logEvent(data) {\n if (loggingServerEnabled()) {\n data = getJSON(data);\n\n // List of attributes the event data is required to have\n var reqAttrib = ['av', 'desc', 'module_name', 'steps_fixed', 'tstamp', 'type', 'uiid'];\n\n // Loop through all attributes and remove any unnecessary ones\n // (if the server will ignore them, no reason for us to store and send them)\n for (var prop in data) {\n if (data.hasOwnProperty(prop) && reqAttrib.indexOf(prop) === -1) {\n // Data has a property that the server will ignore, discard it\n delete data.prop;\n }\n }\n\n // Ensure given JSON data is a valid event\n if (!isValidEvent(data)) {\n console.warn('logEvent() error: Invalid event');\n console.log(data);\n return;\n }\n\n // Don't log events without either an AV name or a module name\n // Getting duplicates of some events where one is missing both\n // Currently all legitimate events should have one or the other\n if (data.av === \"\" && moduleName === \"\") {\n console.warn('Exercise name and moduleName cannot both be \"\"');\n return;\n }\n\n data.module = moduleName;\n\n // Store username and book ID with each event because all events\n // will be grouped together, allowing any user to submit everyone's\n // events to ensure we collect as much data as possible\n if (odsaUtils.scoringServerEnabled()) {\n data.user_email = getUserEmail();\n if (hasBook()) {\n data.inst_book_id = getBookID();\n if (isFullModule()) {\n data.inst_chapter_module_id = getChapterModuleID();\n }\n else {\n data.inst_section_id = getSectionID();\n }\n }\n else if (isStandaloneModule()) {\n data.inst_module_version_id = getInstModuleVersionId();\n }\n else {\n data.inst_course_offering_exercise_id = getInstCourseOfferingExerciseId();\n }\n }\n\n // Add a timestamp to the data\n if (data.tstamp) {\n // Convert existing JSAV timestamp from ISO format to milliseconds\n data.tstamp = new Date(data.tstamp).getTime();\n } else {\n data.tstamp = (new Date()).getTime();\n }\n\n // Convert the description field into a string so the server can\n // handle it properly\n data.desc = JSON.stringify(data.desc);\n\n // Store the event in localStorage\n // The random number is used to reduce the likelihood of collisions where\n // multiple events get logged at the same time\n var rand = Math.floor(Math.random() * 101);\n localStorage[['event', data.tstamp, rand].join('-')] = JSON.stringify(data);\n }\n }", "title": "" }, { "docid": "8b06be2b3b830056eedd69bdf71ec485", "score": "0.5719955", "text": "function TrackEventInit() {\n}", "title": "" }, { "docid": "9a37c0ed681f746c70443cb3a7085e97", "score": "0.5717476", "text": "_addLoggingHandlers () {\n\n queue.jobEventEmitter\n .on(`job complete${':'}${this.name}`, (id, result) => {\n console.log(`Job '${this.name.cyan}' completed with data ` , result);\n kue.Job.get(id, (err, job) => {\n if (err) {\n console.log(err);\n return;\n }\n\n this.emit('complete', result);\n // we remove job here because we need to have a way to log 'remove' event\n if (this.removeOnComplete) {\n job.remove((err) => {\n if (err) throw err;\n });\n }\n });\n })\n .on(`job enqueue${':'}${this.name}`, () => {\n console.log(`Job '${this.name.cyan}' was enqueued`);\n this.emit('enqueue');\n })\n .on(`job failed${':'}${this.name}`, (errorMessage) => {\n console.log(`Job '${this.name.cyan} failed:`, errorMessage);\n this.emit('failed', errorMessage);\n })\n .on(`job progress${':'}${this.name}`, (progress, data) => {\n console.log(`job ${this.name.cyan} ${progress}% complete with data ${data}`);\n this.emit('progress', progress, data);\n })\n .on(`job remove${':'}${this.name}`, () => {\n console.log(`job ${this.name.cyan} was removed from queue.`);\n this.emit('remove');\n })\n .on(`job failed attempt${':'}${this.name}`, (errorMessage, doneAttempts) => {\n const statusString = [ `Job '${this.name}' attempt failed: ${errorMessage}` ];\n if (this.delay) statusString.push(`- Delay => ${this.delay}`);\n if (this.backoff) statusString.push(`- Backoff => ${ JSON.stringify(this.backoff) }`);\n statusString.push(`- Attempt => ${doneAttempts + 1} of ${this.attempts}`);\n\n console.log(statusString.join('\\n').yellow);\n this.emit('failed attempt', errorMessage, doneAttempts);\n });\n }", "title": "" }, { "docid": "a9a41096f99ce8a392965247e8022668", "score": "0.5710228", "text": "constructor() {\n\t\tthis.evts = {};\n\t\tthis._queuedHandler = null;\n\t}", "title": "" }, { "docid": "2063828511e610a377f29d334853b31d", "score": "0.57004595", "text": "function notificationManager() {\n\t\tvar at = 0;\n\t\tvar ot = 0;\n\n\t\ttag.on('irTemperatureChange', function(objectTemp, ambientTemp) {\n\t\t\tot = objectTemp.toFixed(1);\n\t\t\tat = ambientTemp.toFixed(1);\n\t\t});\n\n\t\ttag.on('accelerometerChange', function(x, y, z) {\n\t\t\tnewAccelDataJob(x.toFixed(1), y.toFixed(1), z.toFixed(1));\n\t\t\tconsole.log('%s,%d,%d,%d,%d,%d', getDateTime(), x.toFixed(1), y.toFixed(1), z.toFixed(1), ot, at);\n\t\t});\n\t}", "title": "" }, { "docid": "067be7f86a761a749723fbd0785142cc", "score": "0.5700238", "text": "function eventemitter3__Events() {}", "title": "" }, { "docid": "fc15533d38ba794f757141b32822ed16", "score": "0.56783", "text": "function EventDispatcher(){\n\t\tthis.events = {};\n\t}", "title": "" }, { "docid": "0ef423343d1a1aea4b620f4eee236f42", "score": "0.56705314", "text": "function logTransactionEvents() {\n logErrorEvents = instanceToken.LogErr({_sender: account_one}, {fromBlock: 0, toBlock: 'latest'});\n logErrorEvents.watch(function(err, result) {\n if (err) {\n console.log(\"instanceToken ERROR in LogErr Event! account one\");\n console.log(err);\n return;\n }\n // append details of result.args to UI\n });\n \n // logTokenPurchase = instanceICO.LogTokenPurchase({_sender: account_one}, {fromBlock: 0, toBlock: 'latest'});\n // logTokenPurchase.watch(function(err, result) {\n // if (err) {\n // console.log(\"instanceICO ERROR in LogTokenPurchase Event! account one\");\n // console.log(err);\n // return;\n // }\n // if (result) {\n // console.log(result)\n // return;\n // }\n // // append details of result.args to UI\n // });\n \n // logErrorEventsaccountfour = instanceToken.LogErr({_sender: account_four}, {fromBlock: 0, toBlock: 'latest'});\n // logErrorEventsaccountfour.watch(function(err, result) {\n // if (err) {\n // console.log(\"instanceToken ERROR in LogErr Event! account four\"); \n // console.log(err);\n // return;\n // }\n // // append details of result.args to UI\n // });\n \n // logTokenPurchaseaccountfour = instanceICO.LogTokenPurchase({_sender: account_four}, {fromBlock: 0, toBlock: 'latest'});\n // logTokenPurchaseaccountfour.watch(function(err, result) {\n // if (err) {\n // console.log(\"instanceICO ERROR in LogTokenPurchase Event! account four\"); \n // console.log(err);\n // return;\n // }\n // if (result) {\n // console.log(result);\n // return;\n // }\n // // append details of result.args to UI\n // });\n \n }", "title": "" }, { "docid": "05c1b19c35baa19aec5049c5c7828550", "score": "0.5669687", "text": "handleChangeLogging(e) {\n this.props.onLoggingChange(e.target.checked);\n var action;\n //define the log\n if (e.target.checked) {\n action = 'Activate logging';\n } else action = 'Deactivate logging';\n var entry;\n //get the current position for the log\n locationManager.getLocation().then(function success(position) {\n entry = [position.latitude, position.longitude, 'Settings', action];\n //log the data\n logger.logEntry(entry);\n }, function error(err) {\n //if there was an error getting the position, log a '-' for lat/lng\n entry = ['-', '-', 'Settigns', action];\n //log the data\n logger.logEntry(entry);\n });\n }", "title": "" }, { "docid": "8e2beb486f50959b86d5f701b5fe250e", "score": "0.5650235", "text": "getLog() {\n const message = {\n roomName: this.name,\n };\n this.emit(room_Room.MESSAGE_EVENTS.getLog.key, message);\n }", "title": "" }, { "docid": "8beaf39e2b8b1d1a571d124fa27fa01c", "score": "0.5648034", "text": "function createEventLog (id, userid, activity, eventName) { \n eventLogCont[id] = { user_id: userid, \n activity: activity, \n time_elapsed: 0,\n currentEvent: eventName, \n currentStartTime: performance.now(), \n detail: {\n pattern: []\n } \n }; \n}", "title": "" }, { "docid": "e2c4b31943b9f40d8c2a76e25f88a444", "score": "0.56473017", "text": "function FsEventsHandler() { }", "title": "" }, { "docid": "e84f81a5c1c456f6dbe9b495891bbea8", "score": "0.56463754", "text": "function EventInfo() { }", "title": "" }, { "docid": "e84f81a5c1c456f6dbe9b495891bbea8", "score": "0.56463754", "text": "function EventInfo() { }", "title": "" }, { "docid": "fc82b87bb1b3a661591f22259c442c97", "score": "0.5646255", "text": "constructor() {\n this.events = {};\n }", "title": "" }, { "docid": "0c08889fff1cdedfbe1c51d1b5109186", "score": "0.5645886", "text": "function OnEnable () {\n\tApplication.logMessageReceived += HandleLog;\n}", "title": "" }, { "docid": "759a3e413ee85ed61686db1a8ba685e2", "score": "0.56449574", "text": "function Log() {\n var self = this;\n var feedbackMessageCallbacks = [];\n var errorMessageCallbacks = [];\n\n this.writeFeedback = function (feedback) {\n feedbackMessageCallbacks.forEach(function(callback) {\n callback.call(self, feedback);\n });\n };\n\n this.writeError = function (errorMessage) {\n errorMessageCallbacks.forEach(function(callback) {\n callback.call(self, errorMessage);\n });\n };\n\n this.onFeedbackMessgeReceived = function(callback) {\n feedbackMessageCallbacks.push(callback);\n };\n\n this.onErrorMessageReceived = function(callback) {\n errorMessageCallbacks.push(callback);\n };\n }", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5631552", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5631552", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5631552", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5631552", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "1fa5aa6ebcc72078a23f839393e13264", "score": "0.5625862", "text": "function ahahEventManager() {}", "title": "" }, { "docid": "385dd3a0505af49b6e1aab7785cf460e", "score": "0.56116617", "text": "function logEvent(event) {\n console.log(timestamp() + \" - \" + event);\n }", "title": "" }, { "docid": "83905d183d88452a673053a5b2240a2d", "score": "0.5607872", "text": "constructor() {\n // Call Logger constructor with options from current running listener\n super(config);\n\n // Enable logging based on hook config\n this.enableLogging(logConfig);\n }", "title": "" }, { "docid": "f67136b631e5312d110e91aefe7adb7e", "score": "0.559633", "text": "getLog() {\n const message = {\n roomName: this.name,\n };\n this.emit(Room.MESSAGE_EVENTS.getLog.key, message);\n }", "title": "" }, { "docid": "fd79aebd23eb124a06caeebb4cb79c66", "score": "0.55902314", "text": "function logWatchInfo(event) {\n var eventPath = path.relative(config.paths.root, event.path);\n g.util.log('File \\'' + g.util.colors.cyan(eventPath) + '\\' was ' + g.util.colors.yellow(event.type) + ', running tasks...');\n }", "title": "" }, { "docid": "9564059dc99e9a3afa46403af4f2c838", "score": "0.55898553", "text": "log (msg) {\n send(WORKER_DAEMON_EVENTS.LOG, msg);\n }", "title": "" }, { "docid": "6daeff16241ab0c389bc84f4c9937c8e", "score": "0.5587614", "text": "constructor() {\n this._eventHandlers = {};\n }", "title": "" }, { "docid": "f1731917517d90c6ab5dbff147086b4e", "score": "0.5582775", "text": "function enable_log(e)\n{\n\tlog = e\n}", "title": "" }, { "docid": "0cbf824de69b5caf5776a181b961db7a", "score": "0.5579617", "text": "trackEvent (/* recUser, eventName, eventData */) {\n\t\tconst sharedLogger = this.__dep(`sharedLogger`);\n\t\tsharedLogger.silly(`Analytics handler \"${this.getHandlerId()}\" does not support tracking events.`);\n\t}", "title": "" }, { "docid": "eeac76cdc58ea8f5b5c16314ea214683", "score": "0.5564627", "text": "function EventManager() {\n _classCallCheck(this, EventManager);\n\n this.events = new _tuiCodeSnippet2.default.Map();\n this.TYPE = new _tuiCodeSnippet2.default.Enum(eventList);\n }", "title": "" }, { "docid": "7f032a867822fedb58d7d659ce4a53f9", "score": "0.5557898", "text": "function setupEvents () {\n\n}", "title": "" }, { "docid": "c7563b29403cfa684b432219d7857d82", "score": "0.555629", "text": "function logEvents(crafty) {\n const loggedErrors = [];\n crafty.undertaker.on(\"start\", evt => {\n crafty.log.info(`Starting '${chalk.cyan(evt.name)}' ...`);\n });\n crafty.undertaker.on(\"stop\", evt => {\n const time = prettyTime(evt.duration);\n crafty.log.info(\n `Finished '${chalk.cyan(evt.name)}' after ${chalk.magenta(time)}`\n );\n });\n crafty.undertaker.on(\"error\", evt => {\n const time = prettyTime(evt.duration);\n const level = evt.branch ? \"info\" : \"error\";\n crafty.log[level](\n `'${chalk.cyan(evt.name)}' ${chalk.red(\"errored after\")} ${chalk.magenta(\n time\n )}`\n );\n // If we haven't logged this before, log it and add to list\n if (loggedErrors.indexOf(evt.error) === -1) {\n crafty.log.error(formatError(evt));\n loggedErrors.push(evt.error);\n }\n });\n}", "title": "" }, { "docid": "dc1b3ac33538b8c30dd4ffb686667871", "score": "0.5542931", "text": "log(message) {\n //task 1\n console.log(message); \n\n //now raise an event\n this.emit('spkEventOccured', { id: 222, url: 'arggg.com', eventDesc: 'abc def ghi' });\n }", "title": "" }, { "docid": "9f5eb52065055c97fae8c8cc8ee9086d", "score": "0.5535446", "text": "function EventDispatcher() {\n this._events = {};\n }", "title": "" }, { "docid": "61bcf47b6eb1fa8a1cb11f6a12dddb13", "score": "0.55346507", "text": "stats() {\n let events = this._getEvents();\n\n for(let name in events) {\n let listeners = events[name];\n this._log(\"==================================================\");\n this._log('Event:' + name + ', Listeners: ' + listeners.length);\n this._log(\"--------------------------------------------------\");\n // print all listeners info\n for(let i=0; i<listeners.length; i++) {\n this._log(listeners[i]);\n }\n\n if (listeners.length === 0) {\n this._log('No Listeners');\n }\n }\n }", "title": "" }, { "docid": "cfa17fd17242accf4af6242ad8fbe093", "score": "0.55285066", "text": "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "title": "" }, { "docid": "cd3673571344b84c5edb9e37b23c3739", "score": "0.5528077", "text": "handleStoreEvents () {\n\t\treturn {\n\t\t\t\n\t\t};\n\t}", "title": "" }, { "docid": "aea9a0986b86a0c1e147769a55555785", "score": "0.5520597", "text": "function importEvents(){\n //TODO: implement once integrated with server\n}", "title": "" }, { "docid": "f8069d934d4a6c99211556360186dcad", "score": "0.55170536", "text": "initHooks() {\n\t\t//_connector.on('#createdSpane');\n\t\tthis._connector.sm.on('#expiredSpan', (span, session) => {\n\t\t\tthis.spanExpired(span, session);\n\t\t});\n\n\t\tthis._connector.on('#receivedWHMessage', (rawdata, text, phone, tPhone) => {\n\t\t\tthis.whReceivedMessage(rawdata, text, phone, tPhone);\n\t\t});\n\t\tthis._connector.on('#receivedWHStatus', (rawdata) => {\n\t\t\tthis.whStatusReceived(rawdata);\n\t\t});\n\t\tthis._connector.on('#sentMessage', (rawdata, body, phone, tPhone) => {\n\t\t\tthis.sentMessage(rawdata, body, phone, tPhone);\n\t\t});\n\t}", "title": "" }, { "docid": "965595bd945050ec9429da73d3ba12ab", "score": "0.5488376", "text": "_wrapEvent(runningEvent, log, listener) {\n const event = (0, _properties.deepCopy)(log);\n\n event.removeListener = () => {\n if (!listener) {\n return;\n }\n\n runningEvent.removeListener(listener);\n\n this._checkRunningEvents(runningEvent);\n };\n\n event.getBlock = () => {\n return this.provider.getBlock(log.blockHash);\n };\n\n event.getTransaction = () => {\n return this.provider.getTransaction(log.transactionHash);\n };\n\n event.getTransactionReceipt = () => {\n return this.provider.getTransactionReceipt(log.transactionHash);\n }; // This may throw if the topics and data mismatch the signature\n\n\n runningEvent.prepareEvent(event);\n return event;\n }", "title": "" }, { "docid": "be7aa6be44ef13ecfce43a7b7f01ba95", "score": "0.5484366", "text": "function onEvent(name, event) {\n console.log(name, JSON.stringify(event, null, 2));\n}", "title": "" }, { "docid": "be7aa6be44ef13ecfce43a7b7f01ba95", "score": "0.5484366", "text": "function onEvent(name, event) {\n console.log(name, JSON.stringify(event, null, 2));\n}", "title": "" }, { "docid": "dff218ff8ae7ea9d5832c6dedffafc33", "score": "0.5463764", "text": "init() {\n this._super(...arguments);\n this.events = {};\n this.tags = {};\n this.levels = {\n info: 'info',\n warning: 'warning',\n error: 'error'\n };\n this._consumerMap = {};\n this._callbackMap = {};\n this._applicationContextMap = {};\n this._userContextMap = {};\n\n // Set up the levels for consumer listener map.\n let levels = Object.keys(this.levels);\n let map = {};\n levels.forEach((level) => {\n map[level] = {};\n });\n this._consumerMap = map;\n }", "title": "" }, { "docid": "fd626fecfac940fe6284fcfc15e2908b", "score": "0.5461257", "text": "log(message){ //When we define a function inside a class, we dont need that function keyword anymore\n //Send an HTTP request\n console.log(message);\n \n //Raise an event\n this.emit('messageLogged', {id: 1, url: 'http://'}); //inside of the function of the class, we use this. instead of emitter.emit()\n }", "title": "" }, { "docid": "85adc1e597d042aa06e5297e33b45454", "score": "0.54589486", "text": "function parselog() {\n\tfunction createNode(n, p) {\n\t\treturn {name: n, parent: p, children: []};\n\t}\n\tfunction logLineToString(lineParts) {\n\t\tif(lineParts.length > 1) {\n\t\t\tvar toString = '';\n\t\t\tif(eventToStringIndices[lineParts[1]]) {\n\t\t\t\tvar indices = eventToStringIndices[lineParts[1]];\n\t\t\t\tfor(var i=0; i<indices.length; i++) {\n\t\t\t\t\tif(i!=0) {\n\t\t\t\t\t\ttoString += '|';\n\t\t\t\t\t}\n\t\t\t\t\ttoString += lineParts[indices[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn toString;\n\t\t}\n\t\treturn '';\n\t}\n\tvar eventStack = new Array();\n\tvar logTreeRoot = createNode(logLineToString(['root']), null);\n\tvar currentNode = logTreeRoot;\n\tvar lines = getLogLines();\n\tfor (var i = 0; i < lines.length; i++) {\n\t\tvar lineParts = lines[i].split('|');\n\t\tif(eventStack.length > 0 && eventStartEnd[eventStack[eventStack.length-1]] == lineParts[1]) { //If the line marks the end of another event\n\t\t\tvar tmp = eventStack.pop();\n\t\t\tcurrentNode = currentNode.parent;\n\t\t} else { //the event\n\t\t\t//add the event to the tree\n\t\t\teventStack.push(lineParts[1]); \n\t\t\tvar newChild = createNode(logLineToString(lineParts), currentNode);\n\t\t\tcurrentNode.children.push(newChild);\n\t\t\tif(eventStartEnd[lineParts[1]]) { //if the line marks the starting of an event\n\t\t\t\tcurrentNode = newChild; //move into the child\n\t\t\t}\n\t\t}\n\t}\n\treturn logTreeRoot;\n}", "title": "" }, { "docid": "26ad02d35c40d5112d592c759b2ba026", "score": "0.54560673", "text": "function EventEmitter() {\n // Initialise required storage variables\n this._events = {};\n }", "title": "" }, { "docid": "1157a0ba182f040e7d6bdf4a83cf06ec", "score": "0.54555845", "text": "function EventHelper (possibleEvents) {\n }", "title": "" }, { "docid": "7a43a5ac95fcde973df6eaed52ef52c2", "score": "0.5449122", "text": "function registerLogGulpEvents() {\n\n\t// Total hack due to poor error management in orchestrator\n\tgulp.on('err', function () {\n\t\tfailed = true;\n\t});\n\n\tgulp.on('task_start', function (e) {\n\t\t// TODO: batch these\n\t\t// so when 5 tasks start at once it only logs one time with all 5\n\t\tgutil.log('Starting', '\\'' + chalk.cyan(e.task) + '\\'...');\n\t});\n\n\tgulp.on('task_stop', function (e) {\n\t\tvar time = prettyTime(e.hrDuration);\n\t\tgutil.log(\n\t\t\t'Finished', '\\'' + chalk.cyan(e.task) + '\\'',\n\t\t\t'after', chalk.magenta(time)\n\t\t);\n\t});\n\n\tgulp.on('task_err', function (e) {\n\t\tvar msg = formatError(e);\n\t\tvar time = prettyTime(e.hrDuration);\n\t\tgutil.log(\n\t\t\t'\\'' + chalk.cyan(e.task) + '\\'',\n\t\t\tchalk.red('errored after'),\n\t\t\tchalk.magenta(time)\n\t\t);\n\t\tgutil.log(msg);\n\t\tprocess.exit(1);\n\t});\n\n\tgulp.on('task_not_found', function (err) {\n\t\tgutil.log(\n\t\t\tchalk.red('Task \\'' + err.task + '\\' is not in your gulpfile')\n\t\t);\n\t\tgutil.log('Please check the documentation for proper gulpfile formatting');\n\t\tprocess.exit(1);\n\t});\n}", "title": "" }, { "docid": "9c7795a72d44916febc536b3fcaf33a2", "score": "0.5437868", "text": "function EventEmitter() {} // Shortcuts to improve speed and size", "title": "" }, { "docid": "9c7795a72d44916febc536b3fcaf33a2", "score": "0.5437868", "text": "function EventEmitter() {} // Shortcuts to improve speed and size", "title": "" }, { "docid": "211b42843fa5cd8680c7bc768b30d2d6", "score": "0.5424947", "text": "function writeEvent(eventLog, logClass) {\n var now = new Date();\n var nowStr = now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds();\n $('#messages').prepend('<li class=\"' + logClass + '\"><b>' + nowStr + '</b> ' + eventLog + '.</li>');\n }", "title": "" }, { "docid": "a0cf54c022d9d8da4a50f51415bc44ea", "score": "0.54163235", "text": "function EventSupport() {}", "title": "" }, { "docid": "8fb6c28aedf7e84d9fcfd0f9b7765c47", "score": "0.54043615", "text": "dispatch(eventParam, data = {}) {\n const eventDefinition = this.getEvent(eventParam)\n\n const date = new Date()\n\n const listeners = [\n // add listeners that listen for any event\n ...(this.listeners[ReacticoonEvents.ALL_EVENTS.type] || []),\n // add listeners specific for this event\n ...(this.listeners[eventDefinition.type] || []),\n ]\n\n // we do some work for exceptions events.\n if (isSameEvent(eventDefinition, ReacticoonEvents.LOG_EXCEPTION)) {\n // we cannot save an exception on our store\n // we modify our event by reference here.\n\n // since 'ex' could be forgotten and used exception / e instead, we handle theme here.\n const exception = data.ex || data.exception || data.e\n if (exception && exception.stack) {\n data.exceptionMessage = exception.message\n data.exceptionStack = exception.stack.toString()\n // cannot dispatch exception object\n delete data.ex\n delete data.exception\n delete data.exe\n }\n }\n\n // create the event, since we create it here, the listener could alter it by reference.\n // but making a copy of the data for each listener / just here is performance-costing.\n // TODO: specify on listener / event doc to not modify the event by reference.\n const event = {\n type: eventDefinition.type,\n data,\n date,\n // TODO: only on dev and better format\n __readableDate: moment(date).format('HH:mm:ss:SSS'),\n }\n\n listeners.forEach(listener => {\n try {\n listener(event)\n } catch (ex) {\n console.group('event dispatch error')\n console.log(`An error occured while dispatching the event on the listener`)\n console.log({ event, listener })\n console.error(ex)\n console.groupEnd('event dispatch error')\n }\n })\n }", "title": "" }, { "docid": "0badc64ff55d12dd3801762238017ac5", "score": "0.53941005", "text": "function registerEvents(Personaldetails) {\n for(var e in events) {\n let event = events[e];\n Personaldetails.hook(e, emitEvent(event));\n }\n}", "title": "" }, { "docid": "d6e56ce68f9832f726d258a6c22fe5ab", "score": "0.53881514", "text": "_initializeEventHandlers() {\n this.on('data', this._handleDataEvent)\n this.on('close', this._handleCloseEvent)\n }", "title": "" }, { "docid": "218def949bd0f9e5d997e46d7fb7f10e", "score": "0.53869826", "text": "function createLogFunctions() {\n for (var fnName in logLevels) {\n listeners[fnName] = [];\n self[fnName] = createLogFunction(fnName);\n }\n\n /** return a function that calls the listeners for a given\n * logFunction name */\n function createLogFunction(name) {\n return function() {\n if (logLevels[name] >= this._level)\n notifyListeners(name, arguments);\n };\n }\n }", "title": "" }, { "docid": "05a0ef9b015f966b3df1990e17195866", "score": "0.53858835", "text": "function LogsObservable() { \n EventEmitter.call(this);\n}", "title": "" }, { "docid": "d14182d740d2c77cc2a7d95057aa6b6c", "score": "0.5384677", "text": "function ClientLogger(){\n ClientLogger.prototype.debug = function debug(eventString, methodNameString){\n if(window.DEBUG){\n var str = methodNameString + ' - ' +eventString;\n console.log('%c [DEBUG] ' + str, 'background: #fff; color: blue');\n }\n }\n\n ClientLogger.prototype.log = function log(eventString, methodNameString){\n console.log(methodNameString, eventString);\n }\n\n ClientLogger.prototype.info = function info(eventString, methodNameString){\n var str = methodNameString + ' - ' +eventString;\n console.log('%c [INFO] ' + str, 'background: #fff; color: green');\n }\n\n ClientLogger.prototype.obj = function obj(object, methodName, details){\n this.info(details, methodName);\n console.log(object)\n this.info(\"******\", \"******\");\n }\n\n ClientLogger.prototype.error = function error(eventString, methodNameString){\n var str = methodNameString + ' - ' +eventString;\n console.log('%c [ERROR] ' + str, 'background: #fff; color: red');\n }\n\n ClientLogger.prototype.serverLog = function serverLog(message, stacktrace){\n this.debug(arguments.callee.name, \"[METHOD]\");\n var event = new LogEvent(message, stacktrace, \"Green-UP Admin Dash\");\n window.ApiConnector.postLogEvent(event, window.ApiConnector.pullServerLog(window.UI.updateLogContent));\n }\n}", "title": "" }, { "docid": "d46837d03c9abfae41979d7a7d7487cc", "score": "0.5376227", "text": "function persistenceEventsEmitter() {\n /**\n * Events property is a hashmap, with each property being an array of callbacks!\n * @type {{}}\n */\n var events = {};\n\n /**\n * boolean determines whether or not the callbacks associated with each event should be\n * proceeded async, default is false!\n *\n * @type {boolean}\n */\n var asyncListeners = false;\n\n return {\n /**\n * Adds a listener to the queue of callbacks associated to an event\n *\n * @param eventName - the name of the event to associate\n * @param listener - the actual implementation\n * @returns {*} - returns the ID of the lister to be use to remove it later\n */\n on: function (eventName, listener) {\n var event = events[eventName];\n if (!event) {\n event = events[eventName] = [];\n }\n event.push(listener);\n return listener;\n },\n /**\n * Fires event if specific event was registered, with the option of passing parameters which are going to be processed by the callback\n * (i.e. if passing emit(event, arg0, arg1) the listener should take two parameters)\n *\n * @param eventName\n * @param data - optional object passed to the event!\n */\n emit: function (eventName, data) {\n if (eventName && events[eventName]) {\n events[eventName].forEach(function (listener) {\n if (asyncListeners) {\n setTimeout(function () {\n listener(data);\n }, 1);\n } else {\n listener(data);\n }\n\n });\n }\n // if event is not registered\n else {\n throw new Error('No event ' + eventName + ' defined');\n }\n },\n /**\n * Remove listeners\n *\n * @param eventName\n * @param listener\n */\n removeListener: function (eventName, listener) {\n if (events[eventName]) {\n var listeners = events[eventName];\n listeners.splice(listeners.indexOf(listener), 1);\n }\n }\n }\n}", "title": "" } ]
2a3e04b2cff42ecd96cdeaaf0078c331
updates the price and stock on the DOM based on selected variation
[ { "docid": "91f626483c447c43ae05414c6755cfd7", "score": "0.7165122", "text": "function set_price_qty_and_stock($product_row){\n\n var $table = $product_row.closest('.wrct-table'),\n selected_variation = get_selected_variation($product_row);\n\n // price\n if( ! $product_row.attr('data-wrct-price-text' ) ){\n var $price = $product_row.find('[data-wrct-name=\"price\"] .wrct-cell-val');\n\n if( selected_variation ){\n $price.html( selected_variation.price_html );\n }else{\n $price.html( $product_row.attr('data-wrct-price-range') );\n }\n }\n\n // stock\n $product_row.find('[data-wrct-name=\"stock\"] .wrct-cell-val').html( selected_variation.availability_html );\n\n // qty\n $product_row.find('.input-text.qty').attr({ 'max': selected_variation.max_qty, 'min': selected_variation.min_qty }).val(1);\n\n }", "title": "" } ]
[ { "docid": "d17cf67da1d6245eacc8e80b7808d085", "score": "0.7525248", "text": "function updateVariantPrice(variant) {\r\n\t $('#buy-button-1 .variant-price').text('$' + variant.price);\r\n\t }", "title": "" }, { "docid": "1efe71db7c99f9d2e4d6520b129a6f91", "score": "0.73697174", "text": "function change_single_product_variation_stock_html() {\n\n if ( $('form.variations_form').length && $('body').hasClass('single-product') ) {\n\n $(document).ready(function() {\n\n let $stock_html = JSON.parse( document.querySelector('.variations_form').getAttribute('data-product_avail_html') );\n\n $('input.variation_id').change(function() {\n\n $variation_id = $('input.variation_id').val();\n\n for ( let i = 0; i < $stock_html.length; i++ ) {\n\n if ( $stock_html[i].id == $variation_id ) {\n\n $('.woocommerce-variation-availability').append( $stock_html[i].stock_html );\n\n }\n\n }\n\n });\n\n });\n\n }\n\n }", "title": "" }, { "docid": "215c6b789dd6946615c964e7f5c4373f", "score": "0.73054206", "text": "function updatePrice(e) {\n var parentID = $(e).parents(\"div.item\").attr(\"id\");\n \n var baseCost = parseFloat($('#' + parentID + ' span.painting.price').attr(\"data-price\"));;\n var quantity = $('#' + parentID + ' input[name^=quantity]').val();\n var frameCost = parseFloat($('#' + parentID + ' select[name^=frame] option:selected').attr(\"data-price\"));\n var glassCost = parseFloat($('#' + parentID + ' select[name^=glass] option:selected').attr(\"data-price\"));\n var mattID = $('#' + parentID + ' select[name^=matt]').val();\n\n $(\"#\" + parentID + \" span.price\").html(calcItemPrice(baseCost, quantity, frameCost, glassCost, mattID));\n }", "title": "" }, { "docid": "b1c608ca81870f61d3f2909359380181", "score": "0.69713545", "text": "_onUpdateVariant(event) {\n const variant = event.detail.variant;\n if (!variant) return;\n\n // Update internal state and 'data-product-sku' attribute of price element\n this._state.sku = variant.sku;\n this._element.querySelector(Product.selectors.price).setAttribute('data-product-sku', variant.sku);\n\n // Update values and enable add to cart button\n this._element.querySelector(Product.selectors.sku).innerText = variant.sku;\n this._element.querySelector(Product.selectors.name).innerText = variant.name;\n this._element.querySelector(Product.selectors.description).innerHTML = variant.description;\n\n // Use client-side fetched price\n if (this._state.sku in this._state.prices) {\n this._updatePrice(this._state.prices[this._state.sku]);\n } else {\n // or server-side price as a backup\n this._updatePrice(variant.priceRange);\n }\n }", "title": "" }, { "docid": "523152fc6c70e5435c3fae82f83f13e9", "score": "0.68341625", "text": "function updateStock() {\n\t\t\t\t\t\tupdatedStock = selectedProductDetails.stock_quantity - answer.quantity;\n\t\t\t\t\t}", "title": "" }, { "docid": "bbb96d3a52cf6dc6636788951584f1db", "score": "0.6708791", "text": "_updatePrice(price, optionalSku) {\n let innerHTML = '';\n if (!price.range) {\n if (price.discounted) {\n innerHTML += `<span class=\"regularPrice\">${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })}</span>\n <span class=\"discountedPrice\">${this._formatter.formatPrice({\n value: price.finalPrice,\n currency: price.currency\n })}</span>\n <span class=\"you-save\">You save ${this._formatter.formatPrice({\n value: price.discountAmount,\n currency: price.currency\n })} (${price.discountPercent}%)</span>`;\n } else {\n innerHTML += `<span>${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })}</span>`;\n }\n } else {\n if (price.discounted) {\n innerHTML += `<span class=\"regularPrice\">${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })} - ${this._formatter.formatPrice({ value: price.regularPriceMax, currency: price.currency })}</span>\n <span class=\"discountedPrice\">${this._formatter.formatPrice({\n value: price.finalPrice,\n currency: price.currency\n })} - ${this._formatter.formatPrice({\n value: price.finalPriceMax,\n currency: price.currency\n })}</span>\n <span class=\"you-save\">You save ${this._formatter.formatPrice({\n value: price.discountAmount,\n currency: price.currency\n })} (${price.discountPercent}%)</span>`;\n } else {\n innerHTML += `<span>${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })} - ${this._formatter.formatPrice({\n value: price.regularPriceMax,\n currency: price.currency\n })}</span>`;\n }\n }\n\n let sku = optionalSku || this._state.sku;\n this._element.querySelector(Product.selectors.price + `[data-product-sku=\"${sku}\"]`).innerHTML = innerHTML;\n }", "title": "" }, { "docid": "24abed5141381d84cdb625b225ac9fdc", "score": "0.66994023", "text": "function updatePriceByProduct(product, productPrice){\n product.querySelector('.total-price span').innerHTML = productPrice;\n}", "title": "" }, { "docid": "412b8c36d41ba1f5ae8c8ec677bf960b", "score": "0.66733843", "text": "function updatePrices() {\n}", "title": "" }, { "docid": "8cb5e4be4cb494486b800cf857016ea5", "score": "0.6667328", "text": "function changePrice(element) {\n\n var table = document.getElementsByTagName(\"table\")[0].childNodes; // set all variables for later usage\n var size = table[element].childNodes[3].getElementsByTagName(\"select\")[0].value;\n var extras = table[element].childNodes[4].getElementsByTagName(\"input\");\n var priceCol = table[element].childNodes[5];\n var extraPrice = 0;\n var amount = 0;\n var pizzaPrice = table[element].childNodes[5].getElementsByTagName(\"input\")[size].value;\n\n for (var i = 0; i < extras.length; i++) { //loop through all extras\n\n if (extras[i].getAttribute(\"selected\") == \"true\") {\n extraPrice = parseFloat(extraPrice) + parseFloat(extras[i].value); // if an extra is selected add the price to total\n }\n }\n if (table[element].getElementsByTagName(\"select\")[1].value != 0) { // call the amount the user has selected\n\n amount = table[element].getElementsByTagName(\"select\")[1].value;\n } else {\n amount = 1; // if the amount is 0 set the value to 1 to display the single price of the product\n }\n var price = ((parseFloat(pizzaPrice) + parseFloat(extraPrice)) * amount).toFixed(2);\n priceCol.getElementsByTagName(\"span\")[0].innerHTML = \"Preis: \" + price + \" €\"; // set the inner of the HTML-span to the new price value\n\n}", "title": "" }, { "docid": "7fd581704c33b4e12d127098bd090a20", "score": "0.66370755", "text": "function updatePrice(price) { \n // first selected click, create price original to return. \n if (!price_o.attr('data-source-price')) {\n var source_price = price_o.attr('data-source-price', price_o.text());\n } \n \n //change price\n price_o.hide();\n price_o.text(price).fadeIn(300);\n // right_side.find('.loading').remove();\n }", "title": "" }, { "docid": "e1660b7bc0d27a9410b1bbb6efaafc0e", "score": "0.6597629", "text": "_onUpdateVariant(event) {\n const variant = event.detail.variant;\n if(!variant) return;\n\n // Update internal state\n this._state.sku = variant.sku;\n\n // Update values and enable add to cart button\n this._element.querySelector(Product.selectors.sku).innerText = variant.sku;\n this._element.querySelector(Product.selectors.name).innerText = variant.name;\n this._element.querySelector(Product.selectors.price).innerText = variant.formattedPrice;\n this._element.querySelector(Product.selectors.description).innerHTML = variant.description;\n }", "title": "" }, { "docid": "d87193e2a9bc4aa87ae3bf12275ed65a", "score": "0.65329367", "text": "function updatePrices() {\n clickUpgrades['shovel'].price = clickUpgrades['shovel'].newprice;\n clickUpgrades['excavator'].price = clickUpgrades['excavator'].newprice;\n autoUpgrades['jackhammer'].price = autoUpgrades['jackhammer'].newprice;\n autoUpgrades['wheelbarrow'].price = autoUpgrades['wheelbarrow'].newprice;\n\n}", "title": "" }, { "docid": "67e9aafd70d57c146f9bef51370b5bbc", "score": "0.6511813", "text": "function updateDomPrice() {\n dom.sPrice.innerHTML = totalPrice - deliveryCharges;\n\n dom.tPrice.innerHTML = totalPrice === deliveryCharges ? 0 : totalPrice;\n }", "title": "" }, { "docid": "7f48fbd71b546e85ed2514e27d4ddbed", "score": "0.6495869", "text": "function update_price() {\n var row = $(this).parents('.line-item');\n var kolicina = parseFloat(row.find('.kolicina>input').val());\n var cena = parseFloat(row.find('.cena>input').val());\n var popust = parseFloat(row.find('.popust>input').val());\n var davek = parseFloat(row.find('.davek>input').val());\n popust = (100-popust)/100;\n davek = (100 + davek)/100;\n skupaj = cena*kolicina*popust*davek;\n row.find('.skupaj').html(skupaj.toFixed(2));\n //update_total();\n}", "title": "" }, { "docid": "310043a95d1365e844bf98cc5ae35ba7", "score": "0.64457417", "text": "function updateBox () {\n\tvar originalBox = document.getElementById(\"boxOrder\"); //retrieve the box options in product detail page\n\tvar selectedBox = originalBox.value //retrieve the entered box quantity\n\tnumBoxes = parseInt(selectedBox) //update the global variable to current selection\n\tdocument.getElementById(\"priceOriginal\").textContent = \"$\" + numBoxes*numRolls*priceOrig + \".00\" //update displayed price\n}", "title": "" }, { "docid": "eeafbb4ae1c030c6920ee918b80892c7", "score": "0.63662636", "text": "function updateprice(){\n\n}", "title": "" }, { "docid": "036717ac824ada6612f39446e64591e1", "score": "0.6363182", "text": "function changePrice(){\n\t$(\"input[id^='alternative-']\").click(function() {\n\t//\t$(\"#callToBookDiv\").hide(); //if the previously selected item was onrequest hide the calltobook div and display addToTripButton div\n\t\t$(\"#addToTripButton\").show();\n\t\tvar selectedPrice=$(\"#selectedActivityPrice\").val();\n\t\tvar idSplit = $(this).attr('id').split(\"-\");\n\t\tvar newAltPrice=$(\"input[id='activityPrice-\" + idSplit[1] + \"']\").val();\n\t\tvar newPrice=parseFloat(selectedPrice)+parseFloat(newAltPrice);\n\t\t$(\"#priceDisplay\").text((newPrice).toFixed(2));\n\t\t$(\"#selectedAlternative\").val($(this).val());\n\t\t$(\"#altDescription\").html($(\"p[id='activityDescription-\" + idSplit[1] + \"']\").html());\n\t});\n}", "title": "" }, { "docid": "959018ae1863597404c0029800f042df", "score": "0.63545", "text": "function update_option_price (length) {\n if(typeof products == 'undefined'){\n return ;\n }\n\n length = (length.hasClass('.length')) ? length.attr('data-length') : length.closest('.length').attr('data-length');\n\n $.each(products, function(key, value){\n var inputs = $('.panel input[name=\"' + key + '\"]:not(.remove_spec)');\n\n if (inputs.length == 1) {\n inputs.closest('li').find('label .vat:first').update_vat('on-length', [value['total'][length],value['total_per_interval'][length]], 1);\n\n if ('setup_fee' in value)\n inputs.closest('li').find('setup-fee').update_vat('price', value['setup_fee'][length]);\n } else if(inputs.length > 1) {\n inputs.each(function () {\n var obj = $(this),\n sku = obj.attr('data-sku');\n\n if (sku in value) {\n obj.closest('li').find('label .vat:first').update_vat('on-length', [value[sku]['total'][length], value[sku]['total_per_interval'][length]], 1);\n\n if ('setup_fee' in value[sku]) {\n obj.closest('li').find('setup-fee .vat:not(.strikethrough .vat)').update_vat('price', value[sku]['setup_fee'][length])\n }\n }\n });\n }\n });\n }", "title": "" }, { "docid": "703590eaaca318cfce5246099b1ff9a5", "score": "0.63543576", "text": "function updatePricing(data) {\n var $priceDisplay = $('#event-edit__price');\n var totalPrice = 0;\n var emptyPriceText = '___';\n var newEventPriceString;\n\n if (isValidData(data)) {\n totalPrice = getDrinkPrice(data['guestCount'], data['length'], data['drinkPrice']);\n }\n\n if (totalPrice > 0) {\n var totalPriceText = formatMoney(totalPrice);\n newEventPriceString = totalPriceText;\n } else {\n newEventPriceString = emptyPriceText;\n }\n\n $priceDisplay.text(newEventPriceString);\n }", "title": "" }, { "docid": "275e1cab6f476f5150c147835d9cb929", "score": "0.63474613", "text": "function featurePrice(product, price) {\n document.getElementById(product + '-price').innerText = price;\n const total = calculateTotal();\n document.getElementById('total-price').innerText = total;\n document.getElementById('final-price').innerText = total;\n\n}", "title": "" }, { "docid": "8a560b3cc266f06ec1a2fcdb77768272", "score": "0.6340647", "text": "function change_variation_single_product_data() {\n\n if ($('form.variations_form').length && $('body').hasClass('single-product')) {\n\n $(document).ready(function() {\n\n let $currentProductId = $('.woocommerce-variation-add-to-cart').find('input[name=\"variation_id\"]').val();\n\n let tableRows = null;\n let specSheets = null;\n let installSheets = null;\n\n let $specTableAttr = $('#woocommerce-variable-product-attributes-table').attr('data-table-json');\n\n if ( $('#woocommerce-variable-product-attributes-table').length && typeof $specTableAttr !== typeof undefined && $specTableAttr !== false ) {\n\n tableRows = $.parseJSON($('#woocommerce-variable-product-attributes-table').attr('data-table-json'));\n\n }\n\n let $specAttr = $('#sp-spec-sheet').attr('data-spec-sheet-urls');\n\n if ( $('#sp-spec-sheet').length && typeof $specAttr !== typeof undefined && $specAttr !== false ) {\n\n specSheets = $.parseJSON($('#sp-spec-sheet').attr('data-spec-sheet-urls'));\n\n }\n\n let $installationAttr = $('#sp-installation-sheet').attr('data-installation-sheet-urls');\n\n if ( $('#sp-installation-sheet').length && typeof $installationAttr !== typeof undefined && $installationAttr !== false ) {\n\n installSheets = $.parseJSON($('#sp-installation-sheet').attr('data-installation-sheet-urls'));\n\n }\n\n if (specSheets !== null && specSheets !== undefined) {\n\n $('#sp-spec-sheet').show();\n $('#sp-spec-sheet').attr('href', specSheets[0].url);\n\n } else {\n\n $('#sp-spec-sheet').hide();\n\n }\n\n if (installSheets !== null && installSheets !== undefined) {\n\n $('#sp-installation-sheet').attr('href', installSheets[0].url);\n $('#sp-installation-sheet').show();\n\n } else {\n\n $('#sp-installation-sheet').hide();\n\n }\n\n if ($currentProductId == 0 || $currentProductId) {\n\n $('#woocommerce-variable-product-attributes-table').html(tableRows[0].rows);\n\n } else {\n\n for (let i = 0; i < tableRows.length; i++) {\n\n if (tableRows[i].variation_id == $currentProductId) {\n\n $('#woocommerce-variable-product-attributes-table').html(tableRows[i].rows);\n\n break;\n\n }\n\n }\n\n }\n\n $('.woocommerce-variation-add-to-cart').find('input[name=\"variation_id\"]').on('change', function() {\n\n\n for (let i = 0; i < tableRows.length; i++) {\n\n if (tableRows[i].variation_id == $(this).val()) {\n\n $('#woocommerce-variable-product-attributes-table').html(tableRows[i].rows);\n\n break;\n\n }\n\n }\n\n if ($('input[name=\"variation_id\"]').val() == 0 || $('input[name=\"variation_id\"]').val() == null) {\n\n if (specSheets !== null && specSheets !== undefined) {\n\n $('#sp-spec-sheet').show();\n $('#sp-spec-sheet').attr('href', specSheets[0].url);\n\n }\n\n if (installSheets !== null && installSheets !== undefined) {\n\n $('#sp-installation-sheet').show();\n $('#sp-installation-sheet').attr('href', installSheets[0].url);\n\n }\n\n } else {\n\n $('#sp-spec-sheet').hide();\n\n if (specSheets !== null && specSheets !== undefined) {\n\n for (let j = 0; j < specSheets.length; j++) {\n\n if (specSheets[j].variation_id == $(this).val()) {\n\n $('#sp-spec-sheet').show();\n $('#sp-spec-sheet').attr('href', specSheets[j].url);\n\n }\n\n }\n\n }\n\n $('#sp-installation-sheet').hide();\n\n if (installSheets !== null && installSheets !== undefined) {\n\n for (let k = 0; k < installSheets.length; k++) {\n\n if (installSheets[k].variation_id == $(this).val()) {\n\n $('#sp-installation-sheet').show();\n $('#sp-installation-sheet').attr('href', installSheets[k].url);\n\n }\n\n }\n\n }\n\n }\n\n });\n\n });\n\n }\n\n }", "title": "" }, { "docid": "d77f8487c7255c0aaa132af31f533744", "score": "0.63236856", "text": "function update_price() {\n var row = $(this).parents('.item-row');\n var cost = row.find('.rate').val();\n var qty = row.find('.qty').val();\n //console.log(row,cost,qty)\n // console.log(row.find('.price'))\n row.find('.price').val(Number(qty) * Number(cost));\n subTot.textContent = \"Sub Total: \" + summing();\n tot.textContent=\"Total: \"+summing()*1.5;\n\n }", "title": "" }, { "docid": "c9ef817435db9a85901425364ec51f7e", "score": "0.63190717", "text": "function updateProductDetail(event){\n\tvar productDetailPage=document.getElementById('product_detail_page');\n\tproductDetailPage.style.display='block';\n\tvar button=event.target\n\tvar selectedProduct=button.parentElement;\n\n\t//update the information on the floating window \n\tconsole.log(selectedProduct);\n\tvar newName=selectedProduct.getElementsByClassName('name')[0].innerHTML;\n\tdocument.getElementsByClassName('product_title')[0].innerHTML=newName+' Cinnamon Roll';\n\tvar newImageSrc=selectedProduct.getElementsByClassName('pic')[0].src; \n\tdocument.getElementById('detail_image').src=newImageSrc; \n\tvar newPrice=selectedProduct.getElementsByClassName('price')[0].innerHTML;\n\tdocument.getElementsByClassName('pricing')[0].innerHTML=newPrice+'/ea'\n\n\t//store the name and picture in local storage\n\tlocalStorage.setItem('currName',newName);\n\tlocalStorage.setItem('currPrice',newPrice);\n\tlocalStorage.setItem('currImageSrc',newImageSrc);\n\n\t//check which glazing is selected; add event listner to all of the options \n\tvar glazingList=document.getElementsByClassName('selected_glazing');\n\tfor (var i=0; i<glazingList.length; i++){\n\t\tvar glazing=glazingList[i].getElementsByTagName('input')[0];\n\t\t//console.log(glazing);\n\t\tglazing.addEventListener('click',updateChoice);\n\t\t//console.log(glazing);\n\t}\n\n\t//check which quantity is selected; add event listner to all of the options \n\tvar quantityList=document.getElementsByClassName('selected_quantity');\n\tfor (var i=0; i<quantityList.length; i++){\n\t\tvar quantity=quantityList[i].getElementsByTagName('input')[0];\n\t\tquantity.addEventListener('click',updateChoice); \n\t\t//updateSubtotal\n\t}\n\t\n}", "title": "" }, { "docid": "374fb42f778aa22e6e750668d577e479", "score": "0.6310321", "text": "function update(product, shade){\r\n\tdocument.getElementById('sel').innerHTML = \" Selected\";\r\n\tif(product == 'fxtreme'){\r\n\t\tdocument.getElementById('product').value = \"fxtreme\";\r\n\t\tdocument.getElementById('simg').src = \"images/1.png\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Firecherry Xtreme\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 1200\";\r\n\t}\r\n\telse\r\n\tif(product == 'fxtremeplus'){\r\n\t\tdocument.getElementById('product').value = \"fxtremeplus\";\r\n\t\tdocument.getElementById('simg').src = \"images/2.jpg\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Firecherry Xtreme Plus\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 1500\";\r\n\t}\r\n\telse\r\n\tif(product == 'elegantone'){\r\n\t\tdocument.getElementById('product').value = \"elegantone\";\r\n\t\tdocument.getElementById('simg').src = \"images/3.jpg\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Elegant One\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 1000\";\r\n\t}\r\n\telse\r\n\tif(product == 'elegantones'){\r\n\t\tdocument.getElementById('product').value = \"elegantones\";\r\n\t\tdocument.getElementById('simg').src = \"images/4.jpg\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Elegant One S\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 800\";\r\n\t}\r\n\telse\r\n\tif(product == 'alphax'){\r\n\t\tdocument.getElementById('product').value = \"alphax\";\r\n\t\tdocument.getElementById('simg').src = \"images/5.png\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Alpha X\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 500\";\r\n\t}\r\n\telse\r\n\tif(product == 'fnano'){\r\n\t\tdocument.getElementById('product').value = \"fnano\";\r\n\t\tdocument.getElementById('simg').src = \"images/6.jpg\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Firecherry Nano\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 400\";\r\n\t}\r\n\telse\r\n\tif(product == 'fnanos'){\r\n\t\tdocument.getElementById('product').value = \"fnanos\";\r\n\t\tdocument.getElementById('simg').src = \"images/7.png\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Firecherry Nano S\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 300\";\r\n\t}\r\n\telse\r\n\tif(product == 'jugnaut'){\r\n\t\tdocument.getElementById('product').value = \"jugnaut\";\r\n\t\tdocument.getElementById('simg').src = \"images/8.jpg\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Juggernaut\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 1800\";\r\n\t}\r\n\telse\r\n\tif(product == 'jugnautmini'){\r\n\t\tdocument.getElementById('product').value = \"jugnautmini\";\r\n\t\tdocument.getElementById('simg').src = \"images/9.jpg\";\r\n\t\tdocument.getElementById('stitle1').innerHTML = \"Juggernaut Mini\";\r\n\t\tdocument.getElementById('sprice').innerHTML = \"AUD 1600\";\r\n\t}\r\n\r\n\tif(shade == 'vb'){\r\n\t\tdocument.getElementById('shade').value = \"vb\";\r\n\t\tdocument.getElementById('stitle2').innerHTML = \"Void Black\";\r\n\t}\r\n\telse\r\n\tif (shade == 'fw'){\r\n\t\tdocument.getElementById('shade').value = \"fw\";\r\n\t\tdocument.getElementById('stitle2').innerHTML = \"Frost White\";\r\n\t}\r\n\telse\r\n\tif (shade == 'cg'){\r\n\t\tdocument.getElementById('shade').value = \"cg\";\r\n\t\tdocument.getElementById('stitle2').innerHTML = \"Carbon Grey\";\r\n\t}\r\n\telse\r\n\tif (shade == 'mb'){\r\n\t\tdocument.getElementById('shade').value = \"mb\";\r\n\t\tdocument.getElementById('stitle2').innerHTML = \"Mediterranean Blue\";\r\n\t}\r\n\telse\r\n\tif (shade == 'rp'){\r\n\t\tdocument.getElementById('shade').value = \"rp\";\r\n\t\tdocument.getElementById('stitle2').innerHTML = \"Rose Pink\";\r\n\t}\r\n}", "title": "" }, { "docid": "9f407a07c866d24154c42113d2956c3f", "score": "0.62546456", "text": "function setProductAmountDependsOnSelectedRadioButton()\n {\n $('.cr_sallingPrice').val(getProductAmountFromSelectedRadioButton());\n }", "title": "" }, { "docid": "9f3b0705b6d412b282d3f268aba9a086", "score": "0.62525374", "text": "changeProduct(v){\r\n\t\tvar rowObj = v, unitPrice = 0;\t\t\r\n\t\tlet vv = +rowObj['options'][v['selectedIndex']].value; //the ProductID value in the products array.\r\n\t\t\t\t\r\n\t\t//Find the original 'UnitPrice' from the products table of the product item the user selected from the dropdown list.\r\n\t\t//and set that unit price in the 'Unit Price' cell of the row that the user is on. Comma format it.\r\n\t\tfor(let i = 0; i < this.ProductsData['products'].length; i += 1){\r\n\t\t\tlet pId = +this.ProductsData['products'][i]['ProductID'];\r\n\t\t\tif( pId == vv ){\r\n\t\t\t\tunitPrice = +this.ParseFloat(''+this.ProductsData['products'][i]['UnitPrice']);\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\trowObj = document.getElementById(v['id']);\t\t\r\n\t\trowObj['cells'][1]['children'][0]['value'] = this.commaFormatted(''+ (unitPrice).toFixed(2));\r\n\t\t\r\n\t\treturn this.updateTotals();\t\t\r\n\t}", "title": "" }, { "docid": "08087f69c59c2e9362289746f02720a9", "score": "0.62504774", "text": "function checkPrice() {\n //update the new price based on users' current option choices\n if (frostingChosen === true && quantityChosen === true && methodChosen === true) {\n newPrice = preQuantityChoice.innerHTML * 3;\n var prePrice = document.getElementById(\"price\");\n prePrice.innerHTML = (\"Price: $ \" + newPrice);\n }\n}", "title": "" }, { "docid": "0b8cf4d4799a329143c5fc55e4efc475", "score": "0.62472296", "text": "function addStock() { \n // NOT allowed to use querySelectorAll()\n\n // find all the selected things \n var checkedbox = getSelectedRowBoxes(); \n\n //loop through all elements and extract the info.\n for (var i=0; i<checkedbox.length; i++){\n\n var status = checkedbox[i].parentNode.nextSibling.nextSibling.nextSibling; \n status.textContent = \"Yes\"; \n status.className = \"true\"; \n\n var prodID = checkedbox[i].parentNode.parentNode.id; \n products[prodID].inStock = true; \n\n // change the inStock value of the selected things \n //for (var 1=0; i<checked.length; i++)\n };\n\n saveData(); \n }", "title": "" }, { "docid": "c424adb7e44fa5ac6088daf6ce458605", "score": "0.6242885", "text": "function updatePrice(productprice) {\n const subTotal = document.getElementById(\"sub-total\");\n const taxAmount = document.getElementById(\"tax-amount\");\n const totalPrice = document.getElementById(\"total-price\");\n\n subTotal.innerText = parseInt(document.getElementById(\"phone-price\").innerText) + parseInt(document.getElementById(\"case-price\").innerText);\n taxAmount.innerText = ((subTotal.innerText) * 0.1).toFixed(3);\n totalPrice.innerText = parseInt(subTotal.innerText) + parseFloat(taxAmount.innerText);\n}", "title": "" }, { "docid": "68b904b96eac32630153e743f412776f", "score": "0.623387", "text": "function changeVal(el) {\n\tvar qt = parseFloat(el.parent().children(\".qt\").html());\n\tvar price = parseFloat(el.parent().children(\".price\").html());\n\tvar eq = Math.round(price * qt * 100) / 100;\n\tel.parent().children(\".full-price\").html( eq + \"₪\" );\n\n\tchangeTotal(); \n}", "title": "" }, { "docid": "f7afcb3cb64cd7e4231d49dce3a567f0", "score": "0.62193495", "text": "function show_variation( variation ) {\n var img = $('div.images img:eq(0)');\n var link = $('div.images a.zoom:eq(0)');\n var o_src = $(img).attr('original-src');\n var o_link = $(link).attr('original-href');\n\n var variation_image = variation.image_src;\n var variation_link = variation.image_link;\n var var_display;\n\n if ( variation.same_prices ) var_display = variation.availability_html;\n else var_display = variation.price_html + variation.availability_html;\n\n $('.single_variation').html( var_display );\n\n if ( ! o_src ) {\n $(img).attr('original-src', $(img).attr('src'));\n }\n\n if ( ! o_link ) {\n $(link).attr('original-href', $(link).attr('href'));\n }\n\n if ( variation_image && variation_image.length > 1 ) {\n $(img).attr('src', variation_image);\n $(link).attr('href', variation_link);\n } else {\n $(img).attr('src', o_src);\n $(link).attr('href', o_link);\n }\n\n $('.product_meta .sku').remove();\n $('.product_meta').append(variation.sku);\n\n $('.shop_attributes').find('.weight').remove();\n if ( variation.a_weight ) {\n $('.shop_attributes').append(variation.a_weight);\n }\n\n $('.shop_attributes').find('.length').remove();\n if ( variation.a_length ) {\n $('.shop_attributes').append(variation.a_length);\n }\n\n $('.shop_attributes').find('.width').remove();\n if ( variation.a_width ) {\n $('.shop_attributes').append(variation.a_width);\n }\n\n $('.shop_attributes').find('.height').remove();\n if ( variation.a_height ) {\n $('.shop_attributes').append(variation.a_height);\n }\n\n if ( ! variation.in_stock ) {\n $('.single_variation').slideDown();\n } else {\n $('.variations_button, .single_variation').slideDown();\n }\n }", "title": "" }, { "docid": "ff6f341c544ccf715416b2d090f24654", "score": "0.6219282", "text": "function updatingCostTotal(existPriceId,newPrice){\n // updating chipcost\n let chipExistingPrice=document.getElementById(existPriceId);\n chipExistingPrice.innerText=newPrice\n \n // updating total price and below total\n let bestPrice=gettingElementToNum(\"best-price\");\n let memoryCost=gettingElementToNum(\"memory-cost\");\n let storageCost=gettingElementToNum(\"storage-cost\");\n let deliveryCharge=gettingElementToNum(\"delivery-charge\");\n let total= bestPrice+memoryCost+storageCost+deliveryCharge;\n document.getElementById(\"total-price\").innerText=total; \n belowTotal.innerText=total;\n}", "title": "" }, { "docid": "0abc8808e79b59d33bde44fd8faff57f", "score": "0.62169963", "text": "function UpdateCart(quantityChanged, target, type, idx) {\n var cartContainer = document.getElementsByClassName('products')[0];\n var allproducts = cartContainer.getElementsByClassName('product');\n var totalprice = 0;\n for (var i = 0; i < allproducts.length; i++) {\n var CartProduct = allproducts[i];\n var price1kgProduct = CartProduct.getElementsByClassName('product-price-1kg')[0];\n var quantity1kgProduct = CartProduct.getElementsByClassName('product-quantity-1kg-input')[0];\n var price1kgNumber = parseFloat(price1kgProduct.innerText.replace('$ - 1KG', ''));\n var quantity1kg = quantity1kgProduct.value;\n var priceHalfkgProduct = CartProduct.getElementsByClassName('product-price-Halfkg')[0];\n var quantityHalfkgProduct = CartProduct.getElementsByClassName('product-quantity-Halfkg-input')[0];\n var priceHalfkgNumber = parseFloat(priceHalfkgProduct.innerText.replace('$ - 0.5KG', ''));\n var quantityHalfkg = quantityHalfkgProduct.value;\n totalprice = totalprice + (price1kgNumber * quantity1kg) + (priceHalfkgNumber * quantityHalfkg);\n }\n totalprice = Math.round(totalprice * 100) / 100\n document.getElementsByClassName('cartTotaPrice')[0].innerText = updateTotalPriceData() + '$';\n sessionStorage.setItem('CartTotalPrice', totalprice);\n if (quantityChanged) {\n console.log(target);\n QuantityFromIceCream[idx][type] = +target.value;\n updateShoppingCart();\n }\n //()\n\n}", "title": "" }, { "docid": "51db3c24b0e56211fa9361d0a839aedd", "score": "0.619938", "text": "function totalPriceUpdate() {\n const totalPrice = document.getElementById(\"total-price\");\n const grandTotalPrice = document.getElementById(\"grand-total\");\n const calculateTotalPrice =\n priceTextToNumber(\"best-price\") +\n priceTextToNumber(\"memory-cost\") +\n priceTextToNumber(\"storage-cost\") +\n priceTextToNumber(\"delivery-cost\");\n totalPrice.innerText = calculateTotalPrice;\n grandTotalPrice.innerText = calculateTotalPrice;\n}", "title": "" }, { "docid": "9bfa69e16de13ff48cec432ddeede545", "score": "0.61942035", "text": "function updateSubtot(productElement) {\n let price = Number(productElement.querySelector('.pu').querySelector('span').innerText) \n\n let quantity = Number(productElement.querySelector('.qty').querySelector('input').value)\n\n let subTot = Number(productElement.querySelector('.subtot').querySelector('span').innerText = price * quantity)\n\n return subTot\n}", "title": "" }, { "docid": "f0a52e592da34fcb8bd8f5022a1c9ff1", "score": "0.6192566", "text": "function updateSubtot2(e) {\n e.target.parentElement.parentElement.nextSibling.querySelector('span').textContent = ` ${Number($priceNme) * Number(e.target.value)}`;\n }", "title": "" }, { "docid": "20f78792c9600e673bf08b4037504e83", "score": "0.6180697", "text": "function updatePrice(Id, price) {\n getElement(Id + \"-price\").innerText = price;\n updateTotal();\n}", "title": "" }, { "docid": "d7e681be4cd681fdb93d6ec3d41d5848", "score": "0.61782223", "text": "function updatePrice(rate, quantity) {\n totalPrice += rate * quantity;\n console.log(totalPrice);\n updateDomPrice();\n }", "title": "" }, { "docid": "615d5df59edef36b54edb4f5bdeefd48", "score": "0.6160191", "text": "function updateTitalPrice(){\n const bestPrice=document.getElementById(\"best-price\");\n const bestPriceInner=parseInt(bestPrice.innerText);\n\n const memoryPrice=document.getElementById(\"memory-cost\");\n const memoryPriceInner=parseInt(memoryPrice.innerText);\n\n const storagePrice=document.getElementById(\"storage-cost\");\n const storagePriceInner=parseInt(storagePrice.innerText);\n\n const delivaryCost=document.getElementById(\"Delivery-charge\");\n const delivaryCostInner=parseInt(delivaryCost.innerText);\n\n const totalPrice=document.getElementById(\"total\");\n totalPrice.innerText=bestPriceInner+memoryPriceInner+storagePriceInner+delivaryCostInner;\n \n}", "title": "" }, { "docid": "27cf3b9f60a682dad0a3ca43c87a7d8d", "score": "0.6147916", "text": "function showOptions(){\n let price=Number(base_price.innerHTML);//starting price\n //If self driving selected\n if(sd.checked){\n price += Number(document.getElementById('sd_price_hidden').innerHTML);\n }\n //If autopilot selected\n if(ap.checked){\n price += Number(document.getElementById('ap_price_hidden').innerHTML);\n }\n //If 70kWh battery selected\n if(car_battery_70.checked){\n price += Number(document.getElementById('battery_70_price_hidden').innerHTML);\n }\n //If 80kWh battery selected\n if(car_battery_80.checked){\n price += Number(document.getElementById('battery_80_price_hidden').innerHTML);\n }\n //If AWD is selected\n if(awd.checked){\n price += Number(document.getElementById('awd_price_hidden').innerHTML);\n }\n //If 18 in wheel selected\n if(car_wheel_18.checked){\n price += Number(document.getElementById('wheel_18_price_hidden').innerHTML);\n }\n //If 19 in wheel selected\n if(car_wheel_19.checked){\n price += Number(document.getElementById('wheel_19_price_hidden').innerHTML);\n }\n //Update total on the page\n total_tag.innerHTML='Total Price $'+String(price);\n let savingProvince=document.getElementById('savingProvince');\n if(savingProvince.innerHTML=='bc'){\n priceAfterSaving.innerHTML='Price after savings: $'+Number(document.getElementById('saleAmount').innerHTML.split('$')[1]-5000);\n }else if(savingProvince.innerHTML=='on'){\n priceAfterSaving.innerHTML='Price after savings: $'+Number(document.getElementById('saleAmount').innerHTML.split('$')[1]-14000);\n }else{\n priceAfterSaving.innerHTML='Price without savings: $'+Number(document.getElementById('saleAmount').innerHTML.split('$')[1]);\n }\n}", "title": "" }, { "docid": "d1f6ac898563c6217a0309676b59f1a4", "score": "0.61476743", "text": "function updatePrice() {\n let selectedArr = [];\n seats.forEach(seat => {\n if (seat.classList.contains('selected')) {\n selectedArr.push(seat);\n }\n });\n\n\n total = value * selectedArr.length;\n showUpdatedPrice(selectedArr, total);\n}", "title": "" }, { "docid": "2a08adaba33ab5359cc0a88bfad7cecc", "score": "0.6139971", "text": "function UpdateFromLastCart() {\n\n for (var i = 0; i < 8; i++) {\n const OneKg = SpecificIceCream[i].Onekg;\n const HalfKg = SpecificIceCream[i].Halfkg;\n document.getElementById('quantity_' + SpecificIceCream[i].brand+'_1kg').value = OneKg;\n document.getElementById('quantity_' + SpecificIceCream[i].brand+'_halfkg').value = HalfKg;\n }\n document.getElementById('totalPriceText').value = updateTotalPriceData();\n}", "title": "" }, { "docid": "7f7652427842c364d935a627839d6522", "score": "0.608743", "text": "function storageSelect(price) {\n const storagePriceShow = document.getElementById('storage-price');\n storagePriceShow.innerText = price;\n priceManagement();\n}", "title": "" }, { "docid": "87b81bc09bd4ea5a5129f48e0bf707f7", "score": "0.60780555", "text": "function updateProductSubtotal() {\n // establish subtotal variable\n let productSubtotal = 0;\n // get current value from \"amount\" fields\n let amountValue = document.querySelector('input[name=\"amount\"]:checked').value;\n // assign monetary value at each amount level\n if (amountValue == 1) {\n productSubtotal = 1.99;\n } else if (amountValue == 3) {\n productSubtotal = 4.99;\n } else if (amountValue == 6) {\n productSubtotal = 8.99;\n } else {\n productSubtotal = 15.99;\n }\n // update subtotal in HTML\n productPageSubtotal.innerHTML = productSubtotal;\n\n console.log(productSubtotal);\n}", "title": "" }, { "docid": "2660456bc59b6147534f1cca7dc7273f", "score": "0.60675746", "text": "function displayOrder(order, updatePrice) {\n //versobe console\n //console.log('---- Displaying order...');\n\n jQuery('#order-items_grid table tbody').empty();\n var itemNumber = parseFloat(0);\n var subtotal = parseFloat(0);\n var subtotalInclTax = parseFloat(0);\n var totalTax = parseFloat(0);\n\n //retrieve tax\n var tax = parseFloat(0);\n\n jQuery.each(order, function (i, orderItem) {\n //calc\n orderItem.subtotal = orderItem.price * orderItem.qty;\n\n ////console.log(orderItem);\n if (orderItem.type == 'giftcard')\n orderItem.subtotalInclTax = orderItem.subtotal;\n else\n orderItem.subtotalInclTax = orderItem.priceInclTax * orderItem.qty;\n\n var orderOption = '';\n var edit_price = '';\n var change_qty = '';\n var out_stock = '';\n var is_qty_decimal = '';\n\n var limit = jQuery('#is_user_limited').val();\n if (limit == 0) edit_price = 'edit_price';\n else edit_price = '';\n var class_item = orderItem.class_item;\n var config_change = orderItem.config_change;\n\n if (orderItem.options.length > 0) {\n jQuery.each(orderItem.options, function (i, option) {\n var optionName = option.name.replace('[', '][');\n optionName = optionName.lastIndexOf(']') == (optionName.length - 1) ? optionName : optionName + ']';\n orderOption += '<input type=\"hidden\" name=\"item[' + orderItem.id + '][' + optionName + '\" value=\"' + option.value + '\">';\n //optionInput+='<span class=\"option-title\">'+option.optionTitle+': </span><span class=\"option-name\">'+option.qty+'x '+option.title+'</span></li>';\n if (!!option.value && option.value in productData) {\n var product_id = option.value;\n var product = productData[product_id];\n if (product.qty <= 0 && product.type == 'simple') {\n orderItem.out_stock = 1;\n }\n }\n });\n config_change = \"config_change item_config item_config-id\";\n class_item = \"config item_config item_config-id\";\n if (orderItem.type == 'grouped')\n change_qty = 'grouped';\n }\n\n if (orderItem.type == 'configurable' && orderItem.child_product_id != null) {\n /** XPOS-1888: sometime do NOT display \"Out of Stock\" properly\n * 07/04/2015\n */\n orderItem.out_stock = 0;\n var product_id = orderItem.child_product_id;\n var product = productData[product_id];\n if (!!product && product.qty <= 0 && product.type == 'simple') {\n orderItem.out_stock = 1;\n }\n }\n\n\n if (orderItem.out_stock == 1) {\n var out_stock = '<h6 style=\"height: 15px; line-height: 15px; padding-top:5px; color: red; font-size:.8em\">Out of Stock</h6>';\n }\n if (orderItem.is_qty_decimal == 1) {\n is_qty_decimal = 'qty_decimal';\n }\n //orderOption+='</ul>';\n var tempOrderItem = {};\n if (orderItem.qty == 0) {\n tempOrderItem.style = 'style=\"display:none\"';\n }\n tempOrderItem.id = orderItem.id;\n tempOrderItem.child_product_id = orderItem.child_product_id;\n tempOrderItem.baseId = orderItem.baseId;\n tempOrderItem.name = orderItem.name;\n //issue XPOS-1783\n tempOrderItem.sku = orderItem.sku;\n tempOrderItem.option = orderOption;\n tempOrderItem.qty = orderItem.qty;\n tempOrderItem.tax = orderItem.tax;\n tempOrderItem.subtotal = formatCurrency(orderItem.subtotal, priceFormat);\n tempOrderItem.class_item = class_item;\n tempOrderItem.price_name = orderItem.price_name;\n tempOrderItem.config_change = config_change;\n tempOrderItem.edit_price = edit_price;\n tempOrderItem.change_qty = change_qty;\n tempOrderItem.out_stock = out_stock;\n tempOrderItem.is_qty_decimal = is_qty_decimal;\n tempOrderItem.isNotChangePrice = 0;\n if (orderItem.type == 'bundle') {\n tempOrderItem.isNotChangePrice = 1;\n }\n if (displayTaxInSubtotal) {\n tempOrderItem.subtotal = formatCurrency(orderItem.subtotalInclTax, priceFormat);\n } else {\n tempOrderItem.subtotal = formatCurrency(orderItem.subtotal, priceFormat);\n }\n\n var orderItemOutput = '';\n if (onFlyDiscount) {\n if (jQuery(\"#price_includes_tax\").val() == 1) {\n tempOrderItem.price = orderItem.priceInclTax;\n } else {\n tempOrderItem.price = orderItem.price;\n }\n if (!!orderItem.custom_price) {\n tempOrderItem.price = orderItem.custom_price;\n }\n if (displayTaxInShoppingCart) {\n tempOrderItem.price_display = formatCurrency(orderItem.priceInclTax, priceFormat);\n } else {\n tempOrderItem.price_display = formatCurrency(orderItem.price, priceFormat);\n }\n if (priceFormat.decimalSymbol == ',' && tempOrderItem.price.toString().indexOf(',') !== -1) {\n tempOrderItem.price = formatCurrency(parseFloat(tempOrderItem.price.toString().replace(',', '.')), priceFormat);\n }\n orderItemOutput = nano(orderTemplate, tempOrderItem);\n } else {\n if (displayTaxInShoppingCart) {\n tempOrderItem.price = formatCurrency(orderItem.priceInclTax, priceFormat);\n } else {\n tempOrderItem.price = formatCurrency(orderItem.price, priceFormat);\n }\n\n orderItemOutput = nano(noDiscountTemplate, tempOrderItem);\n }\n\n /** XPOS-2006\n *\n */\n /*\n if (orderItem.type == 'bundle' && !!orderItem.bundle_children) {\n if (orderItem.qty > 0) {\n var _html = '';\n orderItem.bundle_children.forEach(function(_value, _index) {\n _value = parseInt(_value);\n _childProduct = productData[_index];\n\n _html += '<tr>';\n _html += '<td><div class=\"item-first\"><h5>'+_childProduct.name + '</h5><h6 class=\"sku-text\">' +_childProduct.sku+ '</h6></div></td>';\n _html += '<td class=\"qty align-center\">' + _value + '</td>';\n _html += '<td></td>';\n _html += '<td class=\"price align-right\"><input value=\"'+ _childProduct.price +'\" disabled=\"disabled\" /></td>';\n _html += '</tr>';\n\n });\n orderItemOutput += _html;\n }\n }\n */\n\n\n jQuery('#order-items_grid table tbody').append(orderItemOutput);\n if (tempOrderItem.isNotChangePrice == 1) {\n //console.log('bundle id = ' + tempOrderItem.id);\n var PriceIdBundle = 'item-display-price-' + tempOrderItem.id;\n //console.log('id bundle price = \"' + PriceIdBundle+'\"');\n disableElementById(PriceIdBundle);\n }\n itemNumber += parseFloat(orderItem.qty);\n subtotal += parseFloat(orderItem.subtotal);\n subtotalInclTax += parseFloat(orderItem.subtotalInclTax);\n if (orderItem.qty > 0) {\n totalTax += parseFloat(orderItem.tax * 0.01 * orderItem.price * orderItem.qty);\n }\n });\n\n //var tax = subtotalInclTax - subtotal;\n var tax = totalTax;\n jQuery('#item_count_value').text(itemNumber);\n if (updatePrice) {\n if (displayTaxInSubtotal) {\n jQuery('#subtotal_value').text(formatCurrency(subtotalInclTax.toFixed(2), priceFormat));\n } else {\n jQuery('#subtotal_value').text(formatCurrency(subtotal.toFixed(2), priceFormat));\n }\n if (isNumber(tax)) {\n jQuery('#tax_value').text(formatCurrency(tax, priceFormat));\n } else {\n totalTax = 0;\n jQuery('#tax_value').text(formatCurrency(tax, priceFormat));\n }\n\n if (subtotalInclTax == 0) {\n removeDiscount();\n }\n\n var discount = Math.abs(jQuery('#discount_value').val());\n // if(displayTaxInGrandTotal)\n var grandTotal = subtotalInclTax > discount ? subtotalInclTax - discount : 0;\n // else grandTotal = subtotal - discount;\n jQuery('#grandtotal').text(formatCurrency(grandTotal.toFixed(2), priceFormat));\n jQuery('#grand_before').val(formatCurrency(grandTotal.toFixed(2), priceFormat));\n jQuery('#cash-in').val(grandTotal.toFixed(2));\n }\n setTimeout(function () {\n jQuery('#items_area').getNiceScroll().doScrollPos(0, 100000);\n }, 500);\n jQuery('#items_area').getNiceScroll().doScrollPos(0, 100000);\n\n function removeDiscount() {\n jQuery('#discount_value').val(0);\n jQuery('#order_discount').val(0);\n jQuery('#discount_change').val(1);\n }\n}", "title": "" }, { "docid": "fe1cad3c02d7a79faef1662222a106c7", "score": "0.60644495", "text": "function cakeFlavorPrice() { //lahat na dito para madetermine nya anong shape siya na belong. 1 function is recommended\n if(document.getElementById('flavor1').checked) { \n //orange\n }\n\n if(document.getElementById('flavor2').checked) {\n //choco\n }\n\n if(document.getElementById('flavor3').checked) { \n //caramel\n } \n\n //additional charges\n if(document.getElementById('flavor4').checked) {\n //vanilla\n price = $('#vanilla_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n }\n\n if(document.getElementById('flavor5').checked) {\n //ube\n price = $('#ube_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n if(document.getElementById('flavor6').checked) {\n //strawberry\n price = $('#strawberry_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n // NEW FOR PRICE CALCULATION\n\n if(document.getElementById('flavorblue').checked) {\n //strawberry\n price = $('#strawberry_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n if(document.getElementById('flavor7').checked) {\n //redvelvet\n price = $('#redvelvet_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n if(document.getElementById('flavor8').checked) {\n //coffee\n price = $('#coffee_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n}", "title": "" }, { "docid": "cc3a0efa0ff79d9239189903ff2588e3", "score": "0.6053757", "text": "function setPrice(x){\n let product_price = currencyChecker(x);\n let new_id = x.id.replace('input-item-', 'product-price-');\n\n document.getElementById(new_id).textContent = product_price;\n}", "title": "" }, { "docid": "396b4c10a5acc3fe04be1915eedca7fd", "score": "0.604556", "text": "function updateModalPrice(){\n\tvar id;\n\tvar p;\n\t\n\tfor(var item in cart){\n\t\tp = product[item];\n\t\tid = p.name;\n\t\tif(cart[item] != 0){\n\t\t\tdocument.getElementById(id + \"price\").innerHTML = \"$\" + p.price;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "662dfa8e799b75ed17233a087a32a423", "score": "0.60441834", "text": "function changeqty(id, opr) {\n var num = Number($('.number' + id).text());\n if (isNaN(opr)) {\n if (opr == 'plus') {\n num++;\n } else if(opr == 'minus' && num > 1) {\n num--;\n } else {\n return false;\n }\n $(\"#select\" + id).val(num);\n } else {\n num = opr;\n }\n $('.number' + id).text(num);\n var price = $('.Mprice'+id).val();\n var new_price = num*Number(price);\n $('.modalprice'+id).text('$'+new_price.toFixed(2));\n showloader();\n}", "title": "" }, { "docid": "a2dd106677807312e5690d7724ee56e4", "score": "0.60437083", "text": "function changePrice() {\n if ($('#switch1').is(\":checked\")) {\n if ($pr_sale.val() != 0 && $pr_price.val() != '') {\n $('#price-sale-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-preview').html(formatNumber($pr_price.val() - $pr_price.val() / 100 * $pr_sale.val()) + \" ₫\")\n $('#sale-preview').show()\n $('#sale-preview').html($pr_sale.val() + \"%\")\n } else {\n $('#price-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-sale-preview').html('')\n $('#sale-preview').hide()\n }\n } else {\n $('#price-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-sale-preview').html('')\n $('#sale-preview').hide()\n }\n }", "title": "" }, { "docid": "f0f64f5e343e9fad309cd42a7eee38f4", "score": "0.60430324", "text": "function updateSubtot(product) {\n let productPrice = Number(product.querySelector('.pu > span').innerHTML);\n let productQty = product.querySelector('.qty input').value;\n let subTotal = productPrice * productQty;\n product.querySelector('.subtot > span').innerHTML = subTotal;\n return subTotal;\n}", "title": "" }, { "docid": "358a4d15ec4f74361438d6bde3413e60", "score": "0.6040679", "text": "function refreshComponentPrice() {\n\t\tconst selectPackages = pricingWrapper.find('.row-component .select-package:enabled');\n\t\tselectPackages.each(function (index, selectPackage) {\n\t\t\tif ($(selectPackage).val()) {\n\t\t\t\t$(selectPackage).trigger('change');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "91b02fc2178983b556b01ba357e0304f", "score": "0.6039243", "text": "function update_form_product_price(item){\n const form_product = findParentElementByClass(item, 'product-form').getElementsByTagName('form')[0];\n let spam_price = form_product.getElementsByClassName(\"product-form-price\")[0];\n let price = getProductFormPrice(form_product);\n\n spam_price.innerHTML = price.toFixed(2);\n}", "title": "" }, { "docid": "5895c9a4345b44931506b92139b2318e", "score": "0.60258746", "text": "function updateTotal() {\n let previousTotalPrice = document.getElementById('total-price');\n let previousTotalAmount = document.getElementById('total-amount');\n\n const fixedPrice = Number(bestPrice.innerText);\n const extraMemoryCost = Number(extraMemoryPrice.innerText);\n const extraStorageCost = Number(extraStoragePrice.innerText);\n const deliveryCost = Number(deliveryCharges.innerText);\n\n newTotalPrice = fixedPrice + extraMemoryCost + extraStorageCost + deliveryCost;\n newTotalAmount = fixedPrice + extraMemoryCost + extraStorageCost + deliveryCost;\n\n previousTotalPrice.innerText = newTotalPrice;\n previousTotalAmount.innerText = newTotalAmount;\n\n}", "title": "" }, { "docid": "59ad2dd323891039e09cb4420c52fd37", "score": "0.60247535", "text": "function PriceUpdate(price) {\n $(\"#price\").text(price);\n}", "title": "" }, { "docid": "8714e67e81e13c71bbbf2b326d9f9128", "score": "0.6022347", "text": "function update_product_sizes_price(item, index){\n let form_product;\n \n if (item === null){\n form_product = document.getElementsByClassName('product-form')[index].getElementsByTagName('form')[0];\n } else {\n form_product = findParentElementByClass(item, 'product-form').getElementsByTagName('form')[0];\n }\n \n let spam_prices = form_product.getElementsByClassName('product-size-price');\n let prices = getProductSizePrices(form_product);\n\n for (let i=0; i < spam_prices.length; i++) {\n let size = form_product['size'][i].value;\n spam_prices[i].innerHTML = parseFloat(prices[size]).toFixed(2);\n }\n\n //Update the total price\n if (item === null) {\n update_form_product_price(form_product);\n } else {\n update_form_product_price(item);\n }\n}", "title": "" }, { "docid": "53fc4650aff062269f2e9161e4c430d9", "score": "0.6019247", "text": "function updateSubtot($product) {\n // Iteration 1.1\n let priceUnit = $product.querySelector(\".pu span\").innerText;\n let quantityUnit = $product.querySelector(\".qty label input\").value;\n let newSubTotal = Number(priceUnit) * Number(quantityUnit);\n \n $product.querySelector(\".subtot span\").innerText = newSubTotal;\n return newSubTotal;\n}", "title": "" }, { "docid": "9e7ac8f0fc24a5eb2c2660fd318cff15", "score": "0.60153896", "text": "function itemUpdate(index, type) {\n var quantity = document.getElementById(`quantity-${index}`).value;\n var newQuantity;\n if (type === \"inc\") {\n newQuantity = parseInt(quantity) + 1;\n } else if (type === \"dec\") {\n newQuantity = parseInt(quantity) - (parseInt(quantity) > 0 ? 1 : 0);\n } else {\n newQuantity = 0;\n }\n currentPrice[index] = basePrice[index] * newQuantity;\n document.getElementById(`price-${index}`).innerText = currentPrice[index];\n document.getElementById(`quantity-${index}`).value = newQuantity;\n quantity = newQuantity;\n totalPriceUpdate();\n}", "title": "" }, { "docid": "2f89b945aaf194d4d5e339253607bc8a", "score": "0.6012405", "text": "function updatePrice(obj) {\n var price = $(obj).val();\n $(obj).closest('tr').find('.p_qtd').attr('data-price',price);\n updateSubtotal($(obj).closest('tr').find('.p_qtd'));\n}", "title": "" }, { "docid": "ab05b424622dedf40c1d7439dff6c78f", "score": "0.60105515", "text": "function displayprice(){\r\n subtotal=0;\r\n weight=0;\r\n quantity=0;\r\n\r\n var selectboxofoctupus = document.getElementById(\"selectboxwholeoctupus\");\r\n var rowwholeoctupus = document.getElementById(\"newitem\");\r\n //https://thisinterestsme.com/check-element-exists-javascript/\r\n if (typeof(rowwholeoctupus) !=undefined && rowwholeoctupus !=null){\r\n if (selectboxofoctupus.checked){\r\n subtotal = subtotal + parseFloat(document.getElementById(\"priceofoctupus\").value * document.getElementById(\"display\").value);\r\n quantity = quantity + parseFloat(document.getElementById(\"display\").value);\r\n weight = weight + parseFloat(document.getElementById(\"weightofoctupus\").value * (document.getElementById(\"display\").value) );\r\n }\r\n }\r\n \r\n\r\n var selectboxofslicedoctupus = document.getElementById(\"checkboxforslicedoctupus\");\r\n var rowslicedoctupus = document.getElementById(\"newitemslicedoctupus\");\r\n\r\n if (typeof(rowslicedoctupus) != undefined && rowslicedoctupus != null){\r\n if (checkboxforslicedoctupus.checked){\r\n subtotal = subtotal + parseFloat(document.getElementById(\"priceslicedoctupus\").value * document.getElementById(\"display1\").value);\r\n quantity = quantity + parseFloat(document.getElementById(\"display1\").value);\r\n weight = weight + parseFloat(document.getElementById(\"weightslicedoctupus\").value * (document.getElementById(\"display1\").value));\r\n }\r\n }\r\n \r\n var selectboxofcookedctupus = document.getElementById(\"checkboxcookedoctupus\");\r\n var rowscookedoctupus = document.getElementById(\"newitemcookedoctupus\");\r\n if (typeof(rowscookedoctupus) != undefined && rowscookedoctupus != null){\r\n if(selectboxofcookedctupus.checked){\r\n subtotal = subtotal + parseFloat(document.getElementById(\"pricecookedoctupus\").value * document.getElementById(\"display2\").value);\r\n quantity = quantity + parseFloat(document.getElementById(\"display2\").value);\r\n weight = weight + parseFloat(document.getElementById(\"weightcookedoctupus\").value * (document.getElementById(\"display2\").value));\r\n }\r\n }\r\n\r\n var selectboxofnormaloctupus = document.getElementById(\"checkboxfornormaloctupus\");\r\n var rownormaloctupus = document.getElementById(\"newitemnormaloctupus\");\r\n if (typeof(rownormaloctupus) !=undefined && rownormaloctupus != null){\r\n if(selectboxofnormaloctupus.checked){\r\n subtotal = subtotal + parseFloat(document.getElementById(\"pricenormaloctupus\").value * document.getElementById(\"displaynormaloctupus\").value);\r\n quantity = quantity + parseFloat(document.getElementById(\"displaynormaloctupus\").value);\r\n weight = weight + parseFloat(document.getElementById(\"weightnormaloctupus\").value * (document.getElementById(\"displaynormaloctupus\").value));\r\n\r\n }\r\n }\r\n \r\n\r\n document.getElementById(\"displayinfo\").innerHTML =\"The total price is \"+subtotal+\". The total quanity is \"+quantity+\" items. The total weight is \"+weight + \"g\";\r\n}", "title": "" }, { "docid": "a6befffccc85775903e9b7c0b45351ff", "score": "0.6007683", "text": "function storageCost(stroageType){\n // storage button call here \n const storagePrice = document.getElementById(stroageType);\n // Storage Button 256GB call here \n const storagePrice256gb = document.getElementById(\"storage-256gb\");\n // Storage Button 512GB call here \n const storagePrice512gb = document.getElementById(\"storage-512gb\");\n // Storage Button 1TB call here \n const storagePrice1tb = document.getElementById(\"storage-1tb\");\n // storage price showing place call here \n const storagePriceReset = document.getElementById(\"previous-storage-cost\");\n // for 256GB storage price is change here\n if(storagePrice==storagePrice256gb){\n storagePriceReset.innerText = 0;\n }\n // for 512GB storage price is change here\n else if(storagePrice==storagePrice512gb){\n storagePriceReset.innerText = 100;\n }\n // for 1TB storage price is change here\n else if(storagePrice==storagePrice1tb){\n storagePriceReset.innerText = 180;\n }\n // calculation total price function call here \n total();\n}", "title": "" }, { "docid": "bda714f56aff834fc365352a858d14d8", "score": "0.5995788", "text": "function updateDisplayedTotalPrice(){\n // calculate total price of the cart\n let totalPrice = cart.getTotalPrice();\n\n // Modify the displayed value\n document.getElementById(\"total-price\").innerHTML = formatPrice(totalPrice);\n}", "title": "" }, { "docid": "9ab328028518aeaac8d08abe39242d64", "score": "0.5995634", "text": "function changePrice() {\n\tdiscountPackages.forEach((price, i) => {\n\t\tif (toggle.checked === true && slider.valueAsNumber === i) {\n\t\t\tdocument.querySelector(\".month\").innerHTML = \"/year\";\n\t\t\tdisplayPrice.innerHTML = `$${discountPackages[i]}.00`;\n\t\t} else if (toggle.checked === false && slider.valueAsNumber === i) {\n\t\t\tdisplayPrice.innerHTML = `$${pricePackages[i]}.00 `;\n\t\t\tdocument.querySelector(\".month\").innerHTML = \"/month\";\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6039765da8a448b0a581bbccde8b5566", "score": "0.5987162", "text": "function getCurrentSpec() {\n frank_global.product.current = {\n size: get('#productSize .sizeChoosed').innerText.trim(),\n color: {\n code: get('#productColor .colorChoosed').firstChild.dataset.color_code,\n name: get('#productColor .colorChoosed').firstChild.dataset.name\n },\n };\n frank_global.product.current.stock = (function (variants) {\n for (let v of variants) {\n let choosen = ( v.size === frank_global.product.current.size && frank_global.product.current.color.code === v.color_code);\n if (choosen) {\n frank_global.product.current.number = v.stock? 1: 0;\n get('#productNumValue').innerText = frank_global.product.current.number;\n /** set the initial numberToBuy is one */\n return v.stock;\n }\n }\n /** set the initial numberToBuy is zero if there is no stock */\n get('#productNumValue').innerText = frank_global.product.current.number;\n return 0;\n } (frank_global.product.product.variants))\n}", "title": "" }, { "docid": "b769d2b524aeedaea226d640edf7b252", "score": "0.5976642", "text": "function displayProductInfo(productData) {\n document.getElementById(\"product-section\").style.display='flex';\n //Titre de la page (Modèle + Nom du produit)\n document.getElementById(\"product__title\").textContent = \"Modèle \" + productData.name;\n //Référence du produit\n document.getElementById(\"product__id\").textContent = \"Réf. : \" + productData._id;\n //Adresse de l'image du produit\n document.getElementById(\"product__img\").src = productData.imageUrl;\n //Nom du produit\n document.getElementById(\"product__name\").textContent = productData.name; \n //Prix du produit \n document.getElementById(\"product__price\").textContent = productData.price/100 + \".00€\";\n //Description du produit\n document.getElementById(\"product__description\").textContent = productData.description;\n\n // ____________________ Affichage quantité, options et prix ____________________ \n \n // Choix quantité : création d'une liste déroulante de quantité à partir d'un tableau \n let selectQty = document.createElement(\"select\");\n selectQty.className = \"product__quantity--selector\";\n selectQty.id = \"product__quantity--selector\";\n document.getElementById(\"product__quantity\").appendChild(selectQty);\n let optionsQty = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"];\n\n for(let i = 0; i < optionsQty.length; i++) {\n let qty = optionsQty[i];\n let optionElement = document.createElement(\"option\");\n optionElement.textContent = qty;\n optionElement.value = qty;\n selectQty.appendChild(optionElement);\n }\n \n // Calcul et affichage du nouveau prix en fonction de la quantité sélectionnée \n let newPrice = document.createElement(\"p\");\n newPrice.className = \"qty__price\";\n newPrice.className = \"bold\";\n newPrice.textContent = \"Total : \" + productData.price / 100 + \".00€\";\n document.getElementById(\"new__price\").appendChild(newPrice);\n selectQty.addEventListener('change', updateNewPrice);\n\n // Fonction pour mettre à jour le prix affiché lorsque l'utilisateur modifie la quantité\n function updateNewPrice() {\n let qtyPrice = (parseInt(selectQty.value) * productData.price) / 100;\n newPrice.textContent = \"Total : \" + qtyPrice + \".00€\"; \n }\n\n // _______________________ AJOUT PRODUITS AU PANIER _______________________ \n\n // Event listener du bouton \"Ajouter au panier\"\n const btnAddToCart = document.getElementById(\"btn_addToCart\"); \n btnAddToCart.addEventListener(\"click\", (event) => {\n event.preventDefault(); // Ne pas actualiser la page lors du clic \n\n // Création d'un objet contenant les infos du produit ajouté au panier\n let productToAdd = {\n product_img: productData.imageUrl,\n product_name: productData.name,\n product_id: productData._id,\n product_qty: parseInt(selectQty.value),\n product_price: productData.price / 100,\n product_newPrice: (parseInt(selectQty.value) * productData.price) / 100,\n }\n \n let cartProduct = JSON.parse(localStorage.getItem(\"cart\"));\n // Fonction pour ajouter (push) un productToAdd au localStorage (ajouter un produit au panier)\n const addToLocalStorage = () => {\n cartProduct.push(productToAdd);\n localStorage.setItem(\"cart\", JSON.stringify(cartProduct));\n }\n\n // Fonction pour afficher la popup \"produit ajouté au panier\" lorsque l'utilisateur a cliqué sur le bouton d'ajout au panier et que l'ajout a réussi \n const popUpProductAddedToCart = () => {\n document.getElementById(\"popupContainer\").style.display = \"flex\";\n document.getElementById(\"closePopup_icone\").addEventListener('click', () => {\n closePopupContainer();\n })\n }\n // Si panier vide \n if(cartProduct === null) {\n // Création d'un tableau (vide) et ajout (push) d'un nouvel objet productToAdd\n cartProduct = [];\n addToLocalStorage();\n // Affichage d'une popup \"produit ajouté au panier\"\n popUpProductAddedToCart();\n } else {\n let cartProduct2 = JSON.parse(localStorage.getItem(\"cart\"));\n for (let p in cartProduct2) {\n if(cartProduct2[p].product_id === productData._id){\n console.log(\"déjà présent\");\n // Calcul new qty \n console.log(cartProduct2[p].product_qty);\n // Ajouter nouveau produit avec quantité totale \n let productToAdd2 = {\n product_img: productData.imageUrl,\n product_name: productData.name,\n product_id: productData._id,\n product_qty: cartProduct2[p].product_qty + parseInt(selectQty.value),\n product_price: productData.price / 100,\n product_newPrice: ((cartProduct2[p].product_qty + parseInt(selectQty.value)) * productData.price) / 100,\n }\n console.log(productToAdd2);\n // Remove ancien produit du localStorage (celui qui était déjà présent dans le panier)\n cartProduct.splice([p], 1, productToAdd2);\n localStorage.setItem(\"cart\", JSON.stringify(cartProduct));\n productToPush = false;\n popUpProductAddedToCart();\n\n }else{\n productToPush = true;\n }\n }\n if(productToPush){\n addToLocalStorage();\n // Affichage d'une popup \"produit ajouté au panier\"\n popUpProductAddedToCart();\n }\n }\n })\n\n}", "title": "" }, { "docid": "11deacbe72d9700cacc6aad09360b035", "score": "0.59737265", "text": "function updateSubtotal(product) {\n const price = product.querySelector('.price span');\n const priceContent = parseInt(price).innerText;\n\n const quantity = product.querySelector('input').value;\n const incrementQuantity = quantity.valueAsNumber;\n\n const subtotalPrice = priceContent * incrementQuantity;\n\n const subTotalcontainer = product.querySelector('.subtotal span');\n const subtotalContent = subTotalcontainer.innerText;\n\n const subTotal = (subtotalContent.innerHTML =\n '<em>' + subtotalPrice + '</em>');\n\n return subTotal;\n}", "title": "" }, { "docid": "24b1e5425c284ab131019a567d21fcf6", "score": "0.5969968", "text": "updatePriceFromPricing () {\n this.config.display.amount = this.pricing.totalNow;\n this.config.display.currency = this.pricing.currencyCode;\n }", "title": "" }, { "docid": "80d49d371eb4f3012cc35fac9c724e66", "score": "0.5968394", "text": "function calculatePrice() {\n\t\tArray.from(pricingWrapper.find('.pricing-item')).forEach(function (pricingItem) {\n\t\t\tlet totalComponentPrice = 0;\n\t\t\tlet totalPackagingPrice = 0;\n\t\t\tlet totalSurchargePrice = 0;\n\t\t\tconst insurance = formatter.getNumberValue($(pricingItem).find('.input-insurance-price').val() || 0);\n\n\t\t\t/*\n\t\t\tArray.from($(pricingItem).find('.input-component-price-original')).forEach(function (inputComponentPrice) {\n\t\t\t\tconst componentPriceOriginal = formatter.getNumberValue($(inputComponentPrice).val() || 0);\n\t\t\t\tconst componentDurationPercent = $(inputComponentPrice).closest('.row-component').find('.input-duration-percent').val();\n\t\t\t\tconst componentPrice = componentPriceOriginal + (componentDurationPercent / 100 * componentPriceOriginal);\n\t\t\t\t$(inputComponentPrice).closest('.row-component').find('.input-component-price').val(formatter.setNumberValue(componentPrice, 'Rp. '));\n\t\t\t});\n\t\t\t */\n\n\t\t\tArray.from($(pricingItem).find('.input-component-price')).forEach(function (inputComponentPrice) {\n\t\t\t\tconst componentPrice = formatter.getNumberValue($(inputComponentPrice).val() || 0);\n\t\t\t\ttotalComponentPrice += formatter.getNumberValue($(inputComponentPrice).val() || 0);\n\t\t\t});\n\t\t\tArray.from($(pricingItem).find('.input-packaging-price')).forEach(function (inputPackagingPrice) {\n\t\t\t\ttotalPackagingPrice += formatter.getNumberValue($(inputPackagingPrice).val() || 0);\n\t\t\t});\n\t\t\tArray.from($(pricingItem).find('.input-surcharge-price')).forEach(function (inputSurchargePrice) {\n\t\t\t\ttotalSurchargePrice += formatter.getNumberValue($(inputSurchargePrice).val() || 0);\n\t\t\t});\n\t\t\tconst totalPurchase = totalComponentPrice + totalPackagingPrice + totalSurchargePrice + insurance;\n\t\t\tconst totalSellBeforeTax = totalPurchase + (margin / 100 * totalPurchase);\n\n\t\t\tlet tax = 0;\n\t\t\tif (selectIncomeTax.val() === '1') {\n\t\t\t\ttax = 0.02 * totalSellBeforeTax;\n\t\t\t}\n\t\t\tconst totalSellAfterTax = totalSellBeforeTax + tax;\n\n\t\t\t$(pricingItem).find('.label-purchase-amount').text(formatter.setNumberValue(totalPurchase, 'Rp. '));\n\t\t\t$(pricingItem).find('.label-sell-before-tax').text('(' + formatter.setNumberValue(margin) + '%) ' + formatter.setNumberValue(totalSellBeforeTax, 'Rp. '));\n\t\t\t$(pricingItem).find('.label-sell-after-tax').text(formatter.setNumberValue(totalSellAfterTax, 'Rp. '));\n\n\t\t});\n\t}", "title": "" }, { "docid": "8786fa744dc6b1788f254a505ab218bb", "score": "0.59674186", "text": "function calculateCurrentPrice() {\n console.log(\"RECALCULATING PRICE\");\n console.log(store.store);\n let currPrice = 0;\n if (store.get(\"type\") === \"hoodie\") {\n currPrice += parseFloat(store.get(\"settings\")[0][1]);\n } else if (store.get(\"type\") && store.get(\"type\") === \"crewneck\") {\n currPrice += parseFloat(store.get(\"settings\")[1][1]);\n }\n if (store.get(\"color\") === \"green\") {\n currPrice += parseFloat(store.get(\"settings\")[2][1]);\n } else if (store.get(\"color\") && store.get(\"color\") === \"gray\") {\n currPrice += parseFloat(store.get(\"settings\")[3][1]);\n }\n if (document.getElementById(\"front_select\").selectedIndex === 2) {\n currPrice += parseFloat(store.get(\"settings\")[4][1]);\n }\n if (document.getElementById(\"left_arm_select\").selectedIndex === 2) {\n currPrice += parseFloat(store.get(\"settings\")[5][1]);\n }\n if (document.getElementById(\"right_arm_select\").selectedIndex === 2) {\n currPrice += parseFloat(store.get(\"settings\")[6][1]);\n }\n if (document.getElementById(\"back_select\").selectedIndex === 2) {\n currPrice += parseFloat(store.get(\"settings\")[7][1]);\n }\n if (document.getElementById(\"hood_select\").selectedIndex === 2) {\n currPrice += parseFloat(store.get(\"settings\")[8][1]);\n }\n store.set(\"total_price\", \"$\" + currPrice);\n document.getElementById(\"price_display\").innerHTML =\n \"Total: \" + numToPrice(currPrice);\n}", "title": "" }, { "docid": "1c28d24f7fdf3a5592e859e24c884669", "score": "0.5964213", "text": "updatePrice() {\n var index = 0;\n this.total_price = this.collection.data[this.current_product_index].price;\n for (let option_item of this.check_option_list) {\n if (option_item) {\n this.total_price += Number(this.collection.data[this.current_product_index].options[index].price);\n }\n index++;\n }\n }", "title": "" }, { "docid": "cb16e3a46c06d20a9b31f91bf1309e53", "score": "0.59599924", "text": "function changeProductPrice(attributePrice, attributeValue, target) {\n const goodsPrice = target.querySelector('.goods__price');\n goodsPrice.textContent = \"\";\n goodsPrice.insertAdjacentHTML('afterbegin', `${attributePrice}<span style=\"margin-left: 4px;\">руб.</span>`);\n target.setAttribute('data-price', attributePrice);\n target.setAttribute('data-value', attributeValue)\n }", "title": "" }, { "docid": "20509f7f5d2d14f2025b257eb3907891", "score": "0.59565973", "text": "function auto_populate_price(product_id, regular_id, sale_id, sale_label_id){\n $(product_id).change(function(e) {\n var spinner_element1 = $($(regular_id).parent().find('.spinner')[0]);\n var spinner_element2 = $($(sale_id).parent().find('.spinner')[0]);\n spinner_element1.addClass('is-active');\n spinner_element2.addClass('is-active');\n\n var url = \"/wp-admin/admin-ajax.php?action=get_product_price\";\n url += \"&post_id=\"+$(product_id).select2('data').id;\n $.ajax({\n type:'GET',\n url: url,\n success: function (data) {\n data = data.substr(0,data.length-1);\n var dataObject = JSON.parse(data);\n $(regular_id).val(dataObject._regular_price);\n $(sale_id).val(dataObject._sale_price);\n calculate_sale_percentage(regular_id, sale_id, sale_label_id);\n\n spinner_element1.removeClass('is-active');\n spinner_element2.removeClass('is-active');\n }\n });\n });\n }", "title": "" }, { "docid": "fa7e7d5bee94fbc5e5d372da97cdbb2e", "score": "0.5955136", "text": "changeQuantHandler(v, i){\n\t\tthis.props.changeQuant(i, v);\n\t\tthis.calcPrices(i);\n\t}", "title": "" }, { "docid": "54d1fe288e1cdcca66473cc03c21cf40", "score": "0.5949811", "text": "function update_item_stock(row_id) {\n //\n create_form('stock_change_form','content-div');\n //\n // manually populating form from item table\n document.getElementById('item-number').value = document.getElementById(row_id+'-item_number').innerHTML;\n document.getElementById('item-name').value = document.getElementById(row_id+'-item_name').innerHTML;\n document.getElementById('curr-quantity').value = document.getElementById(row_id+'-quantity').innerHTML;\n document.getElementById('new-quantity').value = document.getElementById(row_id+'-quantity').innerHTML;\n var d = new Date();\n var day = d.getDate();\n var mon = d.getMonth()+1;\n if (day < 10) {day = '0'+day.toString();}\n if (mon < 10) {mon = '0'+mon.toString();}\n document.getElementById('date').value = d.getFullYear()+'-'+mon+'-'+day;\n //\n // adding event handlers\n document.getElementById('amount').addEventListener('keyup',function() {elementArithmetic('amount','curr-quantity','new-quantity','+');})\n document.getElementById('amount').addEventListener('blur',elementArithmetic('amount','curr-quantity','new-quantity','+'));\n\n}", "title": "" }, { "docid": "e9561ec6755f7cd83a37a704732e2824", "score": "0.59296185", "text": "function updateQuantity() {\n let prod = this.closest(\".cart-item\");\n let prod_cost = prod.children[2].innerText.slice(1);\n prod.children[4].innerText = `$${Number(prod_cost)*this.value}`\n\n let z = JSON.parse(localStorage.getItem(\"CartItem\"));\n arr = [];\n for (let k = 0; k < Object.keys(z).length; k++) {\n if (z[k].name == prod.children[1].innerText) {\n z[k].quantity = this.value;\n }\n arr.push(z[k]);\n }\n localStorage.setItem(\"CartItem\", JSON.stringify(arr));\n}", "title": "" }, { "docid": "011213da36a6ea827f40b03a3a9ac2d5", "score": "0.59278387", "text": "function changeQuantity(element) {\n current_value = $(element).val();\n product_id = $(element).data('id');\n \n let total_price = 0;\n if (current_value <= 0) {\n current_value = $(element).val(1)\n alert('Invalid Quamtity value');\n }\n \n products[product_id] = current_value;\n localStorage.setItem('cart', JSON.stringify(products));\n \n for(var key in price_per_item) {\n total_price += getPricePerProductQuantity(key, price_per_item[key])\n }\n $('#total_price').text(total_price);\n }", "title": "" }, { "docid": "23c902b1d17bc1c31a2759bb303efd0e", "score": "0.59081125", "text": "function changePrice(item) {\n console.log(item.dataset);\n priceDisplay.innerText = `${item.dataset.price} $`;\n}", "title": "" }, { "docid": "71c400737bad60e473aacd9c6b710dba", "score": "0.590531", "text": "function updateCostAndPrice() {\n $(\"#totalCostCalculated\").text(Math.round(totalCostCalculated * Math.pow(10, 2)) / Math.pow(10, 2));\n $(\"#sellingPriceAtSpan\").text($(\"#profitMarginInput\").val());\n $(\"#sellingPrice\").text((Math.round(sellingPrice * Math.pow(10, 2)) / Math.pow(10, 2)));\n alert('recalculated via updateCostAndPrice method');\n }", "title": "" }, { "docid": "29d98677280d75db1ec60e02f707d2eb", "score": "0.59037095", "text": "function updateRoll () {\n\tvar originalRoll = document.getElementById(\"roll\"); //retrieve the roll options in product detail page\n\tvar selectedRoll = originalRoll.options[originalRoll.selectedIndex].text; //retrieve the selected roll\n\tnumRolls = parseInt(selectedRoll) //update the global variable to current selection\n\tdocument.getElementById(\"priceOriginal\").textContent = \"$\" + numBoxes*numRolls*priceOrig + \".00\" //update displayed price\n}", "title": "" }, { "docid": "8b3558bb0e2e6f9fa3d1cfb9e0230fbe", "score": "0.5903471", "text": "function addStock() {\n // USE querySelectorAll()\n var selected = getSelectedRowBoxes();\n \n for (var i = 0; i < selected.length; i++) {\n var status = selected[i].parentNode.parentNode.children[3];\n status.textContent = \"Yes\";\n status.className = \"true\";\n\n // Update the Product in the products array that \n // corresponds to the checked checkbox we're updating.\n var prodId = selected[i].parentNode.parentNode.id;\n products[prodId].inStock = true;\n\n };\n\n}", "title": "" }, { "docid": "efee09eeda304bac1921684c885b9145", "score": "0.59013563", "text": "function updateVariantTitle(variant) {\r\n\t $('#buy-button-1 .variant-title').text(variant.title);\r\n\t }", "title": "" }, { "docid": "5921b82da09af66709fd3135acbe109d", "score": "0.58949596", "text": "function updateQuantityDisplay(item){\n var itemDiv = document.getElementById(\"cart-item-\"+item.name);\n var input = itemDiv.querySelector(\".quantity-input\");\n var totalPrice = itemDiv.querySelector(\".total-price\")\n input.value = item.quantity;\n totalPrice.innerHTML = (input.value*item.price).toFixed(2)\n}", "title": "" }, { "docid": "3fc2a6e6f7776271efeb358c4963c25e", "score": "0.5889129", "text": "function updatePrice() {\n angular.forEach($scope.stockArr, function(item, index) {\n // console.log(\"updating price\");\n getPriceBySymbol(item.symbol).then(function() {\n item.high = $scope.oneStock.high;\n item.low = $scope.oneStock.low;\n item.open = $scope.oneStock.open;\n item.close = $scope.oneStock.close;\n item.price = $scope.oneStock.price;\n item.volume = $scope.oneStock.volume;\n });\n\n });\n }", "title": "" }, { "docid": "d4f416ce3ad820cec11759eae04dd373", "score": "0.5882375", "text": "function updateProductAmount(product, price, isIncrease) {\n const productNumber = document.getElementById(product + \"-amount\");\n let productAmount = productNumber.value;\n const productPrice = document.getElementById(product + \"-price\");\n let productAmountVal = parseInt(productAmount);\n\n if (isIncrease) {\n productNumber.value = productAmountVal + 1;\n productPrice.innerText = productNumber.value * price;\n } else if (!isIncrease && productAmountVal > 0) {\n productNumber.value = productAmountVal - 1;\n productPrice.innerText = productNumber.value * price;\n }\n updatePrice();\n}", "title": "" }, { "docid": "85e6d7307da40b392e4116f7c073fde9", "score": "0.5882372", "text": "function changeAmount(){\n updateCurrentCost();\n updateAmortization();\n updateTotalCookPerSecChain();\n}", "title": "" }, { "docid": "02881aeba506cbc65db139098ac9df7f", "score": "0.58823305", "text": "function updatePrice(duration, numNeeds) {\n const priceSpan = document.querySelector(\"#price\");\n const priceEstimate = 8 + 2*duration/5 + 5*numNeeds;\n priceSpan.innerText = \"$\" + priceEstimate.toFixed(2).toString();\n}", "title": "" }, { "docid": "5ed58f3a0a918aa1e7535e355d139ecb", "score": "0.5874592", "text": "function changeTotalPrice(quantity) {\n var chosenGlaze = document.querySelector('input[name=\"glaze\"]:checked').value;\n if (chosenGlaze == \"none\") {\n let totalPrice = 3.25*quantity;\n document.getElementById(\"rollprice\").innerHTML = \"$\" + totalPrice.toFixed(2);\n }\n else {\n let totalPrice = (3.25+0.50)*quantity;\n document.getElementById(\"rollprice\").innerHTML = \"$\" + totalPrice.toFixed(2);\n }\n}", "title": "" }, { "docid": "f156eac3941dcc6cf876c26676ab27c8", "score": "0.58744186", "text": "goChange() {\n const scopeChangedPrice = parseFloat(((this.price / 100) * 5).toFixed(2));\n const nextPrice = randomNumber(\n (this.price - scopeChangedPrice),\n (this.price + scopeChangedPrice),\n 'float'\n );\n const nextVolume = randomNumber((this.volume + 10), (this.volume + 30), 'int');\n\n /*\n khi chua resetPrice: \n nextPrice = currentPrice\n this.price = prevPrice\n */\n this.setChange(nextPrice, this.price);\n /*\n setChange() da duoc chay: \n this.change = currentChange\n this.price = prevPrice\n */\n this.setPercentChange(this.change, this.price);\n this.resetPrice(nextPrice);\n this.resetVolume(nextVolume);\n this.resetValue(this.price, this.volume);\n }", "title": "" }, { "docid": "192d90533fd13d48c9092cc93b47fcb0", "score": "0.5870328", "text": "function plateorquantitychange(event){\n let row = event.target.parentNode.parentNode;\n let fooditemname = row.cells[0].innerHTML;\n let fooditemquantity = row.cells[2].firstChild.value;\n let oldprice = row.cells[3].innerHTML;\n if(fooditems[fooditemname].kind == 1 ){\n let fooditemplate = row.cells[1].firstChild.value;\n let fooditemprice = (parseInt(fooditemquantity) * parseInt(fooditems[fooditemname][\"price\"+fooditemplate]));\n row.cells[3].innerHTML = fooditemprice;\n }\n else{\n let fooditemprice = (parseInt(fooditemquantity) * parseInt(fooditems[fooditemname][\"price\"]));\n row.cells[3].innerHTML = fooditemprice;\n }\n let ttl = document.getElementById(\"total\");\n ttl.innerHTML = parseInt(ttl.innerHTML) - parseInt(oldprice) + parseInt(row.cells[3].innerHTML);\n}", "title": "" }, { "docid": "ab01f0ab39214d2f89b63c12ed18cb4c", "score": "0.58672804", "text": "function updateStock(items, options={}) {\n\n if (!options.action) {\n alert('No action supplied to stock update');\n return false;\n }\n\n var modal = options.modal || '#modal-form';\n\n if (items.length == 0) {\n alert('No items selected');\n return;\n }\n\n var html = '';\n\n html += \"<table class='table table-striped table-condensed' id='stocktake-table'>\\n\";\n\n html += '<thead><tr>';\n html += '<th>Item</th>';\n html += '<th>Location</th>';\n html += '<th>Quantity</th>';\n\n html += '</thead><tbody>';\n\n for (idx=0; idx<items.length; idx++) {\n var item = items[idx];\n\n var vMin = 0;\n var vMax = 0;\n var vCur = item.quantity;\n\n if (options.action == 'remove') {\n vCur = 0;\n vMax = item.quantity;\n }\n else if (options.action == 'add') {\n vCur = 0;\n vMax = 0;\n }\n\n html += '<tr>';\n\n html += '<td>' + item.part.name + '</td>';\n\n if (item.location) {\n html += '<td>' + item.location.name + '</td>';\n } else {\n html += '<td><i>No location set</i></td>';\n }\n html += \"<td><input class='form-control' \";\n html += \"value='\" + vCur + \"' \";\n html += \"min='\" + vMin + \"' \";\n\n if (vMax > 0) {\n html += \"max='\" + vMax + \"' \";\n }\n\n html += \"type='number' id='q-\" + item.pk + \"'/></td>\";\n\n html += '</tr>';\n }\n\n html += '</tbody></table>';\n\n html += \"<hr><input type='text' id='stocktake-notes' placeholder='Notes'/>\";\n\n html += \"<p class='warning-msg' id='note-warning'><i>Note field must be filled</i></p>\";\n\n var title = '';\n\n if (options.action == 'stocktake') {\n title = 'Stocktake';\n }\n else if (options.action == 'remove') {\n title = 'Remove stock items';\n }\n else if (options.action == 'add') {\n title = 'Add stock items';\n }\n\n openModal({\n modal: modal,\n title: title,\n content: html\n });\n\n $(modal).find('#note-warning').hide();\n\n modalSubmit(modal, function() {\n\n var stocktake = [];\n var notes = $(modal).find('#stocktake-notes').val();\n\n if (!notes) {\n $(modal).find('#note-warning').show();\n return false;\n }\n\n var valid = true;\n\n // Form stocktake data\n for (idx = 0; idx < items.length; idx++) {\n var item = items[idx];\n\n var q = $(modal).find(\"#q-\" + item.pk).val();\n\n stocktake.push({\n pk: item.pk,\n quantity: q\n });\n };\n\n if (!valid) {\n alert('Invalid data');\n return false;\n }\n\n inventreeUpdate(\"/api/stock/stocktake/\",\n {\n 'action': options.action,\n 'items[]': stocktake,\n 'notes': $(modal).find('#stocktake-notes').val()\n },\n {\n method: 'post',\n }).then(function(response) {\n closeModal(modal);\n afterForm(response, options);\n }).fail(function(xhr, status, error) {\n alert(error);\n });\n });\n}", "title": "" }, { "docid": "cfc42ee4e84f1b8e2121f82a05127117", "score": "0.58656687", "text": "function updateTotal() { \n\nvar optionprice = parseFloat(0);\nvar price = parseFloat(0);\nvar layer_amount = parseFloat(0);\n\n\nfunction layerAmount(){\n if($('.layer_amt').html() != 0 && $('.layer_amt').html() != null && $('.layer_amt').html() != \"\") {\n layer_amount = parseFloat($('.layer_amt').html());\n //optionprice += layer_amount;\n }\n}\n\n\n/* 1 --------- Cake Theme ---------- */\nfunction cakeThemePrice(){\n //theme1 is based on the ID \n if (document.getElementById('theme1').checked) { //triggers when you click the radio button\n price = $('#wedding_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n }\n\n if (document.getElementById('theme2').checked) {\n price = $('#birthday_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n }\n\n if (document.getElementById('theme3').checked) {\n price = $('#dedi_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n if (document.getElementById('theme4').checked) {\n price = $('#occ_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n\n }\n} //end of cakeTHEMEprice\n\n\nfunction cakeSizeCirclePrice(){\n if (document.getElementById('shape1').checked) {\n setShapeAndColor();\n price = ($('#size_select_C').val() == null)? 0 : $('#size_select_C').val();\n optionprice += parseFloat(price);\n var_Shape = \"Circle\";\n }\n}\n\nfunction textilePaintPrice(){\n if (document.getElementById('shape0').checked) {\n setShapeAndColor();\n price = ($('#shape0').val() == null)? 0 : $('#shape0').val();\n optionprice += parseFloat(price);\n var_Shape = \"Circle\";\n }\n}\n\nfunction rubbervinylPrice(){\n if (document.getElementById('rubbervinyl').checked) {\n setShapeAndColor();\n price = ($('#rubbervinyl').val() == null)? 0 : $('#rubbervinyl').val();\n optionprice += parseFloat(price);\n var_Shape = \"Circle\";\n }\n}\n\nfunction sublimationPrice(){\n if (document.getElementById('sublimation').checked) {\n setShapeAndColor();\n price = ($('#sublimation').val() == null)? 0 : $('#sublimation').val();\n optionprice += parseFloat(price);\n var_Shape = \"Rectangle\";\n }\n}\n\nfunction transferPrice(){\n if (document.getElementById('transfer').checked) {\n setShapeAndColor();\n price = ($('#transfer').val() == null)? 0 : $('#transfer').val();\n optionprice += parseFloat(price);\n var_Shape = \"Heart\";\n }\n}\n\n\nfunction cakeSizeRectPrice(){\n if (document.getElementById('shape2').checked) {\n setShapeAndColor();\n price = ($('#size_select_R').val() == null)? 0 : $('#size_select_R').val();\n optionprice += parseFloat(price);\n var_Shape = \"Rectangle\";\n }\n}\n\n\nfunction cakeSizeHeartPrice(){\n if (document.getElementById('shape3').checked) {\n setShapeAndColor();\n price = ($('#size_heart').val() == null)? 0 : $('#size_heart').val();\n optionprice += parseFloat(price);\n var_Shape = \"Heart\";\n }\n}\n\n// function weddeliver()\n// {\n// var \n\n// }\n\n// This is where the shape and color will appear depends on the user's choice\nfunction setShapeAndColor() {\n var shape_src = \"\";\n var shapecolor;\n \n if (var_Shape == \"Circle\") {\n shapecolor = \"<img src='shapes/shape_circle.png' \" + getStyleColor(var_CoatingColor) + \"/>\";\n shape_src = \"shapes/shape_circle.png\";\n showPatternOverlay(\"circle_pattern\");\n }\n\n else if(var_Shape == \"Rectangle\") {\n shapecolor = \"<img src='shapes/shape_rect.png' \" + getStyleColor(var_CoatingColor) + \"/>\";\n shape_src = \"shapes/shape_rect.png\";\n showPatternOverlay(\"rectangle_pattern\");\n }\n\n else if(var_Shape == \"Heart\") {\n shapecolor = \"<img src='shapes/shape_heart.png' \" + getStyleColor(var_CoatingColor) + \"/>\";\n shape_src = \"shapes/shape_heart.png\";\n showPatternOverlay(\"heart_pattern\");\n }\n\n shapecolor += \"<div id=\\\"side_decor\\\" style=\\\"background-repeat: no-repeat;background-size: contain;position: absolute; top:0; left:0\\\"></div>\"; // Append div for pattern later use\n document.getElementById(\"disp_card\").innerHTML = shapecolor;\n document.getElementById(\"preview_image\").style.backgroundColor = getColorHex(var_CoatingColor);\n}\n\n\nfunction showPatternOverlay(pattern_overlay) {\n document.getElementById(\"circle_pattern\").style[\"display\"] = \"none\";\n document.getElementById(\"rectangle_pattern\").style[\"display\"] = \"none\";\n document.getElementById(\"heart_pattern\").style[\"display\"] = \"none\";\n\n var div = document.getElementById(pattern_overlay).style[\"display\"] = null;\n}\n\n/* --- Coating Color --- */\nif (document.querySelector('input[name=\"cake_color\"]:checked') != null) \n {\n var_CoatingColor = document.querySelector('input[name=\"cake_color\"]:checked').value;\n }\n\nfunction getStyleColor(color) {\n if (color === undefined) {\n return(\"style='background-color:#FAFAFA;'\");\n } else {\n hex = \"\";\n if (color == \"cream\") { hex = \"#FBF9D3\" }\n else if(color == \"blue\") { hex = \"#468BCC\" }\n else if(color == \"violet\") { hex = \"#652D90\" }\n else if(color == \"green\") { hex = \"#3CB879\" }\n else if(color == \"red\") { hex = \"#F51A20\" }\n else if(color == \"pink\") { hex = \"#FD5E91\" }\n else if(color == \"orange\") { hex = \"#FBA13F\" }\n else if(color == \"yellow\") { hex = \"#FFEF03\" }\n else if(color == \"brown\") { hex = \"#8D6235\" }\n else if(color == \"black\") { hex = \"#212121\" }\n return(\"style='background-color:\" + hex + \";'\");\n }\n}\n\nfunction getColorHex(color) {\n if (color === undefined) {\n return(\"#FAFAFA\");\n } else {\n hex = \"\";\n if (color == \"cream\") { hex = \"#FBF9D3\" }\n else if(color == \"blue\") { hex = \"#468BCC\" }\n else if(color == \"violet\") { hex = \"#652D90\" }\n else if(color == \"green\") { hex = \"#3CB879\" }\n else if(color == \"red\") { hex = \"#F51A20\" }\n else if(color == \"pink\") { hex = \"#FD5E91\" }\n else if(color == \"orange\") { hex = \"#FBA13F\" }\n else if(color == \"yellow\") { hex = \"#FFEF03\" }\n else if(color == \"brown\") { hex = \"#8D6235\" }\n else if(color == \"black\") { hex = \"#212121\" }\n return(hex);\n }\n}\n\n/* --- End Coating Color --- */\n\n\n\n/*2 ------- Cake SHAPE , ICING --------- */\nfunction cakeFlavorPrice() { //lahat na dito para madetermine nya anong shape siya na belong. 1 function is recommended\n if(document.getElementById('flavor1').checked) { \n //orange\n }\n\n if(document.getElementById('flavor2').checked) {\n //choco\n }\n\n if(document.getElementById('flavor3').checked) { \n //caramel\n } \n\n //additional charges\n if(document.getElementById('flavor4').checked) {\n //vanilla\n price = $('#vanilla_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n }\n\n if(document.getElementById('flavor5').checked) {\n //ube\n price = $('#ube_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n if(document.getElementById('flavor6').checked) {\n //strawberry\n price = $('#strawberry_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n // NEW FOR PRICE CALCULATION\n\n if(document.getElementById('flavorblue').checked) {\n //strawberry\n price = $('#strawberry_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n if(document.getElementById('flavor7').checked) {\n //redvelvet\n price = $('#redvelvet_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n\n if(document.getElementById('flavor8').checked) {\n //coffee\n price = $('#coffee_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); \n } \n}\n\n\n\n\nfunction cakeFrostPrice() {\n if(document.getElementById('frosting1').checked) {\n price = $('#sugar_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); //orange\n } \n\n\n if(document.getElementById('frosting2').checked) {\n price = $('#bcream_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); //chocolate\n }\n\n if(document.getElementById('frosting3').checked) { \n price = $('#mallow_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); //Caramel\n }\n\n //additional charges\n if(document.getElementById('frosting4').checked) {\n price = $('#fondant_id').html().replace(\"₱\", \"\");\n optionprice += parseFloat(price); //vanilla\n }\n}\n\n\n/*function cakeCoating(){\n if(document.getElementById('color2').checked){\n document.getElementById(\"disp_card\").style.color=\"blue\";\n }\n}*/\n\n\n\n\nlayerAmount();\ncakeThemePrice();\ncakeSizeCirclePrice();\ntextilePaintPrice();\nsublimationPrice();\ntransferPrice();\n//cakeSizeRectPrice();\n//cakeSizeHeartPrice();\ncakeFlavorPrice();\ncakeFrostPrice();\n//cakeCoating();\n\n \n\nvar totalPrice = optionprice + layer_amount;\n$('.totalPrice_cake').html(totalPrice);\n\n} //end of the updateTotal function", "title": "" }, { "docid": "0d5939c1327e5c07175c79305d82b785", "score": "0.5864053", "text": "function totalPriceUpdate() {\n var subTotal = currentPrice.reduce((a, b) => a + b, 0);\n var tax = (subTotal * 15) / 100;\n var total = subTotal + tax;\n document.getElementById(\"sub-total\").innerText = subTotal;\n document.getElementById(\"tax\").innerText = tax;\n document.getElementById(\"total\").innerText = total;\n}", "title": "" }, { "docid": "161ff135afbbbb053da000c028722e59", "score": "0.586267", "text": "function attachOnVariantSelectListeners(product) {\r\n\t $('.variant-selectors').on('change', 'select', function(event) {\r\n\t var $element = $(event.target);\r\n\t var name = $element.attr('name');\r\n\t var value = $element.val();\r\n\t product.options.filter(function(option) {\r\n\t return option.name === name;\r\n\t })[0].selected = value;\r\n\r\n\t var selectedVariant = product.selectedVariant;\r\n\t var selectedVariantImage = product.selectedVariantImage;\r\n\t updateProductTitle(product.title);\r\n\t updateVariantImage(selectedVariantImage);\r\n\t updateVariantTitle(selectedVariant);\r\n\t updateVariantPrice(selectedVariant);\r\n\t });\r\n\t }", "title": "" }, { "docid": "0a94dbc1b3634c5f2eb16842f793a223", "score": "0.5862491", "text": "function update_stock() {\n //\n // clearing elements inside main-container div\n var childNodes = document.getElementById('main-container').childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].nodeType == 1) {childNodes[i].removeAll();}\n }\n //\n document.getElementById('tab-clicked').value = 'stock-changes';\n //\n //\n var head_elements = Array(\n {'elm' : 'H4','textNode' : \"Click on an item in the table to update it's quantity.\"},\n {'elm' : 'LABEL', 'className' : 'label-12em', 'textNode' : 'Narrow by Item Number:'},\n {'elm' : 'INPUT', 'id' : 'search-item-number', 'type' : 'text', 'events' : [{'event' : 'keyup', 'function' : gen_item_table.bind(null,1,'item_number','ASC')}]}\n );\n //\n addChildren(document.getElementById('input-div'),head_elements);\n //\n gen_item_table(1,'item_number','ASC');\n}", "title": "" }, { "docid": "3d4be4a8202eb1f50fab964f782d0622", "score": "0.58585495", "text": "function updateprice(qid) {\t\n\n var rqid = qid.split('_');\n rid = rqid[0];\n id = rqid[0]+rqid[1];\n\t\n var oldqty = $('#oldqty'+id).val();\n var newqty = $('#qty'+id).val();\n\t\n var numprice = $('#item_price'+id).html().replace('$', '');\t\t\t\t\n var numsubtotal = $('#subtotal'+rid).html().replace('$', ''); \n var numtotal = $('#total'+rid).html().replace('$', ''); \t\n\n // get new amount\n var qty2 = + Number(newqty - oldqty);\n var numprice2 = Math.abs(qty2) * numprice;\n\t\t\t\n // minus / plus amount\n if (oldqty < newqty) {\n newSubtotal = Number(numsubtotal) + Number(numprice2);\t\t\n newTotal = Number(numtotal) + Number(numprice2); \t\n } else {\n newSubtotal = Number(numsubtotal) - Number(numprice2);\t\t\n newTotal = Number(numtotal) - Number(numprice2);\t\n }\n\n newSubtotal = newSubtotal.toFixed(2);\n newTotal = newTotal.toFixed(2);\n\t\n $('#subtotal'+rid).html('$' + newSubtotal );\t\n $('#total'+rid).html( '$' + newTotal );\n $('#oldqty'+id).val(newqty);\n \t\n}", "title": "" }, { "docid": "3cba7d51f89f641f204ca05459901b95", "score": "0.5847192", "text": "function increaseCourseStock(id, qte) {\n let stockSpan = coursesCard[id - 1].querySelector('.stock')\n \n COURSES[id].stock += qte\n stockSpan.innerHTML = COURSES[id].stock\n}", "title": "" }, { "docid": "e67e884f23dc2def4790d6aa929e70eb", "score": "0.58243084", "text": "function updateQuantity() {\n if (updating) {\n console.log(quant);\n console.log(\"Stock quantity: \" + stockQuantity);\n let newStockQuantity = stockQuantity - quant;\n console.log(\"Remaining stock: \" + quant);\n\n let updatedProduct = {\n id: productID,\n stock_quantity: newStockQuantity\n };\n console.log(updatedProduct);\n updateProducts(updatedProduct).then(function(res) {\n console.log(res);\n });\n }\n }", "title": "" }, { "docid": "4146f0f72bd82df7c0c0bb753e2536ae", "score": "0.58182406", "text": "function updateTotalCartPricing() {\r\n\t $('.cart .pricing').text(formatAsMoney(cart.subtotal));\r\n\t }", "title": "" }, { "docid": "ae34a9ed5fda3d9a029c04d0718fb2b1", "score": "0.58162504", "text": "function updateCost(e) {\n if (this.checked) {\n if (this.id == \"checkboxTaxi\") {\n totalAmount += parseFloat(this.value);\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n } else {\n totalAmount += parseFloat(this.value) * dayAmount;\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n }\n } else {\n if (this.id == \"checkboxTaxi\") {\n totalAmount -= parseFloat(this.value);\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n } else {\n totalAmount -= parseFloat(this.value) * dayAmount;\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n }\n }\n }", "title": "" }, { "docid": "413f7f221fed46a5c56278f9142ef1ab", "score": "0.58118355", "text": "function updatePrice(){\n let currPrice = document.getElementById('currPrice');\n let qty = document.getElementById('qtyNum').value;\n let price = (5) * parseInt(qty);\n currPrice.innerText = 'Total: $' + parseFloat(price);\n localStorage.setItem('currPrice', JSON.stringify(parseFloat(price)))\n}", "title": "" } ]
3c798c8a0a5f028bcc43e69a05e0bca7
Helper for defining the .next, .throw, and .return methods of the Iterator interface in terms of a single ._invoke method.
[ { "docid": "081d57df440f4a874b068d32e0ee43da", "score": "0.0", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" } ]
[ { "docid": "021c49a79b7d2f875755c6ed0e4aa298", "score": "0.74807125", "text": "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "title": "" }, { "docid": "021c49a79b7d2f875755c6ed0e4aa298", "score": "0.74807125", "text": "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "title": "" }, { "docid": "021c49a79b7d2f875755c6ed0e4aa298", "score": "0.74807125", "text": "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "title": "" }, { "docid": "021c49a79b7d2f875755c6ed0e4aa298", "score": "0.74807125", "text": "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "title": "" }, { "docid": "ddbd5f35ca1e084e96ff720f338d6ee8", "score": "0.7428107", "text": "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}", "title": "" }, { "docid": "fe45e230a61b3db5749ebeab1513c5c5", "score": "0.71367383", "text": "function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { prototype[method] = function (arg) { return this._invoke(method, arg); }; }); }", "title": "" }, { "docid": "f0cf00e1b77e823c286e944017143797", "score": "0.7111758", "text": "function defineIteratorMethods(prototype) { // 92\n [\"next\", \"throw\", \"return\"].forEach(function(method) { // 93\n prototype[method] = function(arg) { // 94\n return this._invoke(method, arg); // 95\n }; // 96\n }); // 97\n } // 98", "title": "" }, { "docid": "ac3afa38e6571bfedd86a216250c3fec", "score": "0.70454055", "text": "function defineIteratorMethods(prototype) {\n\t\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t\t prototype[method] = function (arg) {\n\t\t return this._invoke(method, arg);\n\t\t };\n\t\t });\n\t\t }", "title": "" }, { "docid": "0032216aff7e980ddfc20bb8306aa0b1", "score": "0.70297354", "text": "function defineIteratorMethods(prototype) {\n\t\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t\t prototype[method] = function(arg) {\n\t\t return this._invoke(method, arg);\n\t\t };\n\t\t });\n\t\t }", "title": "" }, { "docid": "44e8a6450d1e47555d11dbd057012c4e", "score": "0.6994318", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "44e8a6450d1e47555d11dbd057012c4e", "score": "0.6994318", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "44e8a6450d1e47555d11dbd057012c4e", "score": "0.6994318", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "5f2201a00de89e567b1cb304806b518a", "score": "0.6972502", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "5f2201a00de89e567b1cb304806b518a", "score": "0.6972502", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "5f2201a00de89e567b1cb304806b518a", "score": "0.6972502", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "5f2201a00de89e567b1cb304806b518a", "score": "0.6972502", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "b0d587b2609b8d57baee189d36c54ffb", "score": "0.69664234", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "title": "" }, { "docid": "ff8fb671ad6f24bd6813af4c011d16e1", "score": "0.6951315", "text": "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t define(prototype, method, function(arg) {\n\t return this._invoke(method, arg);\n\t });\n\t });\n\t }", "title": "" }, { "docid": "2b33306fb3ae057721f5ef4fdb76d0e0", "score": "0.6838941", "text": "function defineIteratorMethods (prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "title": "" }, { "docid": "65be4474fd73e9604fcab358d1a800a4", "score": "0.6823335", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "title": "" }, { "docid": "01be2b23ec243dec2fb83a797be745ca", "score": "0.6813316", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }", "title": "" }, { "docid": "fd9e80054b71cd0b7efd25c3957f379a", "score": "0.6790236", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "fd9e80054b71cd0b7efd25c3957f379a", "score": "0.6790236", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "01b9a6ea81043fdca3dafe4f7d16002a", "score": "0.67886424", "text": "function defineIteratorMethods(prototype) {\r\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\r\n prototype[method] = function(arg) {\r\n return this._invoke(method, arg);\r\n };\r\n });\r\n }", "title": "" }, { "docid": "b1acc89dd6dad505fcaa4c6e84adbd6c", "score": "0.6786749", "text": "function defineIteratorMethods(prototype) {\n ['next', 'throw', 'return'].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "b1acc89dd6dad505fcaa4c6e84adbd6c", "score": "0.6786749", "text": "function defineIteratorMethods(prototype) {\n ['next', 'throw', 'return'].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "b979892a2c683c90812ca65134c9d4d0", "score": "0.67851335", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" }, { "docid": "2bb20ccc410882591fe423d982398cae", "score": "0.67783433", "text": "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "title": "" } ]
5b8e7bfe0a03b78171f62a88c1643812
Write a function that accepts a string as a parameter. Return the most frequently occuring letter in that string.
[ { "docid": "bd316e6b8997c9c4d1f9f23be0740797", "score": "0.76711416", "text": "function freqStr(str) {\n var chars = {};\n chars[str.charAt(0)] = 1;\n // first = str.charAt(0);\n // chars[first] = 1;\n var maxChar = str.charAt(0);\n var maxCount = 1;\n for (var i = 1; i < str.length; i++) {\n if (chars[str.charAt(i)]) {\n chars[str.charAt(i)]++;\n\n } else {\n chars[str.charAt(i)] = 1;\n }\n if (chars[str.charAt(i)] > maxCount) {\n maxCount = chars[str.charAt(i)];\n maxChar = str.charAt(i);\n\n }\n }\n return maxChar;\n}", "title": "" } ]
[ { "docid": "c53d9813a4717f11da57955155ccf44c", "score": "0.82722086", "text": "function mostLetter(str) {\n let charMap = new Map();\n\n //iterate through string, add new letters to map, and increase value of\n //repeating letters\n for (let char of str) {\n //gets value of map key (if it exists)\n let count = charMap.get(char);\n //adds to key's value, if key didn't exist, initializes value to 1\n charMap.set(char, count ? ++count : 1);\n }\n\n //compare all entries, keep and return entry with largest value\n return [...charMap.entries()].reduce((char1, char2) => {\n return char1[1] > char2[1] ? char1 : char2;\n });\n}", "title": "" }, { "docid": "8fccf91048df5e213c9901e74b6f73cb", "score": "0.821833", "text": "function frequency(str){\n var result = str[0]; // first letter of str\n var storage = 0; // store biggest found number\n for (i=0 ; i < str.length ; i++){\n var berapa = countLetter(str[i],str);\n if(berapa > storage){\n result = str[i];\n storage = berapa;\n }\n }\n return result;\n }", "title": "" }, { "docid": "e417c5803870021ae5eaf4bb6a1745a4", "score": "0.80874103", "text": "function mostFrequent (myString) {\n if ( 't' > 'e' || 's') {\n return ( '(t) is the most frequent character');\n }\n}", "title": "" }, { "docid": "5e5a9c14e12a9ba12f5f3d292e2fe928", "score": "0.8063063", "text": "function maxCharacter(str) {\n const charMap = {};\n let maxNum = 0;\n let maxChar = '';\n\n str.split('').forEach(i => charMap[i] ? charMap[i]++ : charMap[i] = 1);\n // for in to loop through an object\n for(let i in charMap){\n if(charMap[i] > maxNum){\n maxNum = charMap[i];\n maxChar = i;\n }\n }\n console.log(`Letter ${maxChar} is the most common character in ${str} with ${maxNum} repeats`);\n // return maxChar;\n}", "title": "" }, { "docid": "93f8b4ef66a4ca5dac90aba39e35df4e", "score": "0.78307575", "text": "function maxChar(str) {\n let freq = {};\n for (let i = 0; i < str.length; i++) {\n if (freq[str[i]] === undefined) {\n freq[str[i]]+=1;\n }else {\n freq[str[i]] = 1;\n }\n }\n let max=0;\n let result=str[0];\n for(let ch in freq){\n if (freq[ch] > max) {\n max = freq[ch];\n result = ch;\n }\n }\n return result;\n}", "title": "" }, { "docid": "e13610c85b7ec9796d229c5cb820e219", "score": "0.77313066", "text": "function charFreq(string) {\n //...\n}", "title": "" }, { "docid": "e13610c85b7ec9796d229c5cb820e219", "score": "0.77313066", "text": "function charFreq(string) {\n //...\n}", "title": "" }, { "docid": "cdcb706fbf2f7976c2968b9c4299ed89", "score": "0.77108204", "text": "function highestFreq (str) {\n\t// Create an object displaying the character count for each character.\n \tlet count = str.split('').reduce((a,b) => {\n \ta[b] ? a[b] ++ : a[b] = 1;\n \treturn a;\n \t},{});\n \t// Reduce the keys of our count object\n \treturn Object.keys(count).reduce((a,b,c) => {\n \t\t// If the array provided to reduce is empty. Push in the first element.\n \t\t// We need to start comparing elements.\n \tif(!a.length) {\n \t\ta.push(b); \n \t// If the first element in the array is appears less times than the current character.\n \t// Empty out the checker array and push in the new element.\n \t} else if(count[a[0]] < count[b]) {\n \t\twhile(a.length){\n \t\t\ta.pop();\n \t\t}\n \t\t a.push(b);\n \t// If the current element appears the same amount of times as the first element in the array.\n \t// Push it in the array as well.\n \t} else if(count[a[0]] === count[b]) {\n \t\ta.push(b);\n \t}\n \t// Return the array after each iteration. \n \treturn a;\n \t// Finally sort the array and join it into a string.\n \t}, []).sort().join('');\n}", "title": "" }, { "docid": "f08cbb26b082658b7929f3be16b5b832", "score": "0.7696804", "text": "function maxCharacter(str) {\n const characterMap = {};\n let maxNum = 0;\n let maxChar = \"\";\n // NOTE TURn the string into an array and turn it into key value pairs\n // and the value being the numbers\n str.split(\"\").forEach(alphabet => {\n if (characterMap[alphabet]) {\n characterMap[alphabet]++;\n } else {\n characterMap[alphabet] = 1;\n }\n });\n\n for (let alphabet in characterMap) {\n if (characterMap[alphabet] > maxNum) {\n maxNum = characterMap[alphabet];\n maxChar = alphabet;\n }\n }\n let characters = maxChar.toUpperCase() + \" is repeated \" + maxNum + \" times\";\n return characters;\n}", "title": "" }, { "docid": "abd8e17c5f01f5808e928181155e777c", "score": "0.76933724", "text": "function maxChar(str) {\n let charMap = {}, mostUses = 0, mostUsed;\n\n for (let char of str.split('')) {\n charMap[char] ? charMap[char] += 1 : charMap[char] = 1;\n }\n\n for(let char in charMap) {\n if(charMap[char] > mostUses) {\n mostUses = charMap[char];\n mostUsed = char;\n }\n }\n \n return mostUsed;\n}", "title": "" }, { "docid": "96c76ea639a41a054bf9f097c8b633ad", "score": "0.7680265", "text": "function maxCharacter(str) {\n let strArray = str.toLowerCase().split(''),\n record = {},\n greatest = 0,\n maxChar = ''\n strArray.forEach(letter => record[letter] = 0)\n strArray.forEach(letter => record[letter]++)\n for (e in record){\n if (record[e] > greatest){\n greatest = record[e]\n maxChar = e\n }\n }\n return maxChar\n}", "title": "" }, { "docid": "5a1255d1d3d7a72146ddf1fbd9960fe2", "score": "0.76718664", "text": "maximumOccurringCharacter(string) {\n \n let maxChar = \"\";\n let max = 0;\n\n let hashMap = {};\n\n for(let i = 0; i < string.length; i++) {\n if (hashMap[string[i]] !== undefined) {\n hashMap[string[i]]++;\n } else {\n hashMap[string[i]] = 1;\n }\n }\n\n // Object.entries(hashMap).forEach(([key,value]) => console.log(`${key}: ${value}`));\n\n // Find the key that occurs the most times in the string\n // If keys occur the same number of times, find the first key\n\n Object.entries(hashMap).forEach(([key,value]) => {\n if (value > max) {\n max = value;\n maxChar = key;\n }\n });\n console.log(maxChar);\n return maxChar;\n }", "title": "" }, { "docid": "918a43740cf14daccc0d7609b774ee30", "score": "0.76703143", "text": "function charFreq(string){\n //...\n}", "title": "" }, { "docid": "918a43740cf14daccc0d7609b774ee30", "score": "0.76703143", "text": "function charFreq(string){\n //...\n}", "title": "" }, { "docid": "5182b6a91c57b7863e134ce2eedf2e5c", "score": "0.7663232", "text": "function maxCharacter(str) {\n\n // const charMap = {};\n // let maxNum = 0;\n // let maxChar = '';\n\n // str.split('').forEach(function (char) { \n\n // if(charMap[char]) {\n // charMap[char]++;\n // }else {\n // charMap[char] = 1;\n // }\n // });\n\n\n // for (let char in charMap ) {\n // if(charMap[char] > maxNum) {\n // maxNum = charMap[char];\n // maxChar = char;\n // }\n // }\n // return maxChar;\n\n\n}", "title": "" }, { "docid": "2b890959e4379972cd1382607df2bd98", "score": "0.7655517", "text": "function maxChar(str) {\n const characterCount = {};\n let highestNumRep = 0;\n let mostUsedChar = '';\n\n for (let char of str) {\n characterCount[char] ? characterCount[char]++ : (characterCount[char] = 1);\n }\n // maxChar('hello')\n // characterCount = {\n // 'h': 1,\n // 'e': 1,\n // 'l': 2,\n // 'o': 1\n // }\n\n for (let key in characterCount) {\n if (characterCount[key] > highestNumRep) {\n highestNumRep = characterCount[key];\n mostUsedChar = key;\n }\n }\n return mostUsedChar;\n}", "title": "" }, { "docid": "1826f7fc269200eb4a5ad78e06f691c1", "score": "0.7617099", "text": "function mostCommonLetter(string){\n var max_val = 0;\n var max = [];\n const hash = makeObject(string.split(\"\"));\n for (var property in hash){\n var value = hash[property];\n if (value > max_val && property.match(/[a-z]/)){\n max_val = value;\n max = [property,value];\n }\n }\n \n \n return max;\n}", "title": "" }, { "docid": "2f14e5cfc3450a12d3898050c86ed154", "score": "0.75904036", "text": "function maxCharA(str) {\n let charMap = {};\n let maxNum = 0;\n let maxChar = '';\n \n str.toLowerCase().split('').forEach(function(char) {\n if(charMap[char]) {\n charMap[char]++;\n } else {\n charMap[char] = 1;\n }\n });\n \n for(let i in charMap) {\n // debugger;\n if(charMap[i] > maxNum) { \n maxNum = charMap[i];\n maxChar = i;\n }\n }\n\n return maxChar;\n}", "title": "" }, { "docid": "4d09390415bb375f4a0125083852ba18", "score": "0.7565821", "text": "function maxChar(str) {\n var dict = {};\n var max = 0;\n var maxLetter = '';\n\n for(let letter of str){\n if(!dict[letter]){\n dict[letter] = 1;\n }else{\n dict[letter]++;\n }\n }\n // iterate through object -> in\n for(let char in dict){\n if(dict[char] > max){\n max = dict[char]\n maxLetter = char;\n }\n }\n return maxLetter;\n}", "title": "" }, { "docid": "0c78f89a4a76c00be1b5f8e2c5b4b6ac", "score": "0.75405973", "text": "function maxChar(string){\n\tlet max = 1;\n\tconst chars = {};\n\tlet maxChar = '';\n\n\tfor(let char of string){\n\t\tif(!chars[char]){\n\t\t\tchars[char] = 1;\n\t\t} else {\n\t\t\tchars[char]++;\n\t\t\tif(chars[char] > max){\n\t\t\t\tmax = chars[char];\n\t\t\t\tmaxChar = char;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn maxChar;\n}", "title": "" }, { "docid": "4b24c1e52ad44cab7c2974893ab5cb29", "score": "0.75329673", "text": "function maxChar(str) {\r\n\tvar i,j;\r\n\tvar character;\r\n\tvar counterArray = Array();\r\n\tvar max;\r\n\tvar maxAux;\r\n\tvar MaxChar;\r\n\tfor( i = 0 ; i < str.length ; i++)\r\n\t{\r\n\t\tcharacter = str[i];\r\n\t\tcounterArray[i] = 0; \r\n\r\n\t\tfor( j = 0; j < str.length ; j++){\r\n\t\t\tif(character == str[j])\r\n\t\t\t{\r\n\t\t\t\tcounterArray[i] = counterArray[i] + 1;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t\tmax = Math.max.apply(null, counterArray);\r\n\t\tif(maxAux !== max)\r\n\t\t{\r\n\t\t\tMaxChar = character;\r\n\t\t}\r\n\t\tmaxAux = max;\r\n\r\n\t}\r\n\treturn MaxChar;\r\n}", "title": "" }, { "docid": "b89e352fd439098fad4690d78f6d0db1", "score": "0.7510066", "text": "function maxChar(str) {\n\tlet count = {};\n \tfor (let i in str){\n \tif( count[str[i]] ){\n \t\tcount[str[i]] += 1;\n \t}else{\n \t\tcount[str[i]] = 1;\n \t}\n \t}\n\n \tlet counter = 0;\n \tlet returnChar = '';\n \tfor (let s in count){\n \t\tif(count[s]>counter){\n \t\t\tcounter = count[s];\n \t\t\treturnChar = s;\n \t\t}\n \t}\n\n \treturn returnChar;\n}", "title": "" }, { "docid": "ac7cc76fcf841af494022ea1fd2de3fe", "score": "0.74866474", "text": "function maxCharacter(str) {\r\n const charMap = {};\r\n let maxNum = 0;\r\n let maxChar = '';\r\n \r\n str.split('').forEach(function(char) {\r\n if(charMap[char]) {\r\n charMap[char]++;\r\n } else {\r\n charMap[char] = 1;\r\n }\r\n });\r\n \r\n for(let char in charMap) {\r\n\r\n if(charMap[char] > maxNum) {\r\n maxNum = charMap[char];\r\n maxChar = char;\r\n }\r\n }\r\n \r\n return maxChar;\r\n}", "title": "" }, { "docid": "259a97f336e45c83bca9e8c250689185", "score": "0.74754584", "text": "function most_common_letter(string) {\n\n\tvar list = {};\n\tvar array = string.split(\"\");\n\n\tarray.forEach(function(letter){\n\t\tif(list[letter]!==undefined){\n\t\t\tlist[letter]+=1;\n\t\t}else{\n\t\tlist[letter] = 1;\n\t\t}\n\t})\n\tconsole.log(list);\n\n\tvar higher = 0;\n\tvar higher_letter\n\n\tfor (var letter in list){\n\t\tif(list[letter]>higher){\n\t\t\thigher = list[letter];\n\t\t\thigher_letter = letter;\n\t\t}\n\t}\n\n\tconsole.log([String(higher_letter), higher]);\n\treturn [String(higher_letter), higher];\n}", "title": "" }, { "docid": "c5801c0cb49749389ac666c3b94fda2c", "score": "0.7466756", "text": "function maxCharacter(str) {\n // const charMap = {};\n // let maxNum = 0;\n // let maxChar = '';\n // str.split('').forEach(function(char) {\n // if(charMap[char]){\n // charMap[char]++;\n // } else {\n // charMap[char]= 1;\n // }\n // });\n // for(let char in charMap) {\n // // debugger; // node inspect index.js then hit c enter to run.\n // if(charMap[char] > maxNum) {\n // maxNum = charMap[char];\n // maxChar = char;\n // }\n // }\n // return maxChar;\n}", "title": "" }, { "docid": "2dc7b875d02015870fd2d0e1ab52d918", "score": "0.7458429", "text": "function mostFreqWord(str) {\n var words = str.split(' ');\n var counter = {};\n var mostFreqWord = '';\n var count = 0;\n var maxCount = 0;\n\n words.forEach(function (word) {\n\t if (!counter[word])\n\t\tcounter[word] = 0;\n\t count = ++counter[word];\n\t if (count>maxCount) {\n\t\tmaxCount = count;\n\t\tmostFreqWord = word;\n\t }\n\t});\n return mostFreqWord;\n}", "title": "" }, { "docid": "b8adcea29419c475ddb47fc42b689e97", "score": "0.74496055", "text": "function maxCharacter(str) {\n const charMap = {};\n let maxNum = 0;\n let maxChar = '';\n\n str.split('').forEach(char => {\n if(charMap[char]){\n charMap[char]++;\n }\n else{\n charMap[char] = 1;\n }\n });\n for(let char in charMap){\n if(charMap[char] > maxNum){\n maxNum = charMap[char];\n maxChar = char;\n }\n }\n\n return maxChar;\n}", "title": "" }, { "docid": "d2dc9219f37b661886fde3ed149e9667", "score": "0.73882586", "text": "function maxChar(str) {\n let chars = {};\n let maxC = {\n char: '',\n num: 0\n };\n // normalize all letters\n str = str.toLowerCase();\n\n // populate char object with counts\n for (let char in str) {\n console.log(char, str[char], chars[str[char]]);\n chars[str[char]] = chars[str[char]] + 1 || 1;\n }\n\n // determine highest count char\n for (let char in chars) {\n console.log(char, chars[char]);\n if (chars[char] > maxC.num) {\n maxC.char = char;\n maxC.num = chars[char];\n } \n \n }\n\n return maxC.char;\n}", "title": "" }, { "docid": "fe4ffdd01789ea1f52fa77f2cfe5c91a", "score": "0.73828906", "text": "function maxCharacter(str) {\n const charMap = {};\n let maxNum = 0;\n let maxChar = '';\n \n str.split('').forEach(function(char){\n if(charMap[char]) {\n charMap[char]++;\n } else {\n charMap[char] = 1;\n }\n\n });\n\n for(let char in charMap) {\n // debugger\n if(charMap[char] > maxNum) {\n maxNum = charMap[char];\n maxChar = char;\n }\n }\n return maxChar;\n}", "title": "" }, { "docid": "612da9d1d04cdcc8346dee87ce35f373", "score": "0.7372808", "text": "function maxCharacter(str)\n{\n let mostCommonCharacter = '';\n let latestHighestCount = 0;\n let blacklistedCharacters = [' '];\n \n for(let i = 0; i < str.length; i++)\n {\n if(blacklistedCharacters.includes(str.charAt(i)))\n {\n continue;\n }\n \n let reg = new RegExp(str.charAt(i), 'gi');\n let matches = str.match(reg);\n if (matches.length > 0)\n {\n let matchStr = matches.toString().replace('/,/g', '');\n if(latestHighestCount < matchStr.length)\n {\n mostCommonCharacter = str.charAt(i);\n latestHighestCount = matchStr.length;\n }\n \n blacklistedCharacters.push(str.charAt(i));\n }\n }\n\n return mostCommonCharacter;\n}", "title": "" }, { "docid": "1c7e1b17d695b89f81e729f34c5c5677", "score": "0.7333717", "text": "function maxChar(str) {\n const charTracker = {};\n\n str.split(\"\").map(elem => {\n charTracker[elem] = charTracker[elem] + 1 || 1;\n });\n\n return Object.keys(charTracker).reduce((prevVal, elem) => {\n return charTracker[prevVal] < charTracker[elem] ? elem : prevVal;\n });\n}", "title": "" }, { "docid": "2240e71312af40d0fb8842392dba8836", "score": "0.73080015", "text": "function maxChar(str) {\n const holdingObject = {};\n let max = 0;\n let maxKey = undefined;\n\n for (let char of str) {\n if (holdingObject[char] === undefined) {\n holdingObject[char] = 1;\n } else {\n holdingObject[char]++;\n }\n }\n\n for (let key in holdingObject) {\n if (holdingObject[key] > max) {\n max = holdingObject[key];\n maxKey = key;\n }\n }\n\n return maxKey;\n}", "title": "" }, { "docid": "44fbf95c3f7c7f82f09a7e983d284d7a", "score": "0.7293566", "text": "function maxChar(str) {\n let dict = new Map();\n let maxVal = '';\n let currentMax = 0;\n for (const char of str) {\n let val = 1;\n if (dict.has(char)) {\n val = dict.get(char);\n dict.set(char, ++val);\n } else {\n dict.set(char, val);\n }\n if (val > currentMax) {\n currentMax = dict.get(char);\n maxVal = char;\n }\n } \n return maxVal;\n}", "title": "" }, { "docid": "10be77e6bc28102dd9f90987ce8f396e", "score": "0.72892725", "text": "function getWordsNums(str) {\n const lettersCount = {}\n str.split('').forEach(letter => {\n if (lettersCount[letter]) {\n lettersCount[letter] += 1\n } else {\n lettersCount[letter] = 1\n }\n })\n const maxNum = Math.max.apply(null, Object.values(lettersCount))\n let mostCommonLetters = [];\n for (let letter in lettersCount) {\n if (lettersCount[letter] === maxNum) {\n mostCommonLetters.push(letter)\n }\n }\n return mostCommonLetters\n}", "title": "" }, { "docid": "5ad0b55e5bbe7426b45cc3b9b6e62c10", "score": "0.72884405", "text": "function high(x){\n let alpha = 'abcdefghijklmnopqrstuvwxyz'\n let highest = ''\n \n x.split(' ').forEach((word)=>{\n let total = 0\n let highestTotal = 0\n for(let i=0; i<word.length; i++){\n total += alpha.indexOf(word[i]) + 1\n }\n for(let i=0; i<highest.length; i++){\n highestTotal += alpha.indexOf(highest[i]) + 1\n }\n if(total > highestTotal){\n highest = word\n }\n })\n \n return highest\n }", "title": "" }, { "docid": "d8cf7b2a5af265a8e76b53e09a92ccf2", "score": "0.72876245", "text": "function maxChar(str) {\n let max = 0;\n let counter = {};\n let solution;\n \n for (let i = 0; i < str.length; i++) {\n let char = str[i];\n if (counter[char]) {\n counter[char] += 1;\n } else {\n counter[char] = 1;\n }\n }\n for (let key in counter) {\n if (counter[key] > max) {\n max = counter[key];\n solution = key;\n }\n }\n\n return solution;\n}", "title": "" }, { "docid": "d4bf8d2855002eb0932cc9bc0ba7cd2b", "score": "0.7286138", "text": "function LetterCountI(str) { \n\tvar strArray = str.split(\" \");\n\tvar results = [];\n\tvar max = 1;\n\tfor (var i = 0; i < strArray.length; i++){\n\t\tresults.splice(i,0,{});\n\t\tfor (var j = 0; j<strArray[i].length; j++){\n\n\t\t\tif (results[i][strArray[i][j]] !== undefined){\n\t\t\t\tresults[i][strArray[i][j]]++;\n\t\t\t} else {\n\t\t\t\tresults[i][strArray[i][j]] = 1;\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\tfor (var i = 0; i < results.length; i++){\n\t\tfor (var key in results[i]){\n\t\t\tif (max <= results[i][key]){\n\t\t\t\tmax = results[i][key];\n\t\t\t}\n\t\t}\n\t}\n\tif (max === 1) {\n\t\treturn -1;\n\t} else {\n\t\tfor (var i = 0; i < results.length; i++){\n\t\tfor (var key in results[i]){\n\t\t\tif (max === results[i][key]){\n\t\t\t\treturn strArray[i];\n\t\t\t}\n\t\t}\n\t\t} \n\t}\t \n}", "title": "" }, { "docid": "c13982c2730f58757de83774d1691f5f", "score": "0.728525", "text": "function charFreq( string ){\n\n\tvar obj={};\n\n\tfor (i=0; i < string.length; i++ ){\n\n\t\tif ( ! obj[ string[i] ] ){\n\n\t\t\tobj[ string[i] ] = 1;\n\n\t\t}else{\n\n\t\tobj[ string[i] ] += 1;\n\n\t\t}\n\n\t}\n\tif ( Object.keys(obj).length ){\n\t\treturn obj;\n\t}\n\n}", "title": "" }, { "docid": "64d584d3f79d510da6f0840f03e9d675", "score": "0.7283278", "text": "function maxChar(str) {\n const charMap = {};\n let max = 0;\n let maxChar = \"\";\n\n for (let char of str) {\n if (charMap[char]) {\n charMap[char]++;\n } else {\n charMap[char] = 1;\n }\n }\n console.log(charMap);\n\n for (let char in charMap) {\n if (charMap[char] > max) {\n max = charMap[char];\n maxChar = char;\n }\n }\n return maxChar;\n}", "title": "" }, { "docid": "f4e64c401d51b2eaaba7b75f3ebe0330", "score": "0.72562164", "text": "function most_common_letter(string) {\n var array = string.split(\"\").sort();\n var returnedArray = [array[i],0];\n var i =0;\n while(i<array.length){\n var difference = array.lastIndexOf(array[i]) - i +1;\n if(difference> returnedArray[1]){\n returnedArray[0] = array[i]\n returnedArray[1] = difference;\n }\n i=i+difference; \n }\n return returnedArray;\n}", "title": "" }, { "docid": "a3876c85c33aaff954486dfc09052f1c", "score": "0.72371614", "text": "function maxChar(str) {\n const map = new Map();\n for(c of str) {\n if(map.get(c) === undefined) {\n map.set(c,1);\n } else {\n map.set(c, map.get(c)+1);\n }\n }\n let maxVal = 0;\n let keyRet = '';\n for(var [key, value] of map) {\n if(value > maxVal) {\n maxVal = value;\n keyRet = key;\n }\n }\n\n return keyRet;\n}", "title": "" }, { "docid": "6dd364ecf876f3473bf1795ed4705ca4", "score": "0.7219286", "text": "function charFreq(string) {\n var freq = {};\n for (var i=0; i<string.length;i++) {\n var letter = string.charAt(i);\n if (freq[letter]) {\n freq[letter]++;\n } else {\n freq[letter] = 1;\n }\n }\n\n return freq;\n}", "title": "" }, { "docid": "55e0df157bebd64c293c5b8f9e50b9a0", "score": "0.7215143", "text": "function maxChar(str){\n\tconst charMap = {}\n\tlet max = 0\n\tlet retVal = ''\n\n\tfor(let ch of str){\n\t\tcharMap[ch] = charMap[ch] + 1 || 1\n\t}\n\n\tfor(let obj in charMap){\n\t\tif(charMap[obj] > max){\n\t\t\tmax = charMap[obj]\n\t\t\tretVal = obj\n\t\t}\n\t}\n\n\treturn retVal\n}", "title": "" }, { "docid": "a4922b05f0299620571eee9862bbca9b", "score": "0.71985173", "text": "function maxChar(str) {\n let dic = str.split('').\n\treduce((m, c) => m.has(c) ? m.set(c, m.get(c) + 1): m.set(c, 1), new Map())\n\n var maxChar = ''\n dic.set(maxChar, -1)\n \n dic.forEach((v, k) => {\n\tif (v > parseInt(dic.get(maxChar))) {\n\t maxChar = k\n\t}\n })\n\n return maxChar\n}", "title": "" }, { "docid": "d3c15bd8be533bd2e31bbe8f5a87df65", "score": "0.7196353", "text": "function maxChar(str) {\n\n let lastBiggerNumber = 0;\n let biggerChar = '';\n let array = {};\n for (let char of str) {\n if(array[char]) {\n array[char]++; \n if (array[char] > lastBiggerNumber) {\n lastBiggerNumber = array[char];\n biggerChar = char;\n }\n }\n array[char] = 1;\n }\n\n return biggerChar;\n\n}", "title": "" }, { "docid": "b1259f45c007d8e02d9e8d103be84113", "score": "0.71725005", "text": "function maxChar(str) {\n\n // if you want to ignore casing\n // str = str.toLowerCase() ; \n\n // my solution\n /* \n let set={};\n str.split('').map(char=>{\n let keyArr = Object.keys(set);\n if (keyArr.includes(char)){\n set[char]= set[char]+1\n }\n else{\n set[char]=1\n }\n })\n\n let maxChar;\n let value = 1;\n let keyArr= Object.keys(set);\n keyArr.map(key=>{\n if (set[key]>value) {\n value = set[key]\n maxChar= key\n }\n })\n if (maxChar) {\n console.log(maxChar);\n } else {\n console.log(\"there is no max Character.\");\n }\n */\n\n// standard solution\nlet charMap = {}\nfor (const char of str) {\n // charMap[char] = charMap[char]+1 || 1 ; or\n if (charMap[char]) {\n charMap[char]++;\n }else{\n charMap[char] = 1\n }\n} \n\nlet maxChar = \"\";\nlet maxValue = 0; // or 1\nfor (const key in charMap) {\n if (charMap[key]>maxValue) {\n maxValue = charMap[key]\n maxChar = key\n }\n}\nreturn maxChar;\n\n}", "title": "" }, { "docid": "3cb3fb5f55b640d32e8b17823b70b8ff", "score": "0.71716535", "text": "function findMostFreqWord(value){\n//To Do\n}", "title": "" }, { "docid": "d284b981c225eb381a535b844baa745e", "score": "0.7161315", "text": "function maxChar(str) {\n\n\t//// CM Solution\n\t// var arr = str.split('')\n\t// var obj = {};\n\t// arr.map((char) => {\n\t// \treturn obj[char] ? obj[char]++ : obj[char] = 1;\n\t// })\n\t// var maxValue = 0;\n\t// for(var prop in obj) {\n\t// \tif(maxValue < obj[prop]) {\n\t// \t\tmaxValue = obj[prop];\n\t// \t\tvar high = prop;\n\t// \t}\n\t// }\n\t// return high;\n\n\t// Incomplete - pre-Solution play-around\n\t// var chars = {};\n\t// for(let char of string) {\n\t// \t// if(!chars[char]) {\n\t// \t// \tchars[char] = 1;\n\t// \t// } else {\n\t// \t// \tchars[char]++\n\t// \t// }\n\t// \t// I like this! ** #cool #RememberThis\n\t// \tchars[char] = chars[char] + 1 || 1;\n\t// }\n\n\t// Solution #1\n\tconst charMap = {};\n\tlet max = 0;\n\tlet maxChar = '';\n\n\tfor(let char of str) {\n\t\tif(charMap[char]) {\n\t\t\tcharMap[char]++;\n\t\t} else {\n\t\t\tcharMap[char] = 1;\n\t\t}\n\t}\n\n\tfor(let char in charMap) {\n\t\tif(charMap[char] > max) {\n\t\t\tmax = charMap[char];\n\t\t\tmaxChar = char;\n\t\t}\n\t}\n\n\treturn maxChar;\n\n}", "title": "" }, { "docid": "e0c2e6e596dfbd127da154f0d47dd176", "score": "0.71547127", "text": "function maxChar(str) {\n\n var mp= {};\n var mx= 0;\n var maxChar= '';\n\n for(var ch of str){\n if(mp[ch]) mp[ch]++;\n else mp[ch]=1;\n\n\n }\n for(var ch in mp){\n if(mp[ch]> mx){\n mx= mp[ch];\n maxChar= ch;\n }\n }\nreturn maxChar;\n\n\n}", "title": "" }, { "docid": "0c39ec63a1213cd2e42a2c80b5fb6387", "score": "0.7145101", "text": "function maxChar(str) {\n let hash = {}\n str.split('').map(el => hash[el] = hash[el] + 1 || 1 )\n return Object.keys(hash)[0]\n\n}", "title": "" }, { "docid": "8dae6c84db97a9d5470b4f3cd3a8be10", "score": "0.71143603", "text": "function maxChar(str) {\n\n var strObj = {};\n var splitStr = str.split('');\n splitStr.forEach(function(el) {\n if (strObj[el]){\n strObj[el]++;\n } else {\n strObj[el] = 1;\n }\n });\n\n // for (let char of str) {\n // strObj[char] = strObj[char] + 1 || 1;\n // }\n\n var maxKey = '';\n var currentMax = 0;\n for (var key in strObj) {\n if ((strObj[key]) > currentMax) {\n currentMax = strObj[key];\n maxKey = key;\n };\n };\n console.log('');\n console.log('final max: ' + currentMax);\n console.log('maxed character: ' + maxKey);\n console.log('');\n return maxKey;\n}", "title": "" }, { "docid": "96cd831074cf9a160def4b16030b592e", "score": "0.7111879", "text": "function maxChar(str) {\n let obj = {};\n q = str.split(\"\");\n let n = 2;\n let max = 0;\n let maxChar = \"\";\n\n q.forEach((char, i) => {\n if (!obj[char]) {\n obj[`${char}`] = 1;\n } else {\n obj[char]++;\n }\n });\n for (let key in obj) {\n if (obj[key] > max) {\n max = obj[key];\n maxChar = key;\n }\n }\n return maxChar;\n}", "title": "" }, { "docid": "cb8fc350915872fc467904b6efafac7b", "score": "0.70958775", "text": "function findMaxRepeatCountInWord(word) {\n // Break up individual words into individual letters.\n word = word.split('');\n console.log(word);\n var mostCounts = 0;\n var count = {};\n // Count the instances of each letter\n // Iterate all the counts and find the highest\n // Return this word's max repeat count\n for(var i = 0; i < word.length; i++){\n if(count[word[i]] === undefined){\n count[word[i]] = 0;\n }\n count[word[i]]++;\n }\n for(var prop in count){\n if(count[prop] > mostCounts){\n mostCounts = count[prop];\n }\n }\n return mostCounts;\n}", "title": "" }, { "docid": "4dd5e7c565d7cd906eff9eafd23233dc", "score": "0.7092472", "text": "function maxChar(str) {\n let obj={}\n for (let l of str){\n obj[l] ? obj[l]++ : obj[l]=1\n }\n\n let max = 0\n let maxChar = ''\n\n for (o in obj){\n if(obj[o]>max){\n max = obj[o]\n maxChar = o\n }\n }\n\n return maxChar\n\n}", "title": "" }, { "docid": "f6875fbefa99b44ec785642ecd96123d", "score": "0.7076179", "text": "function maxCharacter(str) {\r\n let results = [,];\r\n for(i = 0; i < str.length(); i++) {\r\n let repeats = 0;\r\n str.forEach(char => {\r\n if(char == str[i]) {\r\n repeats++;\r\n }\r\n results.pop(repeats,str[i]);\r\n });\r\n }\r\n return \"Not implemented\"\r\n}", "title": "" }, { "docid": "2aecd771ae9ac581e5aaa5e6b29bd51d", "score": "0.70749927", "text": "function charFreq(string) {\n var freq = {};\n\n for (var i=0; i<string.length;i++) {\n var character = string.charAt(i);\n if (freq[character]) {\n freq[character]++;\n } else {\n freq[character] = 1;\n }\n }\n\n return freq;\n}", "title": "" }, { "docid": "e07991e26ffcf8c6c02b873e8c6a274e", "score": "0.7071673", "text": "function maxCharacter(str) {\n let dict = {};\n let maxCntChar = 0;\n let entries = [];\n\n str.split('').forEach((char) => {\n if(dict[char]) {\n dict[char]++;\n } else {\n dict[char] = 1;\n }\n });\n maxCntChar = Math.max(...Object.values(dict));\n entries = Object.keys(dict).filter((value) => dict[value] == maxCntChar);\n entries = entries.length == 1 ? entries[0] : entries;\n return entries;\n}", "title": "" }, { "docid": "bcb1e14681d5f602b8ac78c2b8ed01a8", "score": "0.7062496", "text": "function charFreq(str) {\n var freq = {};\nfor (var i=0; i<str.length;i++) {\n var character = str.charAt(i);\n if (freq[character]) {\n freq[character]++;\n } else {\n freq[character] = 1;\n }\n}\n\nreturn freq;\n}", "title": "" }, { "docid": "ac113892395c038abcc5e8f3f26b8651", "score": "0.70489174", "text": "function charFreq(string){\n string.split('')\n var chars = []\n for (var i = 0; i < string.length; i++) {\n var char = string.charAt(i)\n if(chars[char] === undefined) {\n chars[char] = 0\n }\n chars[char]++\n }\n return chars\n}", "title": "" }, { "docid": "b38118e6648e3e45466c12e3e13f5e72", "score": "0.70487803", "text": "function charFreq(string){\n \"use strict\";\n\n var freq = {};\n\n for(var i = 0; i < string.length; i++) {\n var character = string.charAt(i);\n if (freq[character]) {\n freq[character]++;\n } else {\n freq[character] = 1;\n }\n }\n return freq;\n }", "title": "" }, { "docid": "7fcd3a0fec730b5185dc8685c287b9bc", "score": "0.7046581", "text": "function high(x){\n let highestScore = 0;\n let highestWord = '';\n const words = x.split(' ');\n for (let i = words.length - 1; i >= 0; i--) {\n const word = words[i];\n let wordScoreCounter = 0;\n word.split('').forEach(letter => {\n // a: 97 - 96 = 1\n wordScoreCounter = wordScoreCounter + (letter.charCodeAt(0) - 96);\n });\n console.log(word, wordScoreCounter);\n \n if(wordScoreCounter >= highestScore) {\n highestScore = wordScoreCounter;\n highestWord = word;\n }\n }\n return highestWord;\n}", "title": "" }, { "docid": "dfc55d76e4bedf72e507c56f4a0661fd", "score": "0.704406", "text": "function characterFrequency(string) {\n let objLib;\n let resultArray;\n\n objLib = {};\n\n if(string.length === 0) {\n return []\n }\n\n for (const letter of string) {\n if(!objLib[letter]){\n objLib[letter] = 0\n }\n objLib[letter]++;\n }\n\n resultArray = Object.entries(objLib).sort((a , b) => {\n if(a[1] < b[1]){\n return 1\n }\n if(a[1] > b[1]) {\n return -1\n }\n if(a[1] === b[1]) {\n if(a[0] > b[0]) {\n return 1\n }\n }\n })\n \n return resultArray;\n}", "title": "" }, { "docid": "27d52e50eea416688e6796018cdd6a00", "score": "0.70425504", "text": "function maxChars(str) {\n const charsMap = {};\n let max = 0;\n let maxChar = \"\";\n for (let char of str) {\n charsMap[char] = charsMap[char] + 1 || 1;\n }\n for (let char in charsMap) {\n if (charsMap[char] > max) {\n max = charsMap[char];\n maxChar = char;\n }\n }\n return maxChar;\n}", "title": "" }, { "docid": "efcf3431d196f9a6143d449ce9fed324", "score": "0.7006336", "text": "function charFreq(string){\n \"use strict\";\n var frequency = {};\n\n for(var i=0; i<string.length; i++){\n var char = string[i];\n\n if(frequency.hasOwnProperty(char)){\n frequency[char] += 1;\n }else{\n frequency[char] = 1;\n }\n }\n\n return frequency;\n}", "title": "" }, { "docid": "d51ecda86b21f005e2b621506680b357", "score": "0.70061487", "text": "function LetterCountI(str) {\n\n var wordsArray = str.split(\" \"); // split str into individual words\n var counts = []; // tracks number of repeats for each word\n\n // outer loop selects the word to be searched\n for (i = 0; i < wordsArray.length; i++) {\n var count = 0; // tracks current count\n var temp = []; // stores letters of the current word being searched\n // inner loop scans each letter of the current word\n for (j = 0; j < wordsArray[i].length; j++) {\n temp.push(wordsArray[i][j]); // push current letter onto temp\n // if current letter already exists, increase count for this word\n if (temp.indexOf(wordsArray[i][j+1]) !== -1) {\n count++; // tracks number of repeating letters for word i\n }\n counts[i] = count; // store total count for word i\n }\n }\n // determine index of word with highest repeats, return it\n var maxCount = Math.max.apply(null, counts);\n if (maxCount === 0) {return -1;} // if no repeats, return -1\n return wordsArray[counts.indexOf(maxCount)];\n}", "title": "" }, { "docid": "4a0003df05172698e5e29265e6eacab1", "score": "0.69979006", "text": "function characterFrequency (str) {\n const lowerStr = str.toLowerCase();\n const strArr = lowerStr.split('');\n const counts = [];\n strArr.forEach(char => {\n const foundChar = counts.find(count => {\n return count[0]===char;\n });\n if(foundChar){\n foundChar[1]+=1;\n } else {\n const letterCount = [];\n letterCount[0]=char;\n letterCount[1]=1;\n counts.push(letterCount);\n };\n });\n counts.sort((a,b) => {\n if(a[1]>b[1]){\n return -1\n } else if (a[1]<b[1]){\n return 1\n } else if (a[0]<b[0]){\n return -1\n } else if (a[0]>b[0]){\n return 1\n }\n return 0\n });\n \n return counts\n }", "title": "" }, { "docid": "25425447ba69f5ebbdbc02fbe3bcf6c7", "score": "0.69898826", "text": "function highestOcurrence(text) {\n let alphabet; // string (\"array of chars\"), all the letters we will search for\n alphabet = alphabetEng; // assigning the English alphabet\n\n let lettersCount = []; // integer array, to store the counts of all individual letters, to\n let highestOcurrence = 0; // integer, storing the highest frequency of occurrence\n let index = []; // array of integers, storing the indexes of the most frequent letters so far\n // usually contains one index, but when multiple letters are same frequent, then it will store all indexes\n let amount; // integer, storing the amount of exact letter being processed\n\n // loop to find out how many times are all letters located in text\n for (let x = 0; x < alphabet.length; x++) {\n let char = alphabet.charAt(x); // getting the letter at exact location in alphabet\n amount = text.split(char).length - 1; // finding out how many times letter is there in the text\n lettersCount.push(amount); // filling the array of counts\n }\n\n // loop to find out which letter is the most frequent\n for (let y = 0; y < lettersCount.length; y++) {\n let frequency = lettersCount[y]; // finding out specific letter's frequency\n if (frequency > highestOcurrence) { // if there is so far longest word, store it in index\n highestOcurrence = frequency; // update the most frequent amount\n index = []; // make sure there won't be any old indexes from less common letters\n index[0] = y; // store the new most frequent letter's index\n } else if (frequency == highestOcurrence) { // if there is other most common letter, also store its index\n index.push(y);\n }\n }\n\n // if there are more than one most frequent letter, change the grammar from \"letter\" to \"letters\"\n if (index.length > 1) {\n $(\"#letter\").html(\"Most common letters: \");\n }\n\n // loop to print out the list of the most frequent letter(s)\n for (let z = 0; z < index.length; z++) {\n $(\"#common\").append(alphabet.charAt(index[z]));\n if (z != index.length - 1) {\n $(\"#common\").append(\", \"); // include commas between all the letters (but not after the last one)\n }\n }\n\n // print out the frequency of the most common letter(s)\n $(\"#common\").append(\" (\" + highestOcurrence + \" occurrences)\");\n}", "title": "" }, { "docid": "3689d82205bcffaa19e98389a1c3dddb", "score": "0.69577676", "text": "function letOccur(str, a){\n var countletter = 0;\n \n for (var i=0; i < str.length; i++) {\n if (str[i] === a) {\n countletter ++\n }\n }\n return countletter;\n}", "title": "" }, { "docid": "ad1714cd135d057c5d568e256cec3030", "score": "0.6929443", "text": "function strOcc(str, letter) {\n var letterCount = 0;\n for (var i = 0; i < str.length; i++) {\n if (str.charAt(i) == letter) {\n letterCount += 1;\n }\n }\n return letterCount;\n}", "title": "" }, { "docid": "fa47c15de8e35d4ab35824d2cb6f67a4", "score": "0.691921", "text": "function characterFrequency (string) {\n var count = {}, res=[];\n\n for (var i = 0; i < string.length; i++){\n if (count[string[i]]) count[string[i]]++\n else { count[string[i]] = 1 }\n }\n\n for (var key in count){ \n res.push([key, count[key]])\n }\n\n res.sort(function(a,b){\n if (a[1] === b[1]){\n if (a[0] < b[0]) return -1;\n if (a[0] > b[0]) return 1;\n }else { \n if (a[1] > b[1]) return -1;\n if (a[1] < b[1]) return 1;\n return 0;\n }\n })\n\n return res\n}", "title": "" }, { "docid": "ad023004094c35c3a913dfabcf02edc0", "score": "0.6898852", "text": "function countOccurrences(string, letter) {\n console.log(string.split(letter).length - 1);\n}", "title": "" }, { "docid": "a86fadbc556196d733b3e1be03786235", "score": "0.68763316", "text": "function maxRep(str) {\n let charObj = {};\n let max = 0;\n let maxChar = '';\n for (let item of str) {\n charObj[item] = charObj[item] + 1 || 1;\n }\n\n for (let item in charObj) {\n if (charObj[item] > max) {\n max = charObj[item]\n maxChar = item\n }\n }\n return maxChar\n}", "title": "" }, { "docid": "34dd78d1f3f92a39b01d1349cf4b3be8", "score": "0.68549985", "text": "function LetterCountI(str) {\n\n var words = str.split(\" \");\n var largestDif = 0;\n var answer;\n\n for (var i = 0; i < words.length; i++) {\n var currentWord = words[i];\n var currentWordLength = words[i].length;\n var currentWordSorted = words[i].split(\"\").sort();\n for (var j = 0; j < (words[i].length - 1); j++) {\n if (currentWordSorted[j] === currentWordSorted[j + 1]) {\n currentWordSorted.splice(j, 1);\n }\n var currentDif = (currentWordLength - currentWordSorted.length);\n if (currentDif > largestDif) {\n largestDif = currentDif;\n answer = currentWord;\n }\n }\n }\n\n if (largestDif > 0) {\n return answer;\n } else {\n return -1;\n }\n\n}", "title": "" }, { "docid": "8e5929d08e396a1fdc90d44ddf7546c9", "score": "0.6849808", "text": "function charMapper(s) {\n let arr = s.split(\"\");\n let charmap = {};\n arr.forEach (function(c) {\n if (charmap[c]) {\n charmap[c]++;\n } else {\n charmap[c] = 1;\n }\n });\n\n let maxchar = '';\n let max = 0;\n for (let [key, value] of Object.entries(charmap)) {\n if (value > max) {\n maxchar = key;\n max = value;\n }\n }\n\n return maxchar;\n}", "title": "" }, { "docid": "2884a3aeb48018ea220b8be4337cc72e", "score": "0.6829229", "text": "function highestFreq (str) {\n\tvar strObj = {}; \n\tvar max = 0;\n\tvar results = [];\n\tfor (var i = 0; i< str.length; i++){\n\t\tif (strObj[str[i]]!== undefined){\n\t\t\tstrObj[str[i]]++; \n\t\t}\n\t\telse {\n\t\t\tstrObj[str[i]] = 1;\n\t\t}\n\t}\n\tconsole.log(strObj);\n\tfor (var key in strObj){\n\t\tif( strObj[key] > max){\n\t\t\tmax = strObj[key];\n\t\t}\n\t}\n\t for(var key in strObj){\n\t \tif (strObj[key] === max){\n\t \t\tresults.push(key);\n\t \t}\n\t }\n\t return results.sort().join(\"\"); \n\n}", "title": "" }, { "docid": "ae8275b96f3fb3fa55711da3d7f5d53c", "score": "0.6804697", "text": "function high(x) {\n let key = {\n a: 1,\n b: 2,\n c: 3,\n d: 4,\n e: 5,\n f: 6,\n g: 7,\n h: 8,\n i: 9,\n j: 10,\n k: 11,\n l: 12,\n m: 13,\n n: 14,\n o: 15,\n p: 16,\n q: 17,\n r: 18,\n s: 19,\n t: 20,\n u: 21,\n v: 22,\n w: 23,\n x: 24,\n y: 25,\n z: 26\n };\n let words = x.split(' ');\n let counts = words.map(word => {\n let count = 0;\n for (let i = 0; i < word.length; i++) {\n count += key[word[i]];\n }\n return count;\n });\n\n return words[counts.indexOf(Math.max(...counts))];\n}", "title": "" }, { "docid": "d44d7c2bccde03ee8f2a87085b49645a", "score": "0.68018264", "text": "function letterFreq(str) {\n var output = {};\n for (var i = 0;i < str.length; i++) {\n if (output.hasOwnProperty(str[i])) {\n output[str[i]]++;\n } else {\n output[str[i]] = 1;\n }\n }\n return output;\n}", "title": "" }, { "docid": "59448914ffec7aa380413e6017ab2500", "score": "0.6795192", "text": "function firstNonRepeatedCharacter (string) {\n // Write your code here, and\n // return your final answer.\n // for(var i = 0; i < string.length; i++){\n // if(string.indexOf(string[i]) === string.lastIndexOf(string[i])){\n // return string[i];\n // }\n // }\n // return 'sorry'\n var letterStorage = string.split('').reduce(function(update, letter){\n if(!(letter in update)){\n update[letter] = 1;\n } else {\n update[letter]++;\n }\n return update;\n },{});\n //iterate thru the string and put the letters with the value being the number of appearances\n for(var i = 0; i < string.length; i++){\n if(letterStorage[string[i]] === 1){\n return string[i]\n }\n }\n return 'sorry';\n}", "title": "" }, { "docid": "83a62ed2d5076814980c835d1788014a", "score": "0.6787596", "text": "function maxChar(str) {\n let max = 0;\n let winner = '';\n\n const obj = [...str].reduce((acc, el) => {\n const element = acc[el] ? (acc[el] + 1) : 1\n\n return Object.assign(acc, {[el]: element})\n } , {})\n\n for (let prop in obj) {\n if (obj[prop] > max) {\n max = obj[prop]\n winner = prop\n }\n }\n\n return winner;\n}", "title": "" }, { "docid": "d874a91a1205e385df07186bb716dfd7", "score": "0.67790055", "text": "function charFreq(string){\n \"use strict\";\n var freqList = {};\n for (var i = 0; i < string.length; i++) {\n var char = string.charAt(i);\n if (freqList[char]){\n freqList[char] ++;\n } else {\n freqList[char] =1;\n }\n }\n return freqList;\n }", "title": "" }, { "docid": "36925c778a62d5b8e8e00de2ed193eeb", "score": "0.6777049", "text": "function charFreq(string){\n \"use strict\";\n\n}", "title": "" }, { "docid": "cc98d4c7efc74d196173f296e1601bf0", "score": "0.67541575", "text": "function strCount(str, letter){\n return str.split(letter).length - 1;\n}", "title": "" }, { "docid": "a8a144ca3efd2c01be26cdcd9fa1f2cc", "score": "0.6749706", "text": "function letterOccurences(str, letter) {\n\n let totalOcurences = 0;\n for(let i = 0; i < str; i++) {\n if(str[i] == letter) totalOcurences++; \n }\n\n return totalOcurences;\n\n}", "title": "" }, { "docid": "20fa0c1db7bc457b62569323894a90f1", "score": "0.6742549", "text": "function LetterCountI(str){\n // remove special characters from string\n str = str.replace(/[&\\!/\\\\#,+()$~%.:*?<>{}]/g, '');\n var strNew = [];\n // str to array\n var strArray = str.split(' ');\n // loop through each word of array\n for (var x = 0; x < strArray.length; x++) {\n var newWord = \"\";\n // declare variable for each word of strArray\n var strArrayWord = strArray[x];\n // loop through each letter of each word of strArray\n for (var y = 0; y < strArrayWord.length; y++) {\n // declare variable for letter this loop\n var letterThisLoop = strArrayWord[y];\n // use indexOf to determine if letter has been repeated \n if (newWord.indexOf(letterThisLoop) > -1) {\n return strArray[x];\n }\n newWord += letterThisLoop;\n }\n strNew.push(newWord);\n }\n return -1;\n}", "title": "" }, { "docid": "145b8838e6ee69b6c8631a49b1f718a9", "score": "0.67391956", "text": "function countOccurrences(string, letter) {\n let occurrences = 0;\n for (let i = 0; i < string.length; i++) {\n if (string[i] === letter) occurrences++\n }\n return occurrences\n}", "title": "" }, { "docid": "13c924976f7f48c4e8dbf7e8d628cff7", "score": "0.6737142", "text": "function countOcc (str,letter) {\n\tvar count = 0;\n\tfor (var i = 0 ; i< str.length; i++){\n\t\tif (str[i] === letter) {\n\t\t\tcount ++; \n\t\t}\n\t}\n\treturn count; \n}", "title": "" }, { "docid": "c8235b5979f2bdfb811c467e8d9a438f", "score": "0.6735182", "text": "function high(s){\n let as = s.split(' ').map(s=>[...s].reduce((a,b)=>a+b.charCodeAt(0)-96,0));\n return s.split(' ')[as.indexOf(Math.max(...as))];\n }", "title": "" }, { "docid": "ebbc65af053c776ebaaea93ca8b4963e", "score": "0.67209977", "text": "function mostValueWord2(str) {\n // transform input into an array of words\n let arrWord = str.toLowerCase().split(' ');\n let wordValue = 0;\n let sum = 0;\n let word;\n\n // iterate the array of words [\"hello\", \"my\", \"name\", \"is\"]\n for(let i = 0; i < arrWord.length; i++) {\n // iterate the letter of the words \n // for example arrWord[0] will iterate \"hello\"\n // and returning the charCode value for the word\n for(let j = 0; j < arrWord[i].length; j++) {\n sum += arrWord[i].charCodeAt(j) - 96; \n }\n\n // assigning the value of sum, which hold the charCode value of the word\n // to a wordValue variable if the sum > wordValue\n // also, assigning the current word being iterate to variable word\n if(sum > wordValue) {\n wordValue = sum;\n word = arrWord[i];\n }\n\n totalValue = 0;\n }\n\n return word;\n}", "title": "" }, { "docid": "0e574fae78612460410e75b5abbeea8b", "score": "0.67207843", "text": "function charFreq(str) {\n var result = {};\n str.toLocaleLowerCase().split('').forEach(function (val) {\n result[val] ? result[val] += 1 : result[val] = 1;\n });\n return result;\n}", "title": "" }, { "docid": "93c8a5401372f4d17b17c66988d7030c", "score": "0.67140454", "text": "function maxCharacter(str) {\r\n final = new Array\r\n for(i = 0; i< str.length; i++)\r\n {\r\n contained = false\r\n for(j=0; j<final.length && !contained; j++)\r\n {\r\n if(final[j][0] === str[i])\r\n {\r\n final[j][1]++;\r\n contained=true;\r\n } \r\n \r\n }\r\n if(!contained)\r\n {\r\n a = [str[i], 1]\r\n final.push(a)\r\n } \r\n }\r\n\r\n let highest=['z',0];\r\n console.log(final)\r\n for(i=0; i<final.length; i++)\r\n {\r\n if(final[i][1] > highest[1])\r\n {\r\n highest[0] = final[i][0]\r\n highest[1] = final[i][1]\r\n }\r\n }\r\n return highest;\r\n}", "title": "" }, { "docid": "f5ecf9b136ae7f2ede9912e7a481326c", "score": "0.66797715", "text": "function strCount(str, letter){ \n counter = 0;\n for (var i = 0; i < str.length; i++) {\n if (letter === str[i]) {\n counter++\n }\n }\nreturn counter\n}", "title": "" }, { "docid": "cf042c31d49b95d987d42c1c346f8078", "score": "0.6678138", "text": "function maxChar(str) {\n let string = \"The max Character\" //Getting the max character\n let chars = {}; // Initializing an empty chars array\n\n for(let char of string) { // Looping through the string\n if(!chars[char]) { // Checking if the position in the string is not present in the array\n char = 1; // if it is true it will initialize char to 1\n } else {\n char++; // if it is present it will increment the value of char\n }\n }\n\n return chars; // Returning the array of characters\n}", "title": "" }, { "docid": "b59cfb3379da297a1cf9a579494ce6de", "score": "0.6676393", "text": "function longestRepetition(s) {\n let count = 0;\n let prevLetter = \"\";\n\n return s\n .toLowerCase()\n .split(\"\")\n .reduce(\n (acc, curr) => {\n if (curr === prevLetter) {\n count++;\n } else {\n count = 1;\n }\n\n if (count > acc[1]) {\n acc[1] = count;\n acc[0] = curr;\n }\n\n prevLetter = curr;\n return acc;\n },\n [\"\", 0]\n );\n}", "title": "" }, { "docid": "890d5000850a6e72d870ed00a5c059b1", "score": "0.66446483", "text": "function charFreq(string){\n \"use strict\";\n var charList = {};\n for (var x = 0; x < string.length; x++) {\n if (string.charAt(x) in charList)\n charList[string.charAt(x)] += +1;\n else\n charList[string.charAt(x)] = 1;\n }\n return charList;\n}", "title": "" }, { "docid": "3db6a8668a7eb7c1070bee78b36dc662", "score": "0.6633592", "text": "function charOccurrence(word, char) { \n\n    if (typeof word !== \"string\") {\n        return false;\n    }\n    var res = 0; //defining variable for counting\n    for (var i = 0; i < word.length; i++)\n\n        // checking character in string\n        if (word[i] == char)\n            res++;\n\n    return 'Letter ' + char + ' occurres ' + res + ' times in word ' + word;\n}", "title": "" }, { "docid": "a3c5b06e4f9f60e912693bc32643a8b8", "score": "0.66313624", "text": "function high(x){\n var biggest = {\n points: 0,\n word: \"\",\n };\n x.split(\" \").forEach(currentWord => {\n var totalPoints = 0;\n currentWord.split(\"\").forEach((letter) => {\n var points = letter.charCodeAt(0) - 96;\n totalPoints += points;\n });\n if (totalPoints > biggest.points) {\n biggest.points = totalPoints;\n biggest.word = currentWord;\n }\n });\n return biggest.word;\n}", "title": "" }, { "docid": "3ab1baad56e1a1aa268a913389f05bb9", "score": "0.66240674", "text": "function findLongestWord(string) {\n return string.length;\n}", "title": "" }, { "docid": "5939b826512841c624647e9d802d8f9f", "score": "0.66035175", "text": "function findLongestWord(str) {\n return str.split(/\\W+/).reduce(function(item1, item2) {\n return item1.length < item2.length ? item2 : item1;\n }, \"\").length;\n}", "title": "" }, { "docid": "6fa3913cc6dd5977296058bccece9996", "score": "0.66012436", "text": "function findLongestWord(str) {\n return str.split(\" \").sort(function(a, b) { return a.length > b.length;}).pop().length;\n}", "title": "" }, { "docid": "1d78db1c6d217a29070ebeea7445b729", "score": "0.6593723", "text": "function findLongestWord(string){\n return string.reduce((longStr, string)=> {\n return longStr > string.length ? longStr :string.length\n });\n}", "title": "" } ]
3fb2b1b273a17249fd0bec4668486025
Helper function to create a node n with the attributes v for svg
[ { "docid": "45c3d51a5cf7ad26785de583f89e6411", "score": "0.83468765", "text": "function getNode(n, v) {\n n = document.createElementNS(\"http://www.w3.org/2000/svg\", n);\n for (var p in v)\n n.setAttributeNS(null, p, v[p]);\n return n\n}", "title": "" } ]
[ { "docid": "0ef2dd0c222d4b8804827c1c2ccb4317", "score": "0.66994464", "text": "function VNode() {}", "title": "" }, { "docid": "6aba2927b04d054ecace2c929189d42e", "score": "0.6668594", "text": "function createNode(n){\n this.val = n;\n}", "title": "" }, { "docid": "751e9011225771005e24c1b611f86cf7", "score": "0.6648226", "text": "function makeNode(num, index, length) {\n return {\n id: num,\n label: `${num}`,\n size: 10,\n shape: \"dot\",\n font: {\n face: \"Arial\",\n align: \"center\"\n },\n color: make_color((parseInt(index) + 1) / (length + 1), 0.6, 0.99)\n }\n}", "title": "" }, { "docid": "8adad92c2665fd7e9d901e5a52ab3f25", "score": "0.65652466", "text": "function makeNode(name, element, settings) {\n\t\n\tvar node = document.createElementNS('http://www.w3.org/2000/svg', name);\n\t\t\n\t\tif(settings.d) {\n\t\t\tnode.setAttribute('d' , settings.d);\n\t\t}\n\t\t node.setAttribute('stroke-width', '2');\n\t\tif(settings.stroke) {\n\t\t\tnode.setAttribute('stroke', settings.stroke);\n\t\t}\n\t\tif(settings.mask) {\n\t\t\tnode.setAttribute('mask', settings.mask);\n\t\t}\n\t\t\tnode.setAttribute('stroke-dashoffset', angular.fromJson(settings.strokedashoffset));\n\t\n\treturn node;\n}", "title": "" }, { "docid": "b3556c144abf555de4a5f7d5d0ab6faf", "score": "0.63992125", "text": "function wrapNode(n, v) {\n var thisValue = typeof v !== \"undefined\" ? v : \"\";\n return \"<\" + n + \">\" + thisValue + \"</\" + n + \">\";\n }", "title": "" }, { "docid": "70a9e3b7cdbb105cd33979b52143f7d9", "score": "0.62616724", "text": "function addNode(val,x,y)\n{\n d3.select(`#node${val-1}`).remove();\n\n const svg = d3.select('svg');\n\n const g= svg.append('g')\n .attr('id',`node${val-1}`);\n\n const c = g.append('circle')\n .attr('cx',`${x}`)\n .attr('cy',`${y}`)\n .attr('r',25)\n .style('fill','#F5F2B8')\n .attr('stroke','#383F51')\n .attr('stroke-width','2px');\n\n const t =g.append('text')\n .attr('x',`${x}`)\n .attr('y',`${y}`)\n .text(val)\n .attr('fill','#383F51')\n .attr('alignment-baseline',\"central\")\n .attr('text-anchor','middle')\n .attr('font-size','20px')\n .style('font-weight','bold');\n\n}", "title": "" }, { "docid": "75fd6fce52e5c3063a38d23fb0c5b75e", "score": "0.6000591", "text": "function createElement (doc, dispatch, vnode) {\n if (vnode.type === '#text') {\n return doc.createTextNode(vnode.props.nodeValue)\n }\n\n const {type, props, children} = vnode\n let cached = cache[type]\n\n if (typeof cached === 'undefined') {\n cached = cache[type] = svg.isElement(type)\n ? doc.createElementNS(svg.namespace, type)\n : doc.createElement(type)\n }\n\n const node = cached.cloneNode(false)\n\n if (props !== null) {\n for (let key in props) {\n const val = props[key]\n if (val !== null && val !== undefined) {\n dispatch(setAttribute(node, key, val))\n }\n }\n }\n\n for (let i = 0, len = children.length; i < len; ++i) {\n node.appendChild(children[i].el)\n }\n\n return node\n}", "title": "" }, { "docid": "fad9d00b9cc5be8f61bfc85b0c4ed175", "score": "0.5918919", "text": "function createNode(pNode,attr,...chN){\r\n let parent=document.createElement(pNode);\r\n\r\n for(let att of Object.keys(attr)){\r\n parent.setAttribute(att, attr[att]);\r\n }\r\n\r\n for(let ch of chN) parent.appendChild(ch);\r\n\r\n return parent;\r\n}", "title": "" }, { "docid": "f694a7f280d3a87547a8b30f2b7c3cdd", "score": "0.5899799", "text": "function createNode(name, labels, values) {\n var node = document.createElement(name);\n for(var i = 1; i < values.length; i++) {\n var e = document.createElement(labels[i-1]);\n e.appendChild(document.createTextNode(values[i]));\n node.appendChild(e);\n }\n return node;\n}", "title": "" }, { "docid": "4b965e284ed7dbd214eb85e629f442e8", "score": "0.5897669", "text": "function v(e){const t=e.fn.attr;return e.fn.attr=function(e,n){const r=this.length;if(!r)return t.call(this,e,n);for(let i=0;i<r;++i){const r=this[i];if(\"http://www.w3.org/2000/svg\"!==r.namespaceURI)return t.call(this,e,n);if(void 0!==n)r.setAttribute(e,n);else if(Array.isArray(e)){const t={};let n=e.length;for(;n--;){const i=e[n];let o=r.getAttribute(i);(o||\"0\"===o)&&(o=isNaN(o)?o:o-0),t[i]=o}return t}if(\"object\"!=typeof e){let t=r.getAttribute(e);return(t||\"0\"===t)&&(t=isNaN(t)?t:t-0),t}for(const[t,n]of Object.entries(e))r.setAttribute(t,n)}return this},e}", "title": "" }, { "docid": "19d0c6e960769cd152234d9e22b2e285", "score": "0.58939695", "text": "function makeNode(id, label) {\n g.setNode(id, {\n label: label,\n style: \"fill: #afa\"\n });\n }", "title": "" }, { "docid": "05834989bbd2f63910dbb0893feef27f", "score": "0.5856434", "text": "function createNS(type) {\n // return {appendChild:function(){},setAttribute:function(){},style:{}}\n return document.createElementNS(svgNS, type);\n }", "title": "" }, { "docid": "8a19b6630a5cdb4df75204caf96dc9f7", "score": "0.58386505", "text": "function createTag(tag,objAttr){\t\n\t\t\t\tvar oTag = document.createElementNS(svgNS , tag);\t\n\t\t\t\tfor(var attr in objAttr){\n\t\t\t\t\toTag.setAttribute(attr , objAttr[attr]);\n\t\t\t\t}\t\n\t\t\t\treturn oTag;\t\n\t\t\t}", "title": "" }, { "docid": "389d02b2dcc723f852d8734c3b4c862b", "score": "0.5828556", "text": "initializeVizSpace() {\n this.svg = d3.select(this.node)\n .attrs({\n viewBox: `0 0 ${this.getSvgOuterWidth()} ${this.getSvgOuterHeight()}`,\n preserveAspectRatio: `xMidYMid meet`\n })\n ;\n\n this.svg = this.svg.append(\"g\")\n .attrs({\n \"transform\": `translate(${this.props.svgSize.margin.left}, ${this.props.svgSize.margin.top})`,\n })\n ;\n }", "title": "" }, { "docid": "283a7d11223b8c7b1a7b3b480f265710", "score": "0.58114934", "text": "function graphXObject(name, value) \r\n{ \r\n\tthis.label = name;\r\n\tthis.v = value;\r\n}", "title": "" }, { "docid": "da2c5375b7ecc36e7ab6b6f47e0eba3f", "score": "0.5799467", "text": "function Vn(t, e, n, r, i, o, s, u) {\n return new Pn(t, e, n, r, i, o, s, u);\n}", "title": "" }, { "docid": "7c91a441adf111cf8f269612e9f1b6e1", "score": "0.57975405", "text": "function nodesAttrs(nodes) {\n let container = nodes.append('g')\n container\n .attr('id', d => 'node' + d.data.id)\n .attr('class', d => 'node' + (!d.children ?\n ' node--leaf' : ' node--internal') + (d.parent ? ' node--norm' : ' node--root'))\n .attr('transform', d => 'translate(' + [d.y, d.x] + ')')\n .on('click', click)\n container\n .append('circle')\n .attr('r', 3)\n return container\n }", "title": "" }, { "docid": "655141ae0edcc9f28bdeef93f7bd1e8a", "score": "0.57885665", "text": "createNode(node) {\n nodes = webglUtils.extendArray(nodes, nodesCount, ATTRIBUTES_PER_PRIMITIVE);\n nodesCount += 1;\n }", "title": "" }, { "docid": "bc09a1ef7222d7d719c56c8b8652ce83", "score": "0.5783829", "text": "function addNode(x,y,radius,nodeColor,nodeName)\r\n{\r\n\r\n\tnodeText[nodeString.length]='<text x=\"'+(x-4.3*nodeName.length)+'\" y=\"'+(y+2*radius)+'\" fill=\"white\">'+nodeName+'</text>';\r\n\tnodeString[nodeString.length]='<circle cx=\"'+x+'\" cy=\"'+y+'\" r=\"'+radius+'\" stroke=\"white\" stroke-width=\"1\" fill=\"'+nodeColor+'\" onmouseover=\"changeNodeInformation('+nodeString.length+')\" onClick=\"nodeClickHandle('+nodeString.length+')\" />';\r\n}", "title": "" }, { "docid": "b42df74ab092cebac674ef56d8989762", "score": "0.57710594", "text": "static createNode(params) {\n let renderer = params.renderer;\n let paper = params.paper;\n let metadata = params.metadata;\n let position = params.position;\n let props = params.props;\n let graph = params.graph || (params.paper ? params.paper.model : undefined);\n let node;\n if (!position) {\n position = { x: 0, y: 0 };\n }\n if (renderer && isFunction(renderer.createNode)) {\n node = renderer.createNode(metadata, props);\n }\n else {\n node = new joint.shapes.flo.Node();\n if (metadata) {\n node.attr('.label/text', metadata.name);\n }\n }\n node.set('type', joint.shapes.flo.NODE_TYPE);\n if (position) {\n node.set('position', position);\n }\n if (props) {\n Array.from(props.keys()).forEach(key => node.attr(`props/${key}`, props.get(key)));\n }\n node.attr('metadata', metadata);\n if (graph) {\n graph.addCell(node);\n }\n if (renderer && isFunction(renderer.initializeNewNode)) {\n let descriptor = {\n paper: paper,\n graph: graph\n };\n renderer.initializeNewNode(node, descriptor);\n }\n return node;\n }", "title": "" }, { "docid": "4edff670ab384dbdb6562d926617211c", "score": "0.5765741", "text": "function createElement(param) {\n var element = document.createElementNS(svgns, param.name);\n element.id = param.name + \"_\" + param.id;\n\n if (param.text !== undefined)\n element.innerText = element.textContent = param.text;\n\n addOptions.call(element, param.options);\n addActions.call(element, param.actions);\n return element;\n }", "title": "" }, { "docid": "d2f0e80cefa8a1a9fb1c7194d665dc52", "score": "0.57643247", "text": "function createNode(type, attributes, props) {\r\n\tvar node = document.createElement(type);\r\n\tif (attributes) {\r\n\t\tfor (var attr in attributes) {\r\n\t\t\tnode.setAttribute(attr, attributes[attr]);\r\n\t\t}\r\n\t}\r\n\tif (props) {\r\n\t\tfor (var prop in props) {\r\n\t\t\tif (prop in node) node[prop] = props[prop];\r\n\t\t}\r\n\t}\r\n\treturn node;\r\n}", "title": "" }, { "docid": "0d8cc73c025443f82b6aedfebb8e9ea8", "score": "0.57513434", "text": "function createNode(type, attributes, props) {\n var node = document.createElement(type);\n if (attributes) {\n for (var attr in attributes) {\n if (!attributes.hasOwnProperty(attr)) continue;\n node.setAttribute(attr, attributes[attr]);\n }\n }\n if (props) {\n for (var prop in props) {\n if (!props.hasOwnProperty(prop)) continue;\n if (prop in node) node[prop] = props[prop];\n }\n }\n return node;\n }", "title": "" }, { "docid": "773ddae1004a8bca0c512d001e667290", "score": "0.57425064", "text": "function addNode(val,x,y)\n{\n d3.select(`#node${val-1}`).remove();\n d3.select(`#dist${val-1}`).remove();\n\n const svg = d3.select('svg');\n\n const g= svg.append('g')\n .attr('id',`node${val-1}`);\n\n const c = g.append('circle')\n .attr('cx',`${x}`)\n .attr('cy',`${y}`)\n .attr('r',25)\n .style('fill','#F5F2B8')\n .attr('stroke','#383F51')\n .attr('stroke-width','2px');\n\n const t =g.append('text')\n .attr('x',`${x}`)\n .attr('y',`${y}`)\n .text(val)\n .attr('fill','#383F51')\n .attr('alignment-baseline',\"central\")\n .attr('text-anchor','middle')\n .attr('font-size','20px')\n .style('font-weight','bold');\n\n\n if(val!=1)\n {\n const d= g.append('text')\n .attr('id',`dist${val-1}`)\n .attr('x',x)\n .attr('y',y+40)\n .text(`Dist=INF`)\n .attr('text-anchor','middle');\n }\n\n \n else\n {\n g.append('text')\n .attr('id',`dist${val-1}`)\n .attr('x',x)\n .attr('y',y+40)\n .text(`Dist=0`)\n .attr('text-anchor','middle');\n }\n\n}", "title": "" }, { "docid": "904a4f0809fc44dcf46f5730c1e27256", "score": "0.5701668", "text": "function node(x, y, parent_index, g, h, f)\n{\n\tthis.x = x;\n\tthis.y = y;\n\tthis.parent_index = parent_index;\n\tthis.g = g;\n\tthis.h = h;\n\tthis.f = f;\n}", "title": "" }, { "docid": "1f61c3137ce2ae6784be0cd452992784", "score": "0.5685884", "text": "function gCreate(tag) { return document.createElementNS('http://www.w3.org/2000/svg', tag); }", "title": "" }, { "docid": "0ce06b51b31526ab0e18f0c127457327", "score": "0.568245", "text": "function toNativeElement (entityId, path, vnode) {\n\t var el\n\t var attributes = vnode.attributes\n\t var tagName = vnode.type\n\t var childNodes = vnode.children\n\n\t // create element either from pool or fresh.\n\t if (svg.isElement(tagName)) {\n\t el = document.createElementNS(svg.namespace, tagName)\n\t } else {\n\t el = document.createElement(tagName)\n\t }\n\n\t // set attributes.\n\t forEach(attributes, function (value, name) {\n\t setAttribute(entityId, path, el, name, value)\n\t })\n\n\t // add children.\n\t forEach(childNodes, function (child, i) {\n\t var childEl = toNative(entityId, path + '.' + i, child)\n\t if (!childEl.parentNode) el.appendChild(childEl)\n\t })\n\n\t // store keys on the native element for fast event handling.\n\t el.__entity__ = entityId\n\t el.__path__ = path\n\n\t return el\n\t }", "title": "" }, { "docid": "32829f7e5d61847a09705b97042c63e2", "score": "0.5660009", "text": "function makeElt(name, attrs, appendTo)\n{\n var element = document.createElementNS(\"http://www.w3.org/2000/svg\", name);\n if (attrs === undefined)\n attrs = {};\n for (var key in attrs) {\n element.setAttributeNS(null, key, attrs[key]);\n }\n if (appendTo) {\n appendTo.appendChild(element);\n }\n return element;\n}", "title": "" }, { "docid": "29736b9d429e8413941cfcf58c6d9d35", "score": "0.5650344", "text": "function createNode(index) {\n let {\n name,\n\n rotation,\n translation,\n scale,\n matrix,\n\n mesh: meshIndex,\n camera: cameraIndex,\n\n children: childIndices = [],\n\n extensions\n\n } = gltf.nodes[index];\n\n let light = null;\n if (typeof extensions !== 'undefined' && typeof extensions.KHR_lights_punctual !== 'undefined') {\n light = lights[extensions.KHR_lights_punctual.light];\n }\n\n return node({\n mesh: meshes[meshIndex],\n camera: cameras[cameraIndex],\n light,\n rotation,\n translation,\n scale,\n matrix,\n\n // recusively create nodes for the children.\n children: childIndices.map((index) => createNode(index))\n }, name);\n\n }", "title": "" }, { "docid": "c8e6ad5622c8e2e7e4c2ac877ba03515", "score": "0.5619416", "text": "addNode(value){\n if(!value){return null ; }\n let node = new Vert(value);\n this.nodes[value] = node;\n return node;\n }", "title": "" }, { "docid": "c676a5dec7e883a79e3ac6a869a6c428", "score": "0.5612834", "text": "function createSvgElement ( type, attributes ) {\n\tvar element = document.createElementNS( 'http://www.w3.org/2000/svg', type );\n\n\tvar attributeName;\n\tvar attributeValue;\n\n\t// this is similar to the `for` loop you've already seen, except\n\t// that it lets us 'enumerate' the properties of an object – in\n\t// this case, the `attributes` object\n\tfor ( attributeName in attributes ) {\n\t\t// when you don't yet know the name of the object's property,\n\t\t// you use square bracket notation instead of dot notation:\n\t\t//\n\t\t// var property = 'someProperty'\n\t\t// obj.someProperty === obj[ property ]\n\t\tattributeValue = attributes[ attributeName ];\n\t\telement.setAttribute( attributeName, attributeValue );\n\t}\n\n\treturn element;\n}", "title": "" }, { "docid": "075d28764e788e90db299f606cc6ceeb", "score": "0.5609226", "text": "function _a(e, a, v) {\n var t = document.createAttribute(a);\n t.value = v;\n return e.setAttributeNode(t);\n}", "title": "" }, { "docid": "e6ec21d3c086fd4c1294e8db0b951c98", "score": "0.5608688", "text": "function createSVGElement(tag,attributes,appendTo) {\n\t\tvar element = document.createElementNS('http://www.w3.org/2000/svg',tag);\n\t\tattr(element,attributes);\n\t\tif (appendTo) {\n\t\t\tappendTo.appendChild(element);\n\t\t}\n\t\treturn element;\n\t}", "title": "" }, { "docid": "550edfc32b3bf1bd89aa31553490aa72", "score": "0.56045085", "text": "function createMonster(x, y) {\n var monster = document.createElementNS(\"http://www.w3.org/2000/svg\", \"use\");\n monster.setAttribute(\"x\", x);\n monster.setAttribute(\"y\", y);\n monster.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", \"#monster\");\n document.getElementById(\"monsters\").appendChild(monster);\n}", "title": "" }, { "docid": "95a67fb3713f9f0f55b8bed35d9acab3", "score": "0.5595922", "text": "function createNode(transform, render, sibling, child) {\r\n var node = {\r\n transform: transform,\r\n render: render,\r\n sibling: sibling,\r\n child: child,\r\n }\r\n return node;\r\n}", "title": "" }, { "docid": "790112dde90152a9569eea0c219ed611", "score": "0.55947375", "text": "function toNativeElement (entityId, path, vnode) {\n var attributes = vnode.attributes\n var children = vnode.children\n var tagName = vnode.tagName\n var el\n\n // create element either from pool or fresh.\n if (!options.pooling || !canPool(tagName)) {\n if (svg.isElement(tagName)) {\n el = document.createElementNS(svg.namespace, tagName)\n } else {\n el = document.createElement(tagName)\n }\n } else {\n var pool = getPool(tagName)\n el = cleanup(pool.pop())\n if (el.parentNode) el.parentNode.removeChild(el)\n }\n\n // set attributes.\n forEach(attributes, function (value, name) {\n setAttribute(entityId, path, el, name, value)\n })\n\n // store keys on the native element for fast event handling.\n el.__entity__ = entityId\n el.__path__ = path\n\n // add children.\n forEach(children, function (child, i) {\n var childEl = toNative(entityId, path + '.' + i, child)\n if (!childEl.parentNode) el.appendChild(childEl)\n })\n\n return el\n }", "title": "" }, { "docid": "b27393a0fea8a6b110415ed73100bd93", "score": "0.55849594", "text": "function createNode(transform, render, sibling, child)\r\n{\r\n\tvar node = {\r\n\t\ttransform: transform,\r\n\t\trender: render,\r\n\t\tsibling: sibling,\r\n\t\tchild: child\r\n\t}\r\n\treturn node;\r\n}", "title": "" }, { "docid": "2ccc8941be2cd6e53058ed260f84ffee", "score": "0.55738235", "text": "function createNode(el, attr) {\n\t// html comment is not currently supported by virtual-dom\n\tif (el.nodeType === 3) {\n\t\treturn createVirtualTextNode(el);\n\n\t// cdata or doctype is not currently supported by virtual-dom\n\t} else if (el.nodeType === 1 || el.nodeType === 9) {\n\t\treturn createVirtualDomNode(el, attr);\n\t}\n\n\t// default to empty text node\n\treturn new VText('');\n}", "title": "" }, { "docid": "2cfd50ac58792a1bfed3c9fe51e41d27", "score": "0.55632216", "text": "initialize(node, props) {\n const svg = this.svg = d3.select(node).append('svg');\n svg.attr('viewBox', `0 0 ${size} ${size}`)\n .style('width', '100%')\n .style('height', 'auto');\n\n this.circle = svg.append('circle')\n .attr('r', props.r)\n .attr('cx', size / 2)\n .attr('cy', size / 2);\n }", "title": "" }, { "docid": "e834acddf2ed036e138519cfb772854d", "score": "0.55175", "text": "function buildNode(tagName, attributes, children) {\n var node = document.createElement(tagName);\n\n /* Apply attributes */\n if (attributes) {\n for (var attribute in attributes) {\n if (attributes.hasOwnProperty(attribute)) {\n node[attribute] = attributes[attribute];\n }\n }\n }\n\n /* Append children */\n if (children) {\n if (typeof children === 'string') {\n node.appendChild(document.createTextNode(children));\n } else if (children.tagName) {\n node.appendChild(children);\n } else if (children.length) {\n for (var i = 0, length = children.length; i < length; ++i) {\n var child = children[i];\n\n if (typeof child === 'string') {\n child = document.createTextNode(child);\n }\n\n node.appendChild(child);\n }\n }\n }\n\n return node;\n }", "title": "" }, { "docid": "7272f330e2db26198b86d3321984db47", "score": "0.5517284", "text": "function createNode(name) {\n return {\n name: name,\n children: [],\n getParent: null,\n pos: {\n sl: 0,\n sc: 0,\n el: 0,\n ec: 0\n }\n };\n }", "title": "" }, { "docid": "23b32e73bc904a57d8761ae2b21a1603", "score": "0.5517033", "text": "constructor(refX, refY, width, height) {\n let element = document.createElementNS('http://www.w3.org/2000/svg', 'marker');\n element.setAttributeNS(null, 'refX', refX.toString());\n element.setAttributeNS(null, 'refY', refY.toString());\n element.setAttributeNS(null, 'markerWidth', width.toString());\n element.setAttributeNS(null, 'markerHeight', height.toString());\n super(element);\n }", "title": "" }, { "docid": "4a6f58d58015bc30b1e216d1337bb19f", "score": "0.5515437", "text": "function generate_node_from_faux(f)\n{\n\tif (typeof f == 'string')\n\t\treturn document.createTextNode(f);\n\t\t\n\tif (!f || typeof f != 'object')\n\t\treturn document.createTextNode('');\n\tif (f.tag=='SCRIPT' || f.tag=='STYLE' || f.tag=='IFRAME')\n\t\treturn document.createTextNode('');\n\t\t\n\t// any element I guess ought to have the same namespace it's being inserted into. \n\tvar isSVG_NS = (f.tag=='SVG'||f.tag=='PATH'||f.tag=='POLYGON');\n\tvar node = isSVG_NS ? document.createElementNS('http://www.w3.org/2000/svg',f.tag.toLowerCase()) : document.createElement(f.tag || 'SPAN');\n\t/*if (f.id)\n\t\tnode.id = f.id;*/\n\tvar c = f.class;\n\tif (c)\n\t{\n\t\tif (!isSVG_NS)\n\t\t\ttry { node.className = f.class; } catch (e) {}\n\t\telse\n\t\t\tnode.setAttributeNS(null, 'class', f.class);\n\t}\n\t\n\t(hh_virtual_whitelist[f.tag] || []).forEach((p) => {\n\t\t//console.log(f.tag,p,f)\n\t\tif (p in f)\n\t\t\t(isSVG_NS) ? node.setAttributeNS(null, p, f[p]) : node.setAttribute(p, f[p]);\n\t});\n\t\n\tif (f.tag == 'INPUT')\n\t{\n\t\tif (node.type == 'password')\n\t\t\tnode.type = 'text';\n\t\t//if (f.hasOwnProperty('type'))\n\t\t//\tnode.setAttribute('type', f['type']);\n\t\tif (f.hasOwnProperty('checked'))\n\t\t\tnode.checked = f['checked'];\n\t\tif (f.hasOwnProperty('value'))\n\t\t\tnode.value = f['value'];\n\t\t//console.log(f);\n\t}\n\tif (f.tag == 'IMG')\n\t{\n\t\t/*if ('src' in f)\n\t\t\tnode.src = f['src'];*/\n\t\tnode.setAttribute('draggable', false);\n\t}\n\tif (f.tag == 'A')\n\t{\n\t\tnode.classList.add('gutter');\n\t\t/*if (f.hasOwnProperty('href'))\n\t\t\tnode.href = f['href'];*/\n\t}\n\t\n\tif (f.tag == 'LABEL' && f['data-image'])\n\t{\n\t\t//node.setAttribute('data-image', f.dataImage);\n\t\tvar img = generate_node_from_faux({ tag: 'IMG', class: '', src: f['data-image'] });\n\t\tif (f['width'] && f['height'])\n\t\t{\n\t\t\timg.width = parseInt(f['width']);\n\t\t\timg.height = parseInt(f['height']);\n\t\t\t//console.log(f['width'],f['height'],img);\n\t\t}\n\t\t// since it may have already loaded, i dunno why the text jumps though\n\t\timg.onload = (()=>{ var i=img, l=node; return ()=>{ \n\t\t\ti.removeAttribute('width'); \n\t\t\ti.removeAttribute('height'); \n\t\t\tgutter_float_shape_outside(l);\n\t\t\t} })();\n\t\tgutter_float_shape_outside(node);\n\t\tnode.appendChild(img);\n\t}\n\telse if (f.tag == 'LABEL' && f['data-youtube'])\n\t{\n\t\t//node.setAttribute('data-youtube', f.dataYoutube);\n\t\tvar iframe = document.createElement('iframe');\n\t\tiframe.width=560;\n\t\tiframe.height=315;\n\t\tiframe.frameBorder=0;\n\t\tiframe.allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\";\n\t\tiframe.allowFullScreen=\"true\";\n\t\tiframe.src=\"https://www.youtube.com/embed/\" + f.dataYoutube;\n\t\tnode.appendChild(iframe);\n\t}\n\telse if (f._) \n\t{\n\t\tfor (var i = 0; i < f._.length; i++)\n\t\t\tnode.appendChild(generate_node_from_faux(f._[i]));\n\t}\n\t\n\tif (f.tag == 'SVG')\n\t{\n\t\tgutter_float_shape_outside(node);\n\t}\n\n\tif (f['data-hh-location'])\t// for floaters\n\t\t{\n\t\t\tvar left = parseInt(f['data-hh-location'].split(',')[0]), right = parseInt(f['data-hh-location'].split(',')[1]);\n\t\t\tif (left) node.style.marginLeft = left+'px';\n\t\t\tif (right) node.style.marginRight = right+'px';\n\t\t}\t\n\tif (f['data-hh-size'])\n\t\t{\n\t\t\tvar width = parseInt(String(f['data-hh-size']).split(',')[0]), height = parseInt(String(f['data-hh-size']).split(',')[1]);\n\t\t\tif (width) node.style.width = width+'px';\n\t\t\tif (height) node.style.height = height+'px';\n\t\t\t//console.log(f['data-hh-size'],f['data-hh-size'].split(','),width,height);\n\t\t}\t\n\n\treturn node;\n}", "title": "" }, { "docid": "332baba841a911d4e229b973cf35f1b9", "score": "0.55001026", "text": "function createNode(name) {\n return document.createElement(name)\n }", "title": "" }, { "docid": "c677f33b24dee28187a3687bb66137c5", "score": "0.54852813", "text": "create_nodes() {\n return this.data.forEach((d, i) => {\n const node = {\n id: i,\n original: d,\n radius: this.default_radius,\n value: 99,\n x: Math.random() * this.width,\n y: Math.random() * this.height\n };\n return this.nodes.push(node);\n });\n }", "title": "" }, { "docid": "c8a62d008c0cb20325a1c980ff15d0ac", "score": "0.5479591", "text": "function createPointInfo(x, y, whereX, whereY) \r\n{\r\n // make sure you don't display more coordinates at the same time\r\n if (currentNodeInfo) removePointInfo();\r\n // create text node\r\n currentNodeInfo = documentSVG.createElementNS(svgNS, \"text\");\r\n currentNodeInfo.appendChild(documentSVG.createTextNode(\"(\"+x+\",\"+y+\")\"));\r\n // set coordinates\r\n currentNodeInfo.setAttribute(\"x\", whereX.toFixed(1));\r\n currentNodeInfo.setAttribute(\"y\", whereY - 10);\r\n // add the node to the group\r\n chartGroup.appendChild(currentNodeInfo);\r\n}", "title": "" }, { "docid": "832f318a4bc39cb176773eafb93980a8", "score": "0.54764336", "text": "function createVirtualDomNode(el, attr) {\n\tvar ns = el.namespaceURI !== HTML_NAMESPACE ? el.namespaceURI : null;\n\tvar key = attr && el.getAttribute(attr) ? el.getAttribute(attr) : null;\n\n\treturn new VNode(\n\t\tel.tagName\n\t\t, createProperties(el)\n\t\t, createChildren(el, attr)\n\t\t, key\n\t\t, ns\n\t);\n}", "title": "" }, { "docid": "d801006ae371a16c83ffe2bce4c5b664", "score": "0.5453125", "text": "function positionNode(d) {\n // keep the node within the boundaries of the svg\n if (d.x < 0) {\n d.x = 0\n };\n if (d.y < 0) {\n d.y = 0\n };\n if (d.x > width) {\n d.x = width\n };\n if (d.y > height) {\n d.y = height\n };\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n }", "title": "" }, { "docid": "76da376ef681711f7d7616326ee3d3dc", "score": "0.54467434", "text": "function NWTNode() {\n\t\n}", "title": "" }, { "docid": "8049d591b1224934129b2e49e7f167cf", "score": "0.54330456", "text": "function v(x,y,z){\n return new THREE.Vertex(new THREE.Vector3(x,y,z));\n }", "title": "" }, { "docid": "757bcb7375875f90b4f606fb84b92f75", "score": "0.54203695", "text": "function createVirtualTextNode(el) {\n\treturn new VText(el.nodeValue);\n}", "title": "" }, { "docid": "4afe7a3e515d21f500681ca80e465af7", "score": "0.5420294", "text": "function createNode(nodeNumber){\n var temp = {};\n var t = {};\n t['id'] = nodeNumber;\n temp['data'] = t;\n return temp;\n}", "title": "" }, { "docid": "40611a3e769b07e4fe732072f244615e", "score": "0.541789", "text": "function newSVG(name) {\n\treturn (document.createElementNS(\"http://www.w3.org/2000/svg\", name));\n}", "title": "" }, { "docid": "601d7a5accbe4fd8100564b1c3ca4453", "score": "0.54124284", "text": "function asrNode (id, x, y) {\n\t// TODO\n}", "title": "" }, { "docid": "40a6532540c9544c8e41494b17bc17c8", "score": "0.53955173", "text": "function setnodevals()\n\t{\t\t\t\n\t\tnode.attr(\"dx\", nodedx)\n\t\t\t.attr(\"dy\", \".31em\")\n\t\t\t.attr(\"transform\", nodetrans)\n\t\t\t.style(\"text-anchor\", nodeanchor);\t\t\t\n\t}", "title": "" }, { "docid": "3a6e054683fbf4494f69ca91e8a0bd6b", "score": "0.5389034", "text": "function vertexKeyGenerator( v ){\n\t\t//this will hold the ids consistently between vertex and vec3ds\n\t\treturn \"[ x: \"+format(v.x)+ \", y: \"+format(v.y)+ \", z: \"+format(v.z)+\"]\";\n\t}", "title": "" }, { "docid": "af2d8f442f1f371da8fd736cee7f1709", "score": "0.53767353", "text": "function generateSVGObject(parent, type) {\n let namespace = parent.namespaceURI;\n let node = namespace ? document.createElementNS(namespace, type)\n : document.createElement(type);\n parent.appendChild(node);\n return node;\n}", "title": "" }, { "docid": "9bab900ea1fa33bb72555432420a82bf", "score": "0.5364913", "text": "function node(){}", "title": "" }, { "docid": "49b83cabbcd31e24d37c498e475bd28e", "score": "0.5362837", "text": "function makeSVG(tag, attrs) {\n\t\tvar el = document.createElementNS('http://www.w3.org/2000/svg', tag);\n\t\tfor (var k in attrs)\n\t\t\tel.setAttribute(k, attrs[k]);\n\t\treturn el;\n\t}", "title": "" }, { "docid": "ac25023fa336921e183072bcd1a12979", "score": "0.53607386", "text": "function makeNode(name, propertyList, contents)\n\t{\n\t\tvar props = listToProperties(propertyList);\n\n\t\tvar key, namespace;\n\t\t// support keys\n\t\tif (props.key !== undefined)\n\t\t{\n\t\t\tkey = props.key;\n\t\t\tprops.key = undefined;\n\t\t}\n\n\t\t// support namespace\n\t\tif (props.namespace !== undefined)\n\t\t{\n\t\t\tnamespace = props.namespace;\n\t\t\tprops.namespace = undefined;\n\t\t}\n\n\t\t// ensure that setting text of an input does not move the cursor\n\t\tvar useSoftSet =\n\t\t\t(name === 'input' || name === 'textarea')\n\t\t\t&& props.value !== undefined\n\t\t\t&& !isHook(props.value);\n\n\t\tif (useSoftSet)\n\t\t{\n\t\t\tprops.value = SoftSetHook(props.value);\n\t\t}\n\n\t\treturn new VNode(name, props, List.toArray(contents), key, namespace);\n\t}", "title": "" }, { "docid": "0cef05ee3a95ebe907f5157c149e0716", "score": "0.5360447", "text": "function n(e,t,a,l){return{x:e,y:t,width:a,height:l}}", "title": "" }, { "docid": "ad43a3fcd9d26accdc925272d0954ddc", "score": "0.53592247", "text": "function make_node(node, type) {\n // TODO: guess type from attributes, uh oh\n let level;\n if (type === \"section\" && \"level\" in node) {\n level = node.level;\n }\n return {\n name: node.title,\n children: [],\n // attributes unrelated for d3 vis\n meta: {\n id: node.id,\n type: type,\n level: level\n }\n };\n}", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.53486866", "text": "function TViewNode() {}", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.53486866", "text": "function TViewNode() {}", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.53486866", "text": "function TViewNode() {}", "title": "" }, { "docid": "e881fa0a14fa9edddd8dbaeeff45b8c2", "score": "0.5345182", "text": "function NodeDef(){}", "title": "" }, { "docid": "8025140aa84bba92712c6d3b467d5104", "score": "0.5336542", "text": "function v(x,y,z){ \n\t return new THREE.Vertex(new THREE.Vector3(x,y,z)); \n\t }", "title": "" }, { "docid": "1f13f4088197c260fe3d370252f5680d", "score": "0.5335936", "text": "function NodeUniform( params ) {\n\n\tparams = params || {};\n\n\tthis.name = params.name;\n\tthis.type = params.type;\n\tthis.node = params.node;\n\tthis.needsUpdate = params.needsUpdate;\n\n}", "title": "" }, { "docid": "a70966b67bf15f4169fce5ff42a2280c", "score": "0.5324093", "text": "function svg_elem(name, attrs) {\n var attr,\n elem = document.createElementNS(\"http://www.w3.org/2000/svg\", name);\n if (typeof attrs === \"object\") {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n elem.setAttribute(attr, attrs[attr]);\n }\n }\n }\n return elem;\n }", "title": "" }, { "docid": "8f91d14862fc252698a139cb9277a732", "score": "0.53193724", "text": "function printNode (value) {\n console.log('Visisted vertex: ' + value)\n}", "title": "" }, { "docid": "2ba2008617a1cc19b59d59b6cfa5e517", "score": "0.53161305", "text": "function vml (tag, attr) {\n\t return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n\t }", "title": "" }, { "docid": "2ba2008617a1cc19b59d59b6cfa5e517", "score": "0.53161305", "text": "function vml (tag, attr) {\n\t return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n\t }", "title": "" }, { "docid": "b9584be0e69a50c8d780cd5860fcbc2c", "score": "0.5310889", "text": "createSvgTri() {\n\t\tthis.tri = document.createElementNS(svgns, 'polygon');\n\t\tthis.tri.setAttribute('points', `${this.p1.x} ${this.p1.y} ${this.p2.x} ${this.p2.y} ${this.p3.x} ${this.p3.y}`);\n\t\tthis.tri.setAttribute('fill', `${this.color}`);\n\n // inject triangle element into svg element\n\t\tconsole.log('injecting triangle');\n element.appendChild(this.tri);\n\t}", "title": "" }, { "docid": "9c261c53f92babb6ae954a68321715c6", "score": "0.53086334", "text": "function makeNode(name, children, title, extra) {\n var item = {'name': name, '$show': false, '$wasRendered': false};\n\n if (children && children.length) {\n item['children'] = children;\n }\n if (title) {\n item['title'] = title;\n }\n\n if (loDash.isFunction(extra)) {\n\n return loDash.assign(item, extra(item));\n } else {\n\n return loDash.assign(extra || {}, item);\n }\n }", "title": "" }, { "docid": "1f9b73258271e2f96bd8d7e17a685a5d", "score": "0.53080034", "text": "function makeSvg(tag, attrs) {\n\tvar el= document.createElementNS('http://www.w3.org/2000/svg', tag);\n\tfor (var k in attrs) {\n\t\tel.setAttribute(k, attrs[k]);\n\t}\n\treturn el;\n}", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.5303783", "text": "function TNode() {}", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.5303783", "text": "function TNode() {}", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.5303783", "text": "function TNode() {}", "title": "" }, { "docid": "1a6e92edba31d255194a7088e62db329", "score": "0.5298396", "text": "function createNodes(rawData) {\n var myNodes = rawData.map(function (d) {\n var node = {\n title: idValue(d),\n impactValue: +d[year.start],\n radius: radiusScale(+d[year.start] > 0 ? +d[year.start] : 0),\n colorValue: colorValue(d, year.start),\n year: year.start,\n x: Math.random() * 900,\n y: Math.random() * 800,\n field: fosIndex(d),\n pub: pubIndex(d),\n };\n\n for(var key in d) {\n // Skip loop if the property is from prototype\n if (!d.hasOwnProperty(key)) continue;\n node[key] = d[key];\n }\n\n return node;\n\n });\n\n return myNodes;\n }", "title": "" }, { "docid": "13b9c851d4ae10892c99cb73e8013b4e", "score": "0.5289991", "text": "function makeSvg(tag, attrs) {\n var el = document.createElementNS('http://www.w3.org/2000/svg', tag);\n for(var k in attrs) {\n el.setAttribute(k, attrs[k]);\n }\n return el;\n}", "title": "" }, { "docid": "ab5c29a893fb2da6c0c70b9148b96568", "score": "0.5287671", "text": "function renderNode(vNode) {\n const { nodeName, props, children } = vNode\n\n // class\n if (typeof (nodeName) === 'function' && /^class/.test(nodeName.toString())) {\n\n // component instance\n const component = new nodeName(props)\n Object.assign(component, { updater })\n\n const element = renderNode(component.render())\n component.base = element\n\n return element\n }\n\n // functional component\n if (typeof (type) === 'function') {\n return renderNode(nodeName(props))\n }\n\n // string\n if (typeof (nodeName) === 'string') {\n const element = document.createElement(nodeName)\n\n handleProps(props, element)\n handleChildren(children, element)\n\n return element\n }\n}", "title": "" }, { "docid": "1727f06967ba65bea2cf1f4f38dd8862", "score": "0.52855587", "text": "function VennDiagram (cx, cy, r, n) {\n this.cx = cx;\n this.cy = cy;\n this.theta = (2 *Math.PI)/n;\n this.circles = [];\n for (var i=0; i<n; i++) {\n var ccx = Math.cos(this.theta * i + (3*Math.PI/2)) * r * .8 + cx;\n var ccy = Math.sin(this.theta * i + (3*Math.PI/2)) * r * .8 + cy;\n this.circles.push(new Circle(ccx, ccy, r));\n }\n}", "title": "" }, { "docid": "5c9497e7d0d5e1041a739a9fbeae1b0d", "score": "0.52853453", "text": "function createSVG(width, height) {\n var svg = document.createElementNS(svgNS,'svg');\n svg.setAttributeNS(null, 'width', width+'px');\n svg.setAttributeNS(null, 'height', height+'px');\n //svg.setAttributeNS(null, \"xlink\", \"http://www.w3.org/1999/xlink\");\n\n return svg;\n}", "title": "" }, { "docid": "5c9497e7d0d5e1041a739a9fbeae1b0d", "score": "0.52853453", "text": "function createSVG(width, height) {\n var svg = document.createElementNS(svgNS,'svg');\n svg.setAttributeNS(null, 'width', width+'px');\n svg.setAttributeNS(null, 'height', height+'px');\n //svg.setAttributeNS(null, \"xlink\", \"http://www.w3.org/1999/xlink\");\n\n return svg;\n}", "title": "" }, { "docid": "13369d655562aa032dcb5b717c3b943a", "score": "0.52814263", "text": "createSvgText(x, y, color, fontSize, text) {\n const t = document.createElementNS(this.svgNS, \"text\");\n t.setAttributeNS(null, \"x\", x);\n t.setAttributeNS(null, \"y\", y);\n t.setAttributeNS(null, \"fill\", color);\n t.setAttributeNS(null, \"font-size\", fontSize);\n t.textContent = text;\n return t;\n }", "title": "" }, { "docid": "5df6ec855eacfcc36c066618eba65ff5", "score": "0.5281058", "text": "function vml(tag, attr) {\n\t return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr);\n\t }", "title": "" }, { "docid": "bf0f1e023d135730e770242630aa2993", "score": "0.52808523", "text": "function createFigure(node) {\n const element = document.createElement('div');\n element.id = 'circle';\n \n const number = document.createElement('p');\n number.id = 'number';\n number.innerHTML = node.value;\n\n element.appendChild(number);\n return element;\n}", "title": "" }, { "docid": "0a65e2e47e6bb85d757a7d4974b27619", "score": "0.527872", "text": "function generate (p) {\n // Type\n if (typeof p === 'string' && node.type === null) {\n node.type = p.replace(/^./, ch => ch.toUpperCase())\n return\n }\n\n // Type\n if (typeof p === 'function') {\n node.type = p\n return\n }\n\n // Children\n if (isArray(p)) {\n node.children = p\n return\n }\n\n // Attr\n if (typeof p === 'object') {\n node.attr = p\n return\n }\n\n // Content\n if (typeof p === 'string') {\n node.attr.content = p\n return\n }\n }", "title": "" }, { "docid": "c691760bc94601d8f222b7bc4072111a", "score": "0.5271751", "text": "function createX(){\n line(0, 0, -vScale/2, -vScale/2);\n line(0, 0, vScale/2, -vScale/2);\n line(0, 0, vScale/2, vScale/2);\n line(0, 0, -vScale/2, vScale/2);\n}", "title": "" }, { "docid": "09cdeaf88c292c88199d613f37ecb5a4", "score": "0.52680963", "text": "function TViewNode(){}", "title": "" }, { "docid": "fc3c98e024f9e7de006b7708ca5baad7", "score": "0.5267887", "text": "function NodeDef() {}", "title": "" }, { "docid": "fc3c98e024f9e7de006b7708ca5baad7", "score": "0.5267887", "text": "function NodeDef() {}", "title": "" }, { "docid": "fc3c98e024f9e7de006b7708ca5baad7", "score": "0.5267887", "text": "function NodeDef() {}", "title": "" }, { "docid": "7be62f86b4db1631903124eee19c409b", "score": "0.5264058", "text": "function utils_createSVGTextElement(content, x, y, attributes = {}) {\n\n const text = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n text.appendChild(document.createTextNode(content))\n\n text.setAttribute('x', x);\n text.setAttribute('y', y);\n \n Object.keys(attributes).forEach(key => {\n text.setAttribute(key, attributes[key]);\n });\n\n return text;\n}", "title": "" }, { "docid": "8144194b92476a6094f5f255852977d5", "score": "0.5254008", "text": "function vml (tag, attr) {\n return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n }", "title": "" }, { "docid": "8144194b92476a6094f5f255852977d5", "score": "0.5254008", "text": "function vml (tag, attr) {\n return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n }", "title": "" }, { "docid": "8144194b92476a6094f5f255852977d5", "score": "0.5254008", "text": "function vml (tag, attr) {\n return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n }", "title": "" }, { "docid": "8144194b92476a6094f5f255852977d5", "score": "0.5254008", "text": "function vml (tag, attr) {\n return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n }", "title": "" }, { "docid": "8144194b92476a6094f5f255852977d5", "score": "0.5254008", "text": "function vml (tag, attr) {\n return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n }", "title": "" }, { "docid": "8144194b92476a6094f5f255852977d5", "score": "0.5254008", "text": "function vml (tag, attr) {\n return createEl('<' + tag + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"spin-vml\">', attr)\n }", "title": "" } ]
4d6ba91a2607d8edf451ee9d410c136d
Increment the number of acks needed from watch before we can consider the server to be 'insync' with the client's active targets.
[ { "docid": "a7a0e6c64533ad9c73eb8d4bbc697a4b", "score": "0.0", "text": "qs(t) {\n this.Zs(t).qs();\n }", "title": "" } ]
[ { "docid": "05c1041985e7e28d0abcd44f6f698373", "score": "0.6282005", "text": "function updateClientCount(){\n const totalClientsMessage = {\n type: \"userCountChanged\",\n userCount: wss.clients.size\n }\n broadcast(totalClientsMessage)\n}", "title": "" }, { "docid": "45b5bf6f9846da57e5fd49c5bbdb63e0", "score": "0.59961647", "text": "function countIncremented() {\n setCount(count + 1);\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.59612614", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.59612614", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.59612614", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.59612614", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "cfa867d7139c953236b0ed9172967f61", "score": "0.59612614", "text": "increasePendingRequestCount() {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }", "title": "" }, { "docid": "6d682c7a9c5ac2bfcee2b3ae9745d7f2", "score": "0.5796775", "text": "function refCountCallback() {\n\t if (disposed) {\n\t return;\n\t }\n\n\t --count;\n\n\t // If the count becomes 0, then its time to notify the\n\t // listener that the request is done.\n\t if (count === 0) {\n\t cb();\n\t }\n\t }", "title": "" }, { "docid": "f8acef9a525906541af3696e4dd3da4e", "score": "0.57065415", "text": "incRefCount() {\n this._refCount++;\n }", "title": "" }, { "docid": "c1952177569cc8124494946568733743", "score": "0.5705668", "text": "function incrementCounter() {\n counter++;\n showMsg(\"counter\", counter);\n }", "title": "" }, { "docid": "5d8dbb0bdb43d5d96b74e406eb5d25e5", "score": "0.5691737", "text": "checkPendingRequests() {\n while (this.pending.length > 0 && this.canSendSocketRequestImmediately()) {\n const pendingRequest = this.pending.shift() // first in first out\n this.sendSocketRequest(pendingRequest)\n\n this.logger.debug(`Consumed pending request`, {\n clientId: this.clientId,\n broker: this.broker,\n correlationId: pendingRequest.correlationId,\n pendingDuration: pendingRequest.pendingDuration,\n currentPendingQueueSize: this.pending.length,\n })\n\n this[PRIVATE.EMIT_QUEUE_SIZE_EVENT]()\n }\n\n this.scheduleCheckPendingRequests()\n }", "title": "" }, { "docid": "498300494ded56bc221e376dffdce269", "score": "0.56433594", "text": "regConsume() {\r\n this.consCount++;\r\n }", "title": "" }, { "docid": "44f06743f997c77f6c9dda5ac7bf4d8a", "score": "0.5615542", "text": "function increaseCount() {\n return ++count;\n }", "title": "" }, { "docid": "b50f9ed14fab47699b6989747e8051ba", "score": "0.5587348", "text": "numOfConnectedClients(elapsed, count) {\n log.info(`number of connected clients ${count}`);\n }", "title": "" }, { "docid": "2f686b5f79a67e117ae1666bfe024d75", "score": "0.55593294", "text": "function count_acks() {\n var master_queue = new Array();\n\n // add unique mssgs to the queue\n for (var i = 0; i < pnum; i++) {\n for (var j = 0; j < processes[i].queue.length; j ++) {\n var index = isIn(processes[i].queue[j], master_queue);\n\n // if its in the queue, increment the count\n if (index != -1) {\n master_queue[index][1]++;\n // else add it to the master queue\n } else {\n master_queue.push([processes[i].queue[j], 1]);\n }\n }\n }\n\n // increment the acks for the msgs in the process queues\n // if they are equal to pnum\n for (var m = 0; m < master_queue.length; m++) {\n if (master_queue[m][1] == pnum) {\n for (var i = 0; i < pnum; i++) {\n for (var j = 0; j < processes[i].queue.length; j++) {\n if (is_equal(processes[i].queue[j], master_queue[m][0])) {\n processes[i].queue[j].acks = pnum;\n }\n }\n }\n }\n \n }\n}", "title": "" }, { "docid": "b281c00d4880afb5ccfac921dfe12611", "score": "0.5540081", "text": "addListened(){\r\n this.listened ++;\r\n }", "title": "" }, { "docid": "9c9ffa1f80981439efb311578afa3b6b", "score": "0.5533114", "text": "incrementTransactionNumber() {\n this.serverSession.txnNumber++;\n }", "title": "" }, { "docid": "9c9ffa1f80981439efb311578afa3b6b", "score": "0.5533114", "text": "incrementTransactionNumber() {\n this.serverSession.txnNumber++;\n }", "title": "" }, { "docid": "9c9ffa1f80981439efb311578afa3b6b", "score": "0.5533114", "text": "incrementTransactionNumber() {\n this.serverSession.txnNumber++;\n }", "title": "" }, { "docid": "9c9ffa1f80981439efb311578afa3b6b", "score": "0.5533114", "text": "incrementTransactionNumber() {\n this.serverSession.txnNumber++;\n }", "title": "" }, { "docid": "9c9ffa1f80981439efb311578afa3b6b", "score": "0.5533114", "text": "incrementTransactionNumber() {\n this.serverSession.txnNumber++;\n }", "title": "" }, { "docid": "9c9ffa1f80981439efb311578afa3b6b", "score": "0.5533114", "text": "incrementTransactionNumber() {\n this.serverSession.txnNumber++;\n }", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.5530582", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.5530582", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.5530582", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.5530582", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.5530582", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.5530582", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "d5cf96ab2f6235ee29e85e40e10d393f", "score": "0.5530582", "text": "function incrementExpectedAwaits() {\n if (!task.id)\n task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n}", "title": "" }, { "docid": "03cfffe481e4f4559abdf6db10c1df08", "score": "0.5516642", "text": "function incrementExpectedAwaits() {\n if (!task.id) task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n }", "title": "" }, { "docid": "00439d7a453f63f5a95dbf3602da0018", "score": "0.550127", "text": "function increment() {\n // setCount((prevCount) => prevCount + 1);\n dispatch({ type: \"increment\" });\n }", "title": "" }, { "docid": "4c787abd6a693f9928d7fd0e772e499b", "score": "0.5495833", "text": "function incrementExpectedAwaits() {\n if (!task.id) task.id = ++taskCounter;\n ++task.awaits;\n task.echoes += ZONE_ECHO_LIMIT;\n return task.id;\n }", "title": "" }, { "docid": "c811ca33634e2c443f7bff9f8e40ab4d", "score": "0.54855996", "text": "function increase() {\n setCount(count + 1); //passing count + 1 as argument in setCount function\n }", "title": "" }, { "docid": "db652fc3f213300c5d7b18169ed079e9", "score": "0.5485371", "text": "increment(state){\n state.count++\n }", "title": "" }, { "docid": "d41e00b5fabb6d0d98190d1d3410c8cd", "score": "0.54455554", "text": "increase(state, payload) {\n console.log(state);\n state.counter = state.counter + payload.value;\n }", "title": "" }, { "docid": "a119076b54aabbd118355ff9bdf1c173", "score": "0.5435008", "text": "function addCount() {\n // TODO: set the count to whatever it was before + 1\n\n }", "title": "" }, { "docid": "d62055e192da161dd2f4cd0c80ffd708", "score": "0.54281986", "text": "function increment() {\n counter += 1;\n log(\"incremented\");\n }", "title": "" }, { "docid": "d94aff7bf252da4cdc5fd9b012ae67e4", "score": "0.54163957", "text": "_increment() {\n this.sourcesLoaded++;\n if(this.sourcesLoaded >= this.sourcesToLoad && !this.complete) {\n this.complete = true;\n this.renderer.nextRender.add(() => this.onComplete && this.onComplete());\n }\n }", "title": "" }, { "docid": "be9dcee13e24db8c382efea07230cc63", "score": "0.5408703", "text": "IncrementStayCount(currentCount) {\n console.log('Invoked increment Stay count', currentCount );\n const increasedCount = currentCount + 1;\n // console.log(increasedCount);\n // axios.post('/list', {\n // listName: 'Dream Vacations',\n // })\n // .then((response) => {\n // console.log(response);\n // })\n // .catch((error) => {\n // console.log(error);\n // });\n }", "title": "" }, { "docid": "e002986e42c56d415321f12ec06277e4", "score": "0.53842026", "text": "function increment (){\n setCount(count+1)\n }", "title": "" }, { "docid": "9d0cbae1f66fd4860806719d50dd7849", "score": "0.5382994", "text": "function increment() {\n this.value++;\n if (this.value === 10) {\n expect(this.value).equal(10);\n done();\n }\n }", "title": "" }, { "docid": "f368830882dd4d383e5c818ec4b3ac44", "score": "0.5344185", "text": "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "title": "" }, { "docid": "f368830882dd4d383e5c818ec4b3ac44", "score": "0.5344185", "text": "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "title": "" }, { "docid": "f368830882dd4d383e5c818ec4b3ac44", "score": "0.5344185", "text": "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "title": "" }, { "docid": "f368830882dd4d383e5c818ec4b3ac44", "score": "0.5344185", "text": "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "title": "" }, { "docid": "f368830882dd4d383e5c818ec4b3ac44", "score": "0.5344185", "text": "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "title": "" }, { "docid": "4c5d2ec4d0fd6c00f0d1505fa7bfdb1a", "score": "0.53204536", "text": "increment () {\n this.forEach( (epv, peerId) => {\n epv.increment();\n });\n }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.53008544", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.53008544", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.53008544", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "dbcc11d90747da1d78303c83ece98f62", "score": "0.53008544", "text": "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "5b3e9eda72c5a92c1b81fedcf83d5338", "score": "0.527884", "text": "function incrementCounter() {\n counter++;\n console.log('counter', counter);\n }", "title": "" }, { "docid": "65020d4add715ce8e3a4a31d8d8f5588", "score": "0.52700734", "text": "handleAck() {\n if (this.state.ack === 0) {\n this.setState({\n ack: 1,\n });\n } else {\n this.setState({\n ack: 0,\n });\n }\n }", "title": "" }, { "docid": "a447d12c9b8b823ecb7967080122d88e", "score": "0.52680844", "text": "async increment(e){\n if (!this.entry._id)\n return\n\n var step = parseInt(e.currentTarget.dataset.step, 10)\n if (isNaN(step)){\n this.dispatchEvent(new CustomEvent('error', {detail: 'Echec: increment invalide'}))\n return\n }\n\n try{\n let res = await this.send(`/api/entry/${this.entry._id}/increment`, {step: step}, 'POST')\n this.set('entry.count', res.count)\n }\n catch(err){\n console.error(err)\n this.dispatchEvent(new CustomEvent('error', {detail: 'Echec modification', bubbles: true, composed: true}))\n }\n }", "title": "" }, { "docid": "d50307c7217825e83f303585700096d7", "score": "0.5240067", "text": "incrementMatchedEventIndex() {\n this.simulatedEventsIdx++;\n }", "title": "" }, { "docid": "8b7ae85fdec55bbaa24875bfa793b608", "score": "0.5239083", "text": "function accountForConnection() {\n /* Open more connections */\n if (++openedClientConnections < /*100*/ 1000) {\n establishNewConnection();\n } else {\n /* Stop listening */\n uWS.us_listen_socket_close(listenSocket);\n }\n}", "title": "" }, { "docid": "f90b63ea2e0585593ab278fd36bdbf4a", "score": "0.5235838", "text": "incrementSignalCounter(){\n this.signalCounter ++;\n }", "title": "" }, { "docid": "832ce378195df300a97fb64563f5d03b", "score": "0.52330005", "text": "increaseWinCount () {\n\t\tthis.winCount++;\n\t}", "title": "" }, { "docid": "94661fcb872ae33b11a2577a42a865e8", "score": "0.5230439", "text": "function updateOriginConnections(client, change) {\n var origin = client.upgradeReq.headers['origin'];\n var connectionCount = originConnections.get(origin) || 0;\n originConnections.set(origin, parseInt(connectionCount) + change);\n}", "title": "" }, { "docid": "7c24aa5c4c7dbfe57dc9dadb7a94a68f", "score": "0.52246535", "text": "function incrementCounter() {\n counter++;\n console.log(\"counter\", counter);\n }", "title": "" }, { "docid": "9c2ace5821dd94bc4e0e45487e649b5b", "score": "0.5216542", "text": "function incrementCounter() {\n for (var i = innerLen-1; i >= innerLen-4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "9c2ace5821dd94bc4e0e45487e649b5b", "score": "0.5216542", "text": "function incrementCounter() {\n for (var i = innerLen-1; i >= innerLen-4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "5bc175182b4ec49fedaa58eeb0454856", "score": "0.5215918", "text": "increaseLossCount () {\n\t\tthis.lossCount++;\n\t}", "title": "" }, { "docid": "d705218ba662ec99cf489c39af45f08b", "score": "0.521074", "text": "function eventsUpdated(){\n countUnread().then(function(count){\n service.numUnreadEvents = count;\n });\n }", "title": "" }, { "docid": "be0ef9db1ba6cb8c65c6481e02c3c914", "score": "0.5206099", "text": "function incrementCounter() {\n for (var i = innerLen-1; i >= innerLen-4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "title": "" }, { "docid": "b316985a1b5b74843a7711e695bf3fa8", "score": "0.52016956", "text": "function updateCount(data,chk,socket) {\n \n if (data.msg === \"SHORT\") {\n socket.emit(\"updateCount\",[\"#cntS\",parseInt(data.shrt) + 1])\n }\n else if (data.msg === \"LONG\") {\n socket.emit(\"updateCount\",[\"#cntL\",parseInt(data.lng) + 1])\n }\n if (chk === true) {\n socket.emit(\"updateCount\",[\"#cntV\",parseInt(data.vis) + 1])\n }\n\n}", "title": "" }, { "docid": "821b7d53e43a701844f973515f380bbf", "score": "0.51836747", "text": "function increment() {\n // counter++;\n setCounter(counter + 1);\n }", "title": "" }, { "docid": "a0cf9ba46ecf36b260aee651a0f6c41f", "score": "0.517551", "text": "function triggerMore(){\n if(!allCompleted()){\n let max = config.maxConcurrentRequests > avaiableQueue ? avaiableQueue : config.maxConcurrentRequests;\n for(let i=active.size; i < max; i++){\n triggerNext();\n }\n }\n}", "title": "" }, { "docid": "84131d67980609fdaff918ef3ad87307", "score": "0.5160599", "text": "function increment() {\n counter++;\n }", "title": "" }, { "docid": "9acd2edfad52802adb40638dc8bc3b3c", "score": "0.5159865", "text": "function updateClients() {\n io.sockets.emit('update', users);\n console.log(\"TOTAL USER: \" + users.length);\n }", "title": "" }, { "docid": "0411ff5f62fe9b933a8adcc66f01030e", "score": "0.51490927", "text": "startRefreshCount (){\n setInterval( ()=>{\n this.serverList.forEach(this.updateCountStream.bind(this));\n },30000) \n }", "title": "" }, { "docid": "485995168fb92a4e9be5eb345ca1030d", "score": "0.5146219", "text": "function counter (env) {\n // ignore env.trigger\n return env.saved + 1;\n}", "title": "" }, { "docid": "796947fd890b851a102f765b9608f472", "score": "0.5136551", "text": "function increment() {\n caller = 1;\n iteration++;\n if (iteration == largestIteration) {\n largestIteration++;\n }\n processData(caller);\n controller();\n}", "title": "" }, { "docid": "9e428ac884f1e90b77c5d9ddf47d45d7", "score": "0.512602", "text": "function updateCounts(missionId) {\n self.notDoneCount(missionId);\n self.doneCount(missionId);\n }", "title": "" }, { "docid": "56b8e02afdb3157057a43b4fc4a12f75", "score": "0.5124127", "text": "function nu(t, e) {\n t.Mh.on(e.targetId), _u(t).uh(e)\n /**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */;\n}", "title": "" }, { "docid": "926c7cb34f95bb56e1d4d9b7e7e0bd1d", "score": "0.5123026", "text": "async incrementAsync(payload, rootState) {\n await new Promise(resolve => setTimeout(resolve, 1000))\n dispatch.count.increment(payload)\n }", "title": "" }, { "docid": "8d70a7ebd1618e4173a3b2775e0b459a", "score": "0.5106997", "text": "incrementTransactionNumber() {\n if (this.serverSession) {\n this.serverSession.txnNumber =\n typeof this.serverSession.txnNumber === 'number' ? this.serverSession.txnNumber + 1 : 0;\n }\n }", "title": "" }, { "docid": "3a6125003e0c14128f4ec5aa7d6aeeed", "score": "0.51049924", "text": "incInteractionCount(type) {\n this.interactionCounts.inc(type);\n }", "title": "" }, { "docid": "707df5a2fb9ac00434068bede8c76e09", "score": "0.5096277", "text": "function updateUserCount() {\n kuzzle.countSubscription(subcriptionId, function (error, response) {\n if (error) {\n throw new Error(error);\n }\n\n $('#userCount').text('There are ' + response + ' users connected to [' + whoami.chatRoom + ']');\n });\n}", "title": "" }, { "docid": "59fe13449725a626f5f2a539f28e860b", "score": "0.5088359", "text": "function jo(t, e) {\n t.qr.U(e.targetId), us(t).mr(e)\n /**\n * We need to increment the expected number of pending responses we're due\n * from watch so we wait for the removal on the server before we process any\n * messages from this target.\n */;\n}", "title": "" }, { "docid": "0f1d174f95dc48f5e28190982d0930a8", "score": "0.5083097", "text": "function updateCalls(msg) {\n if (calls > 10) {\n return msg.reply.text(TOO_MUCH, { asReply: true });\n }\n calls++;\n}", "title": "" }, { "docid": "0f1d174f95dc48f5e28190982d0930a8", "score": "0.5083097", "text": "function updateCalls(msg) {\n if (calls > 10) {\n return msg.reply.text(TOO_MUCH, { asReply: true });\n }\n calls++;\n}", "title": "" }, { "docid": "f90df9275d34532f5c56adb493eea7d3", "score": "0.5067207", "text": "incrementMine () {\n this.neighborMine += 1\n }", "title": "" }, { "docid": "6163a868d028ecc7d3d13148d687185c", "score": "0.50592375", "text": "function incrementCounter() {\n if (!newOpenCard) {\n moveCounter++;\n $(\".moves\").text(moveCounter);\n updateStarRating();\n }\n }", "title": "" }, { "docid": "e16812b50c3b1832947d7ecf16485468", "score": "0.5059214", "text": "increaseCounter(state, randomNumber) {\n state.counter += randomNumber\n }", "title": "" }, { "docid": "b366ff7f92d87072b0e9423e7b4a48af", "score": "0.50591004", "text": "function incrFetchAttempts(err) {\n\tconsole.log(err);\n\tconsole.log(\"Going to try again after \" + API_RETRY_DELAY + \"ms delay...\");\n\tFetch_Attempts++;\n\tif (Fetch_Attempts >= API_ATTEMPTS_BEFORE_MESSAGE) {\n\t\t$(\"#notLoadingIndicator\").show();\n\t}\n}", "title": "" }, { "docid": "e4bba0890b2417e09008bd2f1e501d38", "score": "0.5059008", "text": "nextClient() {\r\n\t this._endpointsIndex++;\r\n\t if (this._endpointsIndex >= this._endpoints.length) {\r\n\t this._endpointsIndex = 0;\r\n\t }\r\n\t }", "title": "" }, { "docid": "e3b564cf83e66ca5b2e9b6562683e2f6", "score": "0.5057183", "text": "addNumCardsSubmitted(){this._numCardsSubmitted = this._numCardsSubmitted + 1;}", "title": "" }, { "docid": "30f2c565a73514264363b2b7d00d4e7c", "score": "0.50512695", "text": "_increment() {\r\n\t\tthis.counter[0] = (this.counter[0] + 1) & 0xffffffff;\r\n\t\tif (this.counter[0] === 0)\r\n\t\t\tthis.counter[1] = (this.counter[1] + 1) & 0xffffffff;\r\n\t}", "title": "" }, { "docid": "cc88e52f5630e3842d7a5e383f4601b7", "score": "0.504978", "text": "clientCount()\n {\n return Object.keys(this.clients).length;\n }", "title": "" }, { "docid": "da85065058abc01eb49e0ad2c010c3f2", "score": "0.5043706", "text": "function openConnection() {\n \n numConnections++;\n currentDelayAfter++;\n }", "title": "" }, { "docid": "168e8469a1fdcc9cd843f90bb34f3307", "score": "0.50435555", "text": "function incrementAndTest(incomingKey) {\n debugPrint(incomingKey);\n debugPrint(skulls[incomingKey]);\n userCounter += skulls[incomingKey];\n}", "title": "" }, { "docid": "7289cfa3efdb61b48d5aa358a4b537be", "score": "0.5043152", "text": "function updateCounter() {\n var counter = 0;\n deck.matchedCards.forEach(card => {\n counter++\n })\n matchCounter.innerHTML = counter;\n}", "title": "" }, { "docid": "b47d6a144095f0b709c37b2adc8614d5", "score": "0.5039376", "text": "function getNewMessageCountAddressedToUser(client, cb) {\n const areaTags = getAllAvailableMessageAreaTags(client).filter(\n areaTag => areaTag !== Message.WellKnownAreaTags.Private\n );\n\n let newMessageCount = 0;\n async.forEach(\n areaTags,\n (areaTag, nextAreaTag) => {\n getMessageAreaLastReadId(client.user.userId, areaTag, (_, lastMessageId) => {\n lastMessageId = lastMessageId || 0;\n getNewMessageCountInAreaForUser(\n client.user.userId,\n areaTag,\n (err, count) => {\n newMessageCount += count;\n return nextAreaTag(err);\n }\n );\n });\n },\n () => {\n return cb(null, newMessageCount);\n }\n );\n}", "title": "" }, { "docid": "0dffac4ea403ae3dbd92165f0e330910", "score": "0.5036689", "text": "function incrementCounter() {\n counter++;\n console.log(counter);\n }", "title": "" }, { "docid": "7cefacc5efdc3d74ffcafbaeff100f8e", "score": "0.5036533", "text": "updateServerStats () {\n document.getElementById('players').innerText = this.clients.length\n }", "title": "" }, { "docid": "a3690295c66eb8ac00376bf94bc45aef", "score": "0.5026085", "text": "doIncrease() {\n if (this.uptimeSettings.mouseDown) {\n let increment = this.getIncrement(this.uptimeSettings.iteration);\n this.valueUp(increment);\n this.uptimeSettings.iteration++;\n setTimeout(this.doIncrease, this.uptimeSettings.timeout);\n }\n }", "title": "" }, { "docid": "4e2d5b5057bf270689e2e64051783d7b", "score": "0.5023796", "text": "function checkCount() {\n if (aCount && count >= aCount) {\n // flush queue\n queueItems(null);\n\n // send operation complete\n self.notifyOperationComplete(aListener, Cr.NS_OK, Ci.calIOperationListener.GET, null, null);\n\n // tell caller we're done\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "13f4ebda2bf6c760d5aeb1090256a391", "score": "0.50195414", "text": "function increment() {\n // Increment `doc.data.numClicks`. See\n // https://github.com/ottypes/json0 for list of valid operations.\n const old_data = _.clone(my_data);\n my_data.num++;\n my_data.date = new Date();\n var diff = jsondiff(\n old_data,\n my_data,\n diffMatchPatch\n );\n doc.submitOp(diff);\n}", "title": "" }, { "docid": "3b6076efeb438fcc978ca69da82d6bc2", "score": "0.50193334", "text": "function upvoteIncrease() {\n fetch(`http://localhost:4002/articleComments/${id}`, {\n method: \"PATCH\",\n headers: {\n \"content-type\": \"application/json\",\n },\n body: JSON.stringify({\n commentUpvotes: currentUpvote + 1,\n }),\n })\n .then((res) => res.json())\n .then((data) => setCurrentUpvote(data.commentUpvotes));\n }", "title": "" }, { "docid": "34074b4e731b166b7bf26befc4b4de76", "score": "0.5018646", "text": "function callBack(){\n setCount(count + 1);\n }", "title": "" } ]
b727d491753e6ad0f183e5fc22e30e59
Watch for changes to static assets, pages, Sass, and JavaScript
[ { "docid": "68f36a5cfc8fb67e5f55764d312efd42", "score": "0.7451247", "text": "function watch() {\n gulp.watch(PATHS.nodejs, copyBackend);\n gulp.watch(PATHS.views, copyViews);\n gulp.watch('static/fonts/**/*', copyFonts);\n gulp.watch('scss/**/*.scss').on('all', gulp.series(sass));\n gulp.watch('static/js/**/*.js').on('all', gulp.series(javascript));\n gulp.watch('static/img/**/*').on('all', gulp.series(images));\n}", "title": "" } ]
[ { "docid": "b12b84226b083b42430ef0123a2f7d87", "score": "0.782433", "text": "function watch() {\n gulp.watch('./src/assets/**/*.*', copy);\n gulp.watch('./src/sass/**/*.scss', sass);\n gulp.watch('./src/**/*.html')\n .on('all', gulp.series(resetPages, pages, browser.reload));\n gulp.watch('./src/scripts/**/*.js', gulp.series(javascript, browser.reload));\n}", "title": "" }, { "docid": "0e370c72572429ee1898ab3a53518261", "score": "0.7687183", "text": "function watch() {\n // browsersync.init({\n // server: {\n // baseDir: './'\n // }\n // });\n gulp.watch('./assets/stylesheet/scss/**/*.scss', style);\n gulp.watch('./*.html').on('change', browsersync.reload);\n}", "title": "" }, { "docid": "c98fab65ec9487862efb369c3c59b784", "score": "0.76724976", "text": "function watch() {\n gulp.watch(['src/templates/**/*.hbs'], ['pages', reload]);\n gulp.watch(['src/**/*.js'], ['scripts', reload]);\n gulp.watch(['src/**/*.{less,css}'], ['styles', reload]);\n gulp.watch(['src/**/*.{svg,png,jpg,gif}'], ['assets', reload]);\n gulp.watch(['package.json', 'bower.json'], ['assets']);\n}", "title": "" }, { "docid": "e324dbf2b9dc818cbc896375efb7803b", "score": "0.76635736", "text": "function watch() {\n gulp.watch(PATHS.assets, copy);\n gulp.watch('src/templates/**/*.html').on('change', gulp.series(pages, browser.reload));\n gulp.watch('src/index.html').on('change', gulp.series(index, browser.reload));\n gulp.watch('src/assets/scss/**/*.scss', sass);\n gulp.watch('src/assets/js/**/*.js').on('change', gulp.series(javascript, browser.reload));\n gulp.watch(['src/assets/img/**/*', 'src/assets/data/resolutions.json']).on('change', gulp.series(resp, browser.reload));\n gulp.watch(['src/assets/data/projects3.xls', 'src/assets/data/resolutions.json']).on('change', gulp.series(ex2json, browser.reload));\n // gulp.watch('src/styleguide/**').on('change', gulp.series(styleGuide, browser.reload));\n }", "title": "" }, { "docid": "61210a0a39e62bba305a6f36b7c60d6a", "score": "0.76279575", "text": "function watch() {\r\n gulp.watch('scss/**/*', gulp.series(compileSass));\r\n gulp.watch('html/pages/**/*', gulp.series(compileHtml));\r\n gulp.watch('html/{layouts,includes,helpers,data}/**/*', gulp.series(compileHtmlReset, compileHtml));\r\n}", "title": "" }, { "docid": "5762f7e908d4a9a91bed743931143876", "score": "0.76019603", "text": "function watchFiles(){\n gulp.watch(\"./src/assets/scss/**/*\", scss.build);\n gulp.watch(\"./src/assets/js/**/*\", bundle.bundle);\n gulp.watch([\"./src/**/*\", \"!./src/assets/**/*\"], buildSite.build);\n}", "title": "" }, { "docid": "223a882663b8e7e66c6b3e9cc00cfe8d", "score": "0.7574185", "text": "function watch() {\r\n\tgulp.watch(CONF.PATHS.assets, copy);\r\n\tgulp.watch(SRC + '/assets/scss/**/*.scss', gulp.series(sass, renamecss, reload, dir))\r\n\t\t.on('change', path => log('File ' + colors.bold(colors.magenta(path)) + ' changed.'))\r\n\t\t.on('unlink', path => log('File ' + colors.bold(colors.magenta(path)) + ' was removed.'));\r\n\tgulp.watch(CONF.PATHS.main + '/**/*.{php,twig}', reload)\r\n\t\t.on('change', path => {\r\n\t\t\tlog('File ' + colors.bold(colors.magenta(path)) + ' changed.');\r\n\t\t\tcopyfile(path);\r\n\t\t})\r\n\t\t.on('unlink', path => {\r\n\t\t\tremovefile(path);\r\n\t\t})\r\n\tgulp.watch(SRC + '/assets/images/**/*', gulp.series(images, reload));\r\n\t//gulp.watch(SRC + '/assets/js/**/*.js').on('all', gulp.series(webpack.watch, reload));\r\n\t//vorher: gulp.series(webpack.watch, reload));\r\n\tgulp.watch(SRC + '/assets/js/**/*.js').on('all', gulp.series(javascript, reload));\r\n}", "title": "" }, { "docid": "5b0837b8550780797477b4644b03523c", "score": "0.7541593", "text": "function watch() {\n gulp.watch( 'src/pages/**/*.html' ).on( 'change', gulp.series( pages, browser.reload ) );\n gulp.watch( ['src/layouts/**/*', 'src/partials/**/*'] ).on( 'change', gulp.series( refresh, pages, browser.reload ) );\n gulp.watch( ['../scss/**/*.scss', 'src/assets/scss/**/*.scss'] ).on( 'change', gulp.series( refresh, json, scss, pages, browser.reload ) );\n gulp.watch( 'src/assets/js/**/*' ).on( 'change', gulp.series( js, browser.reload ) );\n gulp.watch( 'src/assets/img/**/*' ).on( 'change', gulp.series( images, browser.reload ) );\n}", "title": "" }, { "docid": "da2477a6ba92f54a63878b295f58ef53", "score": "0.75271195", "text": "function watchAll(){\n browserSync();\n convertToCSS();\n watch('src/*.html').on('change', browserAsync.reload);\n watch('src/scss/*.scss', series(convertToCSS)).on('change', browserAsync.reload);\n watch('src/js/*.js').on('change', browserAsync.reload);\n}", "title": "" }, { "docid": "28c08a85843bbfa09d467ef6b69a3fb0", "score": "0.75157213", "text": "function watch() {\n\tserverInit();\n\tgulp.watch(\"./app/scss/*.scss\", cssHandler);\n\tgulp.watch(\"./app/pug/*.pug\", htmlHandler);\n\tgulp.watch(\"./app/js/*.js\", jsHandler);\n}", "title": "" }, { "docid": "e4ac405c8ad93959fc0d1a484b1fc9e1", "score": "0.75011104", "text": "function watch() {\r\n\tgulp.watch( paths.scss.src, styles );\r\n\tgulp.watch( [ paths.js.src, paths.php.src ], browserSyncReload );\r\n}", "title": "" }, { "docid": "6a4aee73ecc3599a8580baf2f788563e", "score": "0.74943095", "text": "function watch() {\n gulp.watch(paths.lessWatch, css);\n gulp.watch(paths.pug, html);\n gulp.watch(paths.js, js);\n}", "title": "" }, { "docid": "748bd38f45ece31521fa4a70173017be", "score": "0.7484572", "text": "function watch() {\n // gulp.watch(PATHS.assets, copy);\n gulp.watch('src/pages/**/*.{html,jpg,png,gif}').on('all', gulp.series(pages, browser.reload));\n gulp.watch('src/pages/**/*.{js,json,yml}').on('all', gulp.series(resetPages, pages, browser.reload));\n // gulp.watch('src/pages/**/*.xml').on('all', gulp.series(copyxml, browser.reload));\n gulp.watch('src/{layouts,partials}/**/*.html').on('all', gulp.series(resetPages, pages, browser.reload));\n \n gulp.watch('src/helpers/**/*.js').on('all', gulp.series(resetPages, pages, browser.reload));\n // gulp.watch('src/assets/scss/**/*.scss').on('all', sass);\n // gulp.watch('src/assets/js/**/*.js').on('all', gulp.series(javascript, browser.reload));\n // gulp.watch('src/assets/img/**/*').on('all', gulp.series(images, browser.reload));\n // gulp.watch('src/styleguide/**').on('all', gulp.series(styleGuide, browser.reload));\n}", "title": "" }, { "docid": "181d42a10c2e6d35bb178cac5de879e2", "score": "0.7481944", "text": "function watch() {\n\n gulp.watch('src/pages/**/*.html').on('all', gulp.series(pages, browser.reload));\n gulp.watch('src/{layouts,partials}/**/*.html').on('all', gulp.series(resetPages, pages, browser.reload));\n gulp.watch('src/{data}/**/*.json').on('all', gulp.series(resetPages, pages, browser.reload));\n gulp.watch('src/assets/scss/**/*.scss').on('all', sassToCss);\n gulp.watch('src/assets/media/**/*').on('all', gulp.series(images, browser.reload));\n gulp.watch(['src/**/*.js']).on('all', gulp.series(['webpack'], browser.reload));\n\n\n}", "title": "" }, { "docid": "49877370d09d749d8452d8775f952d50", "score": "0.74713385", "text": "function watch() {\n gulp.watch(PATHS.assets, copy);\n gulp.watch(PATHS.srcPages).on('all', gulp.series(pages, browser.reload));\n gulp.watch(PATHS.srcPagesData).on('all', gulp.series(resetPages, pages, browser.reload));\n gulp.watch(PATHS.srcFilesScss).on('all', gulp.series(sass, browser.reload));\n gulp.watch(PATHS.jsES5).on('all', gulp.series(jsES5, javascript, browser.reload));\n gulp.watch(PATHS.jsES6).on('all', gulp.series(jsES6, javascript, browser.reload));\n gulp.watch(PATHS.srcFilesImages).on('all', gulp.series(images, browser.reload));\n gulp.watch(PATHS.srcFilesSVG).on('all', gulp.series(svgSprite, injectSvgSprite, browser.reload));\n gulp.watch(PATHS.srcStyleguideFiles).on('all', gulp.series(styleGuide, browser.reload));\n}", "title": "" }, { "docid": "e2c523d8b3aba350139cb10ad1a10be6", "score": "0.74695677", "text": "function watch() {\n gulp.watch(PATHS.miscAssets, gulp.series(copy, reload));\n gulp.watch(`${PATHS.pageTemplates}/**/*.{html,hbs}`).on('all', gulp.series(pages, reload));\n gulp.watch([\n `src/{layouts,components}/**/*.{html,hbs}`,\n `src/helpers/**`\n ]).on('all', gulp.series(resetPages, pages, reload));\n gulp.watch(`${PATHS.data}/**/*.{json,yml}`).on('all', gulp.series(resetPages, pages, reload));\n gulp.watch(`src/**/*.scss`).on('all', gulp.series(sass, reload));\n gulp.watch(`src/**/*.js`).on('all', gulp.series(scripts, reload));\n gulp.watch(PATHS.imageAssets).on('all', gulp.series(images, reload));\n gulp.watch(`${PATHS.styleGuide}/**`).on('all', gulp.series(styleGuide, reload));\n}", "title": "" }, { "docid": "24f5b2a2a9ead493586215ee39657a36", "score": "0.7458025", "text": "function watchFiles() {\n gulp.watch('src/scss/**/*.scss', css);\n gulp.watch('src/pages/**/*.html', html);\n gulp.watch('src/templates/**/*.html', html);\n gulp.watch('app/*.html', browserSyncReload);\n gulp.watch('src/js/**/*.js', js);\n gulp.watch('app/js/**/*.js', browserSyncReload);\n}", "title": "" }, { "docid": "1ef31c9c232bfdbcab83f0fa15739c33", "score": "0.74511296", "text": "function watch() {\n gulp.watch('src/templates/**/*.tpl.html').on('all', gulp.series(pages, browser.reload));\n gulp.watch(['src/layouts/**/*', 'src/partials/**/*']).on('all', gulp.series(resetPages, pages, browser.reload));\n gulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss']).on('all', gulp.series(resetPages, sass, pages, browser.reload));\n gulp.watch('src/assets/img/**/*').on('all', gulp.series(images, browser.reload));\n}", "title": "" }, { "docid": "4f5627fcfc367406b196296c869589f4", "score": "0.7444237", "text": "function watchFiles() {\n\tsync.init({\n\t\topen: 'external',\n\t\tproxy: localsite,\n\t\tport: 8080\n\t});\t\n\n\t//watch for scss file changes\n\twatch(watchCss, buildCSS);\n\t//watch for js file changes\n\twatch(watchJs, series(cleanJS, parallel(buildVarsJS, buildsXHRJS, buildJS), concatJS, parallel(removeJssxhrResidue, removeJsvarsResidue, removeJsResidue)));\n\t//reload browser once changes are made\n\twatch([\n\t\tcssDest + cssOut,\n\t\tjsDest + jsOut,\n\t\twatchPhp \n\t\t]).on('change', sync.reload);\n}", "title": "" }, { "docid": "bbf330de7ee5a7527bac2061e43bdfb7", "score": "0.7440326", "text": "function watch() {\n gulp.watch(PATHS.assets, copy);\n gulp.watch('src/styles/**/*.scss').on('all', sass);\n gulp.watch('src/scripts/**/*.js').on('all', gulp.series(javascript));\n gulp.watch('src/images/**/*').on('all', gulp.series(images));\n}", "title": "" }, { "docid": "e4fe2629336c75fe8f20ce017f868da5", "score": "0.7436695", "text": "function watch()\n{\n\tgulp.watch('/index.html', copyHtml);\n\tgulp.watch('img/*', copyImgs);\n\tgulp.watch('css/*.css', styles);\n\tgulp.watch('/js/*.js', scripts);\n}", "title": "" }, { "docid": "4cccc0d7d47ee42ba2d1c7b4c4949749", "score": "0.7387142", "text": "function _watch() {\r\n\r\n browserSync.init({\r\n notify: false,\r\n \r\n server: paths.dist\r\n });\r\n gulp.watch(paths.src_fonts, _fonts); \r\n gulp.watch('.'+paths.src_js+'**/*.js', _js)\r\n gulp.watch(paths.src_html,_html)\r\n gulp.watch(paths.src_images,_images)\r\n gulp.watch(paths.sub_scss, _sass_to_css) \r\n gulp.watch(paths.dist_html).on('change', browserSync.reload);\r\n \r\n}", "title": "" }, { "docid": "0c1d11902352c80b2e10c8d1f992d254", "score": "0.73678726", "text": "function watchFiles() {\n gulp.watch('assets/css/common.scss', critical);\n gulp.watch('assets/css/critical.scss', critical);\n gulp.watch('assets/css/extends.scss', critical);\n gulp.watch('assets/css/fonts.scss', critical);\n gulp.watch('assets/css/mixins.scss', critical);\n gulp.watch('assets/css/reset.scss', critical);\n gulp.watch('assets/css/variables.scss', critical);\n gulp.watch('assets/css/wufoo.scss', wufoo);\n gulp.watch('assets/js/download.js', webpack);\n gulp.watch('assets/js/header.js', webpack);\n gulp.watch('assets/js/lazy.js', webpack);\n gulp.watch('assets/js/webp.js', webpack);\n gulp.watch('assets/js/wufoo.js', webpack);\n}", "title": "" }, { "docid": "96aa45baa34e94601033561cf1fc9143", "score": "0.7341426", "text": "function watchFiles() {\r\n gulp.watch('src/scss/**/*.scss', css);\r\n gulp.watch('src/js/**/*.js', scripts);\r\n gulp.watch('src/img/**/*.{jpg,png,gif,svg}', images);\r\n gulp.watch('src/img/**/*.pdf', pdfs);\r\n gulp.watch('src/vid/**/*.{mov,webm,mp4}', videos);\r\n gulp.watch(\r\n [\r\n '*.html',\r\n '*.yml',\r\n '_includes/**/*',\r\n '_layouts/**/*',\r\n '_pages/**/*',\r\n '_posts/**/*',\r\n '_data/**.*+(yml|yaml|csv|json)' \r\n ],\r\n gulp.series(jekyll, browserSyncReload)\r\n );\r\n}", "title": "" }, { "docid": "ac690a9ba8df93671199c0da0fbfdef8", "score": "0.73217636", "text": "function watchFiles() {\n gulp.watch(paths.scripts.src, scripts);\n gulp.watch(paths.styles.src, styles);\n gulp.watch(paths.html.src, html);\n}", "title": "" }, { "docid": "ddca43d106eafc1107cf9400b234fd45", "score": "0.7299633", "text": "watch() {\n // Update HTML on each markdown change\n helper.watch('./src/*.md', filepath => {\n this.compile(filepath);\n });\n // Rebuild everything when a layout, include or data changes\n helper.watch(\n [\n './src/_layouts/*.pug',\n './src/_includes/*.pug',\n './src/_mixins/*.pug',\n './src/_data.json',\n ],\n () => {\n this.run();\n }\n );\n }", "title": "" }, { "docid": "4cf8c517663c72d7a546426c985da815", "score": "0.7282999", "text": "function watchFiles() {\n gulp.watch(paths.html.src, gulp.series(html, reload));\n gulp.watch([paths.styles.src, `!${paths.styles.cssDest}/**/*.*`], gulp.series(styles, reload));\n gulp.watch(paths.scripts.src, gulp.series(scripts, reload));\n gulp.watch(paths.images.src, gulp.series(images, reload));\n}", "title": "" }, { "docid": "b1954d355590d0d81754ae179ecc67fb", "score": "0.7273998", "text": "function watch() {\n gulp.watch(config.styles.srcDir, styles);\n gulp.watch(config.scripts.admin, adminscripts);\n \n // Reload browsersync when PHP files change, if active\n if (config.browserSync.active) {\n gulp.watch('./**/*.php', browserSyncReload);\n }\n}", "title": "" }, { "docid": "0453dc1bee94142f7e86a2c76112931f", "score": "0.72663295", "text": "function watch() {\n gulp.watch('email/src/pages/**/*.html')\n .on('change', gulp.series(pages, inline, browser.reload));\n\n gulp.watch(['email/src/layouts/**/*', 'email/src/partials/**/*'])\n .on('change', gulp.series(resetPages, pages, inline, browser.reload));\n\n gulp.watch(['../scss/**/*.scss', 'email/src/assets/scss/**/*.scss'])\n .on('change', gulp.series(resetPages, sass, pages, inline, browser.reload));\n\n gulp.watch('email/src/assets/img/**/*')\n .on('change', gulp.series(images, browser.reload));\n}", "title": "" }, { "docid": "e896d00d4d9a4d302f804524772dbe44", "score": "0.7255582", "text": "function watchFiles(){\n gulp.watch('scss/*.scss', css);\n //funciones para correr en paralelo\n gulp.watch('index.html');\n\n}", "title": "" }, { "docid": "a802806d3b78be4c5e9ce8cb94214b43", "score": "0.724994", "text": "function watch() {\n // Watch YAML files for changes & recompile\n gulp.watch(['src/yml/*.yml', '!src/yml/theme.yml'], gulp.series(config, jekyll, reload));\n\n // Watch theme file for changes, rebuild styles & recompile\n gulp.watch(['src/yml/theme.yml'], gulp.series(theme, config, jekyll, reload));\n\n // Watch SASS files for changes & rebuild styles\n gulp.watch(['_sass/**/*.scss'], gulp.series(jekyll, reload));\n\n // Watch JS files for changes & recompile\n gulp.watch('src/js/main/**/*.js', mainJs);\n\n // Watch preview JS files for changes, copy files & reload\n gulp.watch('src/js/preview/**/*.js', gulp.series(previewJs, reload));\n\n // Watch images for changes, optimize & recompile\n gulp.watch('src/img/**/*', gulp.series(images, config, jekyll, reload));\n\n // Watch html/md files, rebuild config, run Jekyll & reload BrowserSync\n gulp.watch(['*.html', '_includes/*.html', '_layouts/*.html', '_posts/*', '_authors/*', 'pages/*', 'category/*'], gulp.series(config, jekyll, reload));\n}", "title": "" }, { "docid": "03b2ac175c88cbf819865f5220994e9c", "score": "0.7222663", "text": "function watcher() {\n src('src/js/livereload.js')\n .pipe(dest('dist/'));\n\n watch(['./src/**/*.html'], { ignoreInitial: false }, html);\n watch(['./src/**/.js'], { ignoreInitial: false }, series(min, cons));\n watch(['./src/**/.styl'], { ignoreInitial: false }, css);\n watch(['./src/images/**'], { ignoreInitial: false }, images);\n}", "title": "" }, { "docid": "32143c47705c1dd1b858439de9e0856f", "score": "0.7220598", "text": "function watch() {\n gulp.watch(paths.stylusWatch, gulp.series('css'));\n gulp.watch(paths.pugWatch, gulp.series('html'));\n}", "title": "" }, { "docid": "642184e638caf4c7ee2639f277c5d67d", "score": "0.72105837", "text": "function watch() {\n gulp.watch([IOWA.appDir + '/**/*.html'], reload);\n gulp.watch([IOWA.appDir + '/{elements,styles}/**/*.{scss,css}'], ['sass', reload]);\n gulp.watch([IOWA.appDir + '/scripts/**/*.js'], ['jshint']);\n gulp.watch([IOWA.appDir + '/images/**/*'], reload);\n gulp.watch([IOWA.appDir + '/bower.json'], ['bower']);\n gulp.watch(dataWorkerScripts, ['generate-data-worker-dev']);\n}", "title": "" }, { "docid": "3823f937c0514456ab09be73317066f1", "score": "0.7204207", "text": "function watchFiles() {\n gulp.watch(paths.scripts.src, scripts);\n gulp.watch(paths.styles.src, styles);\n}", "title": "" }, { "docid": "fdce26bc4ba0cf49d526071421db88fa", "score": "0.72013867", "text": "function watchFiles() {\r\n gulp.watch('Stylesheets/**/*.scss', compileSass);\r\n gulp.watch('Scripts/**/*.js', compileJs);\r\n}", "title": "" }, { "docid": "dd23252b4f5b0cf0f3a9e3f65de757c7", "score": "0.7201308", "text": "function watch(){\n\n browser_Sync.init({\n server: {\n baseDir: \"app\"\n }\n });\n\n gulp.watch('app/*.html').on('change', browser_Sync.reload);\n gulp.watch('app/assets/css/**/*.css', styles_files);\n gulp.watch('app/assets/js/**/*.js', scripts_files);\n\n\n}", "title": "" }, { "docid": "ec5d068812fd52f7f9ce3af6a35a4f22", "score": "0.7187162", "text": "function watch() {\n gulp.watch(htmlPath + '/**/*.njk', gulp.series('html'));\n gulp.watch(stylesPath + '/**/*.scss', gulp.series('styles'));\n gulp.watch(scriptsPath + '/**/*.js', gulp.series('scripts'));\n gulp.watch(imagesPath + '/*', gulp.series('images'));\n}", "title": "" }, { "docid": "6dbf705450cfbbc77c5a839bb78d2d63", "score": "0.71859896", "text": "function watch() {\n // gulp.watch(paths.html).on('change', reload);\n // gulp.watch(paths.css).on('change', gulp.series(styles, reload));\n // gulp.watch(paths.app).on('change', reload);\n gulp.watch(paths.html, reload);\n gulp.watch(paths.app, reload);\n gulp.watch(paths.css, gulp.series(styles, reload));\n}", "title": "" }, { "docid": "fe4f42fd84f3aa48bdf5fcc8004493da", "score": "0.7168613", "text": "function watch() {\n\tif(!production) {\n\t\tgulp.watch(paths.source, gulp.series( scaffold, reload ));\n\t\tgulp.watch(paths.src.styles + '**/*', styles);\n\t\tgulp.watch(paths.src.scripts + '**/*', scripts);\n\t\tgulp.watch(paths.src.images + '**/*', images);\n\t\tgulp.watch(paths.src.svgs + '**/*', gulp.series( svgSprite, scaffold ));\n\t}\n}", "title": "" }, { "docid": "743fb4f6334ca8717e2c7b30003da328", "score": "0.71569556", "text": "function watch() {\n WATCHER = true;\n for (var subfolder in PATHS.assets) {\n gulp.watch(PATHS.assets[subfolder], assets);\n }\n gulp.watch(PATHS.less.watches, css);\n gulp.watch(PATHS.sass.watches, css);\n gulp.watch(PATHS.javascript.project, javascript);\n gulp.watch(PATHS.images, images);\n gulp.watch('src/components/styleguide/**', styleGuide);\n}", "title": "" }, { "docid": "c0595eb0dd8c7572f4b110aad512e01b", "score": "0.7147297", "text": "function wacthFiles() {\n watch('src/assets/scss/**/*.scss', series(compileCss))\n watch('src/assets/js/**/*.js', series(compileJs))\n watch('src/assets/img/**/*', series(minifyImg))\n watch('src/**/*.hbs', series(resetPages, compileHtml))\n watch('src/data/*.json', series(resetPages, compileHtml))\n}", "title": "" }, { "docid": "0d7edc081d4d5b26046fc5f7082e9a1d", "score": "0.7131129", "text": "function watch() {\n browserSync.init({\n // Tell browser to use thos directory and serve it as a mini-server\n server: {\n baseDir: \"./build\"\n }\n });\n\n style();\n\n gulp.watch(paths.styles.src, style);\n\n // Tell gulp which files to watch to trigger the reload\n // This can be html or whatever you're using to develop your website\n gulp.watch(paths.html.src).on('change', browserSync.reload);\n}", "title": "" }, { "docid": "96852f5936a1d96f00092a0d603efe5f", "score": "0.71234685", "text": "function watch() {\n // style files\n gulp.watch([path.src + '/**/*.scss', path.src + '/**/*.css'])\n .on('change', function (file) {\n var site = getSiteNameFromPath(file.path);\n log('[' + site + '] ' + file.type + ': ' + file.path);\n\n // site => default ? compile all sites\n if (site === 'default') {\n sites.map(function (current) {\n stylesDev(current);\n })\n } else {\n stylesDev(site);\n }\n });\n\n // script files\n gulp.watch(path.src + '/**/*.js')\n .on('change', function (file) {\n var site = getSiteNameFromPath(file.path);\n log('[' + site + '] ' + file.type + ': ' + file.path);\n\n // site => default ? compile all sites\n if (site === 'default') {\n sites.map(function (current) {\n scriptsDev(current);\n })\n } else {\n scriptsDev(site);\n }\n });\n}", "title": "" }, { "docid": "073f460717e467579b0d6baa43379f15", "score": "0.71221155", "text": "function watch() {\n browserSync.init({\n port: 80,\n server: {\n baseDir: \"./\"\n },\n notify: false\n })\n gulp.watch(scssFiles, scss);\n gulp.watch(jsFiles, js);\n gulp.watch(jsFiles).on(\"change\", browserSync.reload);\n gulp.watch(scssFiles).on(\"change\", browserSync.reload);\n gulp.watch(htmlFiles).on(\"change\", browserSync.reload);\n}", "title": "" }, { "docid": "7c36575aef66cfac8a704aa224e168f5", "score": "0.71148086", "text": "function watchForChanges() {\n watch(\n [srcFiles.pathPug, srcFiles.pathSCSS, srcFiles.pathJS],\n series(\n parallel(compileToReadableHTML, compileToReadableCSS, compileToReadableJS)\n )\n );\n}", "title": "" }, { "docid": "ebedd4e35f58ce0455d89d6bf0485188", "score": "0.7108705", "text": "function watch() {\r\n\tgulp.watch(sassFiles, sassy)\r\n\tgulp.watch([\r\n\t\t'./*.php',\r\n\t\t'./layouts/**/*.php',\r\n\t\t'./source/scss/**/*.scss',\r\n\t])\r\n}", "title": "" }, { "docid": "f1f2510392c44df113df96217ead991c", "score": "0.7105729", "text": "function watchAndServe() {\n browserSync.init({\n server: 'dist',\n });\n\n watch('src/styles/**/*.scss', styles);\n watch('src/pug/pages/*.pug', pugHtml);\n // watch('src/**/*.html', html);\n watch('src/assets/**/*', assets);\n watch('src/js/**/*.js', scripts);\n watch('dist/*.html').on('change', browserSync.reload);\n}", "title": "" }, { "docid": "4a36acc95e29dd7eae79c347a935a795", "score": "0.71037436", "text": "function watch() {\n // watch for color changes and generate palette\n gulp.watch('./src/css/common/__variables.css', gulp.series('color'));\n\n // compile and minify css\n gulp.watch(\n './src/css/**/*.css',\n {\n ignored: ['./src/css/common/__variables.css', './src/css/astro.core.css', './src/css/astro.css'],\n },\n gulp.series(css)\n );\n}", "title": "" }, { "docid": "cda4881af8fc2fc16c7d127bffa4050c", "score": "0.71007586", "text": "function watchTask(){\n\n watch([files.scssPath], parallel(scssTask, browserSyncReload));\n watch([files.jsPath], parallel(jsTask, browserSyncReload));\n watch([\"./*.html\",\n \"./*.yml\",\n \"./_includes/*.html\",\n \"./_layouts/*.html\",\n \"./_posts/**/*.*\"], series(jekyll, browserSyncReload));\n \n\n}", "title": "" }, { "docid": "192bdccdf53f2eb02b3bdcc5dc614d3a", "score": "0.70614433", "text": "function watch() {\n\n\t\t// SCRIPTS\n\t\tgulp.watch('./src/*.js').on('all', gulp.series(latest, browserSync.reload));\n\t\t// gulp.watch(['./src/shopback-plugin.js']).on('change', browserSync.reload);\n\n\t}", "title": "" }, { "docid": "744ab7a186ec25e8c459cbf47f740a5b", "score": "0.705118", "text": "function watchArchivos(){\n watch(paths.watch,css);\n watch(paths.js,javascript)\n }", "title": "" }, { "docid": "d89e96d81a0c1d3c976fe1cae1004f76", "score": "0.7015689", "text": "function watchSass() {\n watch('assets/sass/*.sass', compileSass);\n}", "title": "" }, { "docid": "5e161bcfee6a2c4f7c4bf7e9878350af", "score": "0.7004375", "text": "function watch() {\n\n //set base directory for browsersync\n browserSync.init({\n server: {\n baseDir: \"src\",\n index: \"/index.html\"\n }\n }\n\n );\n\n //define our watch tasks\n gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], style);\n gulp.watch('src/*.html').on('change', browserSync.reload);\n gulp.watch('src/js/*.js').on('change', browserSync.reload);\n\n\n}", "title": "" }, { "docid": "df656d2339f10ebb562095ddf9bc0eaf", "score": "0.7001681", "text": "function watch(){\n\tbrowserSync.init({\n server: {\n baseDir: \"./dist\"\n },\n\t\ttunnel:true\n });\n gulp.watch('./src/scss/**/*.scss', sass);\n gulp.watch('./src/css/**/*.css', styles);\n gulp.watch('./src/js/**/*.js', script);\n gulp.watch('./src/*.html', html);\n}", "title": "" }, { "docid": "2531511634b338a48459248a6fa30ed8", "score": "0.6987842", "text": "function watchTask(){\r\n browserSync.init({\r\n server: {\r\n baseDir: \"./\"\r\n }\r\n });\r\n\r\n watch(\"./*.html\").on('change', browserSync.reload);\r\n watch(paths.scss, parallel(styles_Src, styles_Dist));\r\n watch('src/bootstrap/scss/**.*scss', styles_bootstrap);\r\n watch('src/plugins/**/*.css', vendor_styles);\r\n watch(paths.js, js);\r\n watch('src/plugins/**/*.js', vendor_js);\r\n watch('src/images/**/*.*', image_compress);\r\n\r\n}", "title": "" }, { "docid": "32dea374dc1d21f3dd7bd1a4d6a20716", "score": "0.69869274", "text": "function watchMe(done) {\n watch('dev/**/*.{html,scss}', exports.compileCode);\n watch('dev/**/*.{png,jpg,jpeg,gif}', exports.img);\n watch('dev/**/*').on('all', fileSync);\n $.browserSync.reload({ stream: true });\n done();\n}", "title": "" }, { "docid": "1afea3d30f0578e58801044d004a200b", "score": "0.69682294", "text": "function watch() {\n gulp.watch(['scss/**/*.{scss,css}'],\n ['styles', 'styles-grid', 'styletemplates', reload]);\n}", "title": "" }, { "docid": "fea4311a005336f730a47746a1d716c9", "score": "0.6966316", "text": "function watch_files(done) {\n gulp.watch('project/css/**/*.css', reload);\n gulp.watch('project/*.html', reload);\n gulp.watch('project/js/**/*.js', reload);\n done();\n}", "title": "" }, { "docid": "249bc95d2f05b8b66dd5b406ab112ed8", "score": "0.6964452", "text": "function watch() {\n gulp.watch('src/**/*', gulp.series(build, reload));\n}", "title": "" }, { "docid": "39c25c0abd9e65e8b125e3493c630383", "score": "0.6929053", "text": "function watchSourceFiles() {\n let CSS_WATCHER = CFG.CSS.SASS ? CFG.SRC.APP_SCSS : CFG.SRC.APP_CSS;\n gulp.watch([CFG.SRC.APP_JS, CSS_WATCHER], exports[CFG.TASKS.BUILD_APP]);\n gulp.watch([CFG.SRC.VENDOR_JS, CFG.SRC.VENDOR_CSS], exports[CFG.TASKS.BUILD_VENDOR]);\n}", "title": "" }, { "docid": "d5f641c3b2c3d5b3b80c1981298eb32d", "score": "0.6916833", "text": "function devWatchFiles() {\n gulp.watch('./src/templates/**/*', gulp.series(templates.dev));\n gulp.watch('./src/assets/scss/**/*', gulp.series(css.build, copy.dev));\n gulp.watch('./src/assets/js/**/*', gulp.series(js.build, copy.dev));\n gulp.watch('./src/assets/img/**/*', gulp.series(copy.assets, copy.dev));\n gulp.watch('./src/assets/fonts/**/*', gulp.series(copy.assets, copy.dev));\n}", "title": "" }, { "docid": "cb5ac6ea78ade170bfe906aef49e7f98", "score": "0.68891895", "text": "function watch() {\r\n\tsassy();\r\n\r\n\tgulp.watch(sassFiles, sassy)\r\n\tgulp.watch([\r\n\t\t'./source/scss/**/*.scss',\r\n\t])\r\n}", "title": "" }, { "docid": "b12bebaa60b2e54bb2f7ca1faa8a64c2", "score": "0.6861633", "text": "__debug() {\n const watchPath = this.util.getRootPath('templates')\n if (fs.existsSync(watchPath)) {\n const self = this\n const reloadServer = reload(self.app, {\n https: this.config.ssl.enabled ? this.config.ssl.opts : undefined,\n })\n reloadServer.then(function (reloadReturned) {\n watch.watchTree(watchPath, (f, curr, prev) => {\n /// TODO: reset page cache for all paths that match the changed filepath\n /// TODO: to support the above, change the cacheKeys in rendering.js to drop the filename extension\n self.log('Asset change detected, reloading connection')\n reloadReturned.reload()\n })\n })\n } else {\n this.log.error('cannot watch because folder does not exist', {\n watchPath,\n })\n }\n }", "title": "" }, { "docid": "122e16b6d85489348d06b339aed4bcca", "score": "0.6846773", "text": "function watchingJS(cb) {\n watch(watchedJS, buildJS);\n cb();\n}", "title": "" }, { "docid": "9bb224a9b3e2f7f5511860165f226a07", "score": "0.6837791", "text": "function watch() {\n runServer();\n gulp.watch('scss/**/*.scss', {usePolling: true}, compileSass); // usePolling to prevent compile time increase\n}", "title": "" }, { "docid": "c20f1f1b78666f7658be866cb7cb5437", "score": "0.68041104", "text": "function watch() {\r\n gulp.watch([files.pugPath, files.sassPath, files.jsPath, files.imgPath, files.downloadsPath],\r\n gulp.series(pugTask, sassTask, js, images, downloads))\r\n\r\n // gulp.parallel(pugTask, sassTask, js, images, downloads)\r\n\r\n // initiate BrowserSync\r\n browsersync.init({\r\n server: {\r\n // serve files from the /build folder\r\n baseDir: \"./build\"\r\n }\r\n });\r\n\r\n // watch for SASS changes\r\n gulp.watch(files.sassPath, sassTask);\r\n // watch for changes in the HTML\r\n gulp.watch(files.pugPath).on('change', browsersync.reload);\r\n // watch for image changes\r\n gulp.watch(files.imgPath).on('change', browsersync.reload);\r\n}", "title": "" }, { "docid": "5692393d24a9e5a43d5be9c292c0e741", "score": "0.68004954", "text": "function watch(done) {\n gulp.watch(['_sass/**/*.scss', 'css/*.scss'], buildSass);\n gulp.watch('_js/**/*.js', buildJS);\n gulp.watch(['**/*.html', '*.html', '_posts/**/*', '_includes/*', '!_site/**/*'], gulp.series('build'));\n done();\n}", "title": "" }, { "docid": "d4eec707706255bede3349964b681013", "score": "0.67986923", "text": "function watch() {\n gulp.watch(paths.stylusWatch, task('css'));\n}", "title": "" }, { "docid": "38ed3ba4e0790b8c46f7e28bd1a0db75", "score": "0.6790806", "text": "function watchHtml() {\n const watchDirectories = config.html.sources;\n if (config.html.twig.enabled) {\n watchDirectories.push(config.html.twig.baseDir + '**/*.twig');\n watchDirectories.push(config.html.twig.dataSrc + '**/*.json');\n }\n return gulp.watch(watchDirectories, gulp.series('compile:html', 'validate:html'));\n }", "title": "" }, { "docid": "58339c4c0cbaa8d424a47f6ad0e014b7", "score": "0.6770649", "text": "function watchTask() {\n browserSync.init({\n server: {\n baseDir: './pub/'\n }\n })\n watch(files.htmlPath, copyHTML).on('change', browserSync.reload);\n watch(files.imgPath, imageMin).on('change', browserSync.reload);\n watch(files.jsPath, jsTask).on('change', browserSync.reload);\n // watch(files.cssPath, cssTask).on('change', browserSync.reload);\n watch(files.sassPath, styleTask).on('change', browserSync.reload);\n}", "title": "" }, { "docid": "18310aecc5c647bd4f0c97dcf895afeb", "score": "0.6764268", "text": "function watch() {\n gulp.watch(\n [\n pathConfig.move[0].src,\n pathConfig.move[0].exclude[0],\n pathConfig.move[0].exclude[1],\n pathConfig.move[0].exclude[2]\n ],\n move\n );\n gulp.watch(\n [\n pathConfig.img[0].src,\n pathConfig.img[0].exclude[0]\n ],\n img\n );\n gulp.watch(\n \"./src/img/vector/\",\n svgSprite\n );\n gulp.watch(\n [\n pathConfig.js[0].src,\n pathConfig.js[1].src\n ],\n js\n );\n gulp.watch(\n [\n pathConfig.css[0].src,\n pathConfig.css[1].src\n ],\n css\n );\n}", "title": "" }, { "docid": "a7d6c4fa61d822c357823bfb0dbd65db", "score": "0.6756484", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: \"./src/\",\n index: \"prototype.html\"\n }\n });\n // CSS\n gulp.watch('./src/Styles/**/*.scss', styles);\n // HTML\n gulp.watch('./src/Components/**/*.html', include);\n //gulp.watch('./src/**/*.html').on('change', browserSync.reload);\n // JS\n gulp.watch('./src/Scripts/src/**/*.js', scripts);\n // IMAGES\n //gulp.watch('./src/Images/src/**/*.*', images); // *Optional\n // SVG\n // gulp.watch('./src/Images/src/**/*.svg', svgo); // *Optional\n}", "title": "" }, { "docid": "c454d991a56ad60944ad6aac549b39be", "score": "0.6738725", "text": "watch() {\n if (! process.argv.includes('--watch')) return;\n\n this.manualFiles.forEach(file => {\n new File(file).watch(() => {\n File.find(this.manifest.get(file))\n .rename(this.generateHashedFilePath(file))\n .write(File.find(file).read());\n\n this.prune(this.baseDir);\n });\n });\n }", "title": "" }, { "docid": "e6e37bd25b29efaaafc708cac95a99c4", "score": "0.67345214", "text": "function watchers(cb) {\n \n watch('src/scss/*.scss', {readDelay: 500, verbose: true },sassy);\n // watch('src/css/*.css', {readDelay: 500, verbose: true }, minify_css);\n watch('src/js/*.js', {readDelay: 500, verbose: true }, minify_js);\n // Reloads the browser whenever HTML or JS files change\n watch('src/*.html', copy_html);\n watch('src/**/*.{jpg,png,gif,svg,mp4}', {readDelay: 500, verbose: true }, copy_assets, browserSync.reload)\n // let file = '' \n // if (typeof cb === 'function') {\n // cb(null, file);\n // called = true;\n // };\n}", "title": "" }, { "docid": "77357d3aebc5cd7ef3e18f51261cd0d1", "score": "0.6729227", "text": "function watchTask() {\n watch(\"./src/html/**/*.+(html|njk)\", series(htmlComp, browsersyncReload));\n watch([\"./src/css/**/*.css\"], series(cssComp, browsersyncReload));\n watch([\"./src/js/**/*.js\"], series(jsComp, browsersyncReload));\n watch([\"./src/images/**/*.+(png|jpg|gif|svg)\"], series(imageminComp, browsersyncReload));\n}", "title": "" }, { "docid": "38bd20723174e786ab5863d25b58246c", "score": "0.669279", "text": "function watchTask () {\r\n browserSync.init({\r\n server: {\r\n baseDir: \"pub/\",\r\n index: \"/admin-login.php\"\r\n }\r\n });\r\n \r\n // Look after files´changes \r\n watch([files.htmlPath, files.phpPath, files.jsPath, files.cssPath, files.sassPath, files.imgPath], parallel(htmlFiles, phpFiles, jsFiles, cssFiles, sassFiles, imgFiles, babelTranspile)).on(\"change\", reload); \r\n }", "title": "" }, { "docid": "7a96efc4e7eabe8293027005bc348a38", "score": "0.66884595", "text": "function watch_dev() {\r\n\t//re-build the bundles on file changes\r\n\tdetectChanges();\r\n}", "title": "" }, { "docid": "d190df91b3d78e1ebfcd736cc33d5ba6", "score": "0.66805816", "text": "function watchStatic(app, logger = () => {}) {\n logger('info', 'WATCHING', `Watching static files in ${app.staticPath}`);\n nodeWatch(app.staticPath, { recursive: true }, (evt, filePath) => {\n logger('info', 'CHANGE', `Change in static file ${filePath}`);\n fs.copySync(filePath, app.outputPath);\n });\n}", "title": "" }, { "docid": "f522c222497652f85ad5bc5960727028", "score": "0.66731703", "text": "function watchTask() {\r\n watch(\r\n [files.scssPath, files.htmlPath],\r\n series(scssTask, reloadTask)\r\n )\r\n}", "title": "" }, { "docid": "65610b35c6ad490bdf037f570d3a9fb4", "score": "0.66569495", "text": "function _watch(done) {\n gulp.watch(src + '/ts/*.*', _compileTs);\n gulp.watch(src + '/scss/**/*.*', _compileScss);\n done();\n}", "title": "" }, { "docid": "695e30169201e1ffa2733d4aebf03560", "score": "0.66408557", "text": "function watch() {\nbrowserSync.init({\n // You can tell browserSync to use this directory and serve it as a mini-server\n server: {\n baseDir: \".\"\n }\n // If you are already serving your website locally using something like apache\n // You can use the proxy setting to proxy that instead\n // proxy: \"yourlocal.dev\"\n});\ngulp.watch(paths.styles.src, style);\n\n// We should tell gulp which files to watch to trigger the reload\n// This can be html or whatever you're using to develop your website\n// Note -- you can obviously add the path to the Paths object\ngulp.watch(paths.templates.src, generalTemplates).on('change', browserSync.reload);\n\n}", "title": "" }, { "docid": "9ad7daea66a96e6de97abbc08a2d8d39", "score": "0.6612712", "text": "function detectChanges(){\r\n\tgulp.watch(source.js.app, ['concat_app_js']).on('change', onChange);\r\n\tgulp.watch(source.js.vendor, ['concat_vendor_js']).on('change', onChange);\r\n\tgulp.watch(source.css, ['concat_css']).on('change', onChange);\r\n\tgulp.watch(source.forDist, ['copy_to_dist']).on('change', onChange);\r\n\r\n\t//log file that changed\r\n\tfunction onChange(change) {\r\n\t\t//split up the path to get the file name\r\n\t\tvar splitUpPath = change.path.split('/');\r\n\r\n\t\t//log the file detected\r\n\t\tconsole.log('\"' + splitUpPath[splitUpPath.length - 1] + '\" was ' + change.type);\r\n\t}\r\n}", "title": "" }, { "docid": "e5bef6335c695b9320bdbc5160b3879e", "score": "0.65958637", "text": "function watchCodeDev() {\n gulp.watch(['./source/templates/*.handlebars'], handlebars);\n gulp.watch(jsfiles, moveJS);\n gulp.watch(['./source/*.html'], moveHTML);\n gulp.watch(['./source/*.css'], moveCSS);\n}", "title": "" }, { "docid": "516fea42e4676b9b446f7693d23da4a1", "score": "0.65721494", "text": "watchSourceFiles () {\n // watch add/remove of files\n this.pagesWatcher = chokidar.watch([\n '**/*.md',\n '.vuepress/components/**/*.vue'\n ], {\n cwd: this.context.sourceDir,\n ignored: ['.vuepress/**/*.md', 'node_modules'],\n ignoreInitial: true\n })\n this.pagesWatcher.on('add', target => this.handleUpdate('add', target))\n this.pagesWatcher.on('unlink', target => this.handleUpdate('unlink', target))\n }", "title": "" }, { "docid": "a10c3b88da09fd028e68572fb67faddf", "score": "0.65598994", "text": "function watch() {\n gulp.watch(['packages/**/*', 'app/**/*'], gulp.series(['build', 'docs:build']))\n}", "title": "" }, { "docid": "7dc4993d2d3c67c8d366ed8d4d9d874f", "score": "0.65454453", "text": "function watch() {\n browserSync.init({\n server: {\n baseDir: './public'\n }\n });\n}", "title": "" }, { "docid": "7d498054e533b298f76447897928881f", "score": "0.65439063", "text": "function taskWatch() {\n logStartTask('watch');\n\n gulp.watch(`${ASSETS_SRC}/**/*`, gulp.series(taskAssetsClean, taskMarkupReset, taskAssetsCopy));\n gulp.watch(`${MARKUP_SRC}/**/*.html`, gulp.series(taskMarkupClean, taskMarkup));\n gulp.watch(`${STYLES_SRC}/**/*.css`, gulp.series(taskStylesClean, taskStyles));\n gulp.watch(`${SCRIPTS_SRC}/**/*.js`, gulp.series(taskScriptsClean, taskScripts, taskScriptsLint, taskScriptsVendor, taskScriptsModelsClean, taskScriptsModelsCopy, taskScriptsModelsLint));\n}", "title": "" }, { "docid": "2d433ec65299c64f171c0ec9ba8a1ff7", "score": "0.6526297", "text": "function watchSass() {\n watch(files.scss.src, compileSCSS);\n}", "title": "" }, { "docid": "ca99b1a163721243f465e00e877c56a2", "score": "0.6504304", "text": "function watch() {\n console.log('Watching for changes...');\n\n const compiler = webpack(config);\n compiler.watch({\n\n }, (err, stats) => {\n let messages = {\n errors: [],\n warnings: []\n };\n if (err) {\n if (!err.message) {\n console.error(err);\n } else {\n messages = formatWebpackMessages({\n errors: [err.message],\n warnings: [],\n });\n }\n } else {\n // Merge with the public folder\n copyPublicFolder();\n messages = formatWebpackMessages(\n stats.toJson({all: false, warnings: true, errors: true})\n );\n }\n if (messages.errors.length) {\n console.error(messages.errors.join('\\n\\n'))\n }\n\n if (messages.warnings.length) {\n console.error(messages.warnings.join('\\n\\n'))\n }\n\n console.log(`Compilation done in ${(stats.endTime - stats.startTime) / 1000}s`);\n console.log()\n });\n}", "title": "" }, { "docid": "715460339d2100710ba0d0e7ce1eef55", "score": "0.6503946", "text": "watch (directory) {\n logger.debug(`Hotloading enabled, watching for code changes...`)\n\n let modules = {}\n\n chokidar.watch('./lib', {alwaysStat: true}).on('all', (event, path, stats) => {\n if (event === 'add') modules[path] = {size: stats.size}\n if (event === 'change') {\n if (modules[path].size !== stats.size) {\n logger.info(`Reloaded code for ${path}...`)\n modules[path].size = stats.size\n\n delete require.cache[path]\n }\n }\n })\n }", "title": "" }, { "docid": "79454236781c6fc0e672774382a6c1d5", "score": "0.6436835", "text": "function watchCss(cb) {\n gulp.watch(\"./src/scss/*.scss\", css);\n cb();\n}", "title": "" }, { "docid": "306d36b1ad9860d19a3ed6df7bc445ec", "score": "0.6433004", "text": "function watchingSass(cb) {\n watch(watchedSass, buildcss);\n cb();\n}", "title": "" }, { "docid": "ea8530ad7aa9ab945b2f67bf58dfe239", "score": "0.6432874", "text": "function watchFiles(cb) {\r\n var js = source.js || [];\r\n\r\n // only watch the properties file too if one is in play\r\n if (source.properties) {\r\n js.push(source.properties);\r\n }\r\n\r\n watch(js, series(lintJS, compileJS));\r\n watch([source.sass.files], compileCSS);\r\n watch([source.html], compileHTML);\r\n watch([source.etc.files], moveAssets);\r\n watch(fonts, moveFonts);\r\n cb();\r\n}", "title": "" }, { "docid": "9312ebf3ac77bffc218cc33cb584bea4", "score": "0.6411284", "text": "function watchTask() {\n // wich files to watch, since there are more then one we make an array\n //then we tell it what to do with them.\n\n // added a init for browser syncs live server\n browserSync.init({\n server: \"./pub\"\n });\n watch([files.htmlPath, files.cssPath, files.jsPath, files.imgPath, files.sassPath], parallel(copyHTML, cssTask, jsTask, imageTask, sassTask)).on('change', browserSync.reload);\n}", "title": "" }, { "docid": "e044f9b171e57d36c3fc783bbc98ada4", "score": "0.6394317", "text": "async function watch(done) {\n browserSync.init({\n port: 8080,\n server: build\n });\n\n var reload = browserSync.reload;\n\n // image changes\n gulp.watch(src + 'assets/images/**/*', images).on('change', reload);\n\n // html changes\n gulp.watch(src + '**/*.html', html).on('change', reload);\n\n // css changes\n gulp.watch(src + 'assets/sass/**/*', css).on('change', reload);\n\n // js changes\n gulp.watch(src + 'assets/js/**/*', js).on('change', reload);\n\n done();\n}", "title": "" }, { "docid": "22445e98d5a9cd61be3846c60ac33f81", "score": "0.6392145", "text": "function watch(done) {\n\tgulp.watch(paths.html, html);\n\tgulp.watch(paths.styles, buildCSS);\n\tgulp.watch(paths.scripts, buildJS);\n\tdone();\n}", "title": "" }, { "docid": "8152ea24150c2ba65a8134486048673e", "score": "0.6380017", "text": "function gulpWatch(gulp, reload) {\n gulp.watch(['app/**/*.html'], reload);\n gulp.watch([\n 'app/public/**/*.scss'\n ], ['sass:watch']);\n gulp.watch(['app/public/**/*.css'], reload);\n gulp.watch([\n 'app/public/scripts/**/*.js',\n 'app/public/images/**/*',\n 'app/public/fonts/**/*'\n ], reload);\n console.log('<-- files are watched!!!');\n}", "title": "" }, { "docid": "b35fdf7bbb85bbf700f873ffbd5bda47", "score": "0.63687813", "text": "function watchTask() {\n browserSync.init({\n server: {\n baseDir: \"./src\",\n index: \"/index.html\"\n },\n port: 8080\n });\n watch([files.cssPath, files.jsPath], series(parallel(cssTask, jsTask)));\n watch(\"./*.html\").on(\"change\", browserSync.reload);\n watch(\"./js/**/*.js\").on(\"change\", browserSync.reload);\n}", "title": "" }, { "docid": "4be97ea568c594e65305e29cd114fdd4", "score": "0.6350994", "text": "function homologWatchFiles() {\n gulp.watch('./src/templates/**/*', gulp.series(templates.homolog));\n gulp.watch('./src/assets/scss/**/*', gulp.series(css.build, ftp.homolog));\n gulp.watch('./src/assets/js/**/*', gulp.series(js.build, ftp.homolog));\n gulp.watch('./src/assets/img/**/*', gulp.series(copy.assets, ftp.homolog));\n gulp.watch('./src/assets/fonts/**/*', gulp.series(copy.assets, ftp.homolog));\n}", "title": "" } ]
7dfe42c12ac47e13821d899d69245b97
ARC4 An ARC4 implementation. The constructor takes a key in the form of an array of at most (width) integers that should be 0 <= x < (width). The g(count) method returns a pseudorandom integer that concatenates the next (count) outputs from ARC4. Its return value is a number x that is in the range 0 <= x < (width ^ count).
[ { "docid": "88094742aea8a09e2273e9225c2356cc", "score": "0.8025839", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n };\n }", "title": "" } ]
[ { "docid": "a1cf8ea9c1cf628ef135e914da92cd1a", "score": "0.8267325", "text": "function ARC4(key) {\n var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n // The empty key [] is treated as [0].\n if (!keylen) key = [\n keylen++\n ];\n // Set up S using the standard key scheduling algorithm.\n while(i < width)s[i] = i++;\n for(i = 0; i < width; i++){\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n }\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t1, r = 0, i1 = me.i, j1 = me.j, s1 = me.S;\n while(count--){\n t1 = s1[i1 = mask & i1 + 1];\n r = r * width + s1[mask & (s1[i1] = s1[j1 = mask & j1 + t1]) + (s1[j1] = t1)];\n }\n me.i = i1;\n me.j = j1;\n return r;\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n })(width);\n}", "title": "" }, { "docid": "9cad557fcd6e18fb13b814543f1b27e4", "score": "0.8245635", "text": "function ARC4(key) {\n var t, u, me = this, keylen = key.length;\n var i = 0, j = me.i = me.j = me.m = 0;\n me.S = [];\n me.c = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) { me.S[i] = i++; }\n for (i = 0; i < width; i++) {\n t = me.S[i];\n j = lowbits(j + t + key[i % keylen]);\n u = me.S[j];\n me.S[i] = u;\n me.S[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n me.g = function getnext(count) {\n var s = me.S;\n var i = lowbits(me.i + 1); var t = s[i];\n var j = lowbits(me.j + t); var u = s[j];\n s[i] = u;\n s[j] = t;\n var r = s[lowbits(t + u)];\n while (--count) {\n i = lowbits(i + 1); t = s[i];\n j = lowbits(j + t); u = s[j];\n s[i] = u;\n s[j] = t;\n r = r * width + s[lowbits(t + u)];\n }\n me.i = i;\n me.j = j;\n return r;\n };\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n me.g(width);\n}", "title": "" }, { "docid": "9cad557fcd6e18fb13b814543f1b27e4", "score": "0.8245635", "text": "function ARC4(key) {\n var t, u, me = this, keylen = key.length;\n var i = 0, j = me.i = me.j = me.m = 0;\n me.S = [];\n me.c = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) { me.S[i] = i++; }\n for (i = 0; i < width; i++) {\n t = me.S[i];\n j = lowbits(j + t + key[i % keylen]);\n u = me.S[j];\n me.S[i] = u;\n me.S[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n me.g = function getnext(count) {\n var s = me.S;\n var i = lowbits(me.i + 1); var t = s[i];\n var j = lowbits(me.j + t); var u = s[j];\n s[i] = u;\n s[j] = t;\n var r = s[lowbits(t + u)];\n while (--count) {\n i = lowbits(i + 1); t = s[i];\n j = lowbits(j + t); u = s[j];\n s[i] = u;\n s[j] = t;\n r = r * width + s[lowbits(t + u)];\n }\n me.i = i;\n me.j = j;\n return r;\n };\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n me.g(width);\n}", "title": "" }, { "docid": "9cad557fcd6e18fb13b814543f1b27e4", "score": "0.8245635", "text": "function ARC4(key) {\n var t, u, me = this, keylen = key.length;\n var i = 0, j = me.i = me.j = me.m = 0;\n me.S = [];\n me.c = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) { me.S[i] = i++; }\n for (i = 0; i < width; i++) {\n t = me.S[i];\n j = lowbits(j + t + key[i % keylen]);\n u = me.S[j];\n me.S[i] = u;\n me.S[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n me.g = function getnext(count) {\n var s = me.S;\n var i = lowbits(me.i + 1); var t = s[i];\n var j = lowbits(me.j + t); var u = s[j];\n s[i] = u;\n s[j] = t;\n var r = s[lowbits(t + u)];\n while (--count) {\n i = lowbits(i + 1); t = s[i];\n j = lowbits(j + t); u = s[j];\n s[i] = u;\n s[j] = t;\n r = r * width + s[lowbits(t + u)];\n }\n me.i = i;\n me.j = j;\n return r;\n };\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n me.g(width);\n}", "title": "" }, { "docid": "9c3a80b6296c0c4204ce9b8f1f75edd4", "score": "0.8236863", "text": "function ARC4(key) {\n var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n }\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function (count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0, i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & i + 1];\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\n }\n me.i = i;\n me.j = j;\n return r;\n })(width);\n }", "title": "" }, { "docid": "8000cfb3261665f3955689aa1c81a103", "score": "0.821549", "text": "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n (me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability discard an initial batch of values.\r\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\r\n })(width);\r\n}", "title": "" }, { "docid": "8000cfb3261665f3955689aa1c81a103", "score": "0.821549", "text": "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n (me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability discard an initial batch of values.\r\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\r\n })(width);\r\n}", "title": "" }, { "docid": "8000cfb3261665f3955689aa1c81a103", "score": "0.821549", "text": "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n (me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability discard an initial batch of values.\r\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\r\n })(width);\r\n}", "title": "" }, { "docid": "7256ae4449226487c8d58fb647ee4cd5", "score": "0.8214236", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n })(width);\n}", "title": "" }, { "docid": "7256ae4449226487c8d58fb647ee4cd5", "score": "0.8214236", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n })(width);\n}", "title": "" }, { "docid": "7256ae4449226487c8d58fb647ee4cd5", "score": "0.8214236", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n })(width);\n}", "title": "" }, { "docid": "884ea99f0b1c4bdc37df9e24ea5e09ff", "score": "0.8209706", "text": "function ARC4(key) {\n var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n }\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function (count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0, i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & i + 1];\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\n }\n me.i = i;\n me.j = j;\n return r;\n })(width);\n }", "title": "" }, { "docid": "884ea99f0b1c4bdc37df9e24ea5e09ff", "score": "0.8209706", "text": "function ARC4(key) {\n var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n }\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function (count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0, i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & i + 1];\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\n }\n me.i = i;\n me.j = j;\n return r;\n })(width);\n }", "title": "" }, { "docid": "884ea99f0b1c4bdc37df9e24ea5e09ff", "score": "0.8209706", "text": "function ARC4(key) {\n var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];\n s[j] = t;\n }\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function (count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0, i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & i + 1];\n r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];\n }\n me.i = i;\n me.j = j;\n return r;\n })(width);\n }", "title": "" }, { "docid": "52477ed6abfe6354c1db25115a644ee8", "score": "0.819964", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this,\n i = 0,\n j = me.i = me.j = 0,\n s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i,\n j = me.j,\n s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i;\n me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See https://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "title": "" }, { "docid": "53968ad26180b08a044ef30a39d6bbd0", "score": "0.8192816", "text": "function ARC4(key) {\n var t, u, me = this, keylen = key.length;\n var i = 0, j = me.i = me.j = me.m = 0;\n me.S = [];\n me.c = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) {\n key = [keylen++];\n }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n me.S[i] = i++;\n }\n for (i = 0; i < width; i++) {\n t = me.S[i];\n j = lowbits(j + t + key[i % keylen]);\n u = me.S[j];\n me.S[i] = u;\n me.S[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n me.g = function getnext(count) {\n var s = me.S;\n var i = lowbits(me.i + 1);\n var t = s[i];\n var j = lowbits(me.j + t);\n var u = s[j];\n s[i] = u;\n s[j] = t;\n var r = s[lowbits(t + u)];\n while (--count) {\n i = lowbits(i + 1);\n t = s[i];\n j = lowbits(j + t);\n u = s[j];\n s[i] = u;\n s[j] = t;\n r = r * width + s[lowbits(t + u)];\n }\n me.i = i;\n me.j = j;\n return r;\n };\n // For robust unpredictability discard an initial batch of values.\n // See http://www.rsa.com/rsalabs/node.asp?id=2009\n me.g(width);\n }", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "2b6531fb6243732df042f2d3c381e8dc", "score": "0.81781936", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}", "title": "" }, { "docid": "a42a53e193c9f76437b32f6db6ae21a1", "score": "0.8170966", "text": "function ARC4(key) {\n\t var t, keylen = key.length,\n\t me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\t\n\t // The empty key [] is treated as [0].\n\t if (!keylen) { key = [keylen++]; }\n\t\n\t // Set up S using the standard key scheduling algorithm.\n\t while (i < width) {\n\t s[i] = i++;\n\t }\n\t for (i = 0; i < width; i++) {\n\t s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n\t s[j] = t;\n\t }\n\t\n\t // The \"g\" method returns the next (count) outputs as one number.\n\t (me.g = function(count) {\n\t // Using instance members instead of closure state nearly doubles speed.\n\t var t, r = 0,\n\t i = me.i, j = me.j, s = me.S;\n\t while (count--) {\n\t t = s[i = mask & (i + 1)];\n\t r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n\t }\n\t me.i = i; me.j = j;\n\t return r;\n\t // For robust unpredictability, the function call below automatically\n\t // discards an initial batch of values. This is called RC4-drop[256].\n\t // See http://google.com/search?q=rsa+fluhrer+response&btnI\n\t })(width);\n\t}", "title": "" }, { "docid": "b400e574ece9ac07a472a11b21ff234a", "score": "0.8159814", "text": "function ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n }", "title": "" }, { "docid": "884dded5a0917677c957d1eb729f6c57", "score": "0.8051544", "text": "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability, the function call below automatically\r\n // discards an initial batch of values. This is called RC4-drop[256].\r\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\r\n };\r\n }", "title": "" }, { "docid": "884dded5a0917677c957d1eb729f6c57", "score": "0.8051544", "text": "function ARC4(key) {\r\n var t, keylen = key.length,\r\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\r\n\r\n // The empty key [] is treated as [0].\r\n if (!keylen) { key = [keylen++]; }\r\n\r\n // Set up S using the standard key scheduling algorithm.\r\n while (i < width) {\r\n s[i] = i++;\r\n }\r\n for (i = 0; i < width; i++) {\r\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\r\n s[j] = t;\r\n }\r\n\r\n // The \"g\" method returns the next (count) outputs as one number.\r\n me.g = function(count) {\r\n // Using instance members instead of closure state nearly doubles speed.\r\n var t, r = 0,\r\n i = me.i, j = me.j, s = me.S;\r\n while (count--) {\r\n t = s[i = mask & (i + 1)];\r\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\r\n }\r\n me.i = i; me.j = j;\r\n return r;\r\n // For robust unpredictability, the function call below automatically\r\n // discards an initial batch of values. This is called RC4-drop[256].\r\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\r\n };\r\n }", "title": "" }, { "docid": "abab3a9c207246dfd6a87014cf5cb770", "score": "0.8045973", "text": "function ARC4(key){var t,keylen=key.length,me=this,i=0,j=me.i=me.j=0,s=me.S=[];// The empty key [] is treated as [0].\n if(!keylen){key=[keylen++];}// Set up S using the standard key scheduling algorithm.\n while(i<width){s[i]=i++;}for(i=0;i<width;i++){s[i]=s[j=mask&j+key[i%keylen]+(t=s[i])];s[j]=t;}// The \"g\" method returns the next (count) outputs as one number.\n me.g=function(count){// Using instance members instead of closure state nearly doubles speed.\n var t,r=0,i=me.i,j=me.j,s=me.S;while(count--){t=s[i=mask&i+1];r=r*width+s[mask&(s[i]=s[j=mask&j+t])+(s[j]=t)];}me.i=i;me.j=j;return r;// For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n };}//", "title": "" }, { "docid": "893a99f3288bdafc5dcf65347d960294", "score": "0.7683596", "text": "function ARC4init(key){var i,j,t;for(i=0;i<256;++i)this.S[i]=i;for(j=0,i=0;i<256;++i)j=j+this.S[i]+key[i%key.length]&255,t=this.S[i],this.S[i]=this.S[j],this.S[j]=t;this.i=0,this.j=0}", "title": "" }, { "docid": "9becbdaff4c43c0b4f681540c938e522", "score": "0.7651924", "text": "function ARC4init(key) {\r\n var i, j, t;\r\n for(i = 0; i < 256; ++i)\r\n this.S[i] = i;\r\n j = 0;\r\n for(i = 0; i < 256; ++i) {\r\n j = (j + this.S[i] + key[i % key.length]) & 255;\r\n t = this.S[i];\r\n this.S[i] = this.S[j];\r\n this.S[j] = t;\r\n }\r\n this.i = 0;\r\n this.j = 0;\r\n}", "title": "" }, { "docid": "9becbdaff4c43c0b4f681540c938e522", "score": "0.7651924", "text": "function ARC4init(key) {\r\n var i, j, t;\r\n for(i = 0; i < 256; ++i)\r\n this.S[i] = i;\r\n j = 0;\r\n for(i = 0; i < 256; ++i) {\r\n j = (j + this.S[i] + key[i % key.length]) & 255;\r\n t = this.S[i];\r\n this.S[i] = this.S[j];\r\n this.S[j] = t;\r\n }\r\n this.i = 0;\r\n this.j = 0;\r\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7b518de96025a332b021230ea333457a", "score": "0.763883", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "7add207aff69bf51bea4a986e703b272", "score": "0.76287746", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i) {\n this.S[i] = i;\n }j = 0;\n for (i = 0; i < 256; ++i) {\n j = j + this.S[i] + key[i % key.length] & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "50e71ef1654a72f96ee773e8a36c7a82", "score": "0.7628574", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n}", "title": "" }, { "docid": "4943aa003c7c861c6e21f03ecd14fdc9", "score": "0.76190615", "text": "function ARC4init(key) {\r\n var i, j, t;\r\n for(i = 0; i < 256; ++i)\r\n this.S[i] = i;\r\n j = 0;\r\n for(i = 0; i < 256; ++i) {\r\n j = (j + this.S[i] + key[i % key.length]) & 255;\r\n t = this.S[i];\r\n this.S[i] = this.S[j];\r\n this.S[j] = t;\r\n }\r\n this.i = 0;\r\n this.j = 0;\r\n }", "title": "" }, { "docid": "93abe552278b6371e4e5b31b195ccb60", "score": "0.7594628", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "0585918ab64fc5e1651e5ecfbef8444b", "score": "0.75466424", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i) this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = j + this.S[i] + key[i % key.length] & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "20ca68befd0be32205a165150a364c11", "score": "0.7544669", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "06016d298d9cd042353e7783d812f87d", "score": "0.7544228", "text": "function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "017ce9ee2ce0d36e42854a070d4eb1f6", "score": "0.7542831", "text": "function ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}", "title": "" }, { "docid": "f4ceacfb4aea63b21ac9faada2011468", "score": "0.7531741", "text": "function ARC4init(key) {\n var i, j, t;\n for (i = 0; i < 256; ++i) this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }", "title": "" }, { "docid": "5861377669e8c968e345046278722d70", "score": "0.7491135", "text": "function ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}", "title": "" }, { "docid": "5861377669e8c968e345046278722d70", "score": "0.7491135", "text": "function ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}", "title": "" }, { "docid": "5861377669e8c968e345046278722d70", "score": "0.7491135", "text": "function ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}", "title": "" }, { "docid": "2a54fdba13318566bd068015642515e2", "score": "0.7468319", "text": "function ARC4init(key) {\n\t\t\tvar i, j, t;\n\t\t\tfor (i = 0; i < 256; ++i)\n\t\t\t\tthis.S[i] = i;\n\t\t\tj = 0;\n\t\t\tfor (i = 0; i < 256; ++i) {\n\t\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\t\tt = this.S[i];\n\t\t\t\tthis.S[i] = this.S[j];\n\t\t\t\tthis.S[j] = t;\n\t\t\t}\n\t\t\tthis.i = 0;\n\t\t\tthis.j = 0;\n\t\t}", "title": "" }, { "docid": "d97d1eb920716c01cfcd0522ba08996c", "score": "0.66917086", "text": "function Arcfour() {\n this.i = 0;\n this.j = 0;\n this.S = new Array();\n } // Initialize arcfour context from key, an array of ints, each from [0..255]", "title": "" }, { "docid": "4bd0cf7c7525a7c8b253f18d8546dfd6", "score": "0.645858", "text": "function rc4(key, data) {\n\tvar S = new Array(256);\n\tvar c = 0, i = 0; j = 0, t = 0;\n\tfor(i = 0; i != 256; ++i) S[i] = i;\n\tfor(i = 0; i != 256; ++i) {\n\t\tj = (j + S[i] + (key[i%key.length]).charCodeAt(0))%256; \n\t\tt = S[i]; S[i] = S[j]; S[j] = t;\n\t}\n\ti = j = 0; out = Buffer(data.length); \n\tfor(c = 0; c != data.length; ++c) {\n\t\ti = (i + 1)%256;\n\t\tj = (j + S[i])%256;\n\t\tt = S[i]; S[i] = S[j]; S[j] = t;\n\t\tout[c] = (data[c] ^ S[(S[i]+S[j])%256]);\n\t}\n\treturn out;\n}", "title": "" }, { "docid": "1efca7bdc328063f3a3a0953887cba3f", "score": "0.5765203", "text": "function v4() {\n\n crypto.getRandomValues(buffer);\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n buffer[6] = (buffer[6] & 0x0f) | 0x40;\n buffer[8] = (buffer[8] & 0x3f) | 0x80;\n\n var i = 0;\n return byteToHex[buffer[i++]] + byteToHex[buffer[i++]] +\n byteToHex[buffer[i++]] + byteToHex[buffer[i++]] + '-' +\n byteToHex[buffer[i++]] + byteToHex[buffer[i++]] + '-' +\n byteToHex[buffer[i++]] + byteToHex[buffer[i++]] + '-' +\n byteToHex[buffer[i++]] + byteToHex[buffer[i++]] + '-' +\n byteToHex[buffer[i++]] + byteToHex[buffer[i++]] +\n byteToHex[buffer[i++]] + byteToHex[buffer[i++]] +\n byteToHex[buffer[i++]] + byteToHex[buffer[i++]];\n}", "title": "" }, { "docid": "910954c4f82676ead8451e9c7b55db09", "score": "0.5755801", "text": "function getRandomKey() {\n return Math.floor(Math.random() * 4);\n}", "title": "" }, { "docid": "7edf8bf31fb58e260f0e4526430a18c7", "score": "0.57493204", "text": "function Generate_key() {\r\n var i, j, k = [];\r\n addEntropyTime();\r\n var seed = keyFromEntropy();\r\n \r\n var prng = new AESprng(seed);\r\n \r\n for (i = 0; i < 64; i++) {\r\n k.push(HEX[prng.nextInt(15)]);\r\n }\r\n return k.join('');\r\n}", "title": "" }, { "docid": "572c206b88ad2eda52efce456ed6bbc0", "score": "0.574499", "text": "function initRNG(packages) {\n __Crypto.__unit(\"SecureRandom.js\");\n __Crypto.__uses(\"packages.js\");\n\n /////////////////////////////////////////////\n // import\n /////////////////////////////////////////////\n // var Arcfour = __package( packages ).Arcfour;\n /////////////////////////////////////\n // implementation\n /////////////////////////////////////\n //\n // Arcfour\n //\n var Arcfour = function () {\n this.i = 0;\n this.j = 0;\n this.S = new Array();\n };\n\n // Initialize arcfour context from key, an array of ints, each from [0..255]\n Arcfour.prototype.init = function (key) {\n var i, j, t;\n for (i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for (i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n };\n\n Arcfour.prototype.next = function () {\n var t;\n this.i = (this.i + 1) & 255;\n this.j = (this.j + this.S[this.i]) & 255;\n t = this.S[this.i];\n this.S[this.i] = this.S[this.j];\n this.S[this.j] = t;\n return this.S[(t + this.S[this.i]) & 255];\n };\n\n\n // Plug in your RNG constructor here\n Arcfour.create = function () {\n return new Arcfour();\n };\n\n // Pool size must be a multiple of 4 and greater than 32.\n // An array of bytes the size of the pool will be passed to init()\n Arcfour.rng_psize = 256;\n\n //\n // SecureRandom\n //\n var rng_state = null;\n var rng_pool = [];\n var rng_pptr = 0;\n\n // Mix in a 32-bit integer into the pool\n rng_seed_int = function (x) {\n // FIXED 7 DEC,2008 http://oka.nu/\n // >>\n // rng_pool[rng_pptr++] ^= x & 255;\n // rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n // rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n // rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n rng_pool[rng_pptr] ^= x & 255;\n rng_pptr++;\n rng_pool[rng_pptr] ^= (x >> 8) & 255;\n rng_pptr++;\n rng_pool[rng_pptr] ^= (x >> 16) & 255;\n rng_pptr++;\n rng_pool[rng_pptr] ^= (x >> 24) & 255;\n rng_pptr++;\n // <<\n if (rng_pptr >= Arcfour.rng_psize) rng_pptr -= Arcfour.rng_psize;\n };\n\n // Mix in the current time (w/milliseconds) into the pool\n rng_seed_time = function () {\n rng_seed_int(new Date().getTime());\n };\n\n // Initialize the pool with junk if needed.\n pool_init = function () {\n var t;\n //if ( navigator.appName == \"Netscape\" && navigator.appVersion < \"5\" && window.crypto ) {\n // Extract entropy (256 bits) from NS4 RNG if available\n //var z = window.crypto.random(32);\n //for(t = 0; t < z.length; ++t)\n //rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n //}\n while (rng_pptr < Arcfour.rng_psize) { // extract some randomness from Math.random()\n t = Math.floor(65536 * Math.random());\n rng_pool[rng_pptr++] = t >>> 8;\n rng_pool[rng_pptr++] = t & 255;\n }\n rng_pptr = 0;\n rng_seed_time();\n //rng_seed_int(window.screenX);\n //rng_seed_int(window.screenY);\n };\n\n var rng_get_byte = function () {\n if (rng_state == null) {\n rng_seed_time();\n // rng_state = Arcfour.prng_newstate();\n rng_state = Arcfour.create();\n rng_state.init(rng_pool);\n for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n rng_pool[rng_pptr] = 0;\n rng_pptr = 0;\n //rng_pool = null;\n }\n // TODO: allow reseeding after first request\n return rng_state.next();\n };\n\n var SecureRandom = function () {};\n SecureRandom.prototype.nextBytes = function (ba) {\n for (var i = 0; i < ba.length; ++i)\n ba[i] = rng_get_byte();\n };\n\n // initialize\n pool_init();\n\n ///////////////////////////////////////////\n // export\n ///////////////////////////////////////////\n // __package( packages, path ).RNG = RNG;\n // __package( packages, path ).SecureRandom = SecureRandom;\n __Crypto.__export(packages, \"titaniumcore.crypto.SecureRandom\", SecureRandom);\n}", "title": "" }, { "docid": "ff0e56bb625986bb35a5ea3b0f139ccd", "score": "0.5730907", "text": "function generateKey() {\n var i = Math.floor(Math.random() * 4);\n return KEYS[i];\n}", "title": "" }, { "docid": "02e6d1b69d1011d2f4e2f95fc45ea56a", "score": "0.5670105", "text": "function Arcfour() {\n\t\tthis.i = 0;\n\t\tthis.j = 0;\n\t\tthis.S = new Array(256);\n\t}", "title": "" }, { "docid": "c403e200a54867f9e4fdea603a6b9878", "score": "0.5612221", "text": "function generateKey (){\n var key = keygen._({\n length: 16\n });\n\n return key;\n}", "title": "" }, { "docid": "73dd38f2e45813bf890bdf24257da211", "score": "0.5570801", "text": "function generateCTRSeq(iv, l){\n var ctr = new Uint8Array(l);\n iv = iv >>> 0;\n for(var i = 0; i < l;){\n\tt = iv;\n\tctr[i++] = t & 0xff;\n\tt = t >>> 8;\n\tctr[i++] = t & 0xff;\n\tt = t >>> 8;\n\tctr[i++] = t & 0xff;\n\tt = t >>> 8;\n\tctr[i++] = t & 0xff;\n\tiv += 1;\n }\n return ctr;\n}", "title": "" }, { "docid": "b776ffcb88095186db864eea5ace7120", "score": "0.54224515", "text": "function generateRoundKey(key){ \n // to byteArray\n var arr = [];\n for(var i = 0;i < key.length;i++){\n arr[i] = key.charCodeAt(i);\n }\n\n // count nRound\n var sum = 0;\n for(var i = 0;i < arr.length;i++){\n sum = (sum + arr[i]) % 8;\n }\n var nRound = 8 + sum;\n\n // build round key\n // init matrix\n matrix = [];\n for(var i = 0;i < nRound;i++){\n matrix[i] = [];\n for(var j = 0;j< 8;j++){\n matrix[i][j] = [];\n for(var k = 0;k < 8;k++){\n matrix[i][j][k] = 0;\n }\n }\n }\n sum = 0;\n for(var i = 0;i < nRound*8*8;i++){\n sum = (sum + arr[i % arr.length]) % 64;\n matrix[Math.floor(i / 64)][Math.floor((i % 64) / 8)][i % 8] = sum;\n } \n return matrix;\n}", "title": "" }, { "docid": "e6536b845a3f85ca7766eec7d65f5c5f", "score": "0.5376327", "text": "constructor(size = 4) {\n // default size of random prime number\n this.keyMapArray = new Array(size);\n }", "title": "" }, { "docid": "388393e8120126ccfe1727683b0e68d3", "score": "0.5348946", "text": "function generateRandKey() {\n // body...\n}", "title": "" }, { "docid": "05b9eaac8e678efaf7a3a2851619d417", "score": "0.53001934", "text": "initByArray(initKey, keyLength) {\r\n this.initSeed(19650218);\r\n let i = 1;\r\n let j = 0;\r\n let k = this.N > keyLength ? this.N : keyLength;\r\n for (; k; k--) {\r\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\r\n this.mt[i] =\r\n (this.mt[i] ^\r\n (((((s & 0xffff0000) >>> 16) * 1664525) << 16) +\r\n (s & 0x0000ffff) * 1664525)) +\r\n initKey[j] +\r\n j; /* non linear */\r\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\r\n i++;\r\n j++;\r\n if (i >= this.N) {\r\n this.mt[0] = this.mt[this.N - 1];\r\n i = 1;\r\n }\r\n if (j >= keyLength)\r\n j = 0;\r\n }\r\n for (k = this.N - 1; k; k--) {\r\n const s = this.mt[i - 1] ^ (this.mt[i - 1] >>> 30);\r\n this.mt[i] =\r\n (this.mt[i] ^\r\n (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) +\r\n (s & 0x0000ffff) * 1566083941)) -\r\n i; /* non linear */\r\n this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\r\n i++;\r\n if (i >= this.N) {\r\n this.mt[0] = this.mt[this.N - 1];\r\n i = 1;\r\n }\r\n }\r\n this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\r\n }", "title": "" }, { "docid": "edfc78f4e3103f1f714fde8ce7711f42", "score": "0.53000337", "text": "function key_expand( key )\n{\n var temp = new Array(4);\n var i, j;\n var w = new Array( 4*11 );\n\n // copy initial key stuff\n for( i=0; i<16; i++ )\n {\n w[i] = key[i];\n }\n accumulate_wordarray( \"w[0] = \", w.slice(0,4) );\n accumulate_wordarray( \"w[1] = \", w.slice(4,8) );\n accumulate_wordarray( \"w[2] = \", w.slice(8,12) );\n accumulate_wordarray( \"w[3] = \", w.slice(12,16) );\n\n // generate rest of key schedule using 32-bit words\n i = 4;\n while ( i < 44 )\t\t// blocksize * ( rounds + 1 )\n {\n // copy word W[i-1] to temp\n for( j=0; j<4; j++ )\n temp[j] = w[(i-1)*4+j];\n\n if ( i % 4 == 0)\n {\n // temp = SubWord(RotWord(temp)) ^ Rcon[i/4];\n temp = RotWord( temp );\n accumulate_wordarray( \"RotWord()=\", temp );\n temp = SubWord( temp );\n accumulate_wordarray( \"SubWord()=\", temp );\n temp[0] ^= Rcon( i>>>2 );\n accumulate_wordarray( \" ^ Rcon()=\", temp );\n }\n\n // word = word ^ temp\n for( j=0; j<4; j++ )\n w[i*4+j] = w[(i-4)*4+j] ^ temp[j];\n accumulate_wordarray( \"w[\"+i+\"] = \", w.slice( i*4, i*4+4 ) );\n\n i++;\n }\n\n return w;\n}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" }, { "docid": "2811b1216b271ba3581436c92157c4ff", "score": "0.5299341", "text": "function Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}", "title": "" } ]
89707c2a11ae32d8cb83a575665a5fb3
rest(array, [index]) returns the rest of the elements in an array. pass an index to return the values of the array from that index onward.
[ { "docid": "316876c4622243c8f99b1f8efe822351", "score": "0.76150435", "text": "function rest(array, n) {\n\tif (!Array.isArray(array)) {\n\t\treturn;\n\t}\n\n\t//if n is not provided\n\tif (!n) { return array.slice(1); }\n\n\t//slice returns the array if n < 0\n\tif (n < 0) { return [] };\n\n\treturn array.slice(n);\n}", "title": "" } ]
[ { "docid": "ef03d9438e2d06443a1f19c18c08cbf6", "score": "0.7542341", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n }", "title": "" }, { "docid": "ef03d9438e2d06443a1f19c18c08cbf6", "score": "0.7542341", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n }", "title": "" }, { "docid": "bd7d85427af82b48864a0c5f2b902598", "score": "0.75281745", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n }", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "7e9ccc3e1026238131c432bf7e8a5bec", "score": "0.75201106", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}", "title": "" }, { "docid": "d08919399dca18d5697a0a9e536bf365", "score": "0.74577993", "text": "function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n }", "title": "" }, { "docid": "01b6879356aedf43ef62c3e7c38d26d2", "score": "0.69711095", "text": "function rest(args) {\n return [].slice.call(args);\n}", "title": "" }, { "docid": "e51c443403dd0f2e81234e8b9a0ff645", "score": "0.6822548", "text": "function rest() {\n return Array.prototype.slice.call(arguments, 1);\n }", "title": "" }, { "docid": "abcbbcfc3d46effb4a0a99bfc34d083d", "score": "0.65325683", "text": "function tail(array) {\n\t\treturn Array.prototype.slice.call(array, 1);\n\t}", "title": "" }, { "docid": "66aaae1900d90aa448126579671a6e31", "score": "0.6258185", "text": "function rest(firstArg, secondArg, ...args){\n console.log(firstArg)\n console.log(secondArg)\n console.log(args)\n console.log(args[0])\n}", "title": "" }, { "docid": "5965557049161c874a3e1f9d2e6c5d1b", "score": "0.6158774", "text": "function remove(array, index) {\n // Sets up an array up to the specified index\n // I.e. the index value you want to remove :)\n return array.slice(0, index)\n // Adds on the continuing values AFTER\n // the value you skipped in the array\n // you've specified.\n .concat(array.slice(index + 1));\n}", "title": "" }, { "docid": "7143c8d2f363374308cc3e409df5abba", "score": "0.6123382", "text": "function rest(func, start) {\n return (0, _overRest3.default)(func, start, _identity2.default);\n}", "title": "" }, { "docid": "8c56ea92f9191180384f11aa0b7662f3", "score": "0.6106432", "text": "function last(array,n=1){\n return array.slice(-n)\n}", "title": "" }, { "docid": "c346fb85955c5ba1e587beca6a42ab42", "score": "0.6014584", "text": "function unshift(array, ...rest) { \n return rest.concat(array);\n}", "title": "" }, { "docid": "8d86ade0c7a95a8a1c38c4c73d0bf50b", "score": "0.6006656", "text": "function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}", "title": "" }, { "docid": "c9fde1615c83551aa4b3215ce9297aa4", "score": "0.5996349", "text": "function remove(array, index) {\r\n return array.slice(0, index).concat(array.slice(index + 1));\r\n}", "title": "" }, { "docid": "1b17baae5b5c38ea69a239ad326d4970", "score": "0.59921235", "text": "function rest(func, start) {\n\t return (0, _overRest3.default)(func, start, _identity2.default);\n\t}", "title": "" }, { "docid": "842a134fd9a456c3cf312b95e523118f", "score": "0.5969871", "text": "function slice(array,start = 0,end = array.length){\n\treturn array.slice(start,end);\n}", "title": "" }, { "docid": "3e38e639968417560ae8f85d97619237", "score": "0.5965437", "text": "function sliceArray(array) {\n return array.slice(1);\n}", "title": "" }, { "docid": "5bbc9c84b63f8686023e9e98b7883349", "score": "0.5965038", "text": "function tail(array){\n\tarray.splice(0,1);\n\treturn array\n}", "title": "" }, { "docid": "298629bc175c6a290219b6216d13e977", "score": "0.5859553", "text": "function rest(func, start) {\n\t return overRest$1(func, start, identity);\n\t}", "title": "" }, { "docid": "298629bc175c6a290219b6216d13e977", "score": "0.5859553", "text": "function rest(func, start) {\n\t return overRest$1(func, start, identity);\n\t}", "title": "" }, { "docid": "298629bc175c6a290219b6216d13e977", "score": "0.5859553", "text": "function rest(func, start) {\n\t return overRest$1(func, start, identity);\n\t}", "title": "" }, { "docid": "d71ca18e695890a18b78bbc5d35d4763", "score": "0.5790055", "text": "function tail(array, n) {\n if (n === void 0) { n = 0; }\n return array[array.length - (1 + n)];\n}", "title": "" }, { "docid": "d71ca18e695890a18b78bbc5d35d4763", "score": "0.5790055", "text": "function tail(array, n) {\n if (n === void 0) { n = 0; }\n return array[array.length - (1 + n)];\n}", "title": "" }, { "docid": "6c0afcf4aea53d41e1450897ed6ff023", "score": "0.5789367", "text": "function tail(array) {\n var [a, ...b] = [array];\n return b; \n}", "title": "" }, { "docid": "804fb15bf8055e821e95a6d894f4ea97", "score": "0.57828313", "text": "function rest(func, start) {\n return overRest$1(func, start, identity);\n }", "title": "" }, { "docid": "e73e255c7d18d75054bdac64b89e54cb", "score": "0.5782577", "text": "function tail(theArray){\n // return array\n const returnArr = [];\n // loop over theArray starting at index 1, and push values to returnArr\n for (let i=1; i<theArray.length; i++) {\n returnArr.push(theArray[i]);\n }\n return returnArr;\n}", "title": "" }, { "docid": "b8a336c65eb438456e833059386f5d13", "score": "0.5770016", "text": "function last(array, n) {\n\tif (!Array.isArray(array)) {\n\t\treturn;\n\t}\n\n\t//if n is not provided\n\tif (!n) { return array[array.length - 1]; }\n\n\t//slice returns the array if n < 0\n\tif (n < 0) { return [] };\n\n\treturn array.slice(array.length - n);\n}", "title": "" }, { "docid": "bf48b0e86d3039d4599053b55dad0a78", "score": "0.5746587", "text": "function slasherSlice(arr, howMany) {\n // it doesn't always pay to be first\n // well, now my head is chopped off >:(\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "cdf6a0212f4c977a5941ce0bb0166272", "score": "0.57428837", "text": "function sliceArrayFromRight(arr, startIndex, loop) {\n if (!loop) {\n startIndex += 1;\n arr = arr.slice(0, max(0, startIndex));\n }\n return arr;\n }", "title": "" }, { "docid": "f5a9271b27e5aa41b1d32bd58ee9870f", "score": "0.5742774", "text": "function exceptLast(array) {\n\treturn array.slice(0, array.length - 1);\n}", "title": "" }, { "docid": "d86b5f0c1f13333226f56e7c09c99cef", "score": "0.5732042", "text": "function slice(array, start = 0, end = array.length) {\n return array.slice(start, end);\n}", "title": "" }, { "docid": "2e61ab32bd4a68ad435aa862d0f08880", "score": "0.57141995", "text": "function tail(array, n) {\n if (n === void 0) {\n n = 0;\n }\n\n return array[array.length - (1 + n)];\n}", "title": "" }, { "docid": "bfa72dcd34adf3f063f57baabfe6da53", "score": "0.5706082", "text": "function initial(array) {\n return array.slice(0, array.length - 1);\n}", "title": "" }, { "docid": "bfa72dcd34adf3f063f57baabfe6da53", "score": "0.5706082", "text": "function initial(array) {\n return array.slice(0, array.length - 1);\n}", "title": "" }, { "docid": "45d4dd03e4f5a61928c9374e859a34f5", "score": "0.5685904", "text": "function restArray(numvalue,...numArray) \n{\n console.log(\"numvalue:\",numvalue);\n numArray.forEach(element=>console.log(element));\n}", "title": "" }, { "docid": "f1a77203f322287681a76ee2b182f03e", "score": "0.56803524", "text": "function take(x, array) {\n\t\treturn Array.prototype.slice.call(array, 0, x);\n\t}", "title": "" }, { "docid": "7545d8a4d25cbb3e40692c59c1a039d6", "score": "0.56762505", "text": "function last(array, i = 0) {\n return array[array.length - 1 - i];\n}", "title": "" }, { "docid": "0c5af47f87be730e24d510f6adb6a74a", "score": "0.56628543", "text": "function getRest(a, b) {\n\n}", "title": "" }, { "docid": "2dd253e63e4831a64fc08deed9252c8d", "score": "0.56581265", "text": "function slasher(arr, howMany) {\n var remain;\n remain = arr.slice(howMany);\n return remain;\n}", "title": "" }, { "docid": "09b1c80b3a40e6506178971f0fb355b6", "score": "0.56436", "text": "function last(array, n, guard) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return rest(array, Math.max(0, array.length - n));\n } // Returns everything but the first entry of the array. Especially useful on", "title": "" }, { "docid": "782560a06545c52e6e6f8c02bfc2d25f", "score": "0.56150913", "text": "function initial(array, n) {\n\t//proceeds only if the first argument is an array\n\tif (!Array.isArray(array)) {\n\t\treturn;\n\t}\n\n\t//if n is not provided\n\tif (!n) { return array.slice(0, -1); }\n\n\tif (n < 0) { return []};\n\n\treturn array.slice(0, -n);\n}", "title": "" }, { "docid": "338c47ba4c5ba06f9716da20ffb4981c", "score": "0.5607268", "text": "function slasher(arr, howMany) {\n // it doesn't always pay to be first\n return arr.slice(howMany,arr.length+1);\n}", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "338fa09f663e9be3b25457b5550e3523", "score": "0.55987453", "text": "function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }", "title": "" }, { "docid": "de1cc715df7c025050d8b306172c2613", "score": "0.55895257", "text": "function nth(list, index) {\n\n var pointer = list;\n\n for (var i = 0; i < index; i++) {\n\n pointer = pointer.rest;\n }\n\n return pointer.value;\n}", "title": "" }, { "docid": "3d70a92292e563fa7d4dea0b5ce1bb94", "score": "0.55832654", "text": "function slasher3(arr, howMany) {\r\n return arr.slice(howMany);\r\n}", "title": "" }, { "docid": "398d87ebec4bf3e7667ce5323873f56f", "score": "0.55830157", "text": "function getArgsRest(...args) {\n return args.reduce(function (res, item) {\n return res+item;\n })\n}", "title": "" }, { "docid": "0262dd030952d087d5082628325412dd", "score": "0.5572403", "text": "function removeAt(array, index) {\r\n\t var j = index | 0;\r\n\t if (j < 0 || j >= array.length) {\r\n\t return void 0;\r\n\t }\r\n\t var value = array[j];\r\n\t for (var i = j + 1, n = array.length; i < n; ++i) {\r\n\t array[i - 1] = array[i];\r\n\t }\r\n\t array.length -= 1;\r\n\t return value;\r\n\t}", "title": "" }, { "docid": "538c456b7740f1eee01282dec4f5c733", "score": "0.55693585", "text": "function _restParam(func, startIndex) {\n\t startIndex = startIndex == null ? func.length - 1 : +startIndex;\n\t return function() {\n\t var length = Math.max(arguments.length - startIndex, 0);\n\t var rest = Array(length);\n\t for (var index = 0; index < length; index++) {\n\t rest[index] = arguments[index + startIndex];\n\t }\n\t switch (startIndex) {\n\t case 0: return func.call(this, rest);\n\t case 1: return func.call(this, arguments[0], rest);\n\t }\n\t // Currently unused but handle cases outside of the switch statement:\n\t // var args = Array(startIndex + 1);\n\t // for (index = 0; index < startIndex; index++) {\n\t // args[index] = arguments[index];\n\t // }\n\t // args[startIndex] = rest;\n\t // return func.apply(this, args);\n\t };\n\t }", "title": "" }, { "docid": "538c456b7740f1eee01282dec4f5c733", "score": "0.55693585", "text": "function _restParam(func, startIndex) {\n\t startIndex = startIndex == null ? func.length - 1 : +startIndex;\n\t return function() {\n\t var length = Math.max(arguments.length - startIndex, 0);\n\t var rest = Array(length);\n\t for (var index = 0; index < length; index++) {\n\t rest[index] = arguments[index + startIndex];\n\t }\n\t switch (startIndex) {\n\t case 0: return func.call(this, rest);\n\t case 1: return func.call(this, arguments[0], rest);\n\t }\n\t // Currently unused but handle cases outside of the switch statement:\n\t // var args = Array(startIndex + 1);\n\t // for (index = 0; index < startIndex; index++) {\n\t // args[index] = arguments[index];\n\t // }\n\t // args[startIndex] = rest;\n\t // return func.apply(this, args);\n\t };\n\t }", "title": "" }, { "docid": "fa3ce40a2a652faef099720a0ecb4079", "score": "0.55671245", "text": "function nth(list, index) {\n\tif (index == 0 && list != null) {\n\t\treturn list.value;\t\n\t} else if (list == null){\n\t\treturn undefined;\n\t} else {\n\t\treturn nth(list.rest, index-1);\n\t}\n}", "title": "" }, { "docid": "a331ddad99ff1fd8e2a4a072abe6edf9", "score": "0.5565424", "text": "function slasher(arr, howMany) {\n // it doesn't always pay to be first\n return arr.slice(howMany);\n}", "title": "" }, { "docid": "cb11c54757b866715ef4cf6fca865f8a", "score": "0.55635875", "text": "function _restParam(func, startIndex) {\n\t startIndex = startIndex == null ? func.length - 1 : +startIndex;\n\t return function () {\n\t var length = Math.max(arguments.length - startIndex, 0);\n\t var rest = Array(length);\n\t for (var index = 0; index < length; index++) {\n\t rest[index] = arguments[index + startIndex];\n\t }\n\t switch (startIndex) {\n\t case 0:\n\t return func.call(this, rest);\n\t case 1:\n\t return func.call(this, arguments[0], rest);\n\t }\n\t // Currently unused but handle cases outside of the switch statement:\n\t // var args = Array(startIndex + 1);\n\t // for (index = 0; index < startIndex; index++) {\n\t // args[index] = arguments[index];\n\t // }\n\t // args[startIndex] = rest;\n\t // return func.apply(this, args);\n\t };\n\t }", "title": "" }, { "docid": "02870e863bda572f57ba458936281374", "score": "0.55609214", "text": "function removeElementFromBeginningOfArray(array) {\n return array.slice(1)\n}", "title": "" }, { "docid": "8118cdc66460713f5ecbd6791e633e7e", "score": "0.5560009", "text": "function nth(list, index) {\n if (!list) return undefined;\n else if (index === 0) return list.value;\n else return nth(list.rest, index - 1);\n}", "title": "" }, { "docid": "8f84e8d7cf917056e0a2616f3a6f0886", "score": "0.5534431", "text": "function returnLastElementSub(arr) {\n console.log(arr.pop(3)[2])\n}", "title": "" }, { "docid": "79f2fa39fb199871c6eee473ce5ae42b", "score": "0.55288535", "text": "function slice(array, start, end) {\r\n if (end === void 0) { end = array.length; }\r\n var output = new Array(end - start);\r\n for (var i = start; i < end; ++i) {\r\n output[i - start] = array[i];\r\n }\r\n return output;\r\n}", "title": "" }, { "docid": "62b7faee6268e742e1de7e43bfd4b971", "score": "0.55228513", "text": "function init(array) {\n\t\treturn Array.prototype.slice.call(array, 0, -1);\n\t}", "title": "" }, { "docid": "212a4a128170e1b4e9edcc3b8363b295", "score": "0.5513074", "text": "function addRestedPiece(arr, restedArr){\n let newArr = [];\n for(let i = 0; i < arr.length; i++){\n newArr.push(arr[i]);\n }\n restedArr.push(newArr);\n }", "title": "" }, { "docid": "b3539faf32376fab1e10044ae52382da", "score": "0.5506676", "text": "function removeFront(array) {\n _ch_checkArgs(arguments, 1, \"removeFront(array)\");\n return array.shift();\n}", "title": "" }, { "docid": "060473a3f76fc0b35339787b178746d0", "score": "0.5504955", "text": "function slasher(arr, howMany) {\n\treturn arr.slice(howMany);\n}", "title": "" }, { "docid": "979f8b4d83485cf58f0007379b530135", "score": "0.54994786", "text": "function slasher(arr, howMany) {\n return arr.slice(howMany, arr.length);\n}", "title": "" }, { "docid": "3de9ffa70470b54507c6e4124b65dbb9", "score": "0.5494437", "text": "function getAllElementsButLast(array) {\n//return array.pop();//last element of array deleted\n//pop method will return element deleted \narray.pop();\nreturn array;//remaining elements//[1,2,3] \n\n}", "title": "" }, { "docid": "455a29c39f51d48c916c40a53bb427d3", "score": "0.5486736", "text": "function removeElementFromBeginningOfArray(array) {\n array = array.slice(1)\n return array\n}", "title": "" }, { "docid": "00325ce819423416e2a351426c021509", "score": "0.5485799", "text": "function slice(array, startIndex, endIndex) {\n var result = [];\n\n for (var i = startIndex; i < endIndex; i += 1) {\n push(result, array[i]);\n }\n\n return result;\n}", "title": "" }, { "docid": "f9714f6b006766991b61fdf22430c8f7", "score": "0.5485621", "text": "function popFront(arr){\n var val = arr[0];\n for (var i=0; i<arr.length; i++){\n arr[i] = arr[i+1];\n }\n arr.length-=1;\n return val;\n}", "title": "" }, { "docid": "864eac0fc2cab328e3b984efb7544e38", "score": "0.5482465", "text": "function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n } // Get the last element of an array. Passing **n** will return the last N", "title": "" }, { "docid": "cdcbe6d2f0a9edf4bbc4cbf47a7bfc98", "score": "0.5474724", "text": "function slice(arr,index1,index2) {\n var newarr = [];\n if(arr.length < index2){\n index2 = arr.length;\n }\n if(index1 < index2){\n for(var i =0,k=index1; k<index2; i++,k++){\n newarr[i] = arr[k];\n }\n }\n if(index2 == undefined){\n for(var i =0,k=index1; k<arr.length; i++,k++){\n newarr[i] = arr[k];\n }\n }\n return newarr;\n}", "title": "" }, { "docid": "638a7f70c99f09adacd5c5ee93f65592", "score": "0.5465671", "text": "function removeAt(array, index) {\n var j = index | 0;\n if (j < 0 || j >= array.length) {\n return void 0;\n }\n var value = array[j];\n for (var i = j + 1, n = array.length; i < n; ++i) {\n array[i - 1] = array[i];\n }\n array.length -= 1;\n return value;\n}", "title": "" }, { "docid": "87fbca490a9ec57602a95820816735ea", "score": "0.5463559", "text": "function sliceTo(arr, ind) {\n // null is excepted\n return Array.from({\n length: ind\n }, (bb, ii) => arr[ii] ? arr[ii] : 0);\n}", "title": "" }, { "docid": "45e258fc1f38fce2b306c9aa90ec89d4", "score": "0.54451996", "text": "function initial(arr, n){\n \n // if n is defined then pass n to exclude the last n elements from the result \n return n === undefined ? arr.slice(0,arr.length-1) : arr.slice(0,-n); \n \n}", "title": "" }, { "docid": "61edf8d583281a66daa11d7e8988fefc", "score": "0.5432812", "text": "function nth(myList, index) {\n if (index === 0) {\n return myList.value;\n } else {\n return nth(myList.rest, index-1);\n }\n}", "title": "" }, { "docid": "7019b2e050513d06dd1be556e04f5f15", "score": "0.54292566", "text": "function removeElementFromEndOfArray(array) {\n return array.slice(0, (array.length - 1))\n}", "title": "" }, { "docid": "bc8934be46ba207301301373cbeca4c3", "score": "0.54283345", "text": "function lastNOf(arr, length) {\n var index = arr.length - length;\n if (index < 0) {\n index = 0;\n }\n\n return arr.slice(index);\n}", "title": "" }, { "docid": "605efa67e4c528b66d54015546e0b478", "score": "0.5421632", "text": "function get(arr, i) {\n return arr[arr.length - i] || 0;\n}", "title": "" }, { "docid": "c37746f96405a7b548799d5a9149d036", "score": "0.54160553", "text": "function get_combined (array, index) {\n\tif (index.length == 1) {\n\t\treturn array[index];\n\t}\n\t\n\telse {\n\t\tcombined = [];\n\t\tfor (var i=0; i<index.length; i++) {\n\t\t\tcombined = combined.concat(array[index[i]]);\n\t\t}\n\t\treturn combined;\t\n\t}\n}", "title": "" }, { "docid": "03e572ecc50fa97bafb0762464e210a8", "score": "0.5411869", "text": "last(array, n, guard) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return Array.prototype.slice(array, n == null || guard ? 1 : n);\n }", "title": "" }, { "docid": "786541e36ee92cd390ab64597fa55f7b", "score": "0.540972", "text": "function takeRight(array, count) {\n var newArray = [];\n for (var i = array.length - count; i < array.length; i++) {\n if (count < array.length) {\n newArray.push(array[i]);\n }\n\n }\n return newArray;\n}", "title": "" }, { "docid": "9f6f4afe05fa6e6c61bc00d12704c051", "score": "0.54097027", "text": "function take(n, array) {\n return array.slice(0, n);\n}", "title": "" } ]
4d315ac466962c2c88cc959fdcc0c895
Compara os itens do carrinho com os do estoque, para controlar a quantidade de produtos
[ { "docid": "0a907a046bc75bad89920e55955f6926", "score": "0.70075554", "text": "compararEstoque() {\n const itemsCarrinho = this.carrinho.filter( ({id}) => id === this.produto.id )\n this.produto.estoque -= itemsCarrinho.length\n }", "title": "" } ]
[ { "docid": "032be4be2476560b7298eeda316f067d", "score": "0.6701599", "text": "function comprar(objeto) {\n\n //comrpar con dinero suficiente\n if (galletas >= precioProducto[objeto]) {\n inventario[objeto]++;\n galletas -= precioProducto[producto];\n\n } else {\n console.log(\"No tienes suficiente dinero\");\n }\n\n}", "title": "" }, { "docid": "21206c9fa71d7b18206db2ff064a2a67", "score": "0.6289347", "text": "function valoresSemestresAnteriores() {\n sumaNotasCreditos = 0;\n creditosAprovados = 0;\n creditosTotales = 0;\n for (let s = 1; s < semestre; s++) {\n let semestre = notasSemestres[s];\n for (const sigla in semestre) {\n let ramo = all_ramos[sigla];\n sumaNotasCreditos += semestre[sigla] * ramo.creditos;\n creditosTotales += ramo.creditos;\n if (semestre[sigla] > 54)\n creditosAprovados += ramo.creditos;\n }\n }\n}", "title": "" }, { "docid": "ef5ce7bc671771d82454310ce29e767f", "score": "0.622847", "text": "function comparar(){\t\r\n \r\n cartel.innerHTML = \"Buscando jugadores en el 11 ideal\";\r\n \r\n \r\n for(columna=1; columna<nombre.length; columna++)\r\n {\r\n jugadores[columna][0]=0;\r\n for(fila=1; fila<perfecto.length; fila++)\r\n {\r\n for(ro=1; ro<perfecto.length; ro++)\r\n { \r\n // alert(nombre[columna]+\"-\"+jugadores[columna][fila]+\"-\"+perfecto[ro]);\r\n if(jugadores[columna][fila]==perfecto[ro]){\r\n \r\n // alert(nombre[columna]+\" tiene a \"+jugadores[columna][fila]+\" en el 11 ideal\");\r\n \r\n jugadores[columna][0]=jugadores[columna][0]+1;\r\n \r\n } \r\n }\r\n }\r\n \r\n }\r\n \r\n calculo(); \r\n \r\n} //funcion compara ", "title": "" }, { "docid": "d55bdb25aad7c9f4f1e68e372ae948c3", "score": "0.6137395", "text": "function Comportement(risque){\n\t\t this.risque = risque;\n\t\t this.probaDes = [0,2.77,5.55,8.33,11.1,13.8,16.7,13.8,11.1,8.33,5.55,2.77];\n\t\t \n\t\t this.calculMargeMontant = function(joueur,cout){\n\t\t\t if(cout/joueur.montant < this.risque){\n\t\t\t\t return 1;\n\t\t\t }\n\t\t\t return false;\n\t\t }\n\t\t \n\t\t /* Se base sur les prochaines a risque qui arrive, renvoi un pourcentage */\n\t\t this.calculRisque = function(joueur){\n\t\t\t // On calcul le risque de tomber sur une case cher.\n\t\t\t // On considere un risque quand on est au dessus de risque * montant d'amande)\n\t\t\t var position = joueur.pion.position;\n\t\t\t var etat = joueur.pion.etat;\n\t\t\t var stats = 0;\n\t\t\t for(var i = 1 ; i <= 12 ; i++){ \n\t\t\t\t var pos = getNextPos(etat,position);\n\t\t\t\t etat = pos.etat;\n\t\t\t\t position = pos.position;\n\t\t\t\t var fiche = fiches[etat + \"-\" + position];\n\t\t\t\t if(fiche!=null && fiche.getLoyer!=null && (fiche.getLoyer()>(joueur.montant * this.risque))){\n\t\t\t\t\t stats+=this.probaDes[i-1];\n\t\t\t\t }\n\t\t\t }\n\t\t\t return stats;\n\t\t }\n\t\t \n\t\t // calcul le loyer le plus fort du joueur (et n'appartenant pas au joueur)\n\t\t this.plusFortLoyer = function(joueur){\n\t\t\t var max = 0;\n\t\t\t for(var f in fiches){\n\t\t\t\t if(f.getLoyer!=null && f.joueurPossede!=null \n\t\t\t\t\t && !joueur.equals(f.joueurPossede) && f.getLoyer() > max){\n\t\t\t\t\t max = f.getLoyer();\n\t\t\t\t }\n\t\t\t }\n\t\t\t return max;\n\t\t }\n\t }", "title": "" }, { "docid": "2679b9f5c52ed2795b83fdcc998c8728", "score": "0.59976566", "text": "function comprarProducto2(id){\r\n\r\n\t//funcion que toma el id y verifica si es importante para la compra\r\n\tvar isInShopList = isInList(id);\r\n\t//funcion que verifica si ya se compro la cantidad deseada de ese id\r\n\r\n\tvar precioProducto = getPriceById(id);\r\n\tvar total_compra_aux = total_compra - precioProducto;\r\n\ttotal_compra_aux = total_compra_aux.toFixed(2);\r\n\r\n\tif(isInShopList){\r\n\t\tvar isGoal = isGoalAchieved(id,compras2);\r\n\t\tif(!isGoal){\r\n\t\t\t//como no se ha logrado el objetivo se actualiza el precio\r\n\t\t\ttotal_compra = total_compra_aux;\r\n\t\t\tactualizarPrecio(total_compra);\r\n\t\t}else{\r\n\t\t\t/*\r\n\t\t\tya que el objetivo de ese tipo de producto ya se cumplio se inserta el\r\n\t\t\tequivalente de ese id de la lista de compras\r\n\t\t\t*/\r\n\t\t\tvar res = id.split(\"-\");\r\n\t\t\tfor( var i =0; i < listaCompras.length; i++){\r\n\t\t\t\tvar objective = listaCompras[i];\r\n\t\t\t\tvar res2 = listaCompras[i].split(\"-\");\r\n\t\t\t\tif(res[0] == res2[0]){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttotal_compra = total_compra_aux;\r\n\t\t\tactualizarDatos(objective,total_compra);\r\n\t\t}\r\n\t}else{\r\n\t\t//no es necesario realizar esa compra solo se disminuye dinero\r\n\t\ttotal_compra = total_compra_aux;\r\n\t\tactualizarPrecio(total_compra);\r\n\t}\r\n}", "title": "" }, { "docid": "71475cd7b8239335999c07c7ec52b12b", "score": "0.59966475", "text": "function diferenciaQuincenas(){\n \n function primeraQuincena(){\n const sumaPrimeraQuincena = primeraQuincenaDiario.reduce(\n function (valorAcumulado = 0, valorActual) {\n return valorAcumulado + valorActual;\n }\n );\n return sumaPrimeraQuincena;\n };\n\n function segundaQuincena(){\n const sumaSegundaQuincena = pricesGdl.reduce(\n function (valorAcumulado = 0, valorActual) {\n return valorAcumulado + valorActual;\n }\n );\n return sumaSegundaQuincena;\n };\n\n return segundaQuincena() / primeraQuincena();\n}", "title": "" }, { "docid": "049aeacda3f1096ae75122ebcc940b81", "score": "0.59692425", "text": "function compareProductQty(){\n if(inquirerProducyQty > currentQtyProduct)\n console.log(\"Not enough product qty on hand ! \" + \"The requested \" + inquirerProducyQty + \"units is more than current stock of \" + currentQtyProduct + \" units !\");\n else{\n consumeProduct(currentProductID,inquirerProducyQty);\n console.log(\"Thank you for your purchase ! The total of your invoice is : $ \" + (inquirerProducyQty * currentPriceProduct).toFixed(2) );\n console.log(\"------------------------------\");\n }\n}", "title": "" }, { "docid": "7da2de4b21c7330f68d9a95ded2fca52", "score": "0.5870162", "text": "function calDescuentos() {\n document.querySelectorAll('[id^=\"descuento\"]').forEach(item => {\n let idverdura = item.id.split(\"_\");\n let idsubtotal = '[id=\"subtotal_'+idverdura[1]+'\"]';\n let iddescuento = '[id=\"descuento_'+idverdura[1]+'\"]';\n let idiva = '[id=\"iva_'+idverdura[1]+'\"]';\n let calculaSubtotal = 0;\n let calculaDescuento = 0;\n let calculaIva = 0;\n calculaSubtotal=parseInt(document.querySelector(idsubtotal).innerText);\n // aplicamos el criterio que si el total de productos es mayor o igual a 5\n // se aplica el descuento\n if(parseInt(sumCantidades) >= 5){\n calculaDescuento = calculaSubtotal-(calculaSubtotal*porcDescuento);\n calculaIva = calculaDescuento+(calculaDescuento*porcIva);\n }else{\n calculaIva = calculaSubtotal+(calculaSubtotal*porcIva);\n }\n document.querySelector(iddescuento).innerText=calculaDescuento.toFixed(2);\n document.querySelector(idiva).innerText=calculaIva.toFixed(2);\n\n // Cambiamos el estilo de las celdas correspondientes si el total de productos\n // es mayor o igual a 5\n if((calculaDescuento>0) && (calculaSubtotal>0)){\n document.querySelector(idsubtotal).parentElement.className=\"descuentoGreen\";\n document.querySelector(iddescuento).parentElement.className=\"descuentoGreen\";\n document.querySelector(idiva).parentElement.className=\"descuentoGreen\";\n }\n else if((calculaDescuento==0) && (calculaSubtotal>0)){\n document.querySelector(idsubtotal).parentElement.className=\"ivaBlue\";\n document.querySelector(iddescuento).parentElement.className=\"ivaBlue\";\n document.querySelector(idiva).parentElement.className=\"ivaBlue\";\n }else{\n document.querySelector(idsubtotal).parentElement.className=\"cellDer\";\n document.querySelector(iddescuento).parentElement.className=\"cellDer\";\n document.querySelector(idiva).parentElement.className=\"cellDer\";\n }\n })\n}", "title": "" }, { "docid": "f0bd779b917a64c51ed4a95cd85a8dfc", "score": "0.5793769", "text": "function cestaCarrito(cantidadProductos){\n\n /*=============================================\n SI HAY PRODUCTOS EN EL CARRITO\n =============================================*/\n\n if(cantidadProductos != 0){\n \n var cantidadItem = $(\".cuerpoCarrito .cantidadItem\");\n\n var arraySumaCantidades = [];\n \n for(var i = 0; i < cantidadItem .length; i++){\n\n var cantidadItemArray = $(cantidadItem[i]).val();\n arraySumaCantidades.push(Number(cantidadItemArray));\n \n }\n \n function sumaArrayCantidades(total, numero){\n\n return total + numero;\n\n }\n\n var sumaTotalCantidades = arraySumaCantidades.reduce(sumaArrayCantidades);\n $(\".cantidadCesta\").html(sumaTotalCantidades);\n localStorage.setItem(\"cantidadCesta\", sumaTotalCantidades);\n\n }\n\n}", "title": "" }, { "docid": "30d34c7e90182945776bf66fa425642e", "score": "0.5654994", "text": "function calcularConsumo(item) {\n var cant1 = $(\"#requisado\" + item).val();\n var cant2 = $(\"#piso\" + item).val();\n if (cant2 > cant1) {\n mensajeAlerta('El requisado no puede ser menor a cantidad piso');\n } else {\n var consumo = cant1 - cant2;\n $('#consumo' + item).val(consumo);\n };\n}", "title": "" }, { "docid": "357e1c2e7b4cc6aca373eb6c7d536f55", "score": "0.5647537", "text": "function compareInv(product, units) {\n var query = 'SELECT * FROM products WHERE item_id = ?';\n connection.query(query, [product], function(err, res) {\n if (units < res[0].stock_quantity) {\n var unitRemainder = res[0].stock_quantity - units;\n var unitSales = res[0].price * units + res[0].product_sales;\n updateTable(product, unitRemainder, unitSales);\n } else {\n console.log('Insufficient quantity available for purchase.');\n reset();\n }\n });\n}", "title": "" }, { "docid": "5a5ff1d63fb38ed8ddfd982491279d9a", "score": "0.5628679", "text": "acelera(quantidade) {\n var velocidadeNova = this.velocidadeAtual + quantidade;\n\n if (velocidadeNova < this.velocidadeMaxima) {\n this.velocidadeAtual = velocidadeNova;\n console.log(this.velocidadeAtual + \"Marcha usada : \" + carro.pegaMarcha());\n \n } else {\n this.velocidadeAtual = quantidade;\n console.log(\"Recomendavel que diminua a velocidade do Fuscão para velocidade de \" \n + this.velocidadeMaxima + 'KM, maxima permitida. Atualmente sua velocidade é de ' + this.velocidadeAtual +\n 'KM e o motor do fuscão pode fundir. Marcha usada: ' + carro.pegaMarcha()\n );\n }\n }", "title": "" }, { "docid": "124a693e9f3d2b8f4204558b4b172223", "score": "0.562163", "text": "function cercaPrimoTreno(stz_Partenza, arrTreni){\n var count = -1;\n var numTreno;\n var minOra;\n var minMinuti;\n var postiRimasti;\n do{\n count++\n var oraConversion = arrTreni[count].orarioPartenza.split(\":\");\n //converto le ore e i minuti in numeri interi\n minOra = parseInt(oraConversion[0]);\n minMinuti = parseInt(oraConversion[1]);\n numTreno = arrTreni[count].id_Number;\n }while((stz_Partenza != arrTreni[count].staz_Partenza) && (count != arrTreni.length))\n //Separo le ore dai minuti\n var orario = \"\";\n for (var i = 0; i < (arrTreni.length); i++) {\n if((arrTreni[i].staz_Partenza == stz_Partenza) && (arrTreni[i].postiLiberi != 0)){\n var oraConversion = arrTreni[i].orarioPartenza.split(\":\");\n var oraConvertita = parseInt(oraConversion[0]);\n var minutiConvertiti = parseInt(oraConversion[1]);\n if(oraConvertita < minOra){\n minOra = oraConvertita;\n minMinuti = minutiConvertiti;\n numTreno = arrTreni[i].id_Number;\n postiRimasti = arrTreni[i].postiLiberi;\n }\n else if(oraConvertita == minOra) {\n if(minutiConvertiti < minMinuti){\n minMinuti = minutiConvertiti;\n numTreno = arrTreni[i].id_Number;\n postiRimasti = arrTreni[i].postiLiberi;\n }\n }\n }\n }\n var primoTreno = {};\n primoTreno.id_Treno = numTreno;\n if(minOra < 10){\n orario += \"0\" + minOra;\n }else{\n orario = minOra;\n }\n if(minMinuti < 10){\n orario += \":\" + \"0\" + minMinuti;\n }\n else{\n orario += \":\" + minMinuti;\n }\n primoTreno.orario = orario;\n primoTreno.postiRimasti = postiRimasti;\n return primoTreno;\n}", "title": "" }, { "docid": "59a8416ffafd0354f0c882ea5fe76211", "score": "0.56150764", "text": "function contarCartas(jugador) {\n var contador = 0;\n\n //Si recibe el parametro jugador, suma los numeros de las cartas del arreglo jug1\n if (jugador == \"jugador\") {\n for (i = 0; i < jug1.length; i++) {\n contador += jug1[i].numero;\n }\n\n //Si recibe el parametro casa, suma los numeros de las cartas del arreglo casa\n } else if (jugador == \"casa\") {\n for (i = 0; i < casa.length; i++) {\n contador += casa[i].numero;\n }\n } else return -1; //Si recibe un parametro invalido, retorna -1. ES UN ERROR\n return contador;\n}", "title": "" }, { "docid": "cb5b158d6f8351bc8f71871695471f4d", "score": "0.56126875", "text": "clcComutingAllowance(){\n //50,\"big\" sended -> return -money for big PP\n if (this.input.hasCommuterLarge.checked == true) {\n var bi= -1;\n for (var i = 0; i < 5; i++) {\n if (this.CAT.big[i][0] <= this.input.commuterKm.value) {\n bi++;\n }\n }\n return this.CAT.big[bi][1];\n }\n if (this.input.hasCommuterSmall.checked == true) {\n var si= -1;\n for (var i = 0; i < 4; i++) {\n if (this.CAT.small[i][0] <= this.input.commuterKm.value) {\n si++;\n }\n }\n return this.CAT.small[si][1]\n }\n }", "title": "" }, { "docid": "738c5fcd2e25071558d2f6caef061828", "score": "0.5604173", "text": "function comprobarCarton() {\n var comprobar;\n for (var i = 0; i < bingoCard.length; i++) {\n for (var x = 14; x > 0; x--) {\n if (bingoCard[i].number == bingoCard[x].number && i != x) {\n comprobar = true;\n return comprobar;\n } else {\n comprobar = false;\n }\n }\n }\n return comprobar;\n }", "title": "" }, { "docid": "38ff5a1a87bf4564ed8a278ac6cd2052", "score": "0.5583954", "text": "function comprobarPareja(numCarta) {\n if(numCarta===numeroCarta){\n return true;\n }\n else return false;\n}", "title": "" }, { "docid": "e30d054c64aaeca10d82946705aeffae", "score": "0.5572724", "text": "function calcularDesconto() {\n let nomeProduto = document.getElementById('nomeProduto').value;\n let valorProduto = document.getElementById('valorProduto').value;\n let result2 = document.getElementById('resultado7');\n \n let valorDescont;\n let produtoDescontado;\n\n if(valorProduto >= 50 && valorProduto < 200){\n valorDescont = (valorProduto / 100) * 5;\n produtoDescontado = valorProduto - valorDescont;\n result2.innerHTML = `Nome do produto: ${nomeProduto}<br/>Valor do produto: R$ ${valorProduto}<br/>Valor com desconto: R$ ${produtoDescontado}`;\n } else if(valorProduto >= 200 && valorProduto < 500) {\n valorDescont = (valorProduto / 100) * 6;\n produtoDescontado = valorProduto - valorDescont;\n result2.innerHTML = `Nome do produto: ${nomeProduto}<br/>Valor do produto: R$ ${valorProduto}<br/>Valor com desconto: R$ ${produtoDescontado}`;\n } else if(valorProduto >= 500 && valorProduto < 1000) {\n valorDescont = (valorProduto / 100) * 7;\n produtoDescontado = valorProduto - valorDescont;\n result2.innerHTML = `Nome do produto: ${nomeProduto}<br/>Valor do produto: R$ ${valorProduto}<br/>Valor com desconto: R$ ${produtoDescontado}`;\n } else if(valorProduto >= 1000) {\n valorDescont = (valorProduto / 100) * 8;\n produtoDescontado = valorProduto - valorDescont;\n result2.innerHTML = `Nome do produto: ${nomeProduto}<br/>Valor do produto: R$ ${valorProduto}<br/>Valor com desconto: R$ ${produtoDescontado}`;\n } else if(valorProduto < 0) {\n result2.innerHTML = `Valor digitado é menor que zero, digite novamente`;\n } else {\n result2.innerHTML = `Nome do produto: ${nomeProduto}<br/>Valor do produto: R$ ${valorProduto}<br/>Sem desconto`;\n }\n\n }", "title": "" }, { "docid": "93c71413381b6dc7726aab61d7f39230", "score": "0.5572249", "text": "function getPreuBaix(agregadors, temporada) {\n let tmp_preu = 0;\n for (var i = 0; i < agregadors.length; i++) {\n let agregador = agregadors[i];\n for (var j = 0; j < agregador.tarifes.length; j++) {\n let tarifa = agregador.tarifes[j];\n if (tarifa.tarifa != temporada) continue;\n let preu = tarifa.preu.preu_net + tarifa.preu.preu_net * (tarifa.preu.impostos / 100);\n if (tmp_preu > preu || tmp_preu == 0) tmp_preu = preu;\n }\n }\n\n return tmp_preu;\n}", "title": "" }, { "docid": "38d8d68e3dfcd730b235b180f07513f6", "score": "0.55718094", "text": "function exemplo2(){\n \n const salarioMinimo = 998.00;\n \n const custoQuilowatt = salarioMinimo / 5;\n \n console.log(\"O valor de cada quilowatt é: R$\" + custoQuilowatt);\n \n const quilowattsConsumido = 10;\n \n const valorASerPago = quilowattsConsumido * custoQuilowatt;\n console.log(\"O valor a ser pago por essa residência é: R$\" + valorASerPago);\n \n const desconto = (valorASerPago * 15) / 100 ;\n \n const valorASerPagoDesconto = valorASerPago - desconto;\n console.log(\"O valor a ser pago com desconto é: R$\" + valorASerPagoDesconto)\n }", "title": "" }, { "docid": "5c53dbd6e17a31f5d42fa35859fc7106", "score": "0.55610096", "text": "function getQtdNoCarrinho(id) {\n let carrinho = JSON.parse(sessionStorage.getItem('carrinho'))\n\n if (carrinho != null && carrinho.length > 0) {\n for (let i = 0; i < carrinho.length; i++) {\n if (carrinho[i].id == id) {\n console.log(\"Quantidade do item \" + id + \" no carrinho: \" + carrinho[i].qtd)\n return carrinho[i].qtd\n }\n }\n }\n return 0\n}", "title": "" }, { "docid": "e39670b326e05c6291d2a11335f3e29e", "score": "0.5555435", "text": "function whatFlavors(cost, money) {\n cost.unshift(0)\n const flavors = []\n for (let i = 1; i < cost.length; i++){\n for (let j = 1; j < cost.length; j++) {\n if (i === j) {continue}\n else if (cost[i] + cost[j] === money){\n flavors.push(i)\n flavors.push(j)\n flavors.sort((a, b) => {return a - b})\n break\n }\n }\n }\n \n console.log(flavors[1], flavors[3])\n\n\n}", "title": "" }, { "docid": "08883052bd21e94ca43c091c81901eb3", "score": "0.55278635", "text": "function tablaQuitaManchasDesengrasantes(productos, cate) {\n let regsob = renglonesPorHoja;\n let renglonesOcupados = 0;\n let filas = '';\n\n filas += `\n <h1 id=\"nombreCategoria\">\n ${cate} \n </h1>\n \n <table class=\"table table-sm\" id=\"listaPrecios\">\n <tr>\n <th></th>\n <th style=\"text-align: center;\"> 5 Litros envasado </th>\n </tr> \n `\n let nameanterior = '';\n for (let i = 0; i < productos.length; i++) {\n if (productos[i].categoria.name == cate) {\n renglonesOcupados++\n filas += `\n <tr>\n <td style=\"font-size: 12px;\"> ${productos[i].name} </td> \n <td style=\"text-align: center; font-size: 12px;\"> ${productos[i].price} </td> \n `\n filas += `</tr>`\n }\n }\n filas += `</table>`\n renglonesOcupados = renglonesOcupados + 5;\n\n if (renglonesOcupados > regsob) {\n var br = '';\n for (let i = 0; i < renglonesSobrantes; i++) {\n br += `<br>`;\n }\n filas = br + filas;\n renglonesPorHoja = 45\n }\n\n renglonesSobrantes = renglonesPorHoja - renglonesOcupados;\n renglonesPorHoja = renglonesSobrantes;\n return filas;\n}", "title": "" }, { "docid": "7239e900db0f1f01b4bb591acc547b13", "score": "0.55253834", "text": "function bateHorario(turmaTentativa, turmaCadastrada) {\n var coincide = false;\n console.log(\"<Comparando>\");\n console.log(turmaTentativa);\n console.log(turmaCadastrada);\n console.log(\"</Comparando>\");\n for(var j = 0; j < turmaCadastrada.diaHora.length; j++){\n var horarioTurmaCadastrada = converteHora(turmaCadastrada.diaHora[j].horaInicio);\n for(var i = 0; i < turmaTentativa.diaHora.length; i++){\n var horarioTurmaTentativa = converteHora(turmaTentativa.diaHora[i].horaInicio);\n if(turmaCadastrada.diaHora[j].desc == turmaTentativa.diaHora[i].desc){\n if(horarioTurmaCadastrada.hora == horarioTurmaTentativa.hora){\n coincide = true;\n }else{\n var diferenca = Math.abs((horarioTurmaCadastrada.hora*60+horarioTurmaCadastrada.minutos) - (horarioTurmaTentativa.hora*60+horarioTurmaTentativa.minutos));\n console.log(\"Diferenca: \"+diferenca);\n if(diferenca < 120){\n coincide = true;\n }\n }\n }\n }\n }\n return coincide;\n}", "title": "" }, { "docid": "d6caa55cae895200a248be617a439af4", "score": "0.55153775", "text": "function subtrairQtdResumo(item) {\n\n\t\t\tvar corEsc = '',\n\t\t\t\tindex = 0\n\t\t\t;\n\n\t\t\tfor (var j in ctrl.corEscolhida) {\n\n\t\t\t\tcorEsc = ctrl.corEscolhida[j];\n\n\t\t\t\tif (corEsc.codigo === item.cor.CODIGO)\n\t\t\t\t\tcorEsc.quantidade -= item.quantidade;\n\t\t\t\t\n\t\t\t\tif (corEsc.quantidade === 0) {\n\n\t\t\t\t\tindex = ctrl.corEscolhida.indexOf(corEsc);\n\t\t\t\t\tctrl.corEscolhida.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ba6d74d5e65bc6f57222d1fed6d9aacb", "score": "0.5512744", "text": "function pintar_cantidad_carrito (){\n var product_cart_menu = JSON.parse(localStorage.getItem('product_cart_menu'));\n var cantidad_productos = document.querySelector('#cantidad-productos');\n var pedido_precio = document.querySelector('.pedido-precio');\n var cantidad = 0;\n var precio = 0;\n\n\n if (product_cart_menu==null) {\n \n }else{\n for (let i = 0; i < product_cart_menu.length; i++) {\n cantidad = cantidad + (product_cart_menu[i].cantida_menu);\n precio = precio + ((product_cart_menu[i].cantida_menu)*product_cart_menu[i].valor_menu);\n }\n } \n precio = precio +domicilio;\n\n if (product_cart_menu == null || product_cart_menu.length == 0) {\n $('.tiket-compra').removeClass('Active-tiket-compra');\n }else{\n $('.tiket-compra').addClass('Active-tiket-compra');\n }\n cantidad_productos.innerHTML = cantidad;\n pedido_precio.innerHTML = `$ ${new Intl.NumberFormat().format(precio)}`;\n\n}", "title": "" }, { "docid": "280b094a6a6d54ebd4a0e99c0530fcc2", "score": "0.5509579", "text": "function tablaDetergenteJabonLiquidoSuavizanteCLoroLavandina(productos, progrouppresentacion, cate) {\n let regsob = renglonesPorHoja;\n let renglonesOcupados = 0;\n let filas = '';\n filas += `\n <h1 id=\"nombreCategoria\">\n ${cate} \n </h1>\n \n <table class=\"table table-sm\" id=\"listaPrecios\">\n <tr class=\"tamanoEncabezadoLista\">\n <th></th>\n <th style=\"text-align: center;\"> Minimo 200 litros<br>(sin envase) </th> \n <th style=\"text-align: center;\"> Minimo 20 litros<br>(sin envase) </th> \n <th style=\"text-align: center;\"> <br>5 Litros envasado </th>\n </tr> \n `\n let nameanterior = '';\n for (let i = 0; i < productos.length; i++) {\n if (productos[i].name != nameanterior) {\n if (productos[i].categoria.name == cate) {\n renglonesOcupados++\n filas += `\n <tr class=\"estiloListaPrecios\">\n <td style=\"font-size: 12px;\"> ${productos[i].name} </td> \n `\n for (const b in progrouppresentacion) {\n if (productos[i].presentacion != null && productos[i].presentacion.name == b) {\n filas += `<td style=\"text-align: center; font-size: 12px;\"> ${productos[i].price} </td>`\n console.log(b)\n console.log(productos[i].progrouppresentacion)\n }\n }\n filas += `</tr>`\n }\n }\n\n nameanterior = productos[i].name;\n }\n filas += `</table>`\n\n renglonesOcupados = renglonesOcupados + 5;\n\n if (renglonesOcupados > regsob) {\n var br = '';\n for (let i = 0; i < renglonesSobrantes; i++) {\n br += `<br>`;\n }\n filas = br + filas;\n renglonesPorHoja = 45\n }\n\n renglonesSobrantes = renglonesPorHoja - renglonesOcupados;\n renglonesPorHoja = renglonesSobrantes;\n return filas;\n}", "title": "" }, { "docid": "5b0da2eb33b971b45da2e32a91f46b50", "score": "0.5509441", "text": "isInBudget(budget, totalCat){\n let diff = 0;\n let status = '';\n if (totalCat <= budget) {\n diff = budget - totalCat;\n status = '¡En hora buena, estás dentro del presupuesto!'\n } else {\n diff = totalCat - budget;\n status = 'Chanfle, te pasaste de tu presupesto'\n }\n return {diff:diff, status:status}\n }", "title": "" }, { "docid": "8b6f16c96b9c234c3d6c18c18a2d5311", "score": "0.5508609", "text": "function proveraPobede(novac) {\n if (novac < (unosNovcaInt + unosNovcaInt))\n krajPobeda()\n}", "title": "" }, { "docid": "d1d7f586bffe7516af5caeacfd9bef0a", "score": "0.54956824", "text": "function esCompra(persona, prod){\n //Buscar el objeto persona\n for (var i = personas.length - 1; i >= 0; i--) {\n if(personas[i].nombre == persona){\n //Ver si ya tiene la compra\n var bandera = 0;\n for (var o = personas[i].comprasPorPersona.length - 1; o >= 0; o--) {\n if(personas[i].comprasPorPersona[o].producto == prod){\n bandera = 1;\n return true;\n }\n }\n return false;\n break;\n }\n };\n}", "title": "" }, { "docid": "a29f1a21a08f5d53d0ca43510436018a", "score": "0.5472695", "text": "function eliminarProductosCarrito(codigoProducto){\n ProductosCarrito = ProductosCarrito.filter( producto => {\n if(producto.Codigo !== codigoProducto){\n return true;\n }else{\n producto.Cantidad = 1;\n return false;\n }\n })\n mostrarCarritoProductos(ProductosCarrito);\n mostrarAgregarProductos(Productos);\n cambiarPrecioTotal();\n}", "title": "" }, { "docid": "257414e52b713cab91d03c37d21d2885", "score": "0.5470684", "text": "suma(){\r\n var precio = 0;\r\n if(localStorage.getItem('carritoDeCompras')){\r\n let elementos = carritoDeCompras\r\n elementos.forEach((item) => {\r\n precio += Number(item.price) * item.quantity\r\n });\r\n }else{\r\n console.log(\"No se trajeron los productos del LS\");\r\n }\r\n return precio; \r\n \r\n }", "title": "" }, { "docid": "135c80c5c3814d67c73a15240c0bb23b", "score": "0.5433753", "text": "function AgregarACarrito() {\n\t// Función que gestiona la cola de productos en carrito (como estructura de datos)\n\n\tif (!agregoProductos) {\n\t\tcrearCarrito();\n\t\tagregoProductos = true;\n\t}\n\n\t/*\n\t* Esto se desestima por haberse incluido en la función \"actualizarCantidadDeProductosEnCarrito\"\n\t// Cuando se actualizan los productos del minicarrito, actualizo los valores generales también\n\t\n\tcontadorItemsAgregados.innerHTML = parseInt(contadorItemsAgregados.innerHTML) + 1;\n\t//console.log(this.dataset.precio);\n\tacumuladorTotal.innerHTML = parseInt(acumuladorTotal.innerHTML) + parseInt(this.dataset.precio);\n\t*/\n\n\tlet indexOfProductoAAgregar = productosEnCarrito.indexOf(aProductos[aProductos.map(function (e) {\n\t\treturn e.id;\n\t}).indexOf(parseInt(this.dataset.id))]);\n\n\tif (indexOfProductoAAgregar == -1) {\n\t\t// QUiere decir que no existía previamente en el carrito\n\t\tindexOfProductoAAgregar = productosEnCarrito.push(aProductos[aProductos.map(function (e) {\n\t\t\treturn e.id;\n\t\t}).indexOf(parseInt(this.dataset.id))]) - 1;\n\t\t//console.log(productosEnCarrito);\n\n\t\tif (mostrandoCarrito) {\n\t\t\t//Si no existía el producto en el carrito, y se está mostrando, entonces actualizo el carrito\n\t\t\tactualizarProductosEnCarrito();\n\t\t}\n\n\t}\n\n\t//Ahora aumento su cantidad en el array de cantidades \n\tif (typeof cantidadesPorProductoEnCarrito[indexOfProductoAAgregar] != 'number') {\n\t\t// Quiere decir qeu nunca hubo valor aquí\n\t\tcantidadesPorProductoEnCarrito[indexOfProductoAAgregar] = 1;\n\t} else {\n\t\tcantidadesPorProductoEnCarrito[indexOfProductoAAgregar]++;\n\t}\n\t//console.log(cantidadesPorProductoEnCarrito);\n\n\t// Esto está medio sucio. Se llama dos veces esta funcion, cuando el producto es nuevo.\n\tactualizarCantidadDeProductosEnCarrito();\n\n}", "title": "" }, { "docid": "db8d0b90d188e801fd989310d1013daa", "score": "0.54164046", "text": "function getTotalPrice(chosenProducts) {\n totalPrice = 0;\n for (let j=0; j<chosenProducts.length; j+= 1){\n for (let i=0; i<products.length; i+=1) {\n if (chosenProducts[j] == (products[i].name + \" - $\" + products[i].price) ){\n totalPrice += products[i].price;\n }\n }\n }\n \n \n return totalPrice;\n }", "title": "" }, { "docid": "36d3770c13bfcbed026e82a2e7f967c7", "score": "0.54148185", "text": "function compruebaFinal(tCarta) {\n\tvar total=0;\n\tvar id;\n\tfor(var i = 0; i < tCarta; i++){\n\t\tid = document.getElementById(i+\"f\");\n\t\tif (id.className == \"frontFlip2\"){\n\t\t\ttotal++;\n\t\t}\n\t}\n\tif (total == tCarta){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "912ecb54c59dbde49e1d10082b97cc95", "score": "0.54146534", "text": "function comparar(pontuacao){\n let listaPontuacao = pontuacao.split(' ')\n let melhorDesempenho = listaPontuacao[0]\n let piorDesempenho = listaPontuacao[0]\n let records = 0\n let piorJogoNum = 0\n\n for(i = 1; i < listaPontuacao.length; i++){ // percorre o array de pontos\n if(listaPontuacao[i] > melhorDesempenho){ // se a pontuação atual for maior que o melhor desempenho até então\n melhorDesempenho = listaPontuacao[i] // essa pontuação assume a posição de melhor desempenho\n records++; // soma 1 a quantidade de records do jogador\n } else if(listaPontuacao[i] < piorDesempenho){ // se a pontuação atual for menor que o pior desempenho até então\n piorDesempenho = listaPontuacao[i] // essa pontuação assume a posição de pior desempenho\n piorJogoNum = i + 1 // pega o numero daquele jogo em que o desempenho foi o pior do momento (soma 1 porque o array começa em 0)\n }\n }\n return [records, piorJogoNum]\n}", "title": "" }, { "docid": "4db11e7a19b3d0a09717999a779090e8", "score": "0.54062366", "text": "function totalCompra()\n{\n // se obtiene el total calculando el precio por la cantidad comprada.\n var total = 0;\n productos_comprados.forEach(unProducto =>\n {\n total += unProducto.precioUnitario * unProducto.cantidad;\n });\n // se actualiza el html con el nuevo total.\n //var mensaje = document.getElementById('total');\n\n alert('El Total de su compra es de ' + formatMoney(total) + '.');\n //mensaje.innerHTML = \"Total: \" + formatMoney(total);\n}", "title": "" }, { "docid": "dc38349524580e185392dc3048b8a4b8", "score": "0.53998715", "text": "function FIN_tiraCartaMenorValor(){\n\t\t\t\t//En esta tirada, todas las cartas menos las del palo que manda siempre son igual de importantes\n\t\t\t\treturn thisT.cartaMenorValor(cartasEnMano, paloQueMandaSiempre, \"\");\n\t\t\t}", "title": "" }, { "docid": "9b379a4aa1e194825f885cf5874493b2", "score": "0.539967", "text": "fecharCompra() {\n // 20% de desconto para novos clientes\n if(this.novoCliente) { \n \n // desconto de XX% do cupom \n } else if(this.cupom) {\n \n // 5% de desconto para compras acima de 100 reais\n } else {\n \n }\n }", "title": "" }, { "docid": "e35233cec3eec2eb92dd099224ad7146", "score": "0.539878", "text": "function checkTirEnCours() {\n tirEnCours = false;\n equipes.forEach((e) => {\n e.joueurs.forEach((j) => {\n if (j.vitesse > 0) tirEnCours = true;\n });\n });\n }", "title": "" }, { "docid": "e9a8ae961e4a2df320db96ce20aa59f9", "score": "0.53880525", "text": "function generarCompras2() {\r\n\tvar comprasJugador =[];\r\n\tvar isValidPurchase = false;\r\n\r\n\tif(!isEmptyListGenerated){\r\n\t\tgenerateEmptyBuyList(compras2);\r\n\t\tisEmptyListGenerated = true;\r\n\t}\r\n\r\n\t//obtenemos todos las id de todos los radio chequeados\r\n\tcomprasJugador = obtenerCompras();\r\n\r\n\t//eliminamos valor extra de los id parseando la cadena\r\n\tcomprasJugador = parsearlistaCompras(comprasJugador);\r\n\r\n\t//procedemos a obtener la prioridad de los productos\r\n\tvar products_priorities = generateAleatoryPriorities(listaProductos);\r\n\tvar mediumPriority = getMediumPriority(products_priorities);\r\n\r\n\t//procedemos a la validacion de los objetos\r\n\t//comprados contra los requeridos\r\n\r\n\tif(isMoneyLeft(comprasJugador)){\r\n\t\trealizarCompras(comprasJugador);\r\n\t\tvar prioridad = obtenerPrioridad(compras2,products_priorities);\r\n\t\tvar isObjective = isObjectiveComplete(compras2);\r\n\t\tif(isObjective || prioridad >= mediumPriority){\r\n\t\t\t//alert(\"GANASTE\");\r\n\t\t\t$( \"#successfulDialog\" ).dialog( \"open\" );\r\n\t\t\tclose_shop();\r\n\t\t\tcargarNivel(3);\r\n\t\t}\r\n\t}else{\r\n\t\talert(\"Perdiste el juego ya no puedes comprar\");\r\n\t}\r\n\r\n\t//console.log(\"compras: \"+compras2);\r\n\tclearOptions();\r\n}", "title": "" }, { "docid": "63f94cc9a444242623a0f6ab6f394b7c", "score": "0.53846043", "text": "function compara(a, b) {\n let vueloA = a.precio;\n let vueloB = b.precio;\n\n let comparacion = 0;\n if (vueloA > vueloB) {\n return 1;\n } else if (vueloA < vueloB) {\n return -1;\n }\n return comparacion;\n }", "title": "" }, { "docid": "73ef24f6e79b636973a8909e6bdc2b24", "score": "0.53804183", "text": "compterNoeud(){\n let noeud = this.racine\n var compte=0;\n if(noeud==null){return 0}\n else{\n compte++\n const compterFils = function(noeud){\n if(noeud.gauche!=null || noeud.droite!=null){\n return compterFils(noeud.gauche)+compterFils(noeud.droite)\n }\n return compte;\n }\n return compterFils(noeud)\n }\n }", "title": "" }, { "docid": "fab621098eeda3b324dfda2fec72d8d0", "score": "0.5374388", "text": "function enCarrito(nuevoProducto,arrayCarrito){\n if(arrayCarrito.length !== 0){\n for(let i = 0; i < arrayCarrito.length; i++){\n if(nuevoProducto.nombre === arrayCarrito[i].nombre && nuevoProducto.talla === arrayCarrito[i].talla){\n return arrayCarrito[i].cantidad++\n }\n }\n }\n arrayCarrito.push(nuevoProducto)\n}", "title": "" }, { "docid": "583d4e6f0c4357e748edcfba8a99f172", "score": "0.5371128", "text": "function getMoneySpent(keyboards, drives, b) {\n let cost = [];\n for(let keyboard of keyboards){\n for(let usb of drives){\n\n if(keyboard + usb <= b){\n cost.push(keyboard+usb)\n }else {\n if(cost.length == 0){\n cost.push(-1)\n }\n }\n }\n }\n cost.sort((a, b) => a - b);\n return cost[cost.length - 1]\n\n}", "title": "" }, { "docid": "722eec93561b35e0a3c0ac859b883dff", "score": "0.536699", "text": "function accumulate(numTarjeta) {\n return Compra.listByNumTarjeta(numTarjeta) /* Obtencion de compras por numTarjeta */\n .then(compras => {\n /* Caso de exito */\n let puntos = 0; /* Acumulador de puntos */\n let dec = 0; /* Parte decimal de importe */\n\n /* Iteracion de compras para calculo y acumulacion de puntos */\n for(let i = 0; i < compras.length; i++) {\n puntos += Math.floor(compras[i].importe); /* Acumulacion de puntos con parte entera de importe */\n dec = compras[i].importe % 1; /* Obtencion de parte decimal del importe */\n\n if (dec > 0.5) { /* Si parte decimal mayor que 0.5 */\n puntos++; /* Acumular +1 punto */\n }\n }\n \n return Tarjeta.update(numTarjeta, { puntos: puntos }) /* Actualizacion de puntos */\n .then(tarjeta => {\n /* Caso de exito */\n /* Comprobacion de resultado */\n if (tarjeta) {\n return true; /* Actualizacion correcta */\n } else {\n return false; /* Actualizacion incorrecta */ \n }\n })\n .catch(reason => {\n /* Caso de fallo */\n console.log('Error acumulando puntos: ', reason);\n return false; /* Acumulacion incorrecta por problema en DB actualizando puntos */\n });\n })\n .catch(reason => {\n /* Caso de fallo */\n console.log('Error listando compras: ', reason);\n return false; /* Acumulacion incorrecta por problema en db buscando compras por numTarjeta */\n });\n}", "title": "" }, { "docid": "1536461add32e47546460bfcd1bd1c40", "score": "0.5366484", "text": "function verificaNotificacoesParaRemocaoPorBloqueio(notificacoesAtivas, cartao){\n var i = 0;\n var notificacaoEncontrada = false;\n for(; i < notificacoesAtivas.length; i++){\n if(notificacoesAtivas[i].cartaoParcialFim == cartao.parcialCartao){\n notificacaoEncontrada = true;\n break;\n }\n }\n //Removo um item iniciando no indice desejado, ou seja o indice onde identifiquei a notificacao.\n if(notificacaoEncontrada){\n notificacoesAtivas.splice(i,1);\n }\n}", "title": "" }, { "docid": "27247221bb7a8ef780859655786069aa", "score": "0.53571016", "text": "function AgregarCarrito(e){\n \n var cantidadCompra = parseInt(e.target.parentNode.parentNode.firstChild.nextSibling.nextSibling.nextSibling.firstChild.value);\n var stock = parseInt(e.target.parentNode.parentNode.firstChild.nextSibling.nextSibling.innerHTML);\n var mensaje = document.querySelector(\"#mensaje\");\n \n console.log(\"cantidad:\"+cantidadCompra+\"stock:\"+stock)\n\n if(cantidadCompra > stock){\n mensaje.innerHTML = \"Por el momento no hay suficiente stock de este artículo\"\n \n }\n else{\n var nombreProducto = e.target.parentNode.parentNode.firstChild.innerHTML;\n console.log(nombreProducto);\n var find = listaVacia.findIndex(elemento => elemento == nombreProducto);\n if(find != -1){\n \n mensaje.innerHTML = \"El producto seleccionado ya fue agregado a su Carrito de Compras\"\n }\n else{\n mensaje.innerHTML = \"\"; \n //Nombre2 \n var tdNombre2 = document.createElement(\"td\");\n var txtNombre2 = document.createTextNode(e.target.parentNode.parentNode.firstChild.innerHTML);\n tdNombre2.appendChild(txtNombre2);\n \n //Cantidad2\n var tdCantidad2 = document.createElement(\"td\");\n var txtCantidad2 = document.createTextNode(e.target.parentNode.parentNode.firstChild.nextSibling.nextSibling.nextSibling.firstChild.value);\n tdCantidad2.appendChild(txtCantidad2);\n \n //PrecioUnitario\n var tdPrecioUnitario = document.createElement(\"td\");\n var txtPrecioUnitario = document.createTextNode(e.target.parentNode.parentNode.firstChild.nextSibling.innerHTML);\n tdPrecioUnitario.appendChild(txtPrecioUnitario);\n \n //Boton Quitar\n var tdBotonBorrar = document.createElement(\"td\");\n var btnBorrar = document.createElement(\"button\");\n var txtBotonBorrar = document.createTextNode(\"Quitar\");\n btnBorrar.appendChild(txtBotonBorrar);\n tdBotonBorrar.appendChild(btnBorrar);\n btnBorrar.addEventListener(\"click\", borrarElemento);\n \n //table row\n var tr2 = document.createElement(\"tr\");\n tr2.appendChild(tdNombre2);\n tr2.appendChild(tdPrecioUnitario);\n tr2.appendChild(tdCantidad2);\n tr2.appendChild(tdBotonBorrar);\n \n var tbody2 = document.querySelector(\"#tablaCarrito\");\n tbody2.appendChild(tr2);\n \n listaVacia.push(nombreProducto);\n console.log(listaVacia);\n \n // Sumar a un contador el precio de los articulos seleccionados\n \n contador = contador + (parseInt(e.target.parentNode.parentNode.firstChild.nextSibling.nextSibling.nextSibling.firstChild.value) * parseInt(e.target.parentNode.parentNode.firstChild.nextSibling.innerHTML));\n console.log(contador);\n \n \n }} \n }", "title": "" }, { "docid": "4891a25c3a240673dbf4eb825454df0b", "score": "0.535199", "text": "function calcScore() {\n $.each(currentWorld.products.product, function (index, product) {\n //Si la production n'est pas en cours\n if(product.timeleft === 0){}\n //Si la production est en cours\n else {\n product.timeleft = product.timeleft -(Date.now() - product.lastupdate); //Mettre à jour le temps restant\n //Si la produciton est finie\n if (product.timeleft <=0){\n //Reinitialiser\n product.timeleft = 0; \n\n //Mettre à jour l'argent disponible\n currentWorld.money = parseInt(currentWorld.money) + (product.revenu*product.quantite); //dans le document\n $(\"#argent\").html(formatNumber(currentWorld.money) + ' $'); //à l'affichage\n }\n }\n \n\n //Gestion cliquabilité des boutons\n GestionBuyButton(product); \n }); \n}", "title": "" }, { "docid": "e70d18d65d90dfbf9c557f142512e260", "score": "0.5350806", "text": "function compararCartoesSelecionados(){\n if(primeiroCartaoSelecionado.attr('id') === segundoCartaoSelecionado.attr('id')){\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "c033b391ea6d78ade809c28b452d6291", "score": "0.53483415", "text": "function conferir (tempoComida, tempoInserido){\n\n if(tempoInserido < tempoComida){\n console.log(\"Tempo insuficiente!\")\n }\n else if (tempoInserido >2*tempoComida && tempoInserido<=3*tempoComida) {\n console.log('A comida queimou!')\n }\n else if (tempoInserido >3*tempoComida){\n console.log('kabumm!')\n }\n else {\n console.log('Prato pronto, bom apetite!!') \n }\n}", "title": "" }, { "docid": "0226eced1f37f48fb6c1012d7edc1a1d", "score": "0.53383315", "text": "function gererlaQuantite() {\n let increaseButtons = document.querySelectorAll('.btnPlus');\n let decreaseButtons = document.querySelectorAll('.btnMinus');\n let increment = document.querySelectorAll('.increment');\n let nomduProduit = document.querySelectorAll('.“nomDuProduit“');\n\n let currentQuantity = 0;\n let currentProduct = '';\n\n let produitsPanier = localStorage.getItem('PanierOfProducts');\n produitsPanier = JSON.parse(produitsPanier);\n\n for (let i = 0; i < increaseButtons.length; i++) {\n //décrementer via le bouton qui a la class minus\n decreaseButtons[i].addEventListener('click', () => {\n currentQuantity = increment[i].textContent;\n currentProduct = nomduProduit[i].textContent;\n\n if (produitsPanier[currentProduct].quantity <= 1){\n let productNumbers = localStorage.getItem('panierNumbers');\n let cartCost = localStorage.getItem(\"totalPrixProduits\");\n let cartItems = localStorage.getItem('PanierOfProducts');\n cartItems = JSON.parse(cartItems);\n let productName;\n console.log(cartItems);\n\n \n productName = decreaseButtons[i].getAttribute('data-name');\n\n localStorage.setItem('panierNumbers', productNumbers - cartItems[productName].quantity);\n localStorage.setItem('totalPrixProduits', cartCost - (cartItems[productName].prixProduit * cartItems[productName].quantity));\n\n delete cartItems[productName];\n localStorage.setItem('PanierOfProducts', JSON.stringify(cartItems));\n\n afficherLePanier();\n loadNumberOfProducts();\n loadTotalOfProducts();\n reductionPrix();\n netaPayer();\n\n \n } else {\n produitsPanier[currentProduct].quantity -= 1;\n panierNumbers(produitsPanier[currentProduct], \"decrease\");\n totalPrix(produitsPanier[currentProduct], \"decrease\");\n localStorage.setItem('PanierOfProducts', JSON.stringify(produitsPanier));\n\n afficherLePanier();\n reductionPrix();\n netaPayer();\n\n }\n });\n //incrementer via le bouton plus.\n increaseButtons[i].addEventListener('click', () => {\n currentQuantity = increment[i].textContent;\n currentProduct = nomduProduit[i].textContent;\n\n produitsPanier[currentProduct].quantity += 1;\n panierNumbers(produitsPanier[currentProduct]);\n totalPrix(produitsPanier[currentProduct]);\n localStorage.setItem('PanierOfProducts', JSON.stringify(produitsPanier));\n afficherLePanier();\n reductionPrix();\n netaPayer();\n\n });\n }\n }", "title": "" }, { "docid": "aee850494fdf589f50a57d737ba85b74", "score": "0.5335539", "text": "function findWhoBuyMoreProducts() {\n const alice = Object.values(AliceList).reduce((accu, current) => accu + current);\n const bob = Object.values(BobList).reduce((accu, current) => accu + current);\n return alice > bob ? 'Alice' : 'Bob';\n}", "title": "" }, { "docid": "624b0d15b6e5af5268dbe6a26f9630a9", "score": "0.53319234", "text": "function compareCapsByTx(a, b) {\n return a.tx - b.tx;\n}", "title": "" }, { "docid": "d22c1d6734f5acc9a60a70362b1f90dd", "score": "0.5328612", "text": "function comp(a,b) {\n\tif (a===null || b===null) {//Para comprobar si alguno de los 2 arreglos es nulo\n\t\treturn false;\n\t} else if (a.length != b.length) { //Para comprobar que los 2 arreglos tengan el mismo numero de elementos\n\t\treturn false;\n\t} else {\n//Ordenamiento de arreglos y almacenamiento en otras variables para preservar los arreglos originales.\n\t\tvar aOrdenado = a.sort(function(a, b) {\n\t\t return a - b;\n\t\t});\t\t\n\t\tvar bOrdenado = b.sort(function(a, b) {\n\t\t return a - b;\n\t\t});\n//Definicion del ciclo para comparar uno a uno los elementos de los 2 arreglos \n\t\tfor (var i=0; i<aOrdenado.length; i++) { \n\t\t\tif (aOrdenado[i]*aOrdenado[i] !== bOrdenado[i]) { \n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true; //Si no encuentra diferencias en cada comparacion, al final del ciclo devuelve True.\n\t\t}\n}", "title": "" }, { "docid": "a4f1d09d6ed8f8e87c4bb4697728bb0d", "score": "0.532413", "text": "function quantityTotal() {\n inquirer.prompt([{\n name: \"howMany\",\n message: \"How many pieces?\",\n type: \"input\",\n }]).then(function (dataTwo) {\n connection.query(\"SELECT * FROM products WHERE stock =\" + dataTwo.howMany, function (err, res) {\n unitsWanted.push(dataTwo.howMany);\n if (parseInt(unitsWanted) > parseInt(storeStock[0])) {\n console.log(\"Oops! We do not have enough in stock. Please modify quantity.\");\n console.log(\"We only have \" + storeStock[0] + \" of this item.\");\n }\n else {\n totalAll();\n\n }\n })\n });\n }", "title": "" }, { "docid": "e5b047646a36d53667af01122e69c8ad", "score": "0.5318698", "text": "function compare(a,b) {\r\n if (a.qty < b.qty)\r\n return 1;\r\n if (a.qty > b.qty)\r\n return -1;\r\n return 0;\r\n }", "title": "" }, { "docid": "6632b4cab01ae3874a1fbd683751d6f6", "score": "0.5316063", "text": "function mostrarCarrito(contenidoCarrito){\n let listadoProdCarrito = ``;\n\n for (let i = 0; i < contenidoCarrito.length; i++) {\n let productoCarrito = contenidoCarrito[i];\n cantidadProdCarrito = contenidoCarrito.length;\n\n if(productoCarrito.currency == \"UYU\") {\n productoCarrito.unitCost = (productoCarrito.unitCost / 40).toFixed(0);\n productoCarrito.currency = \"USD\";\n } //pasa los pesos a dólares\n\n document.getElementById(\"badge\").innerHTML = cantidadProdCarrito;\n\n listadoProdCarrito += ` \n <!-- Card -->\n <div class=\"card-body\" id=\"prodCard${i}\">\n <div class=\"row mb-4\">\n <div class=\"col-md-5 col-lg-3 col-xl-3\">\n <div class=\"view zoom overlay z-depth-1 rounded mb-3 mb-md-0\">\n <img class=\"img-fluid w-100 imagenCarrito\" src=\"${productoCarrito.src}\">\n <a href=\"#!\"></a>\n </div>\n </div>\n <div class=\"col-md-7 col-lg-9 col-xl-9\">\n <div>\n <div class=\"d-flex justify-content-between\">\n <div>\n <h5 class=\"nombreProd\">${productoCarrito.name}</h5>\n <p class=\"mb-3 text-muted text-uppercase small\">AUTOS</p>\n </div>\n <div>\n <div class=\"def-number-input number-input safari_only mb-0 w-100\">\n <button onclick=\"this.parentNode.querySelector('input[type=number]').stepDown(); calcularCantidad(${i});\"\n class=\"minus\" style=\"outline: none !important\"></button>\n <input class=\"quantity\" min=\"1\" name=\"quantity\" value=\"${productoCarrito.count}\" type=\"number\" id=\"inputCantidad${i}\">\n <button onclick=\"this.parentNode.querySelector('input[type=number]').stepUp(); calcularCantidad(${i});\"\n class=\"plus\" style=\"outline: none !important\"></button>\n </div>\n </div>\n </div>\n <div class=\"d-flex justify-content-between align-items-center\">\n <div>\n <a href=\"#!\" onclick=\"removerProd(this, contenidoCarrito)\" data-value=\"${i}\" type=\"button\" class=\"card-link-secondary small text-uppercase mr-3\" style=\"color:#dd2f56\">\n <i class=\"fas fa-trash-alt mr-1\"></i>Remover Producto</a>\n </div>\n <p class=\"mb-0\"><span><strong>${productoCarrito.currency}</strong><strong id=\"precioUnitario${i}\"> ${formatNumber(productoCarrito.unitCost)}</strong></span></p>\n </div>\n </div>\n </div>\n </div>\n <hr class=\"mb-4\">\n </div>\n <!-- Card -->`\n} document.getElementById(\"listadoCompletoCarrito\").innerHTML = listadoProdCarrito;\n} //recorre el array y va mostrando los productos en el html", "title": "" }, { "docid": "c2d4337c91941efe3164ed872c5bb14c", "score": "0.53152525", "text": "static Comparar(p1, p2){\n\n\t\tif( p1._precio > p2._precio ){\n\t\t\tdocument.write(`El ${p1._nombre} es mas caro que el ${p2._nombre}`)\n\t\t} else {\n\t\t\tdocument.write(`El ${p1._nombre} es mas barato que el ${p2._nombre}`)\n\t\t}\n\n\t}", "title": "" }, { "docid": "604dd3d3826d45e82475eccbe388de15", "score": "0.5307966", "text": "async store({ params: { companyId }, request, response, auth }) {\n const { total_amount, products } = request.post();\n const user = await auth.getUser();\n const company = await user.company().fetch();\n\n const products_id = [];\n const sale = new Sale();\n\n sale.fill({ total_amount });\n for (let i = 0; i < products.length; i++) {\n products_id[i] = products[i].product_id;\n\n const product = await Product.find(products[i].product_id);\n const kardexTotal = await product.kardex().fetch();\n\n // Comprobar si es la primera entrada\n const first = kardexTotal.toJSON().length === 0 ? true : false;\n\n // Si es la primera entrada\n if (first) {\n return response.status(200).json({\n error: true\n });\n } else {\n const kardexTotal = await product\n .kardex()\n .with(\"stocks\")\n .fetch();\n const lastKardex = kardexTotal.toJSON();\n const lastStocks = lastKardex[lastKardex.length - 1].stocks;\n let esta = false;\n let continuar = true;\n const kardex = new Kardex();\n kardex.fill({ detail: \"Venta\" });\n let contador = parseInt(products[i].quantity, 10);\n\n for (let j = 0; j < lastStocks.length; j++) {\n if (contador > 0) {\n const element = lastStocks[j];\n const valueA = parseInt(element.quantity, 10);\n const valueB = parseInt(products[i].quantity, 10);\n\n if (valueB <= valueA) {\n const quantityA = parseInt(element.quantity, 10);\n //const quantityB = parseInt(products[i].quantity, 10);\n const quantityT = quantityA - contador;\n const total = quantityT.toString();\n element.quantity = total;\n\n const totalA = parseInt(element.unit_value, 10);\n const totalB = parseInt(element.total_value, 10);\n const totalC = totalA * contador;\n const totalT = totalB - totalC;\n const totalD = totalT.toString();\n element.total_value = totalD;\n\n const outputs = new Output();\n outputs.fill({\n quantity: contador,\n unit_value: element.unit_value,\n total_value: element.unit_value * contador\n });\n await kardex.outputs().save(outputs);\n await sale.outputs().save(outputs);\n contador -= contador;\n } else {\n const quantityA = parseInt(element.quantity, 10);\n //const quantityB = parseInt(products[i].quantity, 10);\n //const quantityT = quantityA - quantityB;\n //const total = quantityT.toString();\n element.quantity = 0;\n\n const totalA = parseInt(element.unit_value, 10);\n //const totalB = parseInt(element.total_value, 10);\n //const totalC = totalA * quantityB;\n //const totalT = totalB - totalC;\n const totalD = totalA.toString();\n element.total_value = totalD;\n\n const outputs = new Output();\n outputs.fill({\n quantity: quantityA,\n unit_value: element.unit_value,\n total_value: element.unit_value * quantityA\n });\n await kardex.outputs().save(outputs);\n await sale.outputs().save(outputs);\n\n contador -= quantityA;\n }\n }\n }\n\n for (let k = 0; k < lastStocks.length; k++) {\n const element = lastStocks[k];\n const quantityA = parseInt(element.quantity, 10);\n if (quantityA > 0) {\n const stocks = new Stock();\n stocks.fill({\n quantity: element.quantity,\n unit_value: element.unit_value,\n total_value: element.total_value\n });\n await kardex.stocks().save(stocks);\n }\n }\n\n if (esta) {\n const stocks = new Stock();\n stocks.fill({\n quantity: products[i].quantity,\n unit_value: products[i].amount / products[i].quantity,\n total_value: products[i].amount\n });\n await kardex.stocks().save(stocks);\n }\n await product.kardex().save(kardex);\n }\n }\n\n await company.sales().save(sale);\n\n if (products && products.length > 0) {\n await sale.products().attach(products_id, row => {\n for (let j = 0; j < products.length; j++) {\n if (row.product_id === products[j].product_id) {\n row.quantity = products[j].quantity;\n }\n }\n });\n sale.products = await sale.products().fetch();\n }\n\n sale.outputs = await sale.outputs().fetch();\n\n response.status(201).json({\n message: \"Se ha creado la venta satisfactoriamente.\",\n sale: sale,\n error: false\n });\n }", "title": "" }, { "docid": "6c7efb1da68654fa9bf1575853023d1f", "score": "0.53016627", "text": "takeItem(id){\r\n let filtro = carritoDeCompras.filter(producto => producto.id === id)[0];\r\n if(carritoDeCompras[carritoDeCompras.findIndex(item => item.id === filtro.id)].quantity == 1){\r\n this.removeProduct(id);\r\n this.buildCart();\r\n this.totalQuantity(); \r\n this.totalPrice(total);\r\n }else{\r\n carritoDeCompras[carritoDeCompras.findIndex(item => item.id === filtro.id)].quantity--\r\n this.buildCart();\r\n this.totalQuantity();\r\n this.totalPrice(total);\r\n }\r\n localStorage.setItem('carritoDeCompras', JSON.stringify(carritoDeCompras));\r\n \r\n }", "title": "" }, { "docid": "2c03a956bf4b1d639a48d880e26cba99", "score": "0.5294534", "text": "calcularInfTotalEngancheBonificacion(){\n /** Variables para calcular el porcentaje de enganche, Bonificacion de enganche y el total */\n var porcentajeEnganche = parseFloat(0);\n var bonificacionEnganche = parseFloat(0);\n var totalAdeudo = parseFloat(0);\n /** Se recorre el arreglo */\n for(var i = 0; i < this.state.articulosCalculaInformacion.length;i++){\n /** Se obtiene el objeto en la posicion del arreglo */\n var object = this.state.articulosCalculaInformacion[i];\n /** Se calcula el iva del producto */\n var precioiva = (parseFloat(object.precio) * (1 + ((parseFloat(this.props.objConfiguracion.tasafinanciamiento) * parseInt(this.props.objConfiguracion.plazomaximo)) / parseFloat(100)))).toFixed(2);\n /** Se calcula el importe del producto */\n var importeproducto = precioiva * parseInt(object.cantidad);\n /** Se calcula el porcentaje enganche */\n var enganche = ((parseFloat(this.props.objConfiguracion.porcientoenganche)/parseInt(100)) * importeproducto).toFixed(2);\n /** Se calcula la bonificacion del enganche */\n var boniEnganche = (enganche * ((parseFloat(this.props.objConfiguracion.tasafinanciamiento) * parseFloat(this.props.objConfiguracion.plazomaximo)) / parseInt(100))).toFixed(2);\n /** Se calcula el total */\n var total = (parseFloat(importeproducto) - parseFloat(enganche) - parseFloat(boniEnganche)).toFixed(2);\n /** Se asignan los valores a las variables necesarias para llevar el conteo */\n porcentajeEnganche = parseFloat(parseFloat(porcentajeEnganche) + parseFloat(enganche)).toFixed(2);\n bonificacionEnganche = parseFloat(parseFloat(bonificacionEnganche) + parseFloat(boniEnganche)).toFixed(2);\n totalAdeudo = parseFloat(parseFloat(totalAdeudo) + parseFloat(total)).toFixed(2);\n }\n /** Se asigna la informacion al state */\n this.asignarValorState('enganche',parseFloat(porcentajeEnganche).toFixed(2),'informacionTotal');\n this.asignarValorState('bonificacionenganche',parseFloat(bonificacionEnganche).toFixed(2),'informacionTotal');\n this.asignarValorState('total',parseFloat(totalAdeudo).toFixed(2),'informacionTotal');\n }", "title": "" }, { "docid": "7ed541b21cef19c73561deec83da7329", "score": "0.5292103", "text": "function costeMedio(){\n let medio = 0;\n for (let i = 0; i < vuelos.length; i++) {\n medio += vuelos[i].precio;\n }\n medio = medio / (vuelos.length);\n console.log(`\\nEl coste medio de los billetes es de ${medio}\\u20AC`)\n}", "title": "" }, { "docid": "8aa0a08b38b684f5efacac527a3ff53e", "score": "0.52816135", "text": "function calculQuantiteMax(product){\n var cout = product.cout;\n var croissance = product.croissance;\n var n=1;\n var prix = cout;\n while (prix <= currentWorld.money){\n n = n+1;\n prix = calculCout(cout,croissance,n);\n }\n return n-1;\n}", "title": "" }, { "docid": "1297665ece6aca408229575b798cade0", "score": "0.527243", "text": "function buscarRepetido(id_del_producto){\n var bol = 0;\n var dos = id_del_producto;\n let product_cart = JSON.parse(localStorage.getItem('product_cart_menu'));\n\n for (let i = 0; i < product_cart.length; i++) {\n var uno = product_cart[i].id_menu;\n \n if (uno == dos) {\n // console.log('No haga nada')\n alert('Este Producto ya esta Enlistado')\n bol=1;\n }else{\n // console.log('Ingrese Nuevo Producto')\n }\n }\n\n return bol;\n}", "title": "" }, { "docid": "68780d6dcad192d6af2c05edd7c6aaa4", "score": "0.5266139", "text": "function whatFlavors(costs, money) {\n const compliments = {};\n\n for (let i = 0; i < costs.length; i++) {\n const cost = costs[i];\n if (cost >= money) {\n continue;\n }\n const compliment = money - cost;\n if (compliments[cost]) {\n const costIndex = i + 1;\n const complimentIndex = compliments[cost];\n const min = Math.min(costIndex, complimentIndex);\n const max = Math.max(costIndex, complimentIndex);\n console.log(`${min} ${max}`);\n return;\n }\n compliments[compliment] = i + 1;\n }\n}", "title": "" }, { "docid": "4709cac5d17355636d69186a0b713db7", "score": "0.52618325", "text": "descuentosPorCodigo() {\n var codigoDescuento = this.codigoDescuento;\n var descuentoPorCodigo = 0;\n if (codigoDescuento === \"DES1\") {\n var descuentoPorCodigo = this.precioPorPersona;\n }\n else if (codigoDescuento === \"DES200\") {\n var descuentoPorCodigo = 200;\n }\n else if (codigoDescuento === \"DES15\") {\n var descuentoPorCodigo = this.calcularPrecioBase() * 0.15;\n }\n return descuentoPorCodigo;\n }", "title": "" }, { "docid": "ade583e86bb1c18ea71ddd0be7ae170e", "score": "0.52592367", "text": "function compareProducts(a,b) {\n\tif(a.product === 'FabMo-Updater') {\n\t\treturn b.product === 'FabMo-Updater' ? 0 : -1;\n\t}\n\tif(b.product === 'FabMo-Updater') {\n\t\treturn a.product === 'FabMo-Updater' ? 0 : 1;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "99bd6ab52a6885656a3c48e8616ec9f9", "score": "0.5256462", "text": "function total() {\r\n let quantities = Array.from(document.querySelectorAll(\".qute\"))\r\n let unitPrices = Array.from(document.querySelectorAll(\".unit-price\"))\r\n // ALGORITHM\r\n let p = 0;\r\n for (let i in unitPrices) { p = p +(quantities[i].innerHTML)*(+unitPrices[i].innerHTML)\r\n }\r\n totalPrice.innerHTML = p\r\n}", "title": "" }, { "docid": "3f9dfdafade530674d283c14877f2b64", "score": "0.524192", "text": "function compta(p) {\n let c=0;\n\n for(let i=0;i<motRix.length;i++) {\n if(motRix[i]==p) { c++; }\n }\n return c;\n}", "title": "" }, { "docid": "6d8f76258be6e14ba573260cbc6def65", "score": "0.52412826", "text": "carrinhoTotal() {\n let total = 0\n if(this.carrinho.length)\n this.carrinho.forEach(item => {\n total += item.preco\n });\n return total\n }", "title": "" }, { "docid": "3461d658bbe706cc54437bdd909ebaaf", "score": "0.5240938", "text": "function minimumBribes(q) {\n let bribes = 0\n let remainder = 0\n for (let i = 0; i < q.length; i++){\n if (q[i] > q[i + 1]) {\n remainder = q[i] - q[i + 1]\n bribes += remainder\n if (remainder > 2) {\n return 'Too chaotic'\n }\n }\n }\n return bribes\n}", "title": "" }, { "docid": "9a3d7f4194516014bf46ed4c2ec6beb6", "score": "0.5237856", "text": "function getQAmount(queue){\n //skal ikke clones fordi det kun bliver sat ind ét sted\n document.querySelector(\"#qNumb\").textContent = queue.length;\n\n if(queue.length > 10){\n document.querySelector(\"#qCircle\").style.backgroundColor = \"#EA4F67\";\n }\n else if(queue.length > 5 && 10){\n document.querySelector(\"#qCircle\").style.backgroundColor = \"#F2EDAF\";\n }\n}", "title": "" }, { "docid": "1b4f69cdfd86c679e792c0c0713d230b", "score": "0.52369624", "text": "function actualizarTotal() {\n let itemsElements = document.getElementsByClassName(\"item\");\n let total = 0;\n for (let element of itemsElements) {\n // Obtengo el precio de la lista de items en chango y lo multiplico por la cantidad\n let precio = element.children[2].innerText;\n let cantidad = document.getElementById('cantidad-item' + element.dataset.iditem).value;\n total += (precio * cantidad);\n }\n document.getElementById(\"total\").innerText = '$' + total;\n // Habilita el boton de confirmar la factura si ya hay un chango cargado y un cliente elegido\n changoConItem = total != 0;\n document.getElementById(\"botonConfirmar\").disabled = !(changoConItem && clienteElegido);\n}", "title": "" }, { "docid": "d3bc2dd2317cad87ff46ec9c59029d38", "score": "0.523295", "text": "function comp(a, b) {\n if (a.estimated_cost_cents_min < b.estimated_cost_cents_min)\n return -1;\n if (a.estimated_cost_cents_min > b.estimated_cost_cents_min)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "0b3bd94777af10959d39be2e3882b904", "score": "0.5231074", "text": "function getCostosProductosInsumosRtaMdc() {\n\n //vm.objHeaderCostosCalculados = {\n // pjCambio: \"\",\n // lapsoCorteMes: \"\",\n // tomaMayorMenor: \"\",\n // aumentarDismuir: \"\",\n // flexibilidad: \"\"\n //}\n\n if (vm.objHeaderCostosCalculados.pjCambio === \"\") {\n toastr.info('Debe ingresar un % de cambio');\n return;\n }\n\n\n if (vm.objHeaderCostosCalculados.flexibilidad === \"\") {\n toastr.info('Debe ingresar la flexibilidad');\n return;\n }\n\n\n vm.listaCostosProductosRtaMdc = [];\n vm.objectDialog.LoadingDialog(\"...\");\n RTAService.getCostosProductosInsumosRtaMdc()\n .then(function (data) {\n \n if (data.data.length > 0 && data.data[0].length > 0) {\n vm.objectDialog.HideDialog();\n vm.listaCostosProductosRtaMdc = data.data[0];\n\n vm.listaCostosProductosRtaMdc.forEach(function (item) {\n\n //SI EL COSTO MDC ES MAYOR SE COLOCA SINO SE COLOCA EL DE RTA\n //if (item.COSTO_MDC > item.COSTO_RTA) {\n // item.MAYOR_VALOR = item.COSTO_MDC;\n //} else {\n // item.MAYOR_VALOR = item.COSTO_RTA;\n //}\n\n if (vm.objHeaderCostosCalculados.tomaMayorMenor === 'M') {\n\n if (item.COSTO_MDC > item.COSTO_RTA) {\n item.MAYOR_VALOR = item.COSTO_MDC;\n } else {\n item.MAYOR_VALOR = item.COSTO_RTA;\n }\n } else {\n if (item.COSTO_MDC < item.COSTO_RTA) {\n item.MAYOR_VALOR = item.COSTO_MDC;\n } else {\n item.MAYOR_VALOR = item.COSTO_RTA;\n }\n }\n\n if (vm.objHeaderCostosCalculados.tomaMayorMenor === 'P') {\n\n item.MAYOR_VALOR = (item.COSTO_MDC + item.COSTO_RTA) / 2;\n\n }\n\n\n //cALCULAR VARIACIÓN PORCENTUAL \n if (item.COSTO_MDC === 0) {\n item.VARIACION = 0;\n } else {\n item.VARIACION = (((item.COSTO_MDC - item.COSTO_RTA) / item.COSTO_RTA) * 100).toFixed(2);\n }\n \n \n\n //ASIGNAR COSTO FINAL \n\n if (item.VARIACION > parseFloat(vm.objHeaderCostosCalculados.pjCambio) || item.VARIACION > parseFloat(vm.objHeaderCostosCalculados.flexibilidad)) {\n item.SW_ALERTA = 1;\n item.COSTO_FINAL_RTA = item.MAYOR_VALOR;\n vm.swAlarmaCostos = true;\n\n } else {\n item.COSTO_FINAL_RTA = item.MAYOR_VALOR + item.MAYOR_VALOR * (parseFloat (vm.objHeaderCostosCalculados.pjCambio) / 100);\n item.SW_ALERTA = 0;\n }\n\n \n\n });\n }\n else {\n //vm.objectDialog.HideDialog();\n toastr.error(\"Ocurrió un error al tratar de obtener los últimos costos de insumos\");\n }\n });\n }", "title": "" }, { "docid": "de9b5ada63ac3da32a57bd2706ed949a", "score": "0.5224999", "text": "function computarTotal() {\n var total = 0.0;\n\n pedido.forEach(function(id){\n total += pizzas.get(id).precio;\n })\n return total;\n}", "title": "" }, { "docid": "9e847b35bf513b574441f57ae6e86e41", "score": "0.52217215", "text": "comprobarPresupuesto(){\n\n const presupuestoTotal = cantidadPresupuesto.presupuesto;\n const presupuestoRestante = cantidadPresupuesto.restante;\n\n //* Comprobar el 25%\n if((presupuestoTotal / 4) > presupuestoRestante ){\n const restante = document.querySelector('.restante');\n restante.classList.remove('alert-success', 'alert-warning');\n restante.classList.add('alert-danger');\n } else if((presupuestoTotal / 2) > presupuestoRestante){\n const restante = document.querySelector('.restante');\n restante.classList.remove('alert-success');\n restante.classList.add('alert-warning');\n }\n \n console.log(presupuestoRestante);\n }", "title": "" }, { "docid": "eb70b558ff993a57f01483307698e5a4", "score": "0.5220712", "text": "function equity() {\n return sharesOwned * mostRecentPrice + investable;\n}", "title": "" }, { "docid": "ef1da215aa473edea56e598c4f8e1544", "score": "0.5217602", "text": "function compareAvailableAmounts(oldAmounts, newAmounts, bee) {\n $old1 = $(oldAmounts).get(1);\n $new1 = $(newAmounts).get(1);\n if ($old1 == $new1) {\n return false;\n } else {\n bee.cachedAvailableAmounts = newAmounts;\n clearBeeDataFromDOM(bee);\n mapBeeDataToDOM(bee);\n }\n }", "title": "" }, { "docid": "1be764bde3ae39108f3a9654584d363f", "score": "0.5216904", "text": "dividir_cuotas(){\n let cuotas = [];\n\n let exponencial = Math.pow(10,this.exactitud);\n\n let numero = parseInt(this.total*exponencial);\n\n let base = parseInt(numero/this.n);\n\n let ultimo = parseInt(numero) - parseInt(base*parseInt(this.n - 1))\n\n for (let i = 0; i < parseInt(this.n - 1); i++) {\n this.cuotas.push({\n valor: parseFloat(base/exponencial).toFixed(this.exactitud),\n saldo: parseFloat(base/exponencial).toFixed(this.exactitud),\n fecha: \"\",\n });\n }\n\n this.cuotas.push({\n valor: parseFloat(ultimo/exponencial).toFixed(this.exactitud),\n saldo: parseFloat(ultimo/exponencial).toFixed(this.exactitud),\n fecha: \"\",\n });\n }", "title": "" }, { "docid": "4c41e95c8e832cc5e8321db2980f8f5e", "score": "0.52147454", "text": "function exemplo1(){\n\n const salarioMinimo = 998.00;\n \n const custoQuilowatt = salarioMinimo / 5;\n \n console.log(\"O valor de cada quilowatt é: R$\" + custoQuilowatt);\n \n const quilowattsConsumido = 10;\n \n const valorASerPago = quilowattsConsumido * custoQuilowatt;\n console.log(\"O valor a ser pago por essa residência é: R$\" + valorASerPago);\n \n const desconto = (valorASerPago * 85) / 100 ;\n console.log(\"O valor a ser pago com desconto é: R$\" + desconto)\n }", "title": "" }, { "docid": "654792c37538bbfa32d591f2b0328357", "score": "0.5214321", "text": "async function botCheckNovosComprovantes() {\n checkNovosComprovantes(token).then((ret)=>{\n if(ret.rowsAffected>0){\n novosComprovantes++\n sendLog('AVISO',`Solicitado comprovantes na (Easydocs/AgileProcess) - (${ret.rowsAffected})`)\n }\n x_botCheckNovosComprovantes += ret.rowsAffected\n }) \n ++checks\n setTimeout(botCheckNovosComprovantes,time_evidencias) // (1800000) = A cada 30 minutos\n}", "title": "" }, { "docid": "496eb1fff349d4a8253421e13ab30de8", "score": "0.5206819", "text": "function compra(usuario,monto, numeroTarjeta, vencimiento, codigo, productos){\n\n validoUsuario(usuario);\n validoStock(productos);\n\n /*Pseudocodigo retorna los siguientes status code\n Si el pago fue exitoso retorna un 201,\n 400 si no fue exitosa la operacion,\n Internal Server Error 500\n */\n let response = llamamosAVisaParaPagar('https://visa.pagos.api', parametros);\n let message = '';\n if (response === 201){\n message = 'OK';\n } else if (response === 400){\n message = 'No Aprobada la compra';\n } else if (response === 500) {\n message = 'internal server error';\n }\n\n return message\n}", "title": "" }, { "docid": "1f76859250565e45e73e8010c7dbe99d", "score": "0.5204759", "text": "function budgetCalculator(watchNumbers,mobileNumbers,leptopNumbers){\n watchNumbers = watchNumbers * 50;\n mobileNumbers = mobileNumbers * 100;\n leptopNumbers = leptopNumbers * 500;\n \n const allProducts = [watchNumbers , mobileNumbers , leptopNumbers];\n\n for (let i = 0; i < allProducts.length; i++) {\n const element = allProducts[i];\n var negetiveProduct = 0;\n if(element < 1){\n negetiveProduct++;\n break;\n } \n }\n // if any product number is negative following then return warnign message ;\n if(negetiveProduct > 0){\n return \"Warning!! your any product quantity of negative!\"\n } \n // if product number doesn't negative following then return total budget;\n else{\n let totalCalCultaor = watchNumbers + mobileNumbers + leptopNumbers ;\n return totalCalCultaor;\n }\n }", "title": "" }, { "docid": "c58d4d979bf7148b28e317f3131c01ba", "score": "0.52044445", "text": "function calculateStockCounts(product, quantity) {\n const qty = product.quantity + quantity\n const stock = product.stock_quantity\n if (stock < qty) {\n return false\n }\n return true\n }", "title": "" }, { "docid": "78ee18cd77fa7fe58d7ada0119ddb7e9", "score": "0.5202666", "text": "function agregarCarrito(precio) { //PASO 2: agregas la función\n return total += precio; //PASO 3: en el return le dices que vaya sumando el resultado del precio y se sume al total\n}", "title": "" }, { "docid": "9e58f7e7012cf9aa7de2f91c828f2e04", "score": "0.52020776", "text": "async function get_price(money) {\n values = await get_table();\n let value_key = { exist: false }\n for (const key in values) {\n if (values[key].Moneda === money) {\n value_key = {\n Exist: true,\n Compra: values[key].Compra,\n Venta: values[key].Venta\n }\n break;\n }\n }\n return value_key;\n}", "title": "" }, { "docid": "97dca7528a31979a3fea35422b6967ef", "score": "0.51966476", "text": "function divisaoDePrecos(lista,bancoDeClientes){\n \n if(lista.length > 0 ){ // verifica se a lista de produtas esta vazia\n if(bancoDeClientes.length > 0){ // verifica se a lista de clientes esta vazia\n const orcamento= lista.map(precoTotal).reduce(function total(acumulador,atual){// calcula valor total\n \n return atual+acumulador\n })\n const dicionario = new Map() // cria o dicionario chave valor\n for(let i = 0; i < bancoDeClientes.length; i++){// inserir elementos no dicionario para facilitar a contagem caso haja emails repetidos evita duplicidade de emails\n dicionario.set(bancoDeClientes[i])\n }\n //const dicionario = new Map() // cria o dicionario chave valor\n let tamanho = dicionario.size // pega tamanho do banco de clientes\n let valorDividido = Math.floor(orcamento/(tamanho))// valor que cada cliente tem que pagar\n console.log(`'Valor: ${valorDividido}`);\n let provaDeValor = valorDividido*tamanho // valor total ao multiplicarmos o valor individual de cada cliente pelo seu respectivos pagamentos\n console.log(`Prova de Valor: ${provaDeValor}`);\n if(provaDeValor == orcamento){ // Teste se o pagamento esta de acordo com o valor da divida caso esteja correto valor sera atribuido a cada cliente caso contrario primeiro e feito a atribuição a cada cliente e posteriormente a redistribuição do valor que sobra \n for(let j = 0; j < tamanho;j++ ){\n \n dicionario.set(bancoDeClientes[j],valorDividido)// adcionando chave e valor a cada cliente ao Map\n \n }\n return dicionario\n }else{\n \n let sobra = orcamento-provaDeValor // descobrir quanto de dinheiro esta faltando para pagar a divida\n \n for(let j = 0; j < tamanho;j++ ){\n \n dicionario.set(bancoDeClientes[j],valorDividido)// adcionando chave e valor a cada cliente ao Map\n \n }\n for(let j =0; j < sobra;j++){\n dicionario.set(bancoDeClientes[j],valorDividido+1) // distribuição do dinheiro que falta para paagmento da divida\n }\n \n \n return dicionario\n \n }\n }else{\n console.log('Lista de Clientes vazia'); \n }\n }else{\n console.log('Lista de Compras vazia');\n }\n}", "title": "" }, { "docid": "3f520a2603069aa81905f272dc1b2e4c", "score": "0.5192906", "text": "addQuantity(){\r\n var cantidad = 0;\r\n if(localStorage.getItem('carritoDeCompras')){\r\n let elementos = carritoDeCompras\r\n elementos.forEach((item) => {\r\n cantidad += item.quantity\r\n })\r\n }else{\r\n console.log(\"No se trajeron los productos del LS\");\r\n }\r\n return cantidad; \r\n }", "title": "" }, { "docid": "479295d9c566f25cdf72b94417888658", "score": "0.5190776", "text": "function getMoneySpent(keyboards, drives, b){\n\n let totalPrice = 0;\n\n keyboards.forEach(keyPrice => {\n drives.forEach(drivePrice => {\n // if(keyPrice + drivePrice === b){\n // totalPrice = b;\n // // loop won't stop here, it will continue the next loop round!\n // } else if(keyPrice + drivePrice < b && keyPrice + drivePrice > totalPrice){\n // totalPrice = keyPrice + drivePrice;\n // }\n if(keyPrice + drivePrice <= b && keyPrice + drivePrice > totalPrice){\n totalPrice = keyPrice + drivePrice;\n }\n });\n });\n\n return totalPrice ? totalPrice : -1 ;\n}", "title": "" }, { "docid": "4b7ca5a70f231622d2d1d2610db1e477", "score": "0.5189672", "text": "async procesarVenta(context, juegoAVender) {\r\n await delay(2000); // durante proceso de la venta ocurre un delay de 1seg, luego de eso se ejecuta el reducir stock\r\n\r\n //mutacion REDUCIRPRODUCTO_STOCK:\r\n const indiceJuego = context.state.juegos.findIndex(\r\n (juego) => juego.codigo === juegoAVender.codigo\r\n );\r\n if (context.state.juegos[indiceJuego].stock > 0) {\r\n context.commit(\"REDUCIRPRODUCTO_STOCK\", indiceJuego);\r\n }\r\n console.log(\"procesa venta\");\r\n }", "title": "" }, { "docid": "afdb01fdd0e9b82629fc0fba16232843", "score": "0.5179319", "text": "static getCashe(portfolioId, date) {\n var cashe = {};\n var self = this;\n return new Promise((resolve, reject) => {\n\n var currency = '';\n\n self.getPortfolio(portfolioId)\n .then(portfolio => {\n currency = portfolio.currency;\n\n return self.getTrades(portfolioId, date);\n })\n .then(trades => {\n\n var _cashe = 0;\n trades.forEach(trade => {\n\n// console.log('PORTFOLIO.TRADES', trade);\n\n switch(trade.operationId) {\n case 1:\n if (trade.secid === currency) {\n _cashe = _cashe + Number(trade.price*trade.amount) - Number(trade.comission);\n } else {\n _cashe = _cashe - Number(trade.price*trade.amount) - Number(trade.comission);\n }\n break;\n case 2:\n if (trade.secid === currency) {\n _cashe = _cashe - Number(trade.price*trade.amount) - Number(trade.comission);\n } else {\n _cashe = _cashe + Number(trade.price*trade.amount) - Number(trade.comission);\n }\n break;\n case 3:\n if (trade.secid !== currency) {\n _cashe = _cashe + Number(trade.price*trade.amount) - Number(trade.comission);\n }\n break;\n case 4:\n _cashe = _cashe + Number(trade.price*trade.amount*trade.value/100) - Number(trade.comission);\n break;\n case 5:\n _cashe = _cashe + Number(trade.price*trade.amount) - Number(trade.comission);\n break;\n case 6:\n _cashe = _cashe + Number(trade.price*trade.amount) - Number(trade.comission);\n break;\n case 7:\n _cashe = _cashe - Number(trade.value*trade.price*trade.amount/100) - Number(trade.accint*trade.amount) - Number(trade.comission);\n break;\n case 8:\n _cashe = _cashe + Number(trade.value*trade.price*trade.amount/100) - Number(trade.accint*trade.amount) - Number(trade.comission);\n break;\n\n }\n });\n\n cashe.cashe = _cashe.toFixed(2);\n resolve(cashe);\n\n })\n .catch(error => {\n console.log(error);\n reject(error)\n });\n\n }); \n }", "title": "" }, { "docid": "4a545ea1fb76b84be1da7246ddc9e736", "score": "0.51783895", "text": "function coincidenciaProducto(str){\n\tvar categoria = document.getElementsByTagName(\"select\")[0].value;\n\tvar marca = document.getElementsByTagName(\"select\")[1].value;\n\tvar proveedor = document.getElementsByTagName(\"select\")[2].value;\n\tif (categoria == \"\" && marca == \"\" && proveedor == \"\") {\n\t\tif (str != \"\"){\n\t\t\tdocument.getElementById(\"resultadosInventario\").innerHTML = \"<h1>Buscando resultados...</h1>\";\n\t\t\tapuntadorParametro = coin;\n\t\t\tcoin.getProductosCoincidencia(str);\n\t\t}\n\t\telse{\n\t\t\tlibreria.getProductos();\n\t\t\tapuntadorParametro = libreria;\n\t\t}\n\t}\n\telse{\n\t\tif (categoria != \"\" && marca == \"\" && proveedor == \"\") {\n\t\t\tlibreria.getProductosCatCoin(libreria.categorias[categoria]._id, str);\n\t\t};\n\t\tif (categoria != \"\" && marca != \"\" && proveedor == \"\") {\n\t\t\tlibreria.getProductosCatMarCoin(libreria.categorias[categoria]._id,libreria.marcas[marca]._id, str);\n\t\t};\n\t\tif (categoria != \"\" && marca != \"\" && proveedor != \"\") {\n\t\t\tlibreria.getProductosCatMarProCoin(libreria.categorias[categoria]._id,libreria.marcas[marca]._id, libreria.proveedores[proveedor]._id, str);\n\t\t};\n\t\tif (categoria != \"\" && marca == \"\" && proveedor != \"\") {\n\t\t\tlibreria.getProductosCatProCoin(libreria.categorias[categoria]._id, libreria.proveedores[proveedor]._id, str);\n\t\t};\t\t\n\t\tif (categoria == \"\" && marca != \"\" && proveedor != \"\") {\n\t\t\tlibreria.getProductosMarProCoin(libreria.marcas[marca]._id, libreria.proveedores[proveedor]._id, str);\n\t\t};\n\t}\n}", "title": "" }, { "docid": "ab0a0f216b747bfb82b7104227d2277b", "score": "0.5177396", "text": "function calculateTotalCost() {\n var result = 0;\n for (let [name, quantity] of Object.entries(productsProposed)) {\n if (quantity) {\n result += productsAvailable[name].cost * parseInt(quantity);\n }\n }\n return result;\n }", "title": "" }, { "docid": "d55f6d928e37d8f7ca610536d1efd252", "score": "0.5175719", "text": "mostraorcamento(){\n newexpense = budgetController.totalsBudget('exp');\n newincome = budgetController.totalsBudget('inc');\n newPorcentage = budgetController.totalPorcentage();\n newItemPercentagem = budgetController.totalPorcentage();\n neworcamento = budgetController.calculaTotal();\n neworcamento > 0 ? type = 'inc' : type = 'exp';\n document.querySelector(DOMStrings.showOrcamento).textContent = formatNumero(type, neworcamento);\n document.querySelector(DOMStrings.showIncome).textContent = formatNumero('inc', newincome);\n document.querySelector(DOMStrings.showExpense).textContent = formatNumero('exp', newexpense);\n \n if(newPorcentage >= 0){\n document.querySelector(DOMStrings.showPorcentagem).textContent = newPorcentage + ' %';\n }else if(newPorcentage < 0){\n document.querySelector(DOMStrings.showPorcentagem).textContent = '---';\n };\n }", "title": "" }, { "docid": "660f995620d1cbf6ee7c7c5c3bbfce45", "score": "0.51606166", "text": "function multiplicar_ahora (valor1,valor2,descuento_realizado,cant_total){\n\ttotalDeCompra -= parseInt(document.getElementById(cant_total).value)+descuento_realizado;\n\t\n\t//document.getElementById(cant_total).value = valor1*valor2-descuento_realizado;\n\tdocument.getElementById(cant_total).value = (!parseInt(valor1*valor2-descuento_realizado)) ? 0 : parseInt(valor1*valor2-descuento_realizado);\n\n\t//alert(valor1*valor2-descuento_realizado); sale correcto\n\tdocument.ordencompra.total_adeudado.value = totalDeCompra;\n\ttotalDeCompra += parseInt(document.getElementById(cant_total).value);\n\tsumartotales(descuento_realizado);\t\n}", "title": "" }, { "docid": "f418e851cd24653ae0f5f1b3cdb47cef", "score": "0.5160457", "text": "function llenarCarrito(event){\n\n // Creacion del array de productos que quiere\n var productoHtml = event.target.parentNode.parentNode;\n const productoElegido = productos.filter(elem => \"productoCard-\" + elem.id == productoHtml.id)\n carrito.push(productoElegido[0])\n console.log(carrito)\n\n //!// HACER · QUE LOS PRODUCTOS SE ENVIEN DE A UNO.\n //envio los productos a comprar a sessionStorage\n let dataBaseCarrito = JSON.stringify(carrito)\n sessionStorage.setItem(\"Productos en carrito\", dataBaseCarrito);\n let storageProductosCarrito = sessionStorage.getItem(\"Productos en carrito\")\n var productosGuardados = JSON.parse(storageProductosCarrito)\n\n //Contador carrito\n let contadorBasket = document.getElementById (\"contadorBasket\")\n contadorBasket.innerHTML = productosGuardados.length;\n\n //construyo el html del carrito, tomando los productos guardados en Storage.\n productosSeleccionados.innerHTML =\"\";\n productosGuardados.forEach(producto =>{ \n let nuevoArticleCarrito = document.createElement(\"article\")\n let productosEnCarrito = productosSeleccionados.appendChild(nuevoArticleCarrito);\n productosEnCarrito.className = `productoEnCarrito-${producto.id}`;\n productosEnCarrito.innerHTML =\"\";\n\n //preciototalcompra TAMPOCO SALE\n precioTotal+=producto.precio;\n console.log(precioTotal)\n \n productosEnCarrito.innerHTML = `\n <div class=\"carrito-imagenYnombreProducto\">\n <img src=\"${producto.imagen}\"> \n <div class=\"nombre-y-artista\">\n <p class=\"carrito-nombre-producto\">${producto.nombre}</p>\n <p class=\"subtitulo-azul-chico\">de ${producto.artista}</p>\n </div>\n </div>\n <div class=\"carrito-cantidad\">\n <h4 class=\"carrito-minititulo\">Cantidad</h4>\n <div class=\"carrito-cantidad-prod\">\n <a id=\"restar-producto\">-</a>\n <p id=\"contadorProducto\">0</p>\n <a id=\"sumar-producto\">+</a>\n </div>\n </div>\n <div class=\"carrito-cantidad\">\n <h4 class=\"carrito-minititulo\">precio</h4>\n <p>$${producto.precio}</p>\n </div>\n `\n }); \n\n // total de productos\n let totalProductos = document.getElementById(\"carrito-productosTotal\")\n totalProductos.innerHTML= carrito.length\n\n var contadorProducto= document.getElementById(\"contadorProducto\")\n\n function productoRepetido(){ \n let cantidadProducto = parseInt(contadorProducto.innerText)\n for(var i=0; i<carrito.length; i+=1){\n if(carrito[i].id === carrito[i].id){\n let nuevaCantidad=cantidadProducto+=1\n contadorProducto.innerText=nuevaCantidad\n // y no contruyas el html\n }\n }\n}\nproductoRepetido()\n \n}", "title": "" }, { "docid": "00114ce454b306a91bdc5ae30262e678", "score": "0.5157993", "text": "function calcularPrecioConDescuento(precio, descuento, descuento2){\n const porcentajePrecioConDescuento = 100 - descuento - descuento2;\n const precioConDescuento = (precio * porcentajePrecioConDescuento)/ 100;\n\n return precioConDescuento;\n}", "title": "" }, { "docid": "89da256d0e8562a171b36dfa55fb38e2", "score": "0.5157179", "text": "function ObtenerCuadroMasBajo(){\n var bajo = -1;\n \n for(var x=0;x<tamFigura;x++){\n var j = parseInt(figura[x].split('p')[1])/20;\n \n if(j > bajo){\n bajo = j;\n }\n }\n posCuadroColision = bajo;\n }", "title": "" } ]
0c4f3947aec2199f4d67b0bccf1fa6a7
Convenience to retrieve the card index given a card object
[ { "docid": "ca82aaa8943960ae1bbcd991ffd3d0d2", "score": "0.80804515", "text": "function getCardIdx(cardObj, mgo) {\n\tlet cardIdx = cardObj.cardIdx;\n\treturn cardIdx;\n}", "title": "" } ]
[ { "docid": "36b04c9291b3e0e89d6d771938774e8b", "score": "0.77395153", "text": "function indexCard(hand, card){\n for (let i=0; i<hand.length; i++)\n if (JSON.stringify(hand[i]) == JSON.stringify(card))\n return i;\n return -1;\n}", "title": "" }, { "docid": "67af26835c8ed03b3ce094d0cc91a75a", "score": "0.7650507", "text": "function getCardIndex(list, card, data) {\n var listIndex = getListIndex(list, data)\n var cards = data.lists[listIndex].cards\n for(var i=0; i < cards.length; i++) {\n if (cards[i].name === card) {\n return i\n }\n }\n}", "title": "" }, { "docid": "5812cace8d0849a1dbad731770ad984d", "score": "0.7320963", "text": "function findCard(gameboard, card_index) {\n return gameboard.find((obj) => obj.index === card_index);\n }", "title": "" }, { "docid": "8ff28e9a85bd4995a08695148a881fe1", "score": "0.71059906", "text": "find(card) {\n return this.cards.indexOf(card);\n }", "title": "" }, { "docid": "2ab04a7ee0fc723c01ac93e2ecf18872", "score": "0.6998801", "text": "getCard(index) {\n\n }", "title": "" }, { "docid": "a3b07f5a64c2e1b7b04a1f14da222ddb", "score": "0.6851602", "text": "function getIdCard(index) {\n const card = document.getElementsByClassName(\"card-\" + index);\n const idCard = card[0].id;\n return idCard;\n }", "title": "" }, { "docid": "8497b78cbe29503ac9df1f2577467847", "score": "0.6647275", "text": "function cardConvert(card) {\n console.log(card);\n return cards.indexOf(card[0]);\n}", "title": "" }, { "docid": "d36f7b35fd0112f572a425b58c714e25", "score": "0.65759665", "text": "function getCardObj(cardIdx, mgo) {\n\tlet cardObj = mgo.cardMap.get(cardIdx);\n\treturn cardObj;\n}", "title": "" }, { "docid": "9a5e4d823c7d118ba60e47ea3443e0c8", "score": "0.6526037", "text": "getFruitIndex(ft)\n\t{\n\t\treturn this.state.card_list.findIndex(ft);\n\t}", "title": "" }, { "docid": "7c3e1097cca7fad37d136a8761b7a634", "score": "0.6489527", "text": "function card_number(card) {\n\t\t\treturn card.id\n\t\t}", "title": "" }, { "docid": "0cdb18ece748a4f83c06df6d3cd01340", "score": "0.6350924", "text": "function getSpecificCard(index) {\n return $($(\"#cardTable\").children()[index]).children('.card');\n}", "title": "" }, { "docid": "e047b432ce5c71e4fc948807cfe7920d", "score": "0.6297283", "text": "getCardByIndex(i) {\n return this.cards[i];\n }", "title": "" }, { "docid": "60a99b6e8dded9e33ae020d7743f1d6d", "score": "0.6106741", "text": "index(code, cart) {\n \n for (var i = 0; i < cart.length; i++) {\n var item = cart[i];\n if (item.code === code) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "73ee786b432ce16ab13e6d6d8accfba2", "score": "0.6058104", "text": "function index(obj,i) {return obj[i];}", "title": "" }, { "docid": "73ee786b432ce16ab13e6d6d8accfba2", "score": "0.6058104", "text": "function index(obj,i) {return obj[i];}", "title": "" }, { "docid": "73ee786b432ce16ab13e6d6d8accfba2", "score": "0.6058104", "text": "function index(obj,i) {return obj[i];}", "title": "" }, { "docid": "73ee786b432ce16ab13e6d6d8accfba2", "score": "0.6058104", "text": "function index(obj,i) {return obj[i];}", "title": "" }, { "docid": "7ddef49e628f57b8478c5927a8efdfe3", "score": "0.6023224", "text": "function listContainsCard(list, card) {\n for (j=0; j < list.length; j++) {\n if (list[j][0] === card) {\n return j;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "017d6e543dd14cd33813b2abf496b8ae", "score": "0.59670657", "text": "function getIndex(objects, obj) {\n\n var i;\n for (i = 0; i < objects.length; i++) {\n if (objects[i] === obj) {\n return i;\n }\n }\n\n return -1;\n }", "title": "" }, { "docid": "017d6e543dd14cd33813b2abf496b8ae", "score": "0.59670657", "text": "function getIndex(objects, obj) {\n\n var i;\n for (i = 0; i < objects.length; i++) {\n if (objects[i] === obj) {\n return i;\n }\n }\n\n return -1;\n }", "title": "" }, { "docid": "017d6e543dd14cd33813b2abf496b8ae", "score": "0.59670657", "text": "function getIndex(objects, obj) {\n\n var i;\n for (i = 0; i < objects.length; i++) {\n if (objects[i] === obj) {\n return i;\n }\n }\n\n return -1;\n }", "title": "" }, { "docid": "017d6e543dd14cd33813b2abf496b8ae", "score": "0.59670657", "text": "function getIndex(objects, obj) {\n\n var i;\n for (i = 0; i < objects.length; i++) {\n if (objects[i] === obj) {\n return i;\n }\n }\n\n return -1;\n }", "title": "" }, { "docid": "017d6e543dd14cd33813b2abf496b8ae", "score": "0.59670657", "text": "function getIndex(objects, obj) {\n\n var i;\n for (i = 0; i < objects.length; i++) {\n if (objects[i] === obj) {\n return i;\n }\n }\n\n return -1;\n }", "title": "" }, { "docid": "5ea3b8f7b6647cdd6344c85aeb0a0b2b", "score": "0.5923266", "text": "function getIndex(objects, obj) {\n\n\t var i;\n\t for (i = 0; i < objects.length; i++) {\n\t if (objects[i] === obj) {\n\t return i;\n\t }\n\t }\n\n\t return -1;\n\t }", "title": "" }, { "docid": "d07b4c528da8420acd2629b84fda693d", "score": "0.5909543", "text": "async getIndex(rank) {\n // Find all firewalls in the database\n // find() means to get all\n // exec() means to execute the query command\n let firewalls = await Firewall.find().exec();\n // for each firewall\n for(let i=0;i<firewalls.length;i++){\n // if the firewall matches the passed nrank\n if(firewalls[i].firewall == rank){\n // return the index\n return i\n }\n }\n }", "title": "" }, { "docid": "0b12d19d798afec2c1017a075fdbb19f", "score": "0.5889217", "text": "function indexOfDeck(deckName){\n let deckLength = allDecks.length;\n for(let i = 0; i < deckLength; i++){\n // If there is a match of a deckName\n if(allDecks[i].deckName === deckName){\n return i;\n }\n }\n // Return false if you made it through without finding a match\n return -1;\n}", "title": "" }, { "docid": "c92cbd0c2fdf8e9b38c762478aa22dc5", "score": "0.5889015", "text": "getChieldIndex(obj){\n return this.chields.indexOf(obj);\n }", "title": "" }, { "docid": "9d81eeb0662d5194608c9a5fccb64cb1", "score": "0.5869155", "text": "getCurrentCard() {\r\n return this.state.cards[currentIndex[this.guid]];\r\n }", "title": "" }, { "docid": "cb849b93d5de1164170d137eb04d99a3", "score": "0.5842013", "text": "function getCardValue(card) {\n switch (card[0]) {\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n return parseInt(card[0]);\n break;\n case '1':\n case 'J':\n case 'Q':\n case 'K':\n return 10;\n break;\n default:\n return 11;\n }\n }", "title": "" }, { "docid": "d4fef30cef0def705baf9a46fd9dce87", "score": "0.57775354", "text": "function getRandomIndex() {\n\n return Math.floor(Math.random() * cards.length);\n\n}", "title": "" }, { "docid": "03d3f8b134e59016984a0cd3b8966c19", "score": "0.57523024", "text": "getFruit(ndx)\n\t{\n\t\treturn this.state.card_list[ndx];\n\t}", "title": "" }, { "docid": "37bc2f0d5603e48d78a42f6e90facf19", "score": "0.57457554", "text": "function getIndex() {\r\n let index = store.questionNumber;\r\n return index;\r\n}", "title": "" }, { "docid": "e2938679e9641fb032454cc07882ae55", "score": "0.5740494", "text": "function randomCard() {\n let card = Math.floor(Math.random() * 52);\n return bjGame['cards'][card]; //this returns the card in the array that is in position 'card'(Math.random)\n}", "title": "" }, { "docid": "dc8dae8ab21358627d9f9039b77574c1", "score": "0.5701279", "text": "function dcalcCardName(index) {\n return $('#deckGenerator td.dcalc-card[data-card-index=\"' + index + '\"] .cr-display-card').attr(\"data-card-name\");\n}", "title": "" }, { "docid": "03c8e4a7c8ef49ff0c4d34f6b99eb09e", "score": "0.56949633", "text": "function _findIndex(obj, key, value) {\n for (var i = 0; i < obj.length; i++) {\n if (obj[i][key] == value) {\n return i;\n }\n }\n return null;\n}", "title": "" }, { "docid": "0eeb61a1e2dc86a5d2ee02666fdbf0c6", "score": "0.5684862", "text": "function indexFromEntity(entity) {\n\tlet index = reverseIndexMap.get(entity);\n\tif (index === undefined) {\n\t\tindex = ++indexSize;\n\t\treverseIndexMap.set(entity, index);\n\t\tindexMap[index] = entity;\n\t}\n\treturn index;\n}", "title": "" }, { "docid": "7ea62dfbb492ffacb402fddb89cd7d45", "score": "0.5673552", "text": "function slotToDeckId(index) {\r\n var allIds = getAllDeckIds();\r\n return allIds[index - 1];\r\n}", "title": "" }, { "docid": "4aaa13248cd9585e19f5840f13e823e2", "score": "0.56445265", "text": "function clickOnCard(x,y){\n\t\tfor (var i = 0; i < cards.length; i++) {\n\t\t\tif( (x > cards[i].x) && (x < (cards[i].x + cards[i].w)) && (y > cards[i].y) && (y < (cards[i].y + cards[i].h))){\t// Boundary checking\n\t\t\t\treturn i;\t// index on the card you clicked on\n\t\t\t}\n\t\t}\n\t\treturn -1;\t// Didn't click on a card\n\t}", "title": "" }, { "docid": "cb10eebcd3dc0063a79ed479297ba96b", "score": "0.56229234", "text": "function getDealerIndex() {\n for (const [index, player] of players.entries()) {\n // return the dealer index\n if (round.dealer.id === player.id) return index;\n }\n }", "title": "" }, { "docid": "9b8088adb3a5940a888feded121d3eb7", "score": "0.56225485", "text": "function getCardNumericValue(card) {\n switch (card.value) {\n case 'Ace':\n return 1;\n case 'Two':\n return 2;\n case 'Three':\n return 3;\n case 'Four':\n return 4;\n case 'Five':\n return 5;\n case 'Six':\n return 6;\n case 'Seven':\n return 7;\n case 'Eight':\n return 8;\n case 'Nine':\n return 9; \n default:\n return 10;\n }\n}", "title": "" }, { "docid": "4824ca768cf6c01681756caa20b0939c", "score": "0.5612489", "text": "getIndex(key) {\n\t\tfor (let i = 0; i < this.items.length; i++) {\n\t\t\tif (this.items[i].key == key) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "title": "" }, { "docid": "a47833c21c35e86961bfb76c9c5a4b65", "score": "0.5589881", "text": "moveGetTableCard(index) {\n\t\t// Check if the index Exists\n \t\tif (index >= 0 && index < this.moveTableCardLength()) {\n\t\t\t// Return the card from the array\n \t\t\treturn this.mTableCards[index];\n\t\t}\n\t\t// Throw an Error\n \t\telse {\n \t\t\tconsole.log(\"ERROR!! - {Move} [moveGetTable]\");\n \t\t}\n \t}", "title": "" }, { "docid": "ccb9391702b007b5e98d4f5585591db5", "score": "0.55818266", "text": "function randomCard(){ \n //creating a random card and returning it using the card object\n let randomIndex = Math.floor(Math.random() * 13);\n return blackJack['cards'][randomIndex];\n}", "title": "" }, { "docid": "08638f928beb035a82bab629c2baff67", "score": "0.5573549", "text": "function PCEINDEX(piece, piece_id) {\n\treturn (piece*10 + piece_id);\n}", "title": "" }, { "docid": "213a8a054c1463f900a8503b020334ce", "score": "0.5556946", "text": "getCreatorIndex() {\n let creators = this.page.creators;\n for (let cr = 0; cr < creators.length; cr++) {\n if (creators[cr].studentId === global.id) {\n console.log(\"Creator index = \" + cr)\n return cr;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "dfbaf9df744dce6dd9779032507c2d6e", "score": "0.5534255", "text": "function cardValue(card){\n card = card[0];\n if (card=='Ace'){\n return 1;\n } else if (!!parseInt(card)){\n return parseInt(card);\n } else{\n return 10;\n }\n}", "title": "" }, { "docid": "b65de63135e1d229e5ff2abc2d03b168", "score": "0.5531647", "text": "function getDeckIndex(deckName) {\n for(var i = 0, length = $scope.savedDecks.length; i < length; i++) {\n if($scope.savedDecks[i].name === deckName) {\n return i;\n }\n }\n return false;\n }", "title": "" }, { "docid": "0386fcbc32f40de3574a119d78a402e0", "score": "0.5526742", "text": "function index(startObj, i) {return startObj[i]}", "title": "" }, { "docid": "0386fcbc32f40de3574a119d78a402e0", "score": "0.5526742", "text": "function index(startObj, i) {return startObj[i]}", "title": "" }, { "docid": "4b221576abfda9607b3168cb0ab9b681", "score": "0.55087805", "text": "function position(choosen){\n console.log(choosen + \"position\" + cards.indexOf(choosen))\n }", "title": "" }, { "docid": "e6bc79b938354c02e196f54928718537", "score": "0.54907423", "text": "function list_index(obj) {\n\t\treturn obj.parent().parent().children().index(obj.parent());\n\t}", "title": "" }, { "docid": "1101210d17524afe272293fe5f25e962", "score": "0.5489985", "text": "function findCustomerIndex(id) {\n let index = customers.findIndex(function(item, i){\n return item._id === id; // Check id's and return object's index in array\n });\n return index;\n}", "title": "" }, { "docid": "1a5b48c4b0e4fb192028f0a8172060ae", "score": "0.5485364", "text": "function getClickedObjectIndex(answer, displayedProducts){\n var index;\n displayedProducts.forEach(function(product){\n if (product.description === answer){\n index = displayedProducts.indexOf(product);\n }\n });\n return index;\n}", "title": "" }, { "docid": "b71917682ac0314bee87fec6f2462854", "score": "0.5484677", "text": "function objectIdToIndex(list, id)\n {\n return (id & list.INDEX_MASK);\n }", "title": "" }, { "docid": "8ac48911cb8b535127a2e950c3f772b6", "score": "0.5483786", "text": "function getCardNumberValue(card) {\n switch (card.value) {\n case 'Ace':\n return 1;\n case 'Two':\n return 2;\n case 'Three':\n return 3;\n case 'Four':\n return 4;\n case 'Five':\n return 5;\n case 'Six':\n return 6;\n case 'Seven':\n return 7;\n case 'Eight':\n return 8;\n case 'Nine':\n return 9;\n// If card value is equal to 10, Jack, Queen or King, that'll get caught by this default block and will return 10:\n default: \n return 10; \n }\n}", "title": "" }, { "docid": "c822eb6946a2aca541ec99edc4daba7f", "score": "0.54729384", "text": "function getIndex(character, d = data) {\n // d should have the structure:\n // data = [{\"character\": <character>, \"data\": <barData>, ...}, ...]\n // where barData = [{\"phoneme\": <phoneme>, \"Zscore\": <Zscore>, ...}, ...]\n let index = 0;\n if (d) {\n while (index < d.length && d[index][\"character\"] != character) {\n index += 1;\n }\n if (index == d.length) {\n index = false;\n }\n } else {\n index = false;\n }\n return index;\n}", "title": "" }, { "docid": "9bc05b482dd9984013d352c9841402e5", "score": "0.5470841", "text": "async getIndex(name) {\n // Find all items in the database\n // find() means to get all\n // exec() means to execute the query command\n let commands = await Command.find().exec();\n // for each item,\n for(let i=0;i<commands.length;i++){\n // if the item matches the passed name,\n if(commands[i].command == name){\n // return the index\n return i\n }\n }\n }", "title": "" }, { "docid": "65282ba5b2acc7348bf74f01ef2c0055", "score": "0.54630095", "text": "getCardObjectById(cardId) {\n return _.find(this.cards, { id: cardId });\n }", "title": "" }, { "docid": "6f81fafc9f992f4b5bb72dac8b038ffd", "score": "0.54563063", "text": "function getRandomIndex() {\n return Math.floor(Math.random() * (cards.length - 1));\n}", "title": "" }, { "docid": "bd56899e7cb7e1c0501d14736c81e337", "score": "0.54559463", "text": "function getTheUnMatchedCardId() {\n for (var i in cards) {\n if (cards[i].value == 2) {\n return cards[i].id;\n }\n }\n}", "title": "" }, { "docid": "a1fbfc187de1ccc787cc2b7702fcf51e", "score": "0.54401255", "text": "function GetIndex(){\n var index=getRndInteger();\n while(vis[index])\n index=getRndInteger();\n return index;\n}", "title": "" }, { "docid": "cf2ad673fad2eec220c79f42e8412d0e", "score": "0.54373246", "text": "getObject( index ){\n\t\treturn this.entries[ index ];\n\t}", "title": "" }, { "docid": "0829ba751799744866d5d16d3654ee8e", "score": "0.5426664", "text": "findColIndex(col_name) {\n return this.state.studentColumns.find(obj => obj.col_name == col_name).col_index\n }", "title": "" }, { "docid": "b95b43e21ed619c85adcf3d768f500f0", "score": "0.5421132", "text": "function contactIndex(contact, list) {\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (list[i].nodeID === contact.nodeID) return i;\n\t}\n\n\treturn -1;\n}", "title": "" }, { "docid": "feefc937b460bf12abe5051d3035e2e4", "score": "0.541971", "text": "function getItemIndexFromElement(item) {\n const itemIndexString = $(item)\n .closest('.js-item-index-element')\n .attr('data-item-index');\n return parseInt(itemIndexString, 10);\n}", "title": "" }, { "docid": "629febeb94889f15de6cf8ea21de145e", "score": "0.5417271", "text": "function getTheTempCardId() {\n for (var i in cards) {\n if (cards[i].value == 1) {\n return cards[i].id;\n }\n }\n}", "title": "" }, { "docid": "195a721ac4877a9eac6068c40ab17394", "score": "0.5393101", "text": "function getStudentIndex(screenName, array){\n\tfor (var i=0; i < array.length; i++){\n\t\tif (array[i].screen_name == screenName){\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "fea8588bed8e4e37422072dcfaae5b7d", "score": "0.5386798", "text": "function arrayObjectIndexOf(arr, obj){\n for(var i = 0; i < arr.length; i++){\n if(angular.equals(arr[i], obj)){\n return i;\n }\n };\n return -1;\n }", "title": "" }, { "docid": "53997376973471605f6e2a6a9c34f917", "score": "0.53866374", "text": "getIndex() {\n return this.index;\n }", "title": "" }, { "docid": "33d1245535add230e75b890c548db2b8", "score": "0.5380976", "text": "function IndexOf(item)\n{\n for (var i=0; i < this.length; i++)\n { \n if (this[i] == item)\n {\n return i;\n }\n }\n \n return -1;\n}", "title": "" }, { "docid": "6732dddec0073e981aa06c80262e1e96", "score": "0.5380296", "text": "function uuidToIndex(uuid) {\n let index = 0;\n players.forEach((player, playerIndex) => {\n if (player.uuid == uuid) {\n name = player.name;\n index = playerIndex;\n }\n });\n return index;\n}", "title": "" }, { "docid": "8e3c599b1c96e067900937d623aea71e", "score": "0.53680843", "text": "function positionFor(list, key) {\n for(var i = 0, len = list.length; i < len; i++) {\n if( list[i].$id === key ) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "04b1668b03d94888bc5a3224e2f78d84", "score": "0.53628415", "text": "function getIndexOfObject(array, attr, value)\n{\n\tfor(var i = 0; i < array.length; i++) \n\t{\n\t\tif(array[i].hasOwnProperty(attr) && array[i][attr] === value) \n\t\t{\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "b622daf8d1dfe130bf2e14b315d4aee5", "score": "0.5360226", "text": "function findIndexById(list, id){\n for(var i=0; i<list.length; i++){\n if(list[i].id == id)\n return i;\n }\n return -1;\n}", "title": "" }, { "docid": "533f36d1c3e129d30156c6c6dc0985c3", "score": "0.5355993", "text": "function getIndex(objectarray, key, value) {\n\tfor (var i = 0; i < objectarray.length; i++) {\n\t\tif (checkKeys(objectarray, i, key, value))\n\t\t\treturn i;\n\t}\n\t\n\treturn -1;\t\n}", "title": "" }, { "docid": "3700ca27a1ba472f0641ed68ca0691db", "score": "0.53508794", "text": "function getIndexZone(gridContainer, zone) {\r\n for (var zIdx = 0; zIdx < gridContainer.grid.length; zIdx++) {\r\n var gZone = gridContainer.grid[zIdx];\r\n if (gZone.node == zone) {\r\n return zIdx;\r\n }\r\n }\r\n return -1;\r\n}", "title": "" }, { "docid": "ba3fc8504b94e6542799b29601f222ff", "score": "0.5345525", "text": "function getIdxFromId(elementId) {\n var parts = elementId.split('-');\n var idx = +parts.pop(); //convert to number\n return idx;\n}", "title": "" }, { "docid": "d2ebf5c707be43062c8e79e3b994c3f7", "score": "0.53433275", "text": "getHand(index) {\n if (index >= this.hand.length) {\n throw (this.name + \"'s hand has no card at index \" + index)\n }\n return this.hand[index]\n }", "title": "" }, { "docid": "380deded7e9c3321ced0a4b9ff8cac6c", "score": "0.5342766", "text": "getIndex(rowId) {\n return this.state.rows.findIndex((row) => {\n return row === rowId;\n });\n }", "title": "" }, { "docid": "1062bf7290b34238c2ca0795e570cdbe", "score": "0.53331804", "text": "function subSetCardOrderNumber(CardName) {\n \n var RefSht = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Staple CrossRef\");\n var RefMaxRows = RefSht.getMaxRows();\n var Row = 0;\n var Col = 0;\n var RefCardName;\n var CardOrderNum = 0;\n \n for (Row = 2; Row <= RefMaxRows; Row++){\n RefCardName = RefSht.getRange(Row,2).getValue();\n if (RefCardName == CardName) CardOrderNum = RefSht.getRange(Row,1).getValue();\n if (CardOrderNum != 0) Row = RefMaxRows+1;\n }\n return CardOrderNum;\n \n}", "title": "" }, { "docid": "a78ff388fd2bbb6c2b442b88ac9cd4ed", "score": "0.5327149", "text": "function findIndex(items, size, item) {\n for (let i = 0; i <= size; i++) {\n if (items[i] === item) {\n return i + 1\n }\n }\n return null\n}", "title": "" }, { "docid": "331d86983efb22ed421c8bf1acac725f", "score": "0.53181475", "text": "static getOwner(selected_cards, card) {\n let owner = selected_cards.indexOf(card);\n if(owner >= 0 && owner < 2) return 1; // owned by player 1\n else if(owner >= 2 && owner < 4) return 2; // owned by player 2\n else if(owner >= 4 && owner < 9) return 3; // owned by the pool\n else return 0; // not in selected cards -> no owner\n }", "title": "" }, { "docid": "9473dc218965832ecafc405a1973fe13", "score": "0.5312225", "text": "function getIndexPlateformeFromCotes(Plateforme, Cotes) {\n for (let i = 0; i < Cotes.length; i++) {\n if (Cotes[i].Plateforme == Plateforme) {\n return i;\n }\n }\n return null;\n}", "title": "" }, { "docid": "7fccb9d6b3816a7d6570a7891a77aa78", "score": "0.5307991", "text": "function getSymbolFromId(card) {\n\tvar sepIndex = card.id.indexOf('_');\n\treturn card.id.substr(sepIndex + 1);\n}", "title": "" }, { "docid": "efda7442363a7d63e675db2623be7d83", "score": "0.53056693", "text": "function chooseRandomIndex(deck, requirements) {\n\t\tvar index = -1;\n\t\t\n\t\tif(requirements) {\n\t\t\tvar matchingIndices = [];\n\t\t\tdeck.forEach(function(card,idx,ar) {\n\t\t\t\tif(requirements(card))\n\t\t\t\t\tmatchingIndices.push(idx);\n\t\t\t});\n\t\t\tif(matchingIndices.length > 0)\n\t\t\t\tindex = matchingIndices[getRandomNumber(0,matchingIndices.length-1)];\n\t\t}\n\t\telse if(deck.length > 0)\n\t\t\tindex = getRandomNumber(0,deck.length - 1);\n\t\t\n\t\treturn index;\n\t}", "title": "" }, { "docid": "7befe30a877df899490e176572d81b2a", "score": "0.5302101", "text": "function GetIndex(val){\r\ntry{\r\nfor(x=0;x<custbodyterm.length;x++){\r\nif(custbodyterm[x]==val){return x;}\r\n}\r\n}catch(err){\r\nreturn -1;\r\n}\r\nreturn -1;\r\n}", "title": "" }, { "docid": "a70293fde6263bf3e4c7cdfdc81f89fa", "score": "0.53015137", "text": "function findIndexByKeyValue(obj, key, value){\n for (var i = 0; i < obj.length; i++) {\n if (obj[i][key] == value) {\n return i;\n }\n }\n return null;\n}", "title": "" }, { "docid": "7e2b91ca16ccb1eefc4faea9580f611c", "score": "0.5301498", "text": "getCardState(index) {\n if (this.state.currentPair.indexOf(index) !== -1)\n return 'picked';\n if (this.state.matchedCardIndices.has(index))\n return 'matched';\n return 'hidden';\n }", "title": "" }, { "docid": "80c9376c31c26c973b512b3aa7651d75", "score": "0.5290997", "text": "function itemIndexFor(id) {\n var len = AppTodoStore.items.length;\n\n for(var i = 0; i < len; i++) {\n if (AppTodoStore.items[i].id === id) return i;\n }\n return -1;\n}", "title": "" }, { "docid": "d772088138477a84e6a3c34fca17089b", "score": "0.5287204", "text": "function generateId(index, symbol) {\n\treturn 'card' + index + '_' + symbol;\n}", "title": "" }, { "docid": "687635b84f61b455f86af1a906ae47e9", "score": "0.52711684", "text": "getIndex(key) {\n\t\tvar i = this.state.data.findIndex((element)=>{\n\t\t\tif (element.key === key) { return true} })\n\t\treturn i;\n\t}", "title": "" }, { "docid": "e592109b9fb7a99daa1ab9cb52a979c3", "score": "0.5270782", "text": "findIndex(callback) {\n return this.reduce((foundIndex, ele, index) => {\n if (foundIndex === -1 && callback(ele)) {\n return index;\n }\n else {\n return foundIndex;\n }\n }, -1);\n }", "title": "" }, { "docid": "62fcf252321446069578db887fed75f4", "score": "0.52663666", "text": "function findIndexOfItemInCart(item) {\n for (var i = 0; i < cart.length; i++) {\n // Note that the cart is NOT an array of items, but an array of \"cartItems\" - an object\n // containing the \"item\" and a \"quantity\" for that item. So when we ask for the name,\n // we're asking cart[i].item.name.\n if (cart[i].item.name == item.name) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "d5a2c5975704ef3910a5cd490b6ff575", "score": "0.5253313", "text": "function findIndexMethod(list, matchEle){\n\t var index = -1;\n\t for (var i = 0; i < list.length; ++i) {\n\t if (list[i].fieldName!== undefined && list[i].fieldName===matchEle) {\n\t index = i;\n\t break;\n\t }\n\t }\n\n\t return index; \n\t}", "title": "" }, { "docid": "adad3e7208bfc4241d104db0614e1db1", "score": "0.52475256", "text": "findIndex(...args) {\n const index = this.#value.findIndex(...args);\n return index === -1\n ? new ReactivePrimitive(-1)\n : this.#indices[index];\n }", "title": "" }, { "docid": "cc6fe9c51813e3bebd39fa2433dd3f16", "score": "0.524487", "text": "findGapIndex(_card) {\n let index = 0;\n for(let i = 0; i < this.option.inPlay.length; i++) {\n let currCard = this.option.inPlay[i];\n // console.log('comparing', _card.cLocation.x, 'to', currCard.cLocation.x);\n if(_card.cLocation.x < currCard.cLocation.x) {\n index = i + 1;\n }\n }\n\n // console.log('gap index should be, ', index);\n return index;\n }", "title": "" }, { "docid": "d580c923e5c28b36ab3a9fee2315aee6", "score": "0.5244372", "text": "function actionWhenFound(index) {\n console.log(index);\n}", "title": "" }, { "docid": "685517e09654bef3169b6f2d669a2fd9", "score": "0.524023", "text": "function getObjectPositionById(id, object) {\n let pos;\n\n for (let i = 0; i < object.length; i++) {\n if (object[i].id == id) {\n pos = i;\n break;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "62293ac8dad530b4ec0f22b6f9bd71ad", "score": "0.5236112", "text": "getListIndex(id) {\n for (let i = 0; i < this.top5Lists.length; i++) {\n let list = this.top5Lists[i];\n if (list.id === id) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "a38e4e2624c324303e04e3003c494aa8", "score": "0.52329797", "text": "getBoard(index) {\n if (index >= this.board.length) {\n throw (this.name + \"'s board has no card at index \" + index)\n }\n return this.board[index]\n }", "title": "" } ]
4984705a379a49732c5ef66bd34ffc60
Function checks if publication is refereed
[ { "docid": "6d922b1cc03f8d154e63cdf891d0075e", "score": "0.7887244", "text": "function isPubContentRefereed(publication) {\n return publication.contentTypeCode.toLowerCase() === 'refereed'\n}", "title": "" } ]
[ { "docid": "2b674352efc44a0a356ba74ff9b87b8a", "score": "0.6521998", "text": "function isPublished(publication) {\n return (\n publication.publicationStatus !== 'Submitted' &&\n publication.publicationStatus !== 'Accepted' &&\n publication.publicationStatus !== 'In press'\n )\n}", "title": "" }, { "docid": "b82f7c5f40fe3b18a9fc0621c294676a", "score": "0.6395972", "text": "function pubHasDateIssued(publication) {\n return publication.dateIssued !== null\n}", "title": "" }, { "docid": "caa288cdda133d42e884aa196e085dcd", "score": "0.60090286", "text": "get isPublishedRelease() {\n return (this.isRelease && this.isPublished);\n }", "title": "" }, { "docid": "4328bec05090698b0281b76b3f5a3a15", "score": "0.59355295", "text": "function CheckPublishing() {\n\tuseEffect(\n\t\t () => {\n\t\tif ( lockPost === true ) {\n\t\t\t\t\tdispatch( 'core/editor' ).lockPostSaving();\n\t\t} else {\n\t\t\t\t\tdispatch( 'core/editor' ).unlockPostSaving();\n\t\t}\n\t}\n\t\t);\n}", "title": "" }, { "docid": "adf3c70d8c18b64f3d4baa7a3d8954c5", "score": "0.58691084", "text": "isReferredFrom(ref_parts) {\n if (!ref_parts) return false;\n if (sameGeneralDomain(ref_parts.hostname, this.hostname)) {\n return true;\n }\n // not a direct referral, but could be via a third party\n if (ref_parts.hostname in this.tps) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "39ea910732d8804a8c2f06fad6c91175", "score": "0.584111", "text": "function dateCheck( published ) {\n\t//alert( 'Date Published: ' + published );\n\t\n\t// Set up Date objects for publication date and today's date\n\tvar pub_date = new Date( published );\n\tvar now_date = new Date();\n\t\n\t// Find the difference between publication date and today's date\n\tvar diff = new Date( now_date.getTime() - pub_date.getTime() );\n\t\n\t// Calculate difference in years, months, and days\n\tvar year_diff = diff.getUTCFullYear() - 1970;\n\tvar month_diff = diff.getUTCMonth();\n\tvar day_diff = diff.getUTCDate() - 1;\n\t\n\t// Pop up a suitable warning based on how stale the article is\n\tvar s = '';\n\t// TODO: Remove 'over' from warnings if the date diff is exactly X years/months\n\tvar over = '';\n\tif ( year_diff > 0 ) {\n\t\tif ( year_diff > 1 ) { s = 's' };\n\t\talert( 'STALE NEWS WARNING: This article is over ' + year_diff + ' year' + s + ' old!!' );\n\t}\n\telse if ( month_diff > 0 ) {\n\t\tif ( month_diff > 1 ) { s = 's' };\n\t\talert( 'Stale News Warning: This article is over ' + month_diff + ' month' + s + ' old!' );\n\t}\n\telse if ( day_diff > 0 ) {\n\t\tif ( day_diff >= 14 ) {\n\t\t\tvar week_diff = Math.round( day_diff / 7 );\n\t\t\tif ( day_diff % 7 > 0 ) { over = 'over ' };\n\t\t\talert( 'Stale News warning: This article is ' + over + week_diff + ' weeks old.' );\n\t\t}\n\t\telse if ( day_diff >= 3 ) {\n\t\t\talert( 'Stale News warning: This article is now ' + day_diff + ' days old' );\n\t\t}\n\t\telse {\n\t\t\t// Article is less than 3 days old - no warning required\n\t\t\t// TODO: Make this configurable\n\t\t}\n\t}\n\telse {\n\t\t// Article is dated today - no warning required\n\t}\n}", "title": "" }, { "docid": "09b0f6a34dc6058b659c9d0f616e7c5e", "score": "0.5832306", "text": "function ISREF(value) {\n if (!value) return false;\n return value.isRef === true;\n}", "title": "" }, { "docid": "f3ffe96a6fa52805c276f90ec8ca3b65", "score": "0.57848835", "text": "function checkPublished() {\n if (inst.getDataValue('isPublished') === false) {\n return inst.getChildren()\n .then((children) => {\n if (children && children.length) {\n const len = children.length;\n for (let i = 0; i < len; ++i) {\n if (children[i].getDataValue('isPublished') === true) {\n throw new dbErrors.ValidationError({\n message: 'You cannot unpublish this subject until ' +\n 'all its descendants are unpublished.',\n });\n }\n }\n }\n\n return;\n });\n } else {\n return;\n }\n }", "title": "" }, { "docid": "d0b4b66090463e945e6784f04b8b944d", "score": "0.5650886", "text": "function trackUnpublished(publication) {\n\tconsole.log(publication.kind + \" track was unpublished.\");\n}", "title": "" }, { "docid": "b9c8e4865046b35ebb648a574d5ddee6", "score": "0.5605203", "text": "hasUnpublishedChanges() {\n const { provisional, published } = this.state\n\n return JSON.stringify(provisional) !== JSON.stringify(published)\n }", "title": "" }, { "docid": "c3e5baf141a783bbbef5c9fe0b66ebd5", "score": "0.5546814", "text": "canUnsubscribe() {\n\t\treturn this._links.length > 0;\n\t}", "title": "" }, { "docid": "a006a67db981daaa516be3b53d5c69c5", "score": "0.5538993", "text": "function trackUnpublished(publication) {\n log(publication.kind + ' track was unpublished.');\n}", "title": "" }, { "docid": "4111b64148a3ae86952599536f5fb288", "score": "0.54420686", "text": "async checkIfRefExists(ref) {\n try {\n await this.api.git.getRef({ ...this.userInfo, ref });\n return true;\n }\n catch (error) {\n return false;\n }\n }", "title": "" }, { "docid": "b864289f7cbb52bf14ed8e0ef4017c05", "score": "0.5360525", "text": "function aliasCheckPubId(data,callback){\n gun.get(data.pub).once((data,key)=>{\n //console.log(data);\n if(data){\n return callback('EXIST');\n }else{\n return callback(null);\n }\n });\n //return callback(null);\n}", "title": "" }, { "docid": "0ad61f769c34a86d27a0ed817b7b871f", "score": "0.53544307", "text": "function isReference(node) {\n\t return node.kind() == \"Reference\" && node.RAMLVersion() == \"RAML10\";\n\t}", "title": "" }, { "docid": "4cc7676b8bad5b3ff5860ade7e750dde", "score": "0.5352798", "text": "function isReference(node) {\n\t return node.kind() == \"Reference\" && node.RAMLVersion() == \"RAML08\";\n\t}", "title": "" }, { "docid": "c05fc218af437720b14d53aec2c8aab2", "score": "0.53471637", "text": "function isReference(value) {\n return !!(value === null || value === void 0 ? void 0 : value.$ref);\n}", "title": "" }, { "docid": "48f822cabe28a87d266a58cec31779a1", "score": "0.5310942", "text": "function isDocumentUnsaved(doc){\n\t\t// assumes doc is the activeDocument\n\t\tcTID = function(s) { return app.charIDToTypeID(s); }\n\t\tvar ref = new ActionReference();\n\t\tref.putEnumerated( cTID(\"Dcmn\"),\n\t\tcTID(\"Ordn\"),\n\t\tcTID(\"Trgt\") ); //activeDoc\n\t\tvar desc = executeActionGet(ref);\n\t\tvar rc = true;\n\t\t\tif (desc.hasKey(cTID(\"FilR\"))) { //FileReference\n\t\t\tvar path = desc.getPath(cTID(\"FilR\"));\n\t\t\t\n\t\t\tif (path) {\n\t\t\t\trc = (path.absoluteURI.length == 0);\n\t\t\t}\n\t\t}\n\t\treturn rc;\n\t}", "title": "" }, { "docid": "73ada6086b6c741119081ff67f33d2ca", "score": "0.5307328", "text": "hasLink() {\n return !!this.link;\n }", "title": "" }, { "docid": "a9ee986555282fe4f1c2ca1480fa3619", "score": "0.52925694", "text": "function checkAcknowLedgement(document) {\n _.each(document.activities, function(activity) {\n if (activity.type === \"upload-reversion\" || activity.type === \"upload-file\") {\n if (_.findIndex(activity.acknowledgeUsers, function(item) {\n if (item._id) {\n return item._id._id == $scope.currentUser._id && item.isAcknow;\n }\n }) !== -1) {\n activity.isAcknow = true;\n } else {\n activity.isAcknow = false;\n }\n }\n });\n }", "title": "" }, { "docid": "6f21f9bdecfb09fca5a30f52ca8f8f15", "score": "0.5281282", "text": "function srs_can_republish() {\n var browser = get_browser_agents();\n \n if (browser.Chrome || browser.Firefox) {\n return true;\n }\n \n if (browser.MSIE || browser.QQBrowser) {\n return false;\n }\n \n return false;\n}", "title": "" }, { "docid": "0c30e7af105201ca4609138c7527a509", "score": "0.5255804", "text": "function isDocumentNew(doc){\n\t// assumes doc is the activeDocument\n\tcTID = function(s) { return app.charIDToTypeID(s); }\n\tvar ref = new ActionReference();\n\tref.putEnumerated( cTID(\"Dcmn\"),\n\tcTID(\"Ordn\"),\n\tcTID(\"Trgt\") ); //activeDoc\n\tvar desc = executeActionGet(ref);\n\tvar rc = true;\n\t\tif (desc.hasKey(cTID(\"FilR\"))) { //FileReference\n\t\tvar path = desc.getPath(cTID(\"FilR\"));\n\t\t\n\t\tif (path) {\n\t\t\trc = (path.absoluteURI.length == 0);\n\t\t}\n\t}\n\treturn rc;\n}", "title": "" }, { "docid": "1541bb07e787dbb5f3c133e32ce15d11", "score": "0.5226267", "text": "function isDocumentNew(doc){\r // assumes doc is the activeDocument\r cTID = function(s) { return app.charIDToTypeID(s); }\r var ref = new ActionReference();\r ref.putEnumerated( cTID(\"Dcmn\"),\r cTID(\"Ordn\"),\r cTID(\"Trgt\") ); //activeDoc\r var desc = executeActionGet(ref);\r var rc = true;\r if (desc.hasKey(cTID(\"FilR\"))) { //FileReference\r var path = desc.getPath(cTID(\"FilR\"));\r \r if (path) {\r rc = (path.absoluteURI.length == 0);\r }\r }\r return rc;\r}", "title": "" }, { "docid": "a69037ae95ae2ad37dda3306b56b3773", "score": "0.5225991", "text": "function refCount(pubs) {\n var total = 0;\n if (pubs) {\n pubs.forEach(function(pub) {\n total += pub.references ? pub.references.length : 0;\n });\n }\n return total;\n}", "title": "" }, { "docid": "10bba89c0a983766dce32471220c2f92", "score": "0.52229285", "text": "function is_original(author, permlink) {\n return steem.api.getContentAsync(author, permlink)\n .then((results) => {\n return results.id != 0\n })\n .catch((err) => {\n console.log(\"Errors checking if original content \", err)\n })\n}", "title": "" }, { "docid": "c8a0272591aec6019da10afefdf34ef5", "score": "0.5213388", "text": "function isRef(a) {\n return a.startsWith(REF_PREFIX)\n}", "title": "" }, { "docid": "9cb61349289a47e5028c92a88e513e1e", "score": "0.52042866", "text": "function checkRead (book){\n if (book.alreadyRead === true;){\n return \n }\n \n}", "title": "" }, { "docid": "e69777bec84100e057c1469b0595db2a", "score": "0.5199016", "text": "async unpublish(doc) {\n const action = window.apos.modules[doc.type].action;\n try {\n doc = await apos.http.post(`${action}/${doc._id}/unpublish`, {\n body: {},\n busy: true\n });\n apos.notify('apostrophe:noLongerPublished', {\n type: 'success',\n dismiss: true\n });\n apos.bus.$emit('content-changed', {\n doc,\n action: 'unpublish'\n });\n return doc;\n } catch (e) {\n await apos.alert({\n heading: this.$t('apostrophe:error'),\n description: e.message || this.$t('apostrophe:errorWhileUnpublishing'),\n localize: false\n });\n return false;\n }\n }", "title": "" }, { "docid": "1fd1b07d92a07bcf9048289270b22767", "score": "0.51931465", "text": "isAlreadyStored(link) {\n\t\tlinkModel.find({ link }).then((exists) => {\n\t\t\t// exists is null if not found\n\t\t\tif (exists.length) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "e619cbc8d5bd8eb7b36f5d2312e089ed", "score": "0.5175284", "text": "function trackPublished(publication, container) {\n\tif (publication.isSubscribed) {\n\t\tattachTrack(publication.track, container);\n\t}\n\tpublication.on(\"subscribed\", function(track) {\n\t\tconsole.log(\"Subscribed to \" + publication.kind + \" track\");\n\t\tattachTrack(track, container);\n\t});\n\tpublication.on(\"unsubscribed\", detachTrack);\n}", "title": "" }, { "docid": "e763212b73fddd541175ca88fcc982d2", "score": "0.5173515", "text": "function isReference(c) {\n return Object(_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__[\"is\"])(c, 'bpmn:SequenceFlow');\n }", "title": "" }, { "docid": "0686b4bd0ae4e2c80939f1b347b63763", "score": "0.5165127", "text": "function isPub(id) {\n // try to find the ID in the peerlist, and see if it's a public peer if so\n for (var i = 0; i < _app2.default.peers.length; i++) {\n var peer = _app2.default.peers[i];\n if (peer.key === id && !_ip2.default.isPrivate(peer.host)) return true;\n }\n return false;\n}", "title": "" }, { "docid": "0686b4bd0ae4e2c80939f1b347b63763", "score": "0.5165127", "text": "function isPub(id) {\n // try to find the ID in the peerlist, and see if it's a public peer if so\n for (var i = 0; i < _app2.default.peers.length; i++) {\n var peer = _app2.default.peers[i];\n if (peer.key === id && !_ip2.default.isPrivate(peer.host)) return true;\n }\n return false;\n}", "title": "" }, { "docid": "0686b4bd0ae4e2c80939f1b347b63763", "score": "0.5165127", "text": "function isPub(id) {\n // try to find the ID in the peerlist, and see if it's a public peer if so\n for (var i = 0; i < _app2.default.peers.length; i++) {\n var peer = _app2.default.peers[i];\n if (peer.key === id && !_ip2.default.isPrivate(peer.host)) return true;\n }\n return false;\n}", "title": "" }, { "docid": "3e65893613b0a329c8001c634f2e62d9", "score": "0.5159578", "text": "function canReview(){\n\tvar ans = false;\n\t$.each(isReviewer, function(key, val){\n\t\tif ((key == openDoc) && (val == true)){\n\t\t\tans = true;\n\t\t\treturn false;\n\t\t}\n\t});\n\treturn ans;\n}", "title": "" }, { "docid": "c7c407fecffbc49ae008a57bc6216f22", "score": "0.51430345", "text": "function isPubContentOther(publication) {\n return publication.contentTypeCode.toLowerCase() === 'other'\n}", "title": "" }, { "docid": "eaa6a2aa8c5cf1470b075d170a521309", "score": "0.5130823", "text": "isReimbursed() {\n return !this._isEmpty(this.reimbursedDate);\n }", "title": "" }, { "docid": "b4bcf831659fc6981c0f057528117157", "score": "0.5126893", "text": "function isArticle(publication) {\n return (\n publication.publicationTypeCode === 'article' ||\n publication.publicationTypeCode === 'review' ||\n publication.publicationTypeCode === 'bookReview'\n )\n}", "title": "" }, { "docid": "876ba2f3cfb52eaa1c1fba7535393026", "score": "0.5121332", "text": "static isCfnReference(x) {\n return x[CFN_REFERENCE_SYMBOL] === true;\n }", "title": "" }, { "docid": "3d9bba6da0919dfde3e5be0bbf1112ed", "score": "0.51105624", "text": "has(key) {\n return (this.links.find((ref) => (ref.rel === key)) != null);\n }", "title": "" }, { "docid": "d29f9a16751a396c06a45e7dc9b2b260", "score": "0.5105968", "text": "function shouldRefetch(date) {\n return moment().diff(moment(date), \"days\") < 14;\n }", "title": "" }, { "docid": "ee56cbd9a2516ecc6d85268aea52e887", "score": "0.51025426", "text": "function canPublish() {\n var selected = [];\n vm.variants.forEach(variant => {\n\n var published = !(variant.state === \"NotCreated\" || variant.state === \"Draft\");\n\n if (variant.segment == null && variant.language && variant.language.isMandatory && !published && !variant.publish) {\n //if a mandatory variant isn't published \n //and not flagged for saving\n //then we cannot continue\n\n // TODO: Show a message when this occurs\n return false;\n }\n\n if (variant.publish) {\n selected.push(variant.publish);\n }\n });\n\n return selected.length > 0;\n }", "title": "" }, { "docid": "9077c61838b7aa2897a4a7bfa52bcf5e", "score": "0.51014113", "text": "function onSubscriptionEvent(event) {\n // prContact can be empty if this rel=contact is supposed to be inside a rel=participant\n // which doesn't have the /contact link at the moment. However it wouldn't be correct to\n // require the /contact link here as this event cannot be related to this contact. This\n // follows from a simple observation: an event like \"presence updated in contact\" can arrive\n // only if the model has created a presence subscription and the model creates a presence\n // subscription only after it gets the /contact.uri value. You might have noticed that the ctor\n // of the person model can theoretically take the .uri value from the parent rel=participant\n // resource and create a presence subscription without fetching the rel=contact resource,\n // but then prContact won't be empty. This event can be relevant while prContact is empty only\n // if the following conditions are met:\n //\n // 1. This rel=contact is supposed to be a link in a rel=participant.\n // 2. The rel=participant doesn't have the /contact link.\n // 3. The rel=participant has the .uri value.\n // 4. The implementation of the person model can take the .uri from the parent participant model.\n // 5. The implementation of the person model can create a presence subscription without fetching rel=contact.\n //\n // This is theoretically possible and might be a good optimization in the future.\n var r = prContact();\n var target = event.target;\n var scope = event['in'];\n if (target && event.type == 'updated' && scope && r && scope.href == r.href) {\n // status, activity, note, location, capabilities, relationship changes\n foreach(properties, function (p) {\n if (p.type == PropType.linked && target.rel == p.internalName) {\n if (p.observed) {\n p.property.get();\n p.dirty = false;\n }\n else {\n p.dirty = true;\n }\n }\n });\n }\n }", "title": "" }, { "docid": "a5ce9fe44cf32d0c8b0ec3cd17913a80", "score": "0.5100555", "text": "exists(){return null!==this._document;}", "title": "" }, { "docid": "3645d33a96a8b9c93402f5f68086d2a8", "score": "0.50993896", "text": "function isPageNew( distillation ) {\n\t\t\n\t\tvar cache = window.localStorage.getItem( \"cache\" );\n\t\tif ( cache == null || cache == \"null\" ) return true;\n\t\telse cache = JSON.parse( cache ); \n\t\tfor ( i=0; i < cache.length; i++ ) {\n\t\t\tif ( cache[ i ].docId == distillation.docId ) {\n\t\t\t\tif ( cache[ i ].fv.length == distillation.fv.length )\n\t\t\t\t\treturn false;\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "60f818f735c3bc3eac28186569391f7c", "score": "0.50950474", "text": "function prv_publish(publishObj){\n var data = (publishObj.data || {}),\n subscribers,\n len;\n\n if(!topics[publishObj.topic]){\n return false;\n }\n\n subscribers = topics[publishObj.topic];\n len = (subscribers ? subscribers.length : 0);\n\n while(len--){\n subscribers[len].func(data,publishObj.topic);\n }\n\n return this;\n }", "title": "" }, { "docid": "036db0ab0bf0abb027cf093fb1db9415", "score": "0.5088404", "text": "function attachedToRevealed(node) {\n\t\treturn linksToReveal.some(function (d) {\n\t\t\treturn node.name == d.source.name || node.name == d.target.name\n\t\t})\n\t}", "title": "" }, { "docid": "036db0ab0bf0abb027cf093fb1db9415", "score": "0.5088404", "text": "function attachedToRevealed(node) {\n\t\treturn linksToReveal.some(function (d) {\n\t\t\treturn node.name == d.source.name || node.name == d.target.name\n\t\t})\n\t}", "title": "" }, { "docid": "4771594d48726e519c0eaf98d83e0ab1", "score": "0.50635546", "text": "function ensureReferenceExists(v, thrw, prev) {\n if (v instanceof Reference) {\n if (!v.base) {\n thrw(newReferenceError(v.propertyName + \" is not defined\",\n v.node.filename, v.node.lineno), prev);\n return false;\n }\n }\n else {\n thrw(newReferenceError(v.propertyName + \" is not a reference\",\n v.node.filename, v.node.lineno), prev);\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "bc884b4666440e289b5711acb7ea89ab", "score": "0.50467247", "text": "function shouldRefetch(date) {\n return moment().diff(moment(date), \"days\") < 14;\n}", "title": "" }, { "docid": "04392673ec47aa07d3d63ac0230ddc50", "score": "0.5035845", "text": "async publish(doc) {\n const previouslyPublished = !!doc.lastPublishedAt;\n const action = window.apos.modules[doc.type].action;\n try {\n doc = await apos.http.post(`${action}/${doc._id}/publish`, {\n body: {},\n busy: true\n });\n apos.notify('apostrophe:changesPublished', {\n type: 'success',\n dismiss: true,\n icon: 'check-all-icon',\n buttons: [\n {\n type: 'event',\n label: 'apostrophe:undoPublish',\n name: previouslyPublished ? 'revert-published-to-previous' : 'unpublish',\n data: {\n action,\n _id: doc._id\n }\n }\n ]\n });\n apos.bus.$emit('content-changed', {\n doc,\n action: 'publish'\n });\n return doc;\n } catch (e) {\n if ((e.name === 'invalid') && e.body && e.body.data && e.body.data.unpublishedAncestors) {\n if (await apos.confirm({\n heading: 'apostrophe:unpublishedParent',\n description: 'apostrophe:unpublishedParentDescription'\n }, {\n interpolate: {\n unpublishedParents: e.body.data.unpublishedAncestors.map(page => page.title).join(this.$t('apostrophe:listJoiner'))\n }\n })) {\n try {\n for (const page of e.body.data.unpublishedAncestors) {\n await apos.http.post(`${action}/${page._id}/publish`, {\n body: {},\n busy: true\n });\n }\n // Retry now that ancestors are published\n return this.publish(doc);\n } catch (e) {\n await apos.alert({\n heading: this.$t('apostrophe:errorWhilePublishing'),\n description: e.message || this.$t('apostrophe:errorWhilePublishingParentPage'),\n localize: false\n });\n }\n }\n } else {\n await apos.alert({\n heading: this.$t('apostrophe:errorWhilePublishing'),\n description: e.message || this.$t('apostrophe:errorWhilePublishingDocument'),\n localize: false\n });\n }\n return false;\n }\n }", "title": "" }, { "docid": "c2bf5cb2540ddf7b2041a3bc2b1e5627", "score": "0.5034787", "text": "isFromXPub() {\n return Boolean(this.xpub);\n }", "title": "" }, { "docid": "43e6972953f89c366422ec319ea4bebd", "score": "0.50176936", "text": "function trackPublished(publication, container) {\n if (publication.isSubscribed) {\n attachTrack(publication.track, container);\n }\n publication.on('subscribed', function(track) {\n log('Subscribed to ' + publication.kind + ' track');\n attachTrack(track, container);\n });\n publication.on('unsubscribed', detachTrack);\n}", "title": "" }, { "docid": "38031057cfd6cca710be65b8398867bb", "score": "0.49906322", "text": "function isPubGetProbablyRequired(folderUri) {\n const folder = fs_1.fsPath(folderUri);\n const pubspecPath = path.join(folder, \"pubspec.yaml\");\n const packagesPath = path.join(folder, \".packages\");\n if (!folder || !fs.existsSync(pubspecPath))\n return false;\n // If we don't appear to have deps listed in pubspec, then no point prompting.\n const regex = new RegExp(\"dependencies\\\\s*:\", \"i\");\n if (!regex.test(fs.readFileSync(pubspecPath).toString()))\n return false;\n // If we don't have .packages, we probably need running.\n if (!fs.existsSync(packagesPath))\n return true;\n const pubspecModified = fs.statSync(pubspecPath).mtime;\n const packagesModified = fs.statSync(packagesPath).mtime;\n return pubspecModified > packagesModified;\n}", "title": "" }, { "docid": "2188d53413d632515b81b7046f4694cf", "score": "0.4985442", "text": "function check_cv() {\n if (isEmpty(\"cv\")) {\n error(\"cv\", \"Bitte laden Sie ihren Lebenslauf als PDF-Datei hoch.\");\n return;\n }\n valid(\"cv\");\n\n}", "title": "" }, { "docid": "90d820f2646074be06dca1a8bb069e1d", "score": "0.49802354", "text": "function checkInitialRef(state){\n if(!state.initialRef) throw new Error('Unable to locate initial state for composite state: ' + state.id);\n }", "title": "" }, { "docid": "9fa77f66ede658adcc3db77956edea6a", "score": "0.4974469", "text": "_checkThisReviewed() {\n if (\n this.DisplayDeadline !== undefined &&\n new Date(this.DateNextView) > new Date(this.DisplayDeadline)\n ) {\n this.IsReviewed = true;\n }\n }", "title": "" }, { "docid": "d4d9f77cbd78ddc5d2e34586c1762283", "score": "0.49735755", "text": "_checkIsIsbn (isbn) {\n console.log('previous isbn is: ', this._isbn);\n console.log('checking: ', isbn);\n return true;\n }", "title": "" }, { "docid": "685b46337254c14b6e8b58178034c0df", "score": "0.4971535", "text": "async function validateLinkedIssue() {\n // Create pattern\n const patterns = [{ regex: `${template.pr.linkedIssue}[ :]+(#|http)` }];\n\n // If validation failed\n if (validatePatterns(patterns, itemBody).filter(v => !v.ok).length > 0) {\n core.info('PR has no linked issue.');\n\n // Post error comment\n await postComment(composeMessage({ requireLinkedIssue: true }));\n return false;\n }\n\n core.info('PR has a linked issue.');\n return true;\n}", "title": "" }, { "docid": "6c731713ca1e8c364f46feede945a414", "score": "0.49685973", "text": "function userHasBeenReferredByPartnerWhoSuppliesPromocodes() {\n for (var i = 0; i < referralPartnersWhoSupplyPromocodes.length; i++) {\n if (linkshareReferrerID == referralPartnersWhoSupplyPromocodes[i]) { // If the referrer is in the list of referral partners who supply voucher codes\n console.log('The user has been referred by a partner who supplies promocodes');\n return true;\n break;\n }\n }\n console.log('The user has not been referred by a partner who supplies coupons.');\n return false; // If the user has not been referred by a partner who supplies coupons, then return false. This means the pixel can still fire.\n }", "title": "" }, { "docid": "fc53395997acc639571097f1be72e95a", "score": "0.495827", "text": "function isManuscript(publication) {\n if (publication.publicationTypeCode === 'manuscript') {\n return true\n }\n return false\n}", "title": "" }, { "docid": "669fabedbafcdf5b7570964d13434791", "score": "0.49479207", "text": "function _check_ref(ref)\n{\n\tif(ref.indexOf(\".baidu.com\") > 0){\n\t\treturn 1;\n\t}\n\tif(ref.indexOf(\".google.com\") > 0){\n\t\treturn 2;\n\t}\n\tif(ref.indexOf(\"so.eastmoney.com\") > 0){\n\t\treturn 3;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "21e7e63e2462ba1083b80925b7d87689", "score": "0.4945924", "text": "isUpToDate(receiverHash, giverHash) {\n return receiverHash !== undefined\n && (receiverHash === giverHash || Objects.isAncestor(receiverHash, giverHash));\n }", "title": "" }, { "docid": "5a47a6084e070fca5c63602d13c3bf80", "score": "0.49450237", "text": "get isExternallyProcessed() {\n const activeApplicationFlow = this.belongsTo(\n 'activeApplicationFlow'\n ).value();\n const firstApplicationStep = activeApplicationFlow\n .belongsTo('firstApplicationStep')\n .value();\n const externalProcessLink = firstApplicationStep.externalProcessLink;\n const isExternallyProcessed = firstApplicationStep\n .belongsTo('subsidyProceduralStep')\n .value().isExternallyProcessed;\n\n if (externalProcessLink && !isExternallyProcessed) {\n console.warn(\n 'found a link to an external processes, but step is not marked for external processing.'\n );\n\n return false;\n } else if (!externalProcessLink && isExternallyProcessed) {\n console.warn(\n 'found no link to an external processes, but step is marked for external processing.'\n );\n\n return true;\n }\n\n return externalProcessLink && isExternallyProcessed;\n }", "title": "" }, { "docid": "98eb0d9d40b5fbec540b4ea38c8b5b60", "score": "0.494253", "text": "function addReference(data, type, id, duplicate) {\n var authors = new Array();\n var surnames = new Array();\n $.each(data.authors, function(key, value) {\n var string = value.surname;\n surnames.push(string);\n if (value.initials != undefined) {\n string += \", \" + value.initials;\n }\n authors.push(string);\n });\n var authorString = authors.join(\", \");\n var surnameString = surnames.join(\", \");\n var date = \" (\" + data.published.year + \") \";\n var title = \"<em>\" + data.title + \"</em>\";\n if (id > 0) {\n var citation = \"(\" + surnameString + \", \" + data.published.year + \")\";\n $(\".citation[data-ref-id=\" + id + \"]\").text(citation);\n }\n if (!duplicate) {\n if (type == \"book\") {\n var refString = authorString + date + title + \". \" + data.edition + \" ed. \" + data.location + \": \" + data.publisher; \n } else if (type == \"website\") {\n var refString = authorString + date + title + \". Available at: \" + data.url + \" (Accessed: \" + + data.accessed.date + \" \" + data.accessed.month + \" \" + data.accessed.year + \").\";\n } else if (type == \"journal\") {\n var refString = authorString + date + title + \", \" + data.journal + \", \" + data.volume + \"(\" + data.issue + \"), pp. \" + data.pageRange;\n if (data.doi != undefined) {\n refString += \". doi: \" + data.doi + \".\"\n } else {\n refString += \".\";\n }\n }\n } return refString;\n return false;\n }", "title": "" }, { "docid": "3b05b0b09684c42ac6e369083fc31158", "score": "0.4917521", "text": "function isDescriptionRef(descId) {\n // NB: The _=_ is what Facebook adds to Oauth login redirects\n return descId\n && descId != FB_REDIRECT_HASH\n && $(descId).hasClass(\"description-holder\");\n }", "title": "" }, { "docid": "c8c21894f7d4e9012f63cd233d68f6cb", "score": "0.49148285", "text": "async _publicationExists(data, field, message, args, get) {\n // Same as data[ field ].\n const value = get(data, field)\n/* const personId = get(data, field); */\n // Get info from DB\n\n const row = await use('App/Models/Publication').find(value);\n // If this person doesn't exists\n if (!row) {\n throw 'row not found!';\n }\n }", "title": "" }, { "docid": "4fd76a239899a54181bf6e7161f0e5ff", "score": "0.49143428", "text": "checkIfChached(){\n\t\tconst {results} = this.state;\n\t\tif (results === null){\n\t\t\t// make a new request\n\t\t\treturn false;\n\t\t}else{\n\t\t\t//don't make a new request\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "588c52c61c2268bbd6f5b3cab211ab38", "score": "0.49062055", "text": "__isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars\n return true;\n }", "title": "" }, { "docid": "588c52c61c2268bbd6f5b3cab211ab38", "score": "0.49062055", "text": "__isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars\n return true;\n }", "title": "" }, { "docid": "588c52c61c2268bbd6f5b3cab211ab38", "score": "0.49062055", "text": "__isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars\n return true;\n }", "title": "" }, { "docid": "6819fe8db0cd930a7f4d73869ea2eb02", "score": "0.48914647", "text": "function isNotValid(_ref2) {\n var containerId = _ref2.containerId,\n toastId = _ref2.toastId,\n updateId = _ref2.updateId;\n return !containerRef.current || instance.props.enableMultiContainer && containerId !== instance.props.containerId || collection[toastId] && updateId == null ? true : false;\n } // this function and all the function called inside needs to rely on ref(`useKeeper`)", "title": "" }, { "docid": "6819fe8db0cd930a7f4d73869ea2eb02", "score": "0.48914647", "text": "function isNotValid(_ref2) {\n var containerId = _ref2.containerId,\n toastId = _ref2.toastId,\n updateId = _ref2.updateId;\n return !containerRef.current || instance.props.enableMultiContainer && containerId !== instance.props.containerId || collection[toastId] && updateId == null ? true : false;\n } // this function and all the function called inside needs to rely on ref(`useKeeper`)", "title": "" }, { "docid": "f3eb71e33676c5c1ba5d1d2e31a99921", "score": "0.4881369", "text": "function checkURL() {\n try {\n makeURL(document.getElementById(\"calendar-uri\").value);\n }\n catch (ex) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "54da0c382c70870adbfbb4bbad36589f", "score": "0.4868735", "text": "function isLinkToPDF(input) {\n const url = input.toLowerCase().trim\n if (url.indexOf(\".pdf\") >= (url.length-4)){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "f7e10b2ba03c625b16d9f0e37d7a3b98", "score": "0.48678857", "text": "isRevisable() {\n const {isSubmitted, schoolId} = this.state;\n const {currentEducator} = this.props;\n const isPrincipal = currentEducator.labels.indexOf('class_list_maker_finalizer_principal') !== -1;\n const schoolMatches = schoolId !== null && currentEducator.school_id === schoolId;\n\n return (isSubmitted && isPrincipal && schoolMatches);\n }", "title": "" }, { "docid": "11ae83baec47c67dba23767d96fd69d9", "score": "0.48602065", "text": "_computeHasMore(link) {\n // only show if there's a link supplied for additional details\n if (typeof link !== typeof undefined && link !== \"\") {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "478044b132f6fe7c4a67b1c848dc8a73", "score": "0.48560575", "text": "function onArticleVerify( title )\n {\n // send ajax request to submit the article\n jQuery.ajax({\n url: \"/editor/verify?title=\"+title,\n method: \"GET\",\n success: function( data, status, jqXHR ) \n { \n if( data == \"\" ) visualState( STATUS_NEW, \"\" )\n else visualState( STATUS_EDIT, data )\n \n },\n error: function( jqXHR, status, error ) { visualState( STATUS_EDIT, data ) },\n })\n }", "title": "" }, { "docid": "2d3b48a45316b618cd4d6c7b261b3a6a", "score": "0.48527673", "text": "function wb_PubActionsInit() {\n // force publish button to pay attention to STALE status\n var pubbutton = $('a.wb-detail-btn-publish');\n pubbutton.bind('click', function () {\n var stale_status = $('div.wb-detail-page').attr('data-wb-record-stale') == '1';\n if (stale_status) {\n var dlgresult = confirm(\"WARNING\\n\\nThis draft is more than a week old and its associations to other WebBack records may now be out of date.\\n\\nPublish anyway?\");\n return dlgresult;\n }\n return true;\n });\n\n // force archive button to require confirmation\n var arcbutton = $('a.wb-detail-btn-archive');\n arcbutton.bind('click', function () {\n var dlgresult = confirm(\"ARCHIVE\\n\\nAre you sure you wish to archive this record?\");\n return dlgresult;\n });\n}", "title": "" }, { "docid": "8a1134d807e59aa5dbb3d4a4a94bb194", "score": "0.48480612", "text": "__isValidResolution(ref, variable) {\n // eslint-disable-line class-methods-use-this, no-unused-vars\n return true;\n }", "title": "" }, { "docid": "0100e00ea4939bfc4435061eb3e4998d", "score": "0.48361936", "text": "isAvailable() {\n return this.isInitialized() && !this.isAssociated();\n }", "title": "" }, { "docid": "f9d23f7a3df597a5ee118c3c0458d040", "score": "0.48280317", "text": "function toBeDelivered(ticket) {\n return ticket.labor > 0\n }", "title": "" }, { "docid": "2c08118d1933dedd44b6527df3469311", "score": "0.48139328", "text": "function isRefObject(value) {\n return value != null && typeof value.current !== \"undefined\";\n}", "title": "" }, { "docid": "9cf80373591b501871f3dd7e091570fd", "score": "0.48108828", "text": "get renewable() {\n return !!this.provider && typeof this.provider.renew === 'function';\n }", "title": "" }, { "docid": "9b19afadde746b2f394b3b771e7419b1", "score": "0.48100537", "text": "async function checkIfRefExist(userId) {\n const refs = await db_utils.execQuery(\n \"SELECT userId FROM dbo.Referees\" \n );\n if (refs.find((r) => r.userId === parseInt(userId))){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "d2024f6ed991688ebbe9a011cad796c2", "score": "0.48075423", "text": "checkLink() {\n const match = this.props.match;\n const isEditForm = match && match.params.link_id;\n\n if (!this.state.link && isEditForm) {\n const linkId = match.params.link_id;\n const link = this.props.links[linkId];\n\n if (link) {\n getFileObject(link.imgSrc, imageFile => {\n link.imageFile = [imageFile];\n this.setState({link});\n this.props.initialize(link);\n })\n } else {\n this.props.showLink(linkId);\n }\n }\n }", "title": "" }, { "docid": "2a1b0b05ea84d7cee67c3a2b80d0df34", "score": "0.47973242", "text": "function checkRef ( )\n {\n\tvar ref_select = getElementValue( 'pm_ref_select' );\n\tvar ref_value = getElementValue( 'pm_ref_value' );\n\t\n\t// If the dropdown menu selection is 'ref_id', then we expect one or more identifiers as a\n\t// comma-separated list.\n\t\n\tif ( ref_select && ref_select == \"ref_id\" )\n\t{\n\t // Split the list on commas/whitespace.\n\t \n\t var id_strings = ref_value.split(/[\\s,]+/);\n\t var param_list = [ ];\n\t var errors = [ ];\n\t \n\t // Check each identifier individually.\n\t \n\t for ( var i=0; i < id_strings.length; i++ )\n\t {\n\t\t// If it is an extended identifier, keep track of all the different\n\t\t// three-character prefixes we encounter while traversing the list using the\n\t\t// object 'id_key' and array 'key_list'.\n\t\t\n\t\tif ( /^ref[:]\\d+$/.test( id_strings[i] ) )\n\t\t{\n\t\t param_list.push(id_strings[i]);\n\t\t}\n\t\t\n\t\t// If it is a numeric identifier, just add it to the parameter list.\n\t\t\n\t\telse if ( patt_int_pos.test( id_strings[i] ) )\n\t\t{\n\t\t param_list.push('ref:' + id_strings[i]);\n\t\t}\n\t\t\n\t\t// Anything else is an error.\n\t\t\n\t\telse if ( id_strings[i] != '' )\n\t\t{\n\t\t errors.push(\"invalid reference identifier '\" + id_strings[i] + '\"');\n\t\t}\n\t }\n\t \n\t // If we found any errors, display them.\n\t \n\t if ( errors.length )\n\t {\n\t\tparams[\"meta_ref_value\"] = '';\n\t\tparams[\"meta_ref_select\"] = '';\n\t\tparam_errors[\"meta_ref\"] = 1;\n\t\tsetErrorMessage(\"pe_meta_ref\", errors);\n\t }\n\t \n\t // Otherwise, construct the proper parameter value by joining all of the identifiers\n\t // we found.\n\t \n\t else\n\t {\n\t\tif ( param_list.length )\n\t\t{\n\t\t params[\"meta_ref_value\"] = param_list.join(',');\n\t\t params[\"meta_ref_select\"] = 'ref_id';\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t params[\"meta_ref_value\"] = '';\n\t\t params[\"meta_ref_select\"] = '';\n\t\t}\n\t\t\n\t\tsetErrorMessage(\"pe_meta_ref\", \"\");\n\t\tparam_errors[\"meta_ref\"] = 0;\n\t }\n\t}\n\t\n\telse if ( ref_select && ref_param[ref_select] )\n\t{\n\t if ( ref_value != undefined && ref_value != '' )\n\t {\n\t\tparams[\"meta_ref_value\"] = ref_value;\n\t\tparams[\"meta_ref_select\"] = ref_select;\n\t }\n\n\t else\n\t {\n\t\tparams[\"meta_ref_value\"] = '';\n\t\tparams[\"meta_ref_select\"] = '';\n\t }\n\t \n\t param_errors[\"meta_ref\"] = 0;\n\t setErrorMessage(\"pe_meta_ref\", '');\n\t}\n\t\n\telse\n\t{\n\t params[\"meta_ref_select\"] = '';\n\t params[\"meta_ref_value\"] = '';\n\t param_errors[\"meta_ref\"] = 0;\n\t setErrorMessage(\"pe_meta_ref\", \"\");\n\t}\n\t\n\tupdateFormState();\n\t\n\t// var ref_select = myGetElement(\"pm_ref_select\");\n\t\n\t// if ( ref_select )\n\t// {\n\t// var selected = ref_select.value;\n\t \n\t// }\n }", "title": "" }, { "docid": "99950ee70a0c9dec467acf8945653543", "score": "0.47973207", "text": "isFreshPeer (announceObj) {\n try {\n // Ignore announcements that do not have a broadcastedAt timestamp.\n if (!announceObj.data.broadcastedAt) return false\n\n // Ignore items that are older than 10 minutes.\n const now = new Date()\n const broadcastTime = new Date(announceObj.data.broadcastedAt)\n const tenMinutes = 60000 * 10\n const timeDiff = now.getTime() - broadcastTime.getTime()\n if (timeDiff > tenMinutes) return false\n\n return true\n } catch (err) {\n console.error('Error in stalePeer()')\n throw err\n }\n }", "title": "" }, { "docid": "f86721f71815ca27bead03855f91717d", "score": "0.4793076", "text": "function isUnresolved(entry) {\n return !entry.resolved;\n }", "title": "" }, { "docid": "1298ee1d0a7cf78e9b76c474db620103", "score": "0.4792034", "text": "function checkRefopts ( )\n {\n \tparams.reftypes = getCheckList(\"pm_reftypes\");\n \tif ( params.reftypes == \"auth,class\" ) params.reftypes = 'taxonomy';\n \telse if ( params.reftypes == \"auth,class,ops\" ) params.reftypes = 'auth,ops';\n \telse if ( params.reftypes == \"auth,class,ops,occs,colls\" ) params.reftypes = 'all'\n \telse if ( params.reftypes == \"auth,ops,occs,colls\" ) params.reftypes = 'all'\n \tupdateFormState();\n }", "title": "" }, { "docid": "2b72c52ab47ce480f335eebe7ff9a02b", "score": "0.47905692", "text": "async function recSeen() {\n // call firebase server function that handles changing userId: to true (if seen) or false (if unseen)\n // then when this function is done, call getRecs to show the newly changed rec wasSeen checkmark\n await updateRecSeenBy(props.currentUserUID, props.recId)\n .then(async () => {\n // check if click on a rec came from the pod page\n if (props.fromPodPage) {\n await getRecs(props.podId, props.onRecsReceived)\n // or the click on rec came from media type page\n } else if (props.fromMediaTypePage) {\n await getMediaRecs(props.onRecsReceived, props.media_Type)\n }\n })\n}", "title": "" }, { "docid": "85addf04b29caa4c923ebc0ee2586387", "score": "0.4787845", "text": "get hasChanges() { return this.currentVersion !== this.retroVersion; }", "title": "" }, { "docid": "baddcd2ad0e49b307b96369763853580", "score": "0.47867844", "text": "function getLinkRef(link) {\n return link ? link.link : false;\n}", "title": "" }, { "docid": "12456049f755e1c3600418c7e670c896", "score": "0.4784297", "text": "precondition(t){const e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?Qe.updateTime(e):Qe.none();}", "title": "" }, { "docid": "495854098ee84e2944c49597abba0145", "score": "0.47840214", "text": "isPublished() {\n return ['validé', 'validé sans test', 'pré-validé'].includes(this.status);\n }", "title": "" }, { "docid": "094503b0f209e7db67d268afb20e7a77", "score": "0.47770268", "text": "function _isSubjectReference(v) {\n // Note: A value is a subject reference if all of these hold true:\n // 1. It is an Object.\n // 2. It has a single key: @id.\n return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v));\n}", "title": "" }, { "docid": "094503b0f209e7db67d268afb20e7a77", "score": "0.47770268", "text": "function _isSubjectReference(v) {\n // Note: A value is a subject reference if all of these hold true:\n // 1. It is an Object.\n // 2. It has a single key: @id.\n return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v));\n}", "title": "" }, { "docid": "094503b0f209e7db67d268afb20e7a77", "score": "0.47770268", "text": "function _isSubjectReference(v) {\n // Note: A value is a subject reference if all of these hold true:\n // 1. It is an Object.\n // 2. It has a single key: @id.\n return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v));\n}", "title": "" }, { "docid": "094503b0f209e7db67d268afb20e7a77", "score": "0.47770268", "text": "function _isSubjectReference(v) {\n // Note: A value is a subject reference if all of these hold true:\n // 1. It is an Object.\n // 2. It has a single key: @id.\n return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v));\n}", "title": "" }, { "docid": "094503b0f209e7db67d268afb20e7a77", "score": "0.47770268", "text": "function _isSubjectReference(v) {\n // Note: A value is a subject reference if all of these hold true:\n // 1. It is an Object.\n // 2. It has a single key: @id.\n return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v));\n}", "title": "" } ]
01d8252fdc3de1c24052227d129465ba
Return length of string:
[ { "docid": "ce18417c07b438380bf7f17545c2db4d", "score": "0.84862876", "text": "function length(str) {\n return str.length;\n}", "title": "" } ]
[ { "docid": "488d4d0d4e3c59bab6bf342e02370651", "score": "0.88982904", "text": "function sc_stringLength(s) { return s.length; }", "title": "" }, { "docid": "e2c4eaa0b147ce65e191c0c4021d1e8e", "score": "0.8577845", "text": "function length(str) {\r\n\treturn str.length\r\n}", "title": "" }, { "docid": "93832d1efdfd7f70e5ba91de02f8958c", "score": "0.85265386", "text": "function getLength(str){\n return str.length\n}", "title": "" }, { "docid": "93371db74f8f626cfd55a243eda12484", "score": "0.8491693", "text": "function getLength (str){\n return str.length;\n}", "title": "" }, { "docid": "9666b470db98c3419ddd74df9cff371e", "score": "0.8477698", "text": "function getLength (string){\n return string.length;\n}", "title": "" }, { "docid": "9d74bb8ce33e42c2e9b07239486b4d18", "score": "0.84108037", "text": "function Len(str){ \n return String(str).length;\n}", "title": "" }, { "docid": "df80c503b764896c61422832554dbd35", "score": "0.83696026", "text": "function getLength(string) {\n return string.length;\n}", "title": "" }, { "docid": "df80c503b764896c61422832554dbd35", "score": "0.83696026", "text": "function getLength(string) {\n return string.length;\n}", "title": "" }, { "docid": "06ff98e2f9cae45278136b60b3536630", "score": "0.83218753", "text": "function getLength(string) {\n return string.length;\n}", "title": "" }, { "docid": "06ff98e2f9cae45278136b60b3536630", "score": "0.83218753", "text": "function getLength(string) {\n return string.length;\n}", "title": "" }, { "docid": "f21541e4a548eb15059cf75a97ee148a", "score": "0.83059716", "text": "function getLength(str) {\n return str.length;\n}", "title": "" }, { "docid": "f21541e4a548eb15059cf75a97ee148a", "score": "0.83059716", "text": "function getLength(str) {\n return str.length;\n}", "title": "" }, { "docid": "f191d033f29c8310a86dacceeb59bd51", "score": "0.82510334", "text": "function getLength (string){\n return (string.length);\n}", "title": "" }, { "docid": "08d8a6a74bd9e027564d2f2c33d0a0a4", "score": "0.82383233", "text": "function getLength(aString){\n return aString.length;\n}", "title": "" }, { "docid": "13f6f26ebae876a874646603775a5423", "score": "0.81795007", "text": "function Len(s){\n\treturn s.length;\n}", "title": "" }, { "docid": "fb94ad64f51d451c1f00f059ea5045a7", "score": "0.8039365", "text": "function getLength(aString) {\n return aString.length;\n}", "title": "" }, { "docid": "b530f4c33467669cd9933cee179aad53", "score": "0.79761946", "text": "function strlen(string)\n{\n\treturn string.length;\n}", "title": "" }, { "docid": "991bee5a9ac091debc9e85155d8c988c", "score": "0.77447325", "text": "function countLengthString(ch) {\n console.log(\"la longueur de la chaine \" + ch + \" est \", ch.length);\n}", "title": "" }, { "docid": "5edca5ebe80ea45664f99e42cd23b1b9", "score": "0.7699627", "text": "function length(string) {\n string = $.terminal.strip(string);\n return $('<span>' + string + '</span>').text().length;\n }", "title": "" }, { "docid": "561faa86c923ef918a241d629d7fd4fa", "score": "0.7687036", "text": "function runLength(str) {\n\n\n }", "title": "" }, { "docid": "b1cf682485853f486f2f110ad32764a1", "score": "0.7667687", "text": "function longitud(string){\n\treturn string.length\n}", "title": "" }, { "docid": "55ebe97ca3566514e146791f4b47cba1", "score": "0.75947076", "text": "function findLength(input) {\n // finds the length of a string\n return input.length;\n}", "title": "" }, { "docid": "e825b7f8488350e928432ab89dbcabe8", "score": "0.75876063", "text": "function length(string) {\n let length = 0;\n while (string[length] !== undefined) {\n length++;\n }\n return length;\n}", "title": "" }, { "docid": "bb25fcfc3ab15d861f7beffdaa8392c0", "score": "0.7567535", "text": "function getStringLength(string) {\n\t// create a counter variable set to 0\n\tlet counter = 0;\n\t// while the string is not empty\n\twhile (string !== '') {\n\t\t// slice string at the until it ends\n\t\tstring = string.slice(1);\n\t\t//increment counter\n\t\tcounter++;\n\t}\n\t// return counter;\n\treturn counter;\n}", "title": "" }, { "docid": "951d53dd237abd8106fffc641aa7f9f9", "score": "0.75431633", "text": "function getLength(text) {\n return text.length;\n}", "title": "" }, { "docid": "1ed1e79171a2cd23121af7b122a8e474", "score": "0.7474439", "text": "function numberOfCharacter(string) {\n let result = string.length;\n return result;\n}", "title": "" }, { "docid": "5c5ea5736526649c414c1cbc6443cb5e", "score": "0.7471309", "text": "function charCount(string) {\r\n return string.length;\r\n}", "title": "" }, { "docid": "2e510ce6e20929f8d334ca2d3c1a9ef8", "score": "0.7466141", "text": "function strLength(str) {\n \n if (typeof str !== \"string\" || str.length === 0) {\n return undefined;\n }\n return str.length;\n}", "title": "" }, { "docid": "5dd365fc85345d1d2220347156a7bf90", "score": "0.745943", "text": "function getStringLength(string) {\n let i = 0;\n while(string[i]) {\n i++;\n }\n return i;\n}", "title": "" }, { "docid": "99de88d228b293fa8587eec10a33d634", "score": "0.74545044", "text": "function actualLength(str) \r\n {\r\n\t\t if (!str)\r\n\t\t {\r\n\t\t return 0;\r\n\t\t }\r\n\t\t var lns = str.match(/[^\\r]\\n/g);\r\n\t\t \r\n\t\t if (lns)\r\n\t\t {\t\r\n\t\t \treturn str.length + lns.length;\r\n\t\t } \r\n\t\t else\r\n\t\t {\t\t\t\t\r\n\t\t \treturn str.length;\r\n\t\t }\r\n\t}", "title": "" }, { "docid": "26a6ff3328ab75433db2aab35ead5aea", "score": "0.7446943", "text": "function str_len() {\n var str = \"This is a wicked long string with many words!\";\n var x = str.length;\n document.getElementById(\"str_len\").innerHTML = x;\n }", "title": "" }, { "docid": "b660b56ba59032fcd28e934defb5b1e0", "score": "0.7444981", "text": "function byteLength(string) {\n var length = 0 | 0;\n Array.prototype.forEach.call(string, function(chr) {\n var code = chr.charCodeAt(0);\n length += (code < 0x80) ? 1 : (code < 0x800) ? 2 : 3;\n });\n return length;\n}", "title": "" }, { "docid": "84cda0f13c71690d9a3c5ffe6ce82da5", "score": "0.73246276", "text": "function stringLength(input1) {\n var length = input1.length;\n // parameter 1: any JavaScript value\n // Return: a single JavaScript value\n return length;\n}", "title": "" }, { "docid": "7d23a757382a91e9e9c80821558ffed3", "score": "0.72896755", "text": "function getCharacterLength (str) {\n return [...str].length;\n }", "title": "" }, { "docid": "8c4790dcd9fd3b672e992ea08d6c57d0", "score": "0.7277541", "text": "function getCharCount(string) {\n\tvar result = 0; //to be returned\n\t\n\tresult = string.length;\n\t\n\treturn (result);\n}", "title": "" }, { "docid": "70b87120c8d306111f5ac59a9be78787", "score": "0.7262688", "text": "function getStringLength(string) {\r\n let length = 0;\r\n for (let i in string) {\r\n length++;\r\n }\r\n return length;\r\n }", "title": "" }, { "docid": "0dbe12a7beda221050d18ca15ed1197d", "score": "0.72578037", "text": "function lengthOfLongestSubstring(s) {}", "title": "" }, { "docid": "e8f38f201c68eb6a814e34c026ce3537", "score": "0.7221919", "text": "function getStringLength(string){\n var i = 0;\n while (string[i] !== undefined){\n i++;\n }\n return i;\n}", "title": "" }, { "docid": "5fc3c83733366665a04eae5991d6ac9f", "score": "0.72111046", "text": "function string_length() {\n var str = \"Miguel Montelongo\";\n var M = str.length;\n document.getElementById(\"string\").innerHTML = M; \n}", "title": "" }, { "docid": "10a9daa7d69000d89a87173973d05f60", "score": "0.7205639", "text": "function byteLength(str) {\n if (typeof (str) !== 'string') {\n return -1;\n }\n let length = 0;\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n length += codeLength(code);\n }\n return length;\n }", "title": "" }, { "docid": "4487844b8e3db1503431f487b56bbc6f", "score": "0.716678", "text": "static getCharacterLength(str) {\n\t\t// The string iterator that is used here iterates over characters,\n\t\t// not mere code units\n\t\treturn [...str].length;\n\t}", "title": "" }, { "docid": "dba621e7aa4683cad3bf2bc1199e294a", "score": "0.71577", "text": "function computeStringLength(str){\n return str.replace(/[^\\x00-\\xff]/g,\"**\").length;\n}", "title": "" }, { "docid": "f26efd106c3eebacfb1ad92f7e6b3132", "score": "0.7100356", "text": "function renderStringLength(s) {\n\tlet m;\n\tlet pos;\n\tlet len = 0;\n\n\tconst re = ANSI_OR_PIPE_REGEXP;\n\tre.lastIndex = 0;\t//\twe recycle the rege; reset\n\t\n\t//\n\t//\tLoop counting only literal (non-control) sequences\n\t//\tpaying special attention to ESC[<N>C which means forward <N>\n\t//\t\n\tdo {\n\t\tpos\t= re.lastIndex;\n\t\tm\t= re.exec(s);\n\t\t\n\t\tif(m) {\n\t\t\tif(m.index > pos) {\n\t\t\t\tlen += s.slice(pos, m.index).length;\n\t\t\t}\n\t\t\t\n\t\t\tif('C' === m[3]) {\t//\tESC[<N>C is foward/right\n\t\t\t\tlen += parseInt(m[2], 10) || 0;\n\t\t\t}\n\t\t} \n\t} while(0 !== re.lastIndex);\n\t\n\tif(pos < s.length) {\n\t\tlen += s.slice(pos).length;\n\t}\n\t\n\treturn len;\n}", "title": "" }, { "docid": "45c7ac5bd348d2295d21edbdcbec92c0", "score": "0.7080618", "text": "function length(val) {\n\t return val.toString().length;\n\t}", "title": "" }, { "docid": "45c7ac5bd348d2295d21edbdcbec92c0", "score": "0.7080618", "text": "function length(val) {\n\t return val.toString().length;\n\t}", "title": "" }, { "docid": "adcec5f687ef18c4bafbc25b6c6cc863", "score": "0.7073611", "text": "function length(val) {\n return val.toString().length;\n}", "title": "" }, { "docid": "adcec5f687ef18c4bafbc25b6c6cc863", "score": "0.7073611", "text": "function length(val) {\n return val.toString().length;\n}", "title": "" }, { "docid": "adcec5f687ef18c4bafbc25b6c6cc863", "score": "0.7073611", "text": "function length(val) {\n return val.toString().length;\n}", "title": "" }, { "docid": "adcec5f687ef18c4bafbc25b6c6cc863", "score": "0.7073611", "text": "function length(val) {\n return val.toString().length;\n}", "title": "" }, { "docid": "adcec5f687ef18c4bafbc25b6c6cc863", "score": "0.7073611", "text": "function length(val) {\n return val.toString().length;\n}", "title": "" }, { "docid": "adcec5f687ef18c4bafbc25b6c6cc863", "score": "0.7073611", "text": "function length(val) {\n return val.toString().length;\n}", "title": "" }, { "docid": "40e82ac1ec3d08383c5512374556da63", "score": "0.70507985", "text": "length()\n\t{\n\t\t\n\t}", "title": "" }, { "docid": "2947fae5a05094e09135aa5f937c9dfd", "score": "0.7022125", "text": "function getStrTrueLength(str){//获取字符串的真实长度(字节长度)\n\tvar len = str.length, truelen = 0;\n\tfor(var x = 0; x < len; x++){\n\t\tif(str.charCodeAt(x) > 128){\n\t\t\ttruelen += 2;\n\t\t}else{\n\t\t\ttruelen += 1;\n\t\t}\n\t}\n\treturn truelen;\n}", "title": "" }, { "docid": "5b0a9eead85dec6d28de057b61001bfc", "score": "0.69705325", "text": "function length(val) {\n\t\t\t return val.toString().length;\n\t\t\t}", "title": "" }, { "docid": "54dd9d91b9d2a9b638d84fe8587316ea", "score": "0.695273", "text": "function wordLength(word){\n return word.length;\n}", "title": "" }, { "docid": "4f489a89583c4299594f1ad386317971", "score": "0.6952409", "text": "function getLength(word) {\n return word.length;\n}", "title": "" }, { "docid": "4af78e74d3d47f0e133b635feeb08389", "score": "0.69180536", "text": "function getLength(totalChar) {\n return totalChar.length;\n}", "title": "" }, { "docid": "a1a56103540f215e12629bf8377ad3fd", "score": "0.6892986", "text": "function getLength (word) {\n return word.length;\n}", "title": "" }, { "docid": "294383b43382b6ae70de1790b83bcc9d", "score": "0.6841785", "text": "function getLength(x) {\n if (typeof(x) !== 'string') {\n return \"Please enter a string!\";\n }\n else {\n return x.length;\n }\n}", "title": "" }, { "docid": "53bea2a138808dcc3350513f1c1bbe48", "score": "0.68317884", "text": "function getLength(word) {\n return (word.length)\n}", "title": "" }, { "docid": "1bb67947ff2e620960748daf02ede375", "score": "0.68012047", "text": "function getLength(evil) {\n console.log(\"This string is way to long for Bree's liking \" + evil.length)\n}", "title": "" }, { "docid": "30e239a1e8223e66e9985ccd3294503d", "score": "0.6777441", "text": "function getLength(word) {\n return (word.length)\n\n}", "title": "" }, { "docid": "b195cb26d91c3f3b8eb85975d3f42b72", "score": "0.6754273", "text": "function StrLength(str) {\n let count = 0\n\n while (str !== \"\") {\n str = str.split(\"\")\n count++\n str.pop()\n str = str.join(\"\")\n }\n console.log(count)\n}", "title": "" }, { "docid": "4375edcfe886f39dea5166be944719b8", "score": "0.6753804", "text": "function getLength(word) {\n\tvar l = word.length\n\treturn l\n}", "title": "" }, { "docid": "2e0bab67ec2ce0a03f31b6811db700ee", "score": "0.67534304", "text": "function length () {\n return this.node.getComputedTextLength()\n}", "title": "" }, { "docid": "0244c71a0d94d39d52d5565bc645c63d", "score": "0.673576", "text": "get length() {}", "title": "" }, { "docid": "4838d181eabf96b55f989d7860133403", "score": "0.6733522", "text": "function nameLength(d){\n\t\t\t\t\tvar n = nameFn(d);\n\t\t\t\t\treturn n ? n.length : 0;\n\t\t\t\t}", "title": "" }, { "docid": "5cc9e02d13786bb7e7be7e261e0bcd13", "score": "0.6699101", "text": "function getLengthOfWord(word) {\n return word.length;\n}", "title": "" }, { "docid": "aea53b28e31c4978aba89e238a92295d", "score": "0.6688164", "text": "function stringByteLength(str) {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n }", "title": "" }, { "docid": "fb9f389df63bdf2321d601694c0d1d51", "score": "0.66850847", "text": "get length() {\n return this.text.length;\n }", "title": "" }, { "docid": "bb1820833f033a1d79bcf8bd01d19d09", "score": "0.66798484", "text": "function realLength(value) {\n var length = value.indexOf('\\n');\n return stringWidth_1(length === -1 ? value : value.slice(0, length))\n}", "title": "" }, { "docid": "94da31e36ef74ab9d36c7826d4a88da3", "score": "0.66675746", "text": "function getLength(char){\n let word = char\n\n return word.length\n}", "title": "" }, { "docid": "fc1b445aed6a2dee78480e87182fc4d2", "score": "0.6660679", "text": "function strlen_en(str)\n {\n var counter;\n var i;\n counter=0;\n for(i=0;i<str.length;i++)\n {\n while(str.charAt(i)==' '||str.charCodeAt(i)>255||str.charAt(i)=='\\n') i++;\n if(str.charAt(i+1)==' '||str.charAt(i+1)=='\\n'||str.charCodeAt(i+1)>255||i==str.length-1) counter++;\n }\n return counter;\n }", "title": "" }, { "docid": "202b9a6e87401089ad00ab804996623f", "score": "0.6641419", "text": "function utf8Length(str) {\n var utf8String = unescape(encodeURIComponent(str));\n return utf8String.length;\n }", "title": "" }, { "docid": "cbfdf46cfa0a443385fcb56b17b7dea5", "score": "0.6640709", "text": "function stringLengthWithoutEmotes(str) {\n return stringWithoutEmotes(str).length;\n}", "title": "" }, { "docid": "3c566e7752fa3faa59a42c757c1b6ee9", "score": "0.6626764", "text": "function GetByteLength(s)\n{\n\tif(s == null) return false;\n\t\n\tvar count = 0;\n\tfor(i = 0; i < s.length; i++)\n\t{\n\t\tvar c = s.charCodeAt(i);\n\t\tif(c <= 127) count = count + 1;\n\t\telse count = count + 2;\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "1d9af8f17e430b31310b5563d8df0dc6", "score": "0.65992785", "text": "function length(value) {\n var prefix;\n\n /* istanbul ignore if - Currently also tested for at implemention, but we\n * keep it here because that’s proper. */\n if (value.charAt(0) !== ampersand$2) {\n return 0\n }\n\n prefix = value.split(ampersand$2, 2).join(ampersand$2);\n\n return prefix.length - parseEntities_1(prefix).length\n}", "title": "" }, { "docid": "779220d48d9f002aad59840a8ead6a8d", "score": "0.6588925", "text": "function nameLength(d){\r\n var n = nameFn(d);\r\n return n ? n.length : 0;\r\n}", "title": "" }, { "docid": "bbfd38181e3a9ab456e390542540ce29", "score": "0.65877074", "text": "function stringByteLength(str) {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}", "title": "" }, { "docid": "bbfd38181e3a9ab456e390542540ce29", "score": "0.65877074", "text": "function stringByteLength(str) {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}", "title": "" }, { "docid": "bbfd38181e3a9ab456e390542540ce29", "score": "0.65877074", "text": "function stringByteLength(str) {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n return new Blob([str]).size;\n}", "title": "" }, { "docid": "fc53419b639f2ad6439bc821418ca84e", "score": "0.65691954", "text": "function totalLetters(str) {\n var letters = str.replace(/\\s+/g, '');\n return letters.length;\n}", "title": "" }, { "docid": "46ce2a52c37f8c2b7bfb400e71075693", "score": "0.65687144", "text": "function stringByteLength(str) {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n\n return new Blob([str]).size;\n}", "title": "" }, { "docid": "46ce2a52c37f8c2b7bfb400e71075693", "score": "0.65687144", "text": "function stringByteLength(str) {\n if (useNodeBuffer) {\n return Buffer.byteLength(str);\n }\n\n return new Blob([str]).size;\n}", "title": "" }, { "docid": "7474901f41ae55d0d805b951be0c364a", "score": "0.65284973", "text": "function RunLength(str) {\n\tlet count = 0;\n\tlet myResult = '';\n\tlet letter = str[0];\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str[i] === letter) {\n\t\t\tcount++;\n\t\t} else {\n\t\t\tmyResult = myResult + count + letter;\n\t\t\tletter = str[i];\n\t\t\tcount = 1;\n\t\t}\n\t}\n\tif ((i = str.length - 1)) {\n\t\tmyResult = myResult + count + str[i];\n\t}\n\treturn myResult;\n}", "title": "" }, { "docid": "bf814f0485114e6e83055276e73d73bc", "score": "0.65157026", "text": "function WordCount(str) { \n \n var spl = str.split(' ');\n \n str = spl.length;\n\n // code goes here \n return str; \n \n}", "title": "" }, { "docid": "22e6f366bdacc248ced1d53807e33534", "score": "0.65153295", "text": "function utf8Length(str = '') {\n let c = 0;\n let length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length + 1;\n}", "title": "" }, { "docid": "2e6cda05ca2f881758bc77a463641424", "score": "0.6511105", "text": "function len(x) {\n return x.length;\n}", "title": "" }, { "docid": "3dbe3101ef0c6e1be33ad898c9a7b50d", "score": "0.6506138", "text": "length() {\n\t\treturn this.RawValue.length;\n\t}", "title": "" }, { "docid": "3dbe3101ef0c6e1be33ad898c9a7b50d", "score": "0.6506138", "text": "length() {\n\t\treturn this.RawValue.length;\n\t}", "title": "" }, { "docid": "e39bb886d697a812d552fa8ea40e0bf2", "score": "0.6491834", "text": "function len(t) {\n return t.length;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42bdda244913caef0ad70b48bc99f2d9", "score": "0.64862716", "text": "function encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}", "title": "" } ]
6e236807063dd4a2282bd73918aa837a
get average of two rgbs with optional added weight
[ { "docid": "a9256ac4761dcc49906e49f5cc41c560", "score": "0.0", "text": "function interpolateRGB(cObj1, cObj2, obj1Factor = 0.5) {\r\n var newC = {};\r\n newC.colorR = Math.floor(cObj1.colorR * obj1Factor + cObj2.colorR * (1-obj1Factor));\r\n newC.colorG = Math.floor(cObj1.colorG * obj1Factor + cObj2.colorG * (1-obj1Factor));\r\n newC.colorB = Math.floor(cObj1.colorB * obj1Factor + cObj2.colorB * (1-obj1Factor));\r\n\r\n return newC;\r\n}", "title": "" } ]
[ { "docid": "4a9cabdd05ef03671b843e3909e0c629", "score": "0.6719901", "text": "averageWeightDiff(brain1, brain2) {\n if (brain1.genes.length == 0 || brain2.genes.length == 0) {\n return 0;\n }\n\n\n var matching = 0;\n var totalDiff = 0;\n for (var i = 0; i < brain1.genes.length; i++) {\n for (var j = 0; j < brain2.genes.length; j++) {\n if (brain1.genes[i].innovationNo == brain2.genes[j].innovationNo) {\n matching++;\n totalDiff += abs(brain1.genes[i].weight - brain2.genes[j].weight);\n break;\n }\n }\n }\n if (matching == 0) { //divide by 0 error\n return 100;\n }\n return totalDiff / matching;\n }", "title": "" }, { "docid": "4a9cabdd05ef03671b843e3909e0c629", "score": "0.6719901", "text": "averageWeightDiff(brain1, brain2) {\n if (brain1.genes.length == 0 || brain2.genes.length == 0) {\n return 0;\n }\n\n\n var matching = 0;\n var totalDiff = 0;\n for (var i = 0; i < brain1.genes.length; i++) {\n for (var j = 0; j < brain2.genes.length; j++) {\n if (brain1.genes[i].innovationNo == brain2.genes[j].innovationNo) {\n matching++;\n totalDiff += abs(brain1.genes[i].weight - brain2.genes[j].weight);\n break;\n }\n }\n }\n if (matching == 0) { //divide by 0 error\n return 100;\n }\n return totalDiff / matching;\n }", "title": "" }, { "docid": "76a095be2c5a74402504c10dcfc46c92", "score": "0.6518035", "text": "averageWeightDiff(brain1, brain2) {\n if (brain1.connectgenes.length == 0 || brain2.connectgenes.length == 0) {\n return 0;\n }\n\n\n var matching = 0;\n var totalDiff = 0;\n for (var i = 0; i < brain1.connectgenes.length; i++) {\n for (var j = 0; j < brain2.connectgenes.length; j++) {\n if (brain1.connectgenes[i].innovationNo == brain2.connectgenes[j].innovationNo) {\n matching++;\n totalDiff += abs(brain1.connectgenes[i].weight - brain2.connectgenes[j].weight);\n break;\n }\n }\n }\n if (matching == 0) { //divide by 0 error\n return 100;\n }\n return totalDiff / matching;\n }", "title": "" }, { "docid": "e6467dedd15ec69439ae2c07d1e98145", "score": "0.64866614", "text": "function avg(a, b) {\r\n return a + b / 2;\r\n}", "title": "" }, { "docid": "106b63bd9bba6db56e6690de094bd8ce", "score": "0.6408973", "text": "function avg(a, b) {\r\n return (a + b) / 2;\r\n}", "title": "" }, { "docid": "35d3a4117fd834ac0d2fb158964e0d27", "score": "0.6408725", "text": "function avg(a, b) {\n return (a + b) / 2\n}", "title": "" }, { "docid": "fce041c62f58c1fd9c2720502ebef11c", "score": "0.63790214", "text": "function avg(a, b) {\n return (a + b) / 2;\n}", "title": "" }, { "docid": "9f7cb8af6f18e3a4b7e9cea3476b2ed4", "score": "0.6204315", "text": "function calculateAverageSubsampleWeight(record) {\n let subsample_a_weight;\n let subsample_b_weight;\n let empty_bag_weight;\n\n return new Promise(function(resolve, reject){\n if (app.isAnswered('subsample_a_weight')) {\n subsample_a_weight = app.getAnswer('subsample_a_weight');\n } else if (record != null && record.subsample_a_weight) {\n subsample_a_weight = record.subsample_a_weight;\n } else {\n // Return since we don't have a required value\n resolve();\n }\n\n if (app.isAnswered('subsample_b_weight')) {\n subsample_b_weight = app.getAnswer('subsample_b_weight');\n } else if (record != null && record.subsample_b_weight) {\n subsample_b_weight = record.subsample_b_weight;\n } else {\n // Return since we don't have a required value\n resolve();\n }\n\n if (app.isAnswered('empty_bag_weight')) {\n empty_bag_weight = app.getAnswer('empty_bag_weight');\n } else if (record != null && record.empty_bag_weight) {\n empty_bag_weight = record.empty_bag_weight;\n } else {\n // Return since we don't have a required value\n resolve();\n }\n \n let a_weight_no_bag = subsample_a_weight - empty_bag_weight;\n let b_weight_no_bag = subsample_b_weight - empty_bag_weight;\n let average_weight = (a_weight_no_bag + b_weight_no_bag) / 2;\n FormData.BagData.average_fresh_biomass_excludes_bag_weight = average_weight;\n\n resolve();\n \n });\n }", "title": "" }, { "docid": "50b238ba3c06c6ef3accf7232533a722", "score": "0.61879194", "text": "function avg(a,b){\n return (a+b)/2;\n\n}", "title": "" }, { "docid": "18b41a8e35f8105a06d27bb6d4addf3f", "score": "0.6182388", "text": "function avgTwoNumbers(a, b) {\n return (a+b)/2;\n}", "title": "" }, { "docid": "f85cdb5a88de79d135ee3ae1dd40a1e3", "score": "0.61241364", "text": "function avg(a, b) {\n c = (a + b) / 2;\n return c;\n}", "title": "" }, { "docid": "72856058dd8b4aa8c0d41dc809cbd1b6", "score": "0.6123045", "text": "calculateWeightedAverage() {\n this.finalResult = createVector(0, 0);\n let totalWeight = 0;\n for (let i = 0; i < this.desires.length; i++) {\n const desire = this.desires[i].behavior.calculate();\n this.desires[i].result = desire;\n const adjustedWeight =\n this.desires[i].weight * this.desires[i].behavior.partiality;\n const weightedResult = p5.Vector.mult(desire, adjustedWeight);\n this.desires[i].weightedResult = weightedResult;\n this.finalResult.add(this.desires[i].weightedResult);\n totalWeight += adjustedWeight;\n }\n if (totalWeight !== 0) {\n this.finalResult.mult(1.0 / totalWeight);\n } else {\n this.finalResult = this.entity.velocity;\n }\n return this.finalResult;\n }", "title": "" }, { "docid": "7962fa8fab47790ea06c71c3c5305b65", "score": "0.6105019", "text": "function avg(a, b){\n c = a + b/2;\n return c;\n}", "title": "" }, { "docid": "a37a9512c315750ee01020a6143ab0be", "score": "0.6031856", "text": "function avg(a,b) {\n c = (a+b)/2;\n return c;\n}", "title": "" }, { "docid": "8b2408e0fae414a2cfde8a4a6f7c3367", "score": "0.6027117", "text": "function weightedPredictionScoreColor(c1, c2, votesA, votesB) {\n // we normalize the weight according to some magic value. We want the number between -1 and 1.\n rgb1 = hexToRgb(c1);\n rgb2 = hexToRgb(c2);\n \n // find average point then deviate according to score which is always between -1 and 1\n avg = {r: rgb1['r'] + rgb2['r'], g: rgb1['g'] + rgb2['g'], b: rgb1['b'] + rgb2['b']};\n \n avg['r'] /= 2;\n avg['g'] /= 2;\n avg['b'] /= 2;\n \n score = votesA - votesB;\n score /= votesA + votesB;\n \n // now deviate according to weight\n avg['r'] = avg['r'] + avg['r'] * score;\n avg['g'] = avg['g'] + avg['g'] * score;\n avg['b'] = avg['b'] + avg['b'] * score;\n \n return rgbToHex(avg);\n}", "title": "" }, { "docid": "aa23534bbd3fe1a7beef9c435f29f950", "score": "0.60235363", "text": "function weightedMean(weightsArray, valuesArray){\n let values = 0;\n let weights = 0;\n let topline = 0;\n let bottomline = 0;\n for(i=0; i < valuesArray.length; i++){\n topline += weightsArray[i] * valuesArray[i];\n bottomline += weightsArray[i];\n }\n return topline/bottomline;\n }", "title": "" }, { "docid": "17777ba17b7e8f7e9bfae91e73cfcd96", "score": "0.5953644", "text": "function add(img1, img2, weight) {\n return blend(img1, img2, function(a, b){return a.mul(weight).add(b.mul(1-weight));});\n}", "title": "" }, { "docid": "b5d309259a9d994074045daffee958b5", "score": "0.5929025", "text": "function weightedSum(ret, w1, v1, w2, v2) {\n for (var j = 0; j < ret.length; ++j) {\n ret[j] = w1 * v1[j] + w2 * v2[j];\n }\n }", "title": "" }, { "docid": "bb891ddb072d6006388f15387194273c", "score": "0.5813369", "text": "function compute(items, itemWeights) {\n //const sw = itemWeights.reduce((s, x) => s + x, 0);\n //const wmean = items.reduce((wm, x, i) => wm + (x * itemWeights[i]), 0) / sw;\n let sw = 0;\n return items.reduce((wm, x, i) => {\n sw += itemWeights[i];\n return wm + (x * itemWeights[i])\n }, 0) / sw;\n}", "title": "" }, { "docid": "fbec7c373b47bf28dc45357680ee6ebb", "score": "0.5790033", "text": "function averageThese(num1, num2) {\n\tvar average = (num1 + num2) / 2;\n\treturn average;\n}", "title": "" }, { "docid": "d243dc80025b8336c997f6bfc1a8211a", "score": "0.57538515", "text": "function avg(one, two, three) {\n return (one + two + three) / 3;\n}", "title": "" }, { "docid": "a73efc4d655747e9c8de049220199a96", "score": "0.57430553", "text": "function knapsackLight(value1, weight1, value2, weight2, maxW) {\n let val = 0;\n if (weight1 > maxW && weight2 <= maxW) {\n return value2\n } else if (weight2 > maxW && weight1 <= maxW) {\n return value1\n } else if (value1 == value2 && (weight1 <= maxW || weight2 <= maxW )) {\n return value1\n }\n if (value1 > value2 && weight1 <= maxW) {\n val = value1;\n } else if(value2 > value1 && weight2 <= maxW) {\n val = value2;\n }\n\n if (weight1+weight2 <= maxW) {\n val = (value1+value2)\n }\n return val\n}", "title": "" }, { "docid": "6df0a9cc260d88317f5b97781f151439", "score": "0.5710195", "text": "function avg({count, sum : {min, max}}) {\n return (min + max)/count;\n}", "title": "" }, { "docid": "119b70b1a432cdad93acd4f9a8fd78d9", "score": "0.563148", "text": "function blend(a, b, weight) {\n const aColor = decomposeColor(a);\n const bColor = decomposeColor(b);\n\n const w = (2 * weight) - 1;\n const w1 = (w + 1) / 2.0;\n const w2 = 1 - w1;\n\n /** @type {[number, number, number, number?]} */\n const values = [\n (w1 * aColor.values[0]) + (w2 * bColor.values[0]),\n (w1 * aColor.values[1]) + (w2 * bColor.values[1]),\n (w1 * aColor.values[2]) + (w2 * bColor.values[2]),\n aColor.values[3] ?? 1,\n ];\n\n return recomposeColor({ type: 'rgba', values });\n}", "title": "" }, { "docid": "1818beb5d10fba0761f2db4a6d0547b6", "score": "0.5620793", "text": "function weightedMean(g,n,nodes){\r\n var sum=0,totalweight=0\r\n nodes.forEach(m => {\r\n // 1/(num of columns the parent is away)\r\n var weight = 1//1/Math.abs(g.node(n).x-g.node(m).x)\r\n sum += g.node(m).y * weight\r\n totalweight += weight\r\n })\r\n return sum/totalweight\r\n}", "title": "" }, { "docid": "c3864fd555ba5f4ee3df5c403c550855", "score": "0.56054425", "text": "function average(num1, num2){\n\treturn (num1 + num2) / 2\n}", "title": "" }, { "docid": "de91b9b02fac867fcff615f79acf9292", "score": "0.556568", "text": "avg()\n {\n\n }", "title": "" }, { "docid": "5d305c864c5a258a1b39b56f21c3e2e9", "score": "0.5548983", "text": "getAverageRating() {\n let ratingsSum = this.ratings.reduce((accumulator, rating) => accumulator + rating);\n return ratingsSum / this.ratings.length;\n }", "title": "" }, { "docid": "17643a0cce462a49703b505dae060f45", "score": "0.55209863", "text": "function bmiCalculator(weight , height) {\n var bmi = weight / (height * height);\n return Math.round(bmi);\n}", "title": "" }, { "docid": "fad4e20bef3489cf93b43760c6234f1d", "score": "0.5518069", "text": "function getGroupWeight(elements) {\n\tlet total = new Decimal(0);\n\tfor (let i = 0; i < elements.length; i++) {\n\t\ttotal = total.add(getElementWeight(elementData[elements[i]].position))\n\t}\n\treturn total;\n}", "title": "" }, { "docid": "c79900816fcac3bdefc7a085b5abd502", "score": "0.5512272", "text": "function avg(a,b,c){\n var d = (a + b + c)\n return (d / 3)\n}", "title": "" }, { "docid": "b9a7864b3015d85c9141a9d732b5ffe2", "score": "0.55113775", "text": "function weightedAverage(prices, volumes) {\n if (prices.length !== volumes.length) {\n throw new TypeError(\"Weighted Average expects two equal sized lists\")\n }\n\n if (!prices.every((x) => isNum(x)) || !volumes.every((x) => isNum(x))) {\n throw new TypeError(\"Weighted Average lists must contain only numbers\")\n }\n\n const largestVolume = volumes.reduce((x, xs) => {\n return x > xs ? x : xs\n }, 0)\n\n const volumeWeights = volumes.map((x) => x / largestVolume)\n\n const weightTotal = volumeWeights.reduce((x, xs) => x + xs)\n\n const weightedPriceTotal = prices\n .map((x, i) => x * volumeWeights[i])\n .reduce((x, xs) => x + xs)\n\n return weightedPriceTotal / weightTotal\n}", "title": "" }, { "docid": "3a44c34c8cd06ad5fe0d9236692424ff", "score": "0.5492462", "text": "function averageNumbers (numbers2) {\n return numbers2.reduce((sum, v) => sum += v, 0)/numbers2.length;\n}", "title": "" }, { "docid": "096c56ae2a07959dd45d6c96285348fb", "score": "0.5483624", "text": "getAverageRating() {\n const sumRating = this._ratings.reduce((acc,cur) => acc + cur);\n return sumRating / this._ratings.length; \n }", "title": "" }, { "docid": "624e1035623622ddff09140f65e9b412", "score": "0.54720783", "text": "function average(r){\r\n if(r.length == 0) return 0;\r\n return sum(r) / r.length;\r\n}", "title": "" }, { "docid": "983de2e03424836652fad17368752978", "score": "0.5451554", "text": "function avg (firstNum, secondNum, thirdNum){\n return ((Number(firstNum)+Number(secondNum)+Number(thirdNum))/3);\n}", "title": "" }, { "docid": "5cd9fd12cb51f289051b5405be683a2f", "score": "0.5426058", "text": "function avgPooling2d(args) {\n return averagePooling2d(args);\n}", "title": "" }, { "docid": "5cd9fd12cb51f289051b5405be683a2f", "score": "0.5426058", "text": "function avgPooling2d(args) {\n return averagePooling2d(args);\n}", "title": "" }, { "docid": "5cd9fd12cb51f289051b5405be683a2f", "score": "0.5426058", "text": "function avgPooling2d(args) {\n return averagePooling2d(args);\n}", "title": "" }, { "docid": "c2f1a92de0d145eda9d18eac905b9f83", "score": "0.5421271", "text": "function findAvg2(arr2)\n{\n var nrd2 = 0;\n var arr2 = [1,2,3,4,5,6,7,8,9,10,100];\n \n for(var r = 0; r < arr2.length; r++)\n {\n nrd2 += arr[r];\n }\n return nrd2 / arr2.length;\n}", "title": "" }, { "docid": "d9b117ff7bc1685e403a63ec8fcbf5c1", "score": "0.5401102", "text": "function reduceAddAvg(attr) {\n return function(p,v) {\n ++p.count\n p.sum += v[attr];\n p.avg = p.sum/p.count;\n return p;\n };\n }", "title": "" }, { "docid": "09dc6d870412a975865461b7b20d83f7", "score": "0.5391607", "text": "getAverageRating() {\n return (\n this._ratings.reduce(\n (accumlator, currentValue) => accumlator + currentValue,\n 0\n ) / this._ratings.length\n );\n }", "title": "" }, { "docid": "4d0f62544b60b1434548276e762ef90e", "score": "0.5385861", "text": "function avg(num1, num2, num3) {\n\tvar total = Number(num1) + Number(num2) + Number(num3)\n\tvar avg = total / 3\n\treturn avg;\n}", "title": "" }, { "docid": "93cb784d52337b4869c05d9adb63ddde", "score": "0.53845304", "text": "function avg (a, b, c){\n return (a + b + c)/3;\n}", "title": "" }, { "docid": "54072942a214151c7f581005f93bf2a2", "score": "0.536872", "text": "function avg(num1, num2, num3) {\n return (num1 + num2 + num3)\n}", "title": "" }, { "docid": "d2fef3f20585db32f3b8bf9393ef2d03", "score": "0.5364176", "text": "function avg(a,b,c){\n return (a+b+c)/3;\n }", "title": "" }, { "docid": "9a27d7f2f7649a5e8c99e199dda5b3a5", "score": "0.53627497", "text": "function calculateAverageAdded(oldAverage, oldCount, newScore) {\n return (oldAverage * oldCount + newScore) / (oldCount + 1);\n}", "title": "" }, { "docid": "424b05ada3c46792ea26c14fc5f69fd5", "score": "0.5351781", "text": "function ratesAverage(arr) {\n if (arr.legth === 0)\n return 0;\n else {\n let avg = (arr.reduce((accum, item) => {\n if (!item.rate) return accum;\n return accum + item.rate;\n }, 0)) / arr.length;\n let total = parseFloat(avg.toFixed(2));\n if (!total) return 0;\n else return total;\n }\n}", "title": "" }, { "docid": "42fd1a8a19da3d186014e1f4d751416d", "score": "0.5341844", "text": "function average (...args){\nvar result = 0;\nfor ( i = 0; i< args.length;i ++)\n{ result = args[i] + result}\nreturn result / args.length;\n}", "title": "" }, { "docid": "13365c318a33cea91b3d00f39ef89609", "score": "0.5338089", "text": "function mean(numberList1, numberList2){\n var numMeans = [];\n numMeans = sum(numberList1, numberList2);\n numMeans[0] = numMeans[0]/(numberList1.length/2) + Math.min.apply(null, numberList1);\n numMeans[1] = numMeans[1]/(numberList2.length/2) + Math.min.apply(null, numberList2);\n return numMeans;\n}", "title": "" }, { "docid": "4933d94fc6ac1c37fa1a31e43910f7c6", "score": "0.53241736", "text": "function calculateWeight(){\n\n per1= calculatePercentage();\n if(isNaN(per1)){\n per1 = 0;\n var x =document.querySelector(\"#percentage\");\n x.innerHTML = 0 + \"/\"+ 0;\n }\n\n var w1 = Number(document.getElementById(\"weight1\").value);\n if(isNaN(w1)){\n w1 =0;\n }\n\n var cal1 = Number(per1*w1);\n\n per2= calculatePercentage2();\n if(isNaN(per2)){\n per2 = 0;\n var x =document.querySelector(\"#percentage2\");\n x.innerHTML = 0 + \"/\"+ 0;\n }\n\n var w2 = Number(document.getElementById(\"weight2\").value);\n if(isNaN(w2)){\n w2 =0;\n }\n\n var cal2 = Number(per2 * w2);\n\n per3= calculatePercentage3();\n if(isNaN(per3)){\n per3 = 0;\n var x =document.querySelector(\"#percentage3\");\n x.innerHTML = 0 + \"/\"+ 0;\n }\n\n var w3 = Number(document.getElementById(\"weight3\").value);\n if(isNaN(w3)){\n w3 =0;\n }\n\n var cal3 = Number(per3 * w3);\n\n per4= calculatePercentage4();\n if(isNaN(per4)){\n per4 = 0;\n var x =document.querySelector(\"#percentage4\");\n x.innerHTML = 0 + \"/\"+ 0;\n }\n\n var w4 = Number(document.getElementById(\"weight4\").value);\n if(isNaN(w4)){\n w4 =0;\n }\n\n var cal4 = Number(per4 * w4);\n\n var w = Number(w1 + w2 + w3 + w4);\n var cal = Number((cal1 + cal2 + cal3 + cal4) / w);\n \n var x = document.querySelector(\"#result\");\n x.innerHTML = \"Result: weighted Grades are \" + cal.toFixed(2);\n return cal;\n}", "title": "" }, { "docid": "d277c0589c5470f18bfa9f927273f7a0", "score": "0.53184396", "text": "function average(z,x,c,v,b){\n\toutput= (z+x+c+v+b)/5;\n\treturn output;\n}", "title": "" }, { "docid": "6dcf698f8372ee2b5b5607700a80de02", "score": "0.5316337", "text": "function getBuildRatio(a, b, normWeights) {\n return Data.Statistics.reduce(function (r, stat) { return r * Math.pow(a.stats[stat] / b.stats[stat], normWeights[stat]); }, 1);\n }", "title": "" }, { "docid": "55f928f44c00972f0ae074a21784670c", "score": "0.53135777", "text": "function averageRBI(aryplayer) {\n var aryRBIs = aryplayer.map(function(player) {\n return player.rbi;\n });\n\n var sumRBIs = aryRBIs.reduce(function(rbi1, rbi2) {\n return rbi1 + rbi2;\n });\n\n return sumRBIs / aryplayer.length;\n}", "title": "" }, { "docid": "4dbc362f91f08b4a34350af907db4fc9", "score": "0.5313141", "text": "function combine_normal(v1, alpha1, v2, alpha2) {\nreturn v2 * alpha2 + (1 - alpha2) * alpha1 * v1;\n}", "title": "" }, { "docid": "e28d055e7f342726eafba70c61881935", "score": "0.53089035", "text": "function getavg(){\n return avg;\n }", "title": "" }, { "docid": "70647196e6105b80faed34106da4f1e2", "score": "0.5292368", "text": "function average(a, b, fnc) {\n return fnc(a, b) / 2;\n}", "title": "" }, { "docid": "308b5f41da987fc2fa17fbcd05ee9d30", "score": "0.5278221", "text": "function bmiCalculator(weight, height) {\n var bmi = weight / Math.pow(height, 2);\n return Math.round(bmi);\n}", "title": "" }, { "docid": "5f2531cda06eb57f487dec2d0e5c5c51", "score": "0.5277109", "text": "function avg (input1, input2, input3) {\n\tvar answer = (input1 + input2 + input3)/3;\n\treturn answer;\n}", "title": "" }, { "docid": "ec03e2721c8e8db57b0af2b67eeac932", "score": "0.5267255", "text": "getAverageRating(){\n const reducer = (total, currentVal) => total + currentVal;\n const sumOfRatings = this._ratings.reduce(reducer);\n const averageRatings = sumOfRatings/this._ratings.length - 1;\n return averageRatings;\n }", "title": "" }, { "docid": "be6aa7457e5b2dd241dc071c191f499b", "score": "0.5254704", "text": "function bmiCalculator (weight, height) {\n var bmi = weight / (height * height);\n return bmi;\n}", "title": "" }, { "docid": "5470af118e9b58fffa141b27764f7dc9", "score": "0.5249827", "text": "function weightedCalc(){\n\tvar weightedSum=0.00;\n\tvar count=0;\n\n\tvar activities=[];\n\tactivities.push(act1, act2, act3, act4);\n\n\tfor (var i=0; i<activities.length; i++){\n\t\tif(isNonNeg(activities[i].weight.value) &&\n\t\t!zeroLength(activities[i].weight.value) &&\n\t\tactivities[i].perc.hidden == false) {\n\t\t\tweightedSum+=(activities[i].grade.value/activities[i].total.value)*activities[i].weight.value;\n\t\t\tcount+=(activities[i].weight.value*1);\n\t\t}\n\t}\n\n\tif (count!=0)\n\t\tdocument.querySelector(\"#finalOutput\").value=(weightedSum/count * 100).toFixed(2) + \"/100\";\n\telse\n\t\tdocument.querySelector(\"#finalOutput\").value=\"NaN\";\n\n\tdocument.querySelector(\"#finalOutput\").hidden=false;\n}", "title": "" }, { "docid": "6a984792bab6bee42bf000b6c9e7f322", "score": "0.5247812", "text": "function avgPooling1d(args) {\n return averagePooling1d(args);\n}", "title": "" }, { "docid": "6a984792bab6bee42bf000b6c9e7f322", "score": "0.5247812", "text": "function avgPooling1d(args) {\n return averagePooling1d(args);\n}", "title": "" }, { "docid": "6a984792bab6bee42bf000b6c9e7f322", "score": "0.5247812", "text": "function avgPooling1d(args) {\n return averagePooling1d(args);\n}", "title": "" }, { "docid": "ffdae9016f726714d75307431a2f7b83", "score": "0.5244989", "text": "function avg (num1, num2, num3){\n return ((num1 + num2 + num3) / 3)\n}", "title": "" }, { "docid": "f2d4954b0d649cf248494cd1c2a8c9d6", "score": "0.5242245", "text": "function avg(a,b,c) {\n return (a+b+c)/3;\n}", "title": "" }, { "docid": "1176be5ae2c76e5fe6144dfd8fe24ad6", "score": "0.5237769", "text": "function computeAvgTenure(){\n\t\treturn;\n\t}", "title": "" }, { "docid": "1176be5ae2c76e5fe6144dfd8fe24ad6", "score": "0.5237769", "text": "function computeAvgTenure(){\n\t\treturn;\n\t}", "title": "" }, { "docid": "3e63b564e9a89315e3485fc2a44bcaae", "score": "0.52364075", "text": "align(boids) {\n let avg = createVector(); // average from other vectors boids (velocities)\n let total = 0;\n boids.forEach(boid => {\n if (boid != this && this.position.dist(boid.position) < this.perseptionRad) {\n avg.add(boid.velocity);\n total++;\n }\n });\n // avg becomes the steering in witch the boid is boing to head into.\n if (total > 0) {\n avg.div(total);\n avg.setMag(this.maxSpeed);\n avg.sub(this.velocity);\n avg.limit(this.maxForce);\n }\n return avg;\n }", "title": "" }, { "docid": "06fa98340f8f75aa05ae589288bf18e9", "score": "0.52347285", "text": "function avg(one, two, three) {\n console.log((one + two + three) / 3);\n return ((one + two + three) / 3);\n}", "title": "" }, { "docid": "925db7c000844561fe04136e13beeb71", "score": "0.5215897", "text": "function BMI(weight ,height)\n{\n var bmi = weight / (height * height);\n return bmi;\n}", "title": "" }, { "docid": "104686ceb8dfcf18f5116d1f770f6678", "score": "0.5210644", "text": "function avg(num1, num2, num3) {\n return (num1+num2+num3)/3;\n}", "title": "" }, { "docid": "5ad37760f338cfee174571d019afc333", "score": "0.5206966", "text": "function avg (a, b, c) {\n var d = (a+b+c)/3;\n return d;\n}", "title": "" }, { "docid": "821dbe7b90b17baa8671355a01b6345a", "score": "0.5206745", "text": "function calculateAverages() {\n console.log('Calculating averages')\n // Calculate averages from the summation.\n const javascriptAvg = javascriptSum.reduce((curr, prev) => curr + prev) / javascriptSum.length;\n const wasmAvg = wasmSum.reduce((curr, prev) => curr + prev) / wasmSum.length;\n console.log('javascript average', javascriptAvg);\n console.log('wasm average', wasmAvg);\n}", "title": "" }, { "docid": "c9b38ffd97c5247e6cf3adacb146efc1", "score": "0.5204421", "text": "function ratesAverage(moviesCopy) {\n const totalReviews = moviesCopy.reduce((acc, movie) => {\n return acc + parseFloat(movie.rate);\n }, 0);\n return parseFloat((totalReviews / moviesCopy.length).toFixed(2));\n}", "title": "" }, { "docid": "48b5fd61e2c95392e652114d2364f05d", "score": "0.5204249", "text": "function averageRevenue(drivers){\n return totalRevenue(drivers) / drivers.length;\n}", "title": "" }, { "docid": "130cbd7d1d9ef42a049818b5255b1605", "score": "0.5199775", "text": "function ratesAverage(){\n var sum = movies.reduce(function(sum, placeholder){\n return sum + Number(placeholder.rate);\n },0);\n \n var ratesAverage = Math.round((sum / movies.length) * 100)/100 \n \n return ratesAverage\n }", "title": "" }, { "docid": "4e253dbdedcfdc2ab168532f40a8e0e5", "score": "0.5188622", "text": "function getAverage(data){\n\t\tif(cut == \"gender\"){\n\t\t\treturn d3.mean(data,function(d){return +d.male_num/d.total_num});\n\t\t}\n\t\tif(cut == \"supWhite\"){\n\t\t\treturn d3.mean(data,function(d){return +d.white_sup_num/d.total_sup_num});\n\t\t}\n\t\tif(cut == \"supGender\"){\n\t\t\treturn d3.mean(data,function(d){return +d.male_sup_num/d.total_sup_num});\n\t\t}\n\t\treturn d3.mean(data,function(d){return +d.white_num/d.total_num});\n\t}", "title": "" }, { "docid": "5fc920c88feddc88f1b0b0a8904b2577", "score": "0.51862234", "text": "function average (a,b,c,d,e) {\n\tvar anwser = (a + b + c + d + e) / 5 ;\n\treturn anwser;\n}", "title": "" }, { "docid": "f8f637cf5cb026b9811fd66434398f33", "score": "0.51830673", "text": "function average(num1, num2) {\n // console.log( (num1 + num2) / 2); // prints 11\n return (num1 + num2) / 2;\n}", "title": "" }, { "docid": "60f519a011842f33fdbff56f05747f75", "score": "0.51708317", "text": "function bmiCalculator(weight,height){\n return weight/Math.pow(height,2);\n}", "title": "" }, { "docid": "60c1c425c2f44c410e2cfb08dc245a59", "score": "0.51649827", "text": "function calculateAverage(a, b, c, d, e) {\n\n return Math.round((a + b + c + d + e) / 5);\n}", "title": "" }, { "docid": "a15101482d88e9b46f51cbecbb103f28", "score": "0.5161032", "text": "function mean(band){\r\n var x = img.select(band).reduceRegion({\r\n reducer: ee.Reducer.mean(),\r\n geometry: ee.Geometry(img.geometry()),\r\n scale: 30,\r\n maxPixels: 1e11\r\n });\r\n var y = img.select('IC', band).reduceRegion({\r\n reducer: ee.Reducer.linearFit(),\r\n geometry: ee.Geometry(img.geometry()),\r\n scale: 30,\r\n maxPixels: 1e11\r\n });\r\n \r\n var m = ee.Number(y.get('scale'));\r\n var b = ee.Number(y.get('offset'));\r\n var Ilavg = ee.Number(x.get(band));\r\n var corrected = img.expression(\r\n \"(image - (b + m*ic) + mean)*0.0001\", {\r\n 'image': img.select(band),\r\n 'ic': img.select('IC'),\r\n 'b': b,\r\n 'm': m,\r\n 'mean': Ilavg}\r\n );\r\n return corrected.double();\r\n}", "title": "" }, { "docid": "babdb7882103a37e109ac7b824db6c16", "score": "0.5150457", "text": "function calculateAverage(grades) {\n let num = 0;\n grades.forEach(function (num1) {\n num += num1;\n });\n return Math.round(num / grades.length);\n }", "title": "" }, { "docid": "3738e4fe9637ea8766c2e4ec89e07032", "score": "0.51501757", "text": "function calculateAverage(grades) {\n // grades is an array of numbers\n let avCalc = grades.reduce(function (a, b) {\n return (a + b);\n });\n return Math.round(avCalc / grades.length);\n}", "title": "" }, { "docid": "3ac7e775b80c5578bb42ef3c8ba5c5e6", "score": "0.5149234", "text": "static average(...args){\n \tlet temp_args = Convert.deep_copy(args)\n let sum\n if(temp_args.length == 1){\n \tsum = temp_args[0][0]\n \tfor(let i = 1; i < temp_args[0].length; i++){\n \tsum += temp_args[0][i]\n }\n return sum/temp_args[0].length\n }\n \n sum = temp_args[0]\n \tfor(var i = 1; i < Vector.size(args); i++){\n \tif (Vector.size(args[i]) === Vector.size(sum)){\n\t\t\t\tif (Vector.size(sum) === 1){\n \tsum += args[i]\n }else{\n \tfor(var j = 0; j < Vector.size(sum); j++){\n \t\tsum[j] += args[i][j]\n \t}\n }\n \t\n }else{\n \tif (Vector.size(args[i]) === 1){\n \tfor(var j = 0; j < Vector.size(sum); j++){\n \t\tsum[j] += args[i]\n \t}\n }else{\n \tif (Vector.size(sum) === 1){\n var temp = sum\n sum = args[i]\n \t\tfor(var j = 0; j < Vector.size(sum); j++){\n \t\t\tsum[j] += temp\n }\n \t}else{\n }\n }\n }\n }\n return Vector.divide(sum, args.length)\n }", "title": "" }, { "docid": "8b5f380dda1534f1f9825bee269a0301", "score": "0.51451933", "text": "function calcAverage(num1, num2, num3) {\n return (num1 + num2 + num3)/3;\n}", "title": "" }, { "docid": "bf452949093a2402d95b55bab235022b", "score": "0.5139936", "text": "function addBands(images){\n var min = images.min().select(bands)\n var max = images.max().select(bands)\n // var mean = images.mean().select(bands)\n // mean = min.addBands(max).addBands(mean)\n return min.addBands(max)\n // return mean.addBands(min.expression('(a-b)/(a+b)',{'a':max.select(bands),'b':max.select(bands)}).rename(['B7_NDSV']))\n}", "title": "" }, { "docid": "51577b7e4bc6433980b0d03bdbb0e33a", "score": "0.5135709", "text": "function battingAverage(numHits, numAtBats) { // Paramater values are always local to the function only\n\t\n\treturn numHits / numAtBats;\n\t\n}", "title": "" }, { "docid": "29ffd38248775f5c8a4a0561df02bff4", "score": "0.5133041", "text": "function lorentz_boost (b) {\n const b2 = b[0] * b[0] + b[1] * b[1] + b[2] * b[2]\n\n if (b2 == 0) {\n return [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]\n }\n\n const g = 1 / Math.sqrt(1 - b2)\n const o = outer(b, b)\n\n return [\n [g, -g * b[0], -g * b[1], -g * b[2]],\n [\n -g * b[0],\n 1 + (g - 1) * o[0][0] / b2,\n (g - 1) * o[0][1] / b2,\n (g - 1) * o[0][2] / b2\n ],\n [\n -g * b[1],\n (g - 1) * o[1][0] / b2,\n 1 + (g - 1) * o[1][1] / b2,\n (g - 1) * o[1][2] / b2\n ],\n [\n -g * b[2],\n (g - 1) * o[2][0] / b2,\n (g - 1) * o[2][1] / b2,\n 1 + (g - 1) * o[2][2] / b2\n ]\n ]\n}", "title": "" }, { "docid": "b7f8533a6e0eb2e0e854fd2908a5081d", "score": "0.51280063", "text": "function averageAge (num1, num2, num3,) {\n let avg = null\n if(num3 == undefined)\n { \n avg = (num1 + num2) / 2\n }\n else\n {\n avg = (num1 + num2 + num3) / 3\n }\n return Math.round(avg)\n}", "title": "" }, { "docid": "8fae990f37fd909e256a28cab175ee1c", "score": "0.51278853", "text": "average(...args) {\n this.mean(...args);\n }", "title": "" }, { "docid": "4a54464d3cd883d281fa2e1008ad320a", "score": "0.51268435", "text": "function findAverage(x, y) {\n var answer = (x + y) / 2;\n return answer;\n}", "title": "" }, { "docid": "3362707aa4ca5e7846707720aa289587", "score": "0.5125925", "text": "function calcAverageGrade(asgtArr, total) {\n var sum = 0, grade, average;\n for(var i = 0; i < asgtArr.length; i++) {\n grade = (asgtArr[i].score) / total;\n sum += grade;\n }\n average = sum / (asgtArr.length);\n return average * ONE_HUNDRED;\n}", "title": "" }, { "docid": "a8346d9925fd5f83af1d19d1cf50a23d", "score": "0.5125917", "text": "function Avg() {\n\tvar total = 0.0,\n\tcount = 0;\n\tthis.update = function( data ) {\n\t\tthis.total += data;\n\t\tthis.count++;\n\t}\n\tthis.result = function() {\n\t\tvar total = this.total;\n\t\tvar count = this.count;\n\t\tthis.total = 0.0;\n\t\tthis.count = 0;\n\t\treturn count == 0 ? 0.0 : total / count;\n\t}\n}", "title": "" }, { "docid": "2fc0c2889f054a7802f6bf82f85b9e33", "score": "0.5124769", "text": "function computeWeightedLoss(losses, sampleWeights) {\n return Object(dist[\"mul\"])(losses, sampleWeights);\n}", "title": "" }, { "docid": "3377c9637d71dca733b3597b944af87e", "score": "0.5108096", "text": "function ratesAverage(arr) {\n if (!arr.length) {\n return 0;\n };\n return Number((arr.reduce((a,b) => {\n if (b.rate) {\n return a + b.rate;\n } else {\n return a\n };\n }, 0) / arr.length).toFixed(2));\n }", "title": "" }, { "docid": "831ab65252f1d6343416cff6876c22ac", "score": "0.5107738", "text": "get valuePerWeightRatio() {\r\n return this.value / this.weight;\r\n }", "title": "" }, { "docid": "cb4bcbf8c5c453cb7bb12f4e2858bcb1", "score": "0.51075906", "text": "function calculateLinearAverageBins(bandWidth) {\n for (let i = 0; i < levels.length; i++) {\n levelsSum += levels[i]\n numFrequencies++\n\n if ((i + 1) % bandWidth === 0) {\n bandedLevels.push(levelsSum / numFrequencies / 255)\n levelsSum = 0\n numFrequencies = 0\n }\n }\n }", "title": "" }, { "docid": "d3d4269efe9311f56f0130c6c3495647", "score": "0.51031744", "text": "function bmiCalculator(weight, height) {\n return weight / Math.pow(height, 2)\n}", "title": "" } ]
a9e2aa7c140866e2e2d4a7a0cedac8a1
Function to set user
[ { "docid": "cb4748cddd763758f1bbec3623701397", "score": "0.67344034", "text": "function setCurrentUser(user) {\n currentUser = user.data;\n currentUserAllData = user;\n\n return Fliplet.App.Storage.set(USERID_STORAGE_KEY, currentUser.flUserId).then(function() {\n return Fliplet.App.Storage.set(USERTOKEN_STORAGE_KEY, currentUser.flUserToken);\n });\n }", "title": "" } ]
[ { "docid": "bc6fc9b823b132083c0d21500b42b846", "score": "0.77134085", "text": "function setUser(u) {\n user = u\n}", "title": "" }, { "docid": "0fd43cc6fff4f6b1cead6a9bf5687cff", "score": "0.75273144", "text": "SET_USER(state, user) {\n state.user = user;\n }", "title": "" }, { "docid": "df8396c05041cc4220f8d45ad5089ab4", "score": "0.75221276", "text": "SET_USER(state, data) {\n state.user = data;\n }", "title": "" }, { "docid": "99f63e9ffdc9d1ad5fb0ee8dc8a1ee5b", "score": "0.7373706", "text": "function setUser(username){\n return {\n type: 'SET_USER',\n username\n }\n}", "title": "" }, { "docid": "30e5992298de961f9bfe55c833731caa", "score": "0.724797", "text": "setUser (user) {\n AppStorage.setUserData(user)\n AppDispatcher.handleAction({\n actionType: 'USER_SET',\n data: user\n })\n }", "title": "" }, { "docid": "df7e792c86b2641e440948ddadae7b83", "score": "0.7239591", "text": "SET_USER(state, data) {\n state.user.data = data;\n }", "title": "" }, { "docid": "2c7b6a67af8284a8f44c10f903dc8e0d", "score": "0.7196601", "text": "function setCurrentUser(user) {\n \n currentUser.userId = user[0];\n currentUser.firstName = user[1];\n currentUser.lastName = user[2];\n currentUser.email = user[3];\n currentUser.password = user[4];\n }", "title": "" }, { "docid": "9d89f343b3839d25615766afc4f44383", "score": "0.7050696", "text": "setUser (state, user) {\n state.user = user\n }", "title": "" }, { "docid": "4766b503156fadd6e7e224763f33f55b", "score": "0.70332533", "text": "function setUser(user) {\n callOnHub('setUser', user);\n}", "title": "" }, { "docid": "4766b503156fadd6e7e224763f33f55b", "score": "0.70332533", "text": "function setUser(user) {\n callOnHub('setUser', user);\n}", "title": "" }, { "docid": "4766b503156fadd6e7e224763f33f55b", "score": "0.70332533", "text": "function setUser(user) {\n callOnHub('setUser', user);\n}", "title": "" }, { "docid": "f148e97ad22fb6704dcd7b90b3a59bd0", "score": "0.70055866", "text": "function setUser(user) {\n\t\t\tlocalStorage.addLocal('user', user);\n\t\t}", "title": "" }, { "docid": "9b62d86f2e714a16f60b5abfce6a34d0", "score": "0.7001967", "text": "async setCurrentUser() {\n const response = await this.client.get('currentUser')\n this.currentUser = response.currentUser\n }", "title": "" }, { "docid": "cca2d7d6dc10e4adb2c7783dc492454b", "score": "0.6996134", "text": "[AUTH_MUTATIONS.SET_USER](state, user) {\n state.user = user\n }", "title": "" }, { "docid": "f70c46685580501f4dcca3f7ad87940e", "score": "0.6986484", "text": "function setUsername() {\n up.user = vw.getUsername();\n\n signallingConnection.sendToServer({\n user: up.user,\n date: Date.now(),\n id: up.clientID,\n type: \"username\",\n act: \"username\"\n });\n}", "title": "" }, { "docid": "e8f604d75fd0eff3147260924f228026", "score": "0.69638157", "text": "[AUTH_MUTATIONS.SET_USER](state, user) {\n state.user = user;\n state.user_id = user.id;\n }", "title": "" }, { "docid": "16c2bec28a88377941ebb55904c4ffad", "score": "0.69578874", "text": "function setUser(user_id) {\n Profile.setUser(user_id);\n }", "title": "" }, { "docid": "50ec2204e80228ee0881eb2fc9dd5b44", "score": "0.69511354", "text": "function setUserName(uname) {\n\t//alert(uname);\n\tdocument.userAccounts.userName= uname;\n}", "title": "" }, { "docid": "5d2a62b8aa00ccaa5f15848df47e668b", "score": "0.6950444", "text": "function setUser(_user){\n user = _user;\n domAttr.set('userNameDiv', 'innerHTML', _user.name);\n }", "title": "" }, { "docid": "009981e4dd59c176372cb05924d31737", "score": "0.69115996", "text": "function setUser(user) {\n if (Meteor.isServer) {\n return;\n }\n\n if (user === null || typeof user === 'undefined') { // no one is logged in\n Raven.setUser(); // remove data if present\n return;\n }\n\n Raven.setUser({id: user._id, username: user.username});\n}", "title": "" }, { "docid": "e5de4d300a0b0dee4613b69a30334763", "score": "0.6905081", "text": "function setUser() {\n\tuser = firebase.auth().currentUser;\n\tisSignedIn = true;\n\tcheckIfIt();\n\tcheckIt();\n\tconnectUser();\n\tdisplayScreen();\n}", "title": "" }, { "docid": "c30afea80b43a80769ad321938e422e6", "score": "0.6896958", "text": "function setUser(id, username) {\n\tuserid = id;\n\tusername = username;\n\tlocalStorage.setItem('userid', userid);\n\tlocalStorage.setItem('username', username);\n}", "title": "" }, { "docid": "841da4bb960239cf6e81142edf96771d", "score": "0.68912655", "text": "function setUserId(value) {\n __params['uid'] = value;\n}", "title": "" }, { "docid": "8abeb9f8c67960ca8200aada1a74a85d", "score": "0.6873554", "text": "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}", "title": "" }, { "docid": "ab9a3a31c2111ce4fa103f07fe04ec60", "score": "0.68574864", "text": "setUser(newUser) {\n this.user = newUser\n }", "title": "" }, { "docid": "2947e88dcb81da12838949a21aff1c67", "score": "0.6854787", "text": "setUser(state, newUser) {\n state.user = newUser;\n }", "title": "" }, { "docid": "b989251d8ea2539b790c8da4112e33ae", "score": "0.6846528", "text": "setCurrentUser (user, id) {\n resourceCache.addItem('users', user)\n }", "title": "" }, { "docid": "6af786ff5edfc63a03bb847e91d5666f", "score": "0.6802443", "text": "function setUsername(){\n currentUser = document.getElementById(\"username\").value;\n closeModal();\n setupSelf();\n}", "title": "" }, { "docid": "b4165931ffcc7d6065ece5ae83fe7b11", "score": "0.6792841", "text": "set userName(aValue) {\n this._logger.debug(\"userName[set]\");\n this._userName = aValue;\n }", "title": "" }, { "docid": "6b55405d2307d4e98364048b2b52f86b", "score": "0.67736745", "text": "function SetUser(Story, { parameters: { user = true } }) {\n if (user) {\n if (typeof user === \"boolean\") {\n // use default user\n user = undefined\n }\n\n setAuthForTest(user)\n }\n return <Story />\n}", "title": "" }, { "docid": "f5d881bb5ed0b850cbc2861ba19ad610", "score": "0.6770381", "text": "function setUser(user) {\n hub.getCurrentHub().setUser(user);\n}", "title": "" }, { "docid": "a205c56639c910517ba7c98ef1b7a8f1", "score": "0.6764917", "text": "set userName(userName) {\n this._userName = userName;\n console.log(\"User name set to \" + userName);\n }", "title": "" }, { "docid": "3a76fc34ea819cd91c44b1f17ba98bdd", "score": "0.6749851", "text": "setChalmersUser(state, userId) {\n state.chalmersUser = { userId };\n }", "title": "" }, { "docid": "0e18cf41f392422723224b631a9f3176", "score": "0.6736071", "text": "set_user(on) { store.dispatch(hpUser(on)); }", "title": "" }, { "docid": "935d2912d79e18fb100559fa4dbc16a5", "score": "0.6734248", "text": "user(state, user) {\n state.user = user;\n }", "title": "" }, { "docid": "589b957bb738c8560c8a71eb7d692f47", "score": "0.6724384", "text": "_define_user() {\n if ( GenericStore.defaultUserId ) {\n this.definedProps[ 'uid' ] = GenericStore.defaultUserId;\n }\n }", "title": "" }, { "docid": "8f02ce6231a75d3c2946b2952cb312d1", "score": "0.6723239", "text": "function setUser(response) {\n\t\t\tctrl.user = response;\n\t\t}", "title": "" }, { "docid": "6474658e8eeecdd5fa3ebba05c197a84", "score": "0.6705321", "text": "function setUserName(newUserName) {\n bot.userName = newUserName;\n rl.question(''\n + 'Please enter the steam account\\'s password.\\n'\n , setUserPassword\n );\n}", "title": "" }, { "docid": "28a6aa2c6f00e9bfb745430ab1ff7dc0", "score": "0.66904885", "text": "function setUser(user) {\n\t getCurrentHub().setUser(user);\n\t}", "title": "" }, { "docid": "dbfcef7ee070d1007473b00e164414c7", "score": "0.6680496", "text": "function setUser(req, res, next) {\n const userId = req.body.userId\n if (userId) {\n req.user = users.find(user => user.id === userId)\n }\n next()\n}", "title": "" }, { "docid": "6e10fdc16e9342099b3c77ea57c07686", "score": "0.66600513", "text": "function setUserData() {\n //TODO: for non-social logins - userService is handling this - not a current issue b/c there is no data for these right after reg, but needs to be consistent!\n authService.setUserCUGDetails();\n authService.setUserLocation();\n authService.setUserPreferences();\n authService.setUserBio();\n authService.setUserBookings();\n authService.setUserFavorites();\n authService.setUserReviews();\n authService.setSentryUserContext();\n authService.setSessionStackUserContext();\n\n //was a noop copied from register controller: vm.syncProfile();\n }", "title": "" }, { "docid": "8674261c96fe66b23c00293196a26256", "score": "0.6637743", "text": "setUserData(state, user){\n console.log(\"[DEUG] setUserData: \", user)\n state.user = user;\n }", "title": "" }, { "docid": "f01d01431e543f187026c5dd543b92de", "score": "0.65804553", "text": "function setUserName(uuid, userName) {\n userStore[uuid].userName = userName ? userName : userStore[uuid].displayName;\n if (getIndexOfSettingsUser(uuid) !== -1) {\n doUIUpdate();\n }\n }", "title": "" }, { "docid": "c3527d0ccf6c3dd0a301990a541ec416", "score": "0.65787715", "text": "function setUser(user) {\n getCurrentHub().setUser(user);\n }", "title": "" }, { "docid": "6263c8d75222c483ccb092d01ead2df6", "score": "0.6578287", "text": "function setCurrentUser (object) {\n\n var user = {\n firstName: object.firstName,\n lastName: object.lastName,\n username: object.username,\n password: object.password\n };\n\n $rootScope.currentUser = user;\n $rootScope.loggedIn = true;\n $localStorage.currentUser = JSON.stringify(user);\n\n }", "title": "" }, { "docid": "f519e815e7c1d7512336dc2662e5725f", "score": "0.65608853", "text": "set user (value) {\n if (_user = value) {\n this.push();\n } else {\n this.clear();\n }\n }", "title": "" }, { "docid": "6018f6e0f0d406e854aec6f2edeabb9f", "score": "0.6560066", "text": "function syncUser (newval) {\n storage.set('user', newval);\n}", "title": "" }, { "docid": "192a44615bbb116810be2a505b403cf0", "score": "0.6550498", "text": "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\n }", "title": "" }, { "docid": "bf65794080f63756f03c584fef1bdba9", "score": "0.65400225", "text": "function setUser() {\n try {\n if (typeof document !== 'undefined') document.write('Values set successfully');\n user.set('firstName', firstName.value);\n user.set('lastName', lastName.value);\n user.set('mobilePhoneNumber', phoneNumber.value);\n user.set('email', userEmail.value);\n user.set('username', username.value);\n user.set('password', password.value);\n createAccount();\n} catch (error) {\n if (typeof document !== 'undefined') document.write(`but, Error setting values: ${error.message}`);\n console.log('Error setting values', error);\n}}", "title": "" }, { "docid": "d9b82eddb38fed647fd1ac7740e5e350", "score": "0.65371025", "text": "function setUser() {\n var docRef = userRef.doc(user.email);\n docRef.get().then((doc) => {\n setUsername(doc.data().username);\n setCurrentUser(doc.data());\n });\n }", "title": "" }, { "docid": "ae00a12e302729b0316738d112cfaa1c", "score": "0.6535287", "text": "set userName(aValue) {\n this._logService.debug(\"gsDiggUserDTO.userName[set]\");\n this._userName = aValue;\n }", "title": "" }, { "docid": "13e661b23b5aefe4ba501d272f7ee98a", "score": "0.6525831", "text": "set(state, user) {\n state.isLogged = true\n state.isAdmin = user.role === 'admin'\n state.isRoot = user.name === 'root'\n state.id = user.id\n state.name = user.name\n state.role = user.role\n state.description = user.description\n state.groupIds = user.groupIds\n }", "title": "" }, { "docid": "eb5588340497935aea07cd69d9520d1a", "score": "0.65253776", "text": "async setUserData() {\n\t\tvar userinfo;\n\t\tawait AppX.fetch('User', 'self').then(async result => {\n\t\t\tvar info = result.data;\n\t\t\tglobal.userLogin = info.login;\n\n\t\t\tawait AppX.fetch('OrganizationDetail', info.organizationUid).then(result => {\n\t\t\t\tglobal.userOrgName = result.data.name;\n\t\t\t});\n\n\t\t});\n\t}", "title": "" }, { "docid": "5c2f0100b210f81f62599f189027e4bc", "score": "0.65244263", "text": "function selectUser(user) {\n\t vm.currentUser = user;\n\t\t}", "title": "" }, { "docid": "028174660930e51f5f80693f0e76bc37", "score": "0.6493756", "text": "function setCurrentUser(userID){\n\t\n\t//check if user exist. if the user does not exist, then create the user. \n\t//necessary fields needed for creation (firstName, lastName, email, phone, latitude, longitude)\n\t//If the user does exist, then set the current user.\n\t//Also, update the position.\n\tconsole.log(\"user.js(setCurrentUser): userID: \" + userID);\n\tvar user = readUser(userID);\n\t//var user = readUser(1232);\n\t\n\tif(user != null){\n\t\tconsole.log(\"user exists\");\n\t\tconsole.log(user);\n\t\t\n //set session User ID\n $.ajax({\n\t\t\turl : \"sess\",\n\t\t\tdata : {\n\t\t\t\t'UserID' : userID\n\n\t\t\t},\n\t\t\tcontext : document.body,\n\t\t\tasync : false,\n\t\t\ttype : 'POST',\n\t\t\tdataType : \"json\",\n\t\t\tsuccess : function(data) {\n\t\t\t\tconsole.log(\"Data Success\");\n\t\t\t\tconsole.log(data);\n\t\t\t},\n\t\t\terror : function(jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log(\"Status: \" + textStatus);\n\t\t\t\tconsole.log(\"Error: \" + errorThrown);\n\t\t\t}\n\t\t});\n \n\t\t//update position\n\t\tcurrentUser = user;\n\t\t//obtainLocation(); //The position is updated automatically when this method is called.\n\t\tobtainLocationFromInitialization();\n\t}\n\telse{\n\t\tconsole.log(\"user does NOT exist\");\n\t\tconsole.log(user);\n\t}\n\t\n}", "title": "" }, { "docid": "b49b30d9de77f8d12eb6dba6be3600a4", "score": "0.6467514", "text": "function user()\n {\n\n }", "title": "" }, { "docid": "73fd29c43c9e7bd04dc0d1143bd1f564", "score": "0.64550525", "text": "function setActiveUser(user) {\n if (!user) {\n localStorageService.set('activeUser', null);\n } else {\n let activeUser = {\n userID: user.userID,\n username: user.username,\n token: user.token,\n userSources: user.userSources || {}\n };\n localStorageService.set('activeUser', activeUser);\n }\n }", "title": "" }, { "docid": "cb665d0a5d72ad15109e5ebe3a7a203d", "score": "0.6450657", "text": "function setLogin(username) {\n if (login == false) {\n login = true;\n benutzer = username;\n } else {\n login = false;\n }\n}", "title": "" }, { "docid": "a5fa6d2b09b095b080d512a8c51f8591", "score": "0.64458925", "text": "function setUsername(username) {\n\t\tthis.username = username;\n\t}", "title": "" }, { "docid": "21484b2d6c000f157b5e1ca4af617e3a", "score": "0.64402276", "text": "setUsername(username){\n this._username = username;\n }", "title": "" }, { "docid": "85c227972c910f375dfd2969b7630918", "score": "0.6433019", "text": "function set_user_name(env, title, first, initial, last) {\n env.auth.user.name = [title, first, initial, last];\n}", "title": "" }, { "docid": "bbb4f2288a36f18ed52796d405a8f673", "score": "0.63958824", "text": "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "title": "" }, { "docid": "1b88063fd38fc998ba029fbe208b79b1", "score": "0.6395152", "text": "async setUserFlags () {\n\t\tif (Commander.dryrun) {\n\t\t\tthis.log('\\tWould have set user flags');\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tthis.log('\\tSetting user flags...');\n\t\t}\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tinMaintenanceMode: true,\n\t\t\t\tmustSetPassword: true,\n\t\t\t\tclearProviderInfo: true\n\t\t\t}\n\t\t};\n\n\t\tawait this.data.users.updateDirect({ teamIds: this.team.id }, op);\n\t\tawait this.sendOpsToUsers(op);\n\t}", "title": "" }, { "docid": "cbc32c955c5a38d1a8f97a00eab130a8", "score": "0.6392276", "text": "set userInfo(user) {\n\t\tthis.koa.userInfo = user;\n\t}", "title": "" }, { "docid": "7c6463def39d6d798fcc8ebc5265d30a", "score": "0.6392218", "text": "function setUserCredentails(username, password){\n this.username = username;\n this.password = password;\n}", "title": "" }, { "docid": "ec71864f73a19980b92977f208e35871", "score": "0.63905156", "text": "function setRole(role) {\n //api call to retrieve user info\n _user.role = role;\n}", "title": "" }, { "docid": "d8bd5301c6d70ccc90dc5dd3d83efbe1", "score": "0.6374965", "text": "async setGitUserAndEmail({ user, email }) {\r\n if (!user || !email) return;\r\n\r\n const nameResponse = await spawnGit([\"config\", \"--global\", \"user.name\", user]);\r\n const emailResponse = await spawnGit([\"config\", \"--global\", \"user.email\", email]);\r\n\r\n // ROJAS ADD THIS TO ALL CALLS\r\n if (nameResponse.length || emailResponse.length) this.sendMessage({ type: \"error\", message: \"Error setting the name or email.\" });\r\n }", "title": "" }, { "docid": "5f35360f8f17ef252e1daf27143c9de8", "score": "0.6372441", "text": "set({ commit, dispatch, rootState }) {\n dispatch('sync/start', 'userSet', { root: true })\n return rootState.api\n .me()\n .then(r => {\n // Format server response\n const user = {\n id: r.data._id,\n name: r.data.username,\n role: r.data.role,\n description: r.data.description || {},\n groupIds: r.data.groups || []\n }\n dispatch('sync/stop', 'userSet', { root: true })\n // Commit user\n commit('set', user)\n\n // Bootstrap app from index.js / set\n dispatch('set', null, { root: true })\n\n return user\n })\n .catch(e => {\n dispatch('sync/stop', 'userSet', { root: true })\n dispatch('messages/error', e.message, { root: true })\n dispatch('reset', null, { root: true })\n\n throw e\n })\n }", "title": "" }, { "docid": "20ef29eaa7e446cfd21aa1b563200d62", "score": "0.6367844", "text": "function userSetMode(){\n // remove the sensitive list and add the user list to websiteMap\n removePreloadListFromBlacklist();\n preloadUserSet();\n saveMode(\"userset\")\n}", "title": "" }, { "docid": "739c960d501d346a8b9e7836485f7072", "score": "0.63549453", "text": "auth_user_data(state, user){\n state.auth_user = user\n }", "title": "" }, { "docid": "27477f70d854be6158b4c8265a390c68", "score": "0.63286084", "text": "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 }", "title": "" }, { "docid": "363587c0feeec52fa1b19f69acbc091d", "score": "0.63284326", "text": "function set_user_name(new_name){\n //TODO Validate User String\n current_user_name = new_name\n nameSpace.innerHTML=(\"User: \" + current_user_name)\n \n}", "title": "" }, { "docid": "6f6dcf3a2900397b062fbc38eaed7f90", "score": "0.6324612", "text": "set userName (value) {\n this._userName = value\n /**\n * @event IrcUser#userName\n */\n this.emit('userName')\n }", "title": "" }, { "docid": "311479d35918a6269131cbfddadf5cad", "score": "0.63152695", "text": "function setUser() {\n user = new User($(\"#idh\").html(),$(\"#nameh\").html());\n}", "title": "" }, { "docid": "e715a556e5a3304f8e018380eaba9e62", "score": "0.6312735", "text": "SET_USERS( state, data ){\n state.users = data;\n }", "title": "" }, { "docid": "0d076dbbfbfc744f71d18f5fd0837bde", "score": "0.6302306", "text": "function resetLoginAndPassword() {\n\tsettings.set('User', {\n\t\t'SerialNo': 'null',\n\t\t'CtlUrl': 'null',\n\t\t'Mail': 'null',\n\t\t'Nick': 'null'\n\t});\n}", "title": "" }, { "docid": "206122522b8e06a6a7badbadabe04e74", "score": "0.62999004", "text": "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 }", "title": "" }, { "docid": "000ac97b6f8a7c03cf1d834204df7116", "score": "0.62776875", "text": "function set_user_email(env, email) {\n env.auth.user.user_email = email;\n}", "title": "" }, { "docid": "233b1ad8c48434186884415d6269e679", "score": "0.6269531", "text": "'user.changeUsername'(username) {\n check(username, String);\n\n if (this.userId) {\n Accounts.setUsername(this.userId, username)\n }\n }", "title": "" }, { "docid": "d5c391840288e1547c0da53337691cee", "score": "0.6267925", "text": "function set(data) {\n userDetails = data; \n console.log('entered set factory')\n console.log(userDetails);\n }", "title": "" }, { "docid": "4c2228b17b433d37a17a1d7868e2f389", "score": "0.62675714", "text": "function setUserId() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n var userId = xhr.responseText;\n if (validateId(userId)) {\n chrome.storage.local.set(\n { userId: userId, recentlyUpdated: true },\n function () {\n console.log(\"Settings saved\");\n }\n );\n }\n }\n };\n xhr.open(\"GET\", \"https://data2.netflixparty.com/create-userId\", true);\n xhr.send(null);\n }", "title": "" }, { "docid": "171d3e1ba5dcbef05589f55b43a67375", "score": "0.6267108", "text": "setUserLS(userName) {\n localStorage.setItem('logedUser', userName);\n }", "title": "" }, { "docid": "ce83b4f23579b97935c1686c7c7e7269", "score": "0.62668866", "text": "function setCurrUser(uId, fullName) {\r\n userId = uId;\r\n currFullName = fullName;\r\n eventBuildHref();\r\n drawCalendar(currDate, duration);\r\n pnlClose();\r\n}", "title": "" }, { "docid": "0d46df67e40ea4dd12bb2ecf4912773f", "score": "0.6254438", "text": "[types.SET_USER_NAME](state,payload){\n if(payload){\n state.user.name=payload;\n }\n }", "title": "" }, { "docid": "673ac3bc787411e8d0d5ad3204d1a855", "score": "0.6227526", "text": "function setNickNameUser(nickName){\n\tif (checkUsrSubscription()){\n\t\t$(\"#user-name\").html(nickName);\n\t\t$(\"#headBoxLogin .notlogged\").css(\"display\", \"none\");\n\t\t$(\"#headBoxLogin .logged\").css(\"display\", \"inline\");\n\t}\n}", "title": "" }, { "docid": "55279d14b8e2fc49b44b54d51edf542e", "score": "0.6224248", "text": "function setUserLocalStorage(username, email) {\n localStorage.setItem(\"username\", username);\n localStorage.setItem(\"email\", email);\n}", "title": "" }, { "docid": "593ed8a92bcd3288432aa589b4d7b8cf", "score": "0.62227523", "text": "function init() {\n \n newUser()\n\n}", "title": "" }, { "docid": "52d6a2eaf93c6a3bedada9117f3e66ad", "score": "0.619703", "text": "setUser(user = null) {\n\n this.user = user;\n AsyncStorage.setItem('@tabvn_camera:user', user ? JSON.stringify(user) : \"\");\n\n }", "title": "" }, { "docid": "3b2df351bc89d1df31a3e84ed08f8b49", "score": "0.61917496", "text": "function set_new_user_email(env, email) {\n init_new_user_storage(env);\n env.auth.new_user.user_email = email;\n}", "title": "" }, { "docid": "f9f4e92df7b1dd2586a024504025399d", "score": "0.61788887", "text": "function create_user(userobject){\n\n}", "title": "" }, { "docid": "a4c9de4829fc7b847668ad6c75da9b79", "score": "0.6168302", "text": "function createUser() {}", "title": "" }, { "docid": "a5cf40e5f0cce0119bb7726e921012bf", "score": "0.6165673", "text": "function set_new_user_name(env, title, first, initial, last) {\n init_new_user_storage(env);\n env.auth.new_user.name = [title, first, initial, last];\n}", "title": "" }, { "docid": "1fe9461a72019a44b75ea221f6fb5bbf", "score": "0.6155857", "text": "function setupUserView()\r\n {\r\n // Fill all text boxes with data for user role\r\n\t$('.firstName').val(ISOC_TECH_FIRST_NAME);\r\n\t$('.lastName').val(ISOC_TECH_LAST_NAME);\r\n\t$('.email').val(ISOC_TECH_EMAIL);\r\n\t$('.secretWord').val(ISOC_TECH_SECRET_WORD);\r\n\t$('.role-text').val(ISOC_TECH_ROLE);\r\n\t$('.shift').val(ISOC_TECH_SHIFT);\r\n\t$('.id').val(ISOC_TECH_EMPLOYEE_ID);\r\n\t\t\t\t\t\r\n\t//Hide drop downs for Admin\r\n\t$('.role-select').hide();\r\n\t$('.adminUserPicker').hide();\r\n\t\t\t\t\t\r\n\t//show textboxes for users\r\n\t$('.role-text').show();\r\n\t\t\t\t\t\r\n\t// modify textboxes to be read only\r\n\t$('.role-text').attr('readonly', true);\r\n }", "title": "" }, { "docid": "5395aea58ce266b52b496faeeb1a6b57", "score": "0.6153595", "text": "function newUser(){\r\r\n}", "title": "" }, { "docid": "df325060771888c7bb6c4e24d4e51281", "score": "0.615042", "text": "setUser(new_user){\n if(new_user != null){\n new_user[\"password\"] = \"Nice Try\";\n }\n this.setState({loggedUser: new_user});\n }", "title": "" }, { "docid": "d04a6bc627b24aad554371d8123fbc7f", "score": "0.6148314", "text": "function setUser() {\n user = JSON.parse(getCookie(\"user\"));\n}", "title": "" }, { "docid": "94084884ca059c951ff18150a1bc0168", "score": "0.6144833", "text": "function initialize_shit(){\n\tif(!user_exists('default')){\n\t\tadd_user('default', '', patients_default);\n\t}\n}", "title": "" }, { "docid": "9448431e9f8f83a70c96734651f5fa7f", "score": "0.6140701", "text": "function setUserInfo(fields,callback){\n\tcallback = callback || function () {\n\t\t// nothing\n\t};\n\n\t//check sessionId\n\tif(utils.isDataExistNull(fields)){\n\t\tcallback(false,ERROR.NULL_VALUE);\n\t\treturn;\n\t}\n\n\tredisClient.HMSET(\"Info:user:\"+fields.userId,fields,function (err,reply){\n\t\tif(!err){\n\t\t\tif(fields.age){\n\t\t\t\tredisClient.ZADD(\"Info:age\",fields.age,fields.userId);\n\t\t\t}\n\t\t\tif(fields.sex){\n\t\t\t\tredisClient.ZADD(\"Info:sex\",fields.sex,fields.userId);\n\t\t\t}\n\t\t\tcallback(true);\n\t\t} else {\n\t\t\tcallback(false,err);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "5839e81df7a2e8f1c38cc117eecbc989", "score": "0.6135088", "text": "function setUser(response, notify) {\n if (notify == null) {\n notify = true;\n }\n if (response == null) {\n user = null;\n }\n else {\n user = formatUserData(response);\n usersFactory.updateUser(user);\n displayTypesFactory.updateConfig(response.notifications.internal);\n }\n if (CONFIG.dev) {\n cozenEnhancedLogs.info.functionCalled('userFactory', 'setUser');\n console.log(response);\n }\n if (notify) {\n _notify();\n }\n }", "title": "" }, { "docid": "15216b335e10ceeae4587d0516935e27", "score": "0.612785", "text": "set userData(value) {}", "title": "" } ]
063446570318f669c4dfa1d6c8f55605
constructor de la clase persona
[ { "docid": "49fc5b64b55a77096e3aeebace0925c1", "score": "0.0", "text": "function Persona(nombre,apellido,email){\n this.nombre=nombre;\n this.apellido=apellido;\n this.email=email;\n this.nombreCompleto= function(){\n return this.nombre + \" \" + this.apellido;\n }\n}", "title": "" } ]
[ { "docid": "35ba9e798ee3936a88ee952d284b29d1", "score": "0.8293083", "text": "constructur() {}", "title": "" }, { "docid": "4da117810475b0e9ba413138eafc9f0e", "score": "0.7727132", "text": "constructor (){}", "title": "" }, { "docid": "f04cbd5afe6cc09874045cc0931a660d", "score": "0.7691677", "text": "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7650762", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7650762", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7650762", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7650762", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7650762", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7650762", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.7650762", "text": "constructor(){}", "title": "" }, { "docid": "21913661b9ec84059592ee32d5622abd", "score": "0.7534183", "text": "constructor(nombre, apellido){\n this.nombre=nombre\n this.apellido= apellido\n }", "title": "" }, { "docid": "d16a74386f83a4378d31e99ace37e71a", "score": "0.7530839", "text": "constructor(nombre,urgencia){\n this.nombre = nombre //Se agrega this. para saber a que instancia pertenece\n this.urgencia = urgencia\n }", "title": "" }, { "docid": "5df93303f5965aa2050a449098d3f01d", "score": "0.75291616", "text": "function Persona(){\n // propiedades públicas (atributos)\n this.nombre;\n this.edad;\n }", "title": "" }, { "docid": "6e00b5a0669b9ef5da499126aedfbf5f", "score": "0.75129795", "text": "function Persona() {\n\n //public porpierties\n this.nombre;\n this.edad;\n\n}", "title": "" }, { "docid": "ca1127dd0262cabb361aaf29eecd36bc", "score": "0.7500944", "text": "constructor(nome, idade){\n this.nome = nome; //this. esta se referindo ao proprio objeto e nao a uma variavel em especifico\n this.idade = idade;\n }", "title": "" }, { "docid": "dcf6773fb3fafa96c2f813e26ec27ed5", "score": "0.74830997", "text": "consructor() {\n }", "title": "" }, { "docid": "50975fc0f5872e6b931b1a331f7d29f4", "score": "0.7482853", "text": "constructor() {\r\n // ohne Inhalt\r\n }", "title": "" }, { "docid": "2cf244877b20434d2b8695e8ef2d3183", "score": "0.7456904", "text": "function Persona(nombre,apellido) {\r\n this.nombre = nombre\r\n this.apellido = apellido\r\n}", "title": "" }, { "docid": "73fc273c8b01c5e185f8804f0e385d71", "score": "0.7447089", "text": "constructor(nom, prenom){\n this.nom = nom;\n this.prenom = prenom;\n }", "title": "" }, { "docid": "f0a11aaed205e0f990c6a5151cea7cbd", "score": "0.743631", "text": "function Persona(name){\n this.name = name;\n}", "title": "" }, { "docid": "fc6ceb4d47ec24e1cc08502528a35ec0", "score": "0.7403055", "text": "function Persona(nombre, apellido, altura, edad) {\n // Al prototipo o construtor le pasamos como parametros -\n // las key de los atributos que serian nombre, apellido-\n // y para guardarlo dentro de este objeto que se esta-\n // construllendo en la memoria, podemos hacer referencia-\n // a este objeto dentro de esta funcion con this-\n // this va hacer referencia al objeto que se acaba-\n // construir this.nombre = nombre, le asignamos nombre-\n // son dos variables distintas que reciben el nombre-\n // como parametro este mismo this lo repetimos para-\n // los demas parametros del prototipo\n // implicitamente JS retorna this cuando llamamos-\n // a esta funcion con la palabra new, sino utilizamos-\n // la palabra new hay otras formas mas engorrosas-\n // de hacerlo y con new es mas prolifico 🤣🤣🤣\n this.nombre = nombre;\n this.apellido = apellido;\n this.altura = altura;\n this.edad = edad;\n}", "title": "" }, { "docid": "8be984acf04adefa3d6c36d9fbfa5ea3", "score": "0.7385167", "text": "constructor(nombre, ruido) { \n this.nombre = nombre;\n this.ruido = ruido;\n }", "title": "" }, { "docid": "930260871b48c029f59c4646fbd67f00", "score": "0.73721653", "text": "function Persona(nombre, apellido, altura) {\n //console.log('me ejecutaron');\n\n //para guardar los parametros que acabamos de crear usamos this\n\n this.nombre = nombre; //son dos variables distintos this es un atributo y nombre es el parametro qyue recibimos \n this.apellido = apellido;\n this.altura = altura;\n //return this; //no se pone esta implicito en js\n}", "title": "" }, { "docid": "ef1b7e3c2cb195f7d7cca952c9b95df4", "score": "0.7346271", "text": "constructor(\n parametroNombre,\n parametroApellido,\n parametroDni,\n parametroFechaNacimiento,\n parametroEmail,\n parametroTelefono\n ) {\n //crear las propiedades del objeto\n this.nombre = parametroNombre;\n this.apellido = parametroApellido;\n this.dni = parametroDni;\n this.fechaNacimiento = parametroFechaNacimiento;\n this.email = parametroEmail;\n this.telefono = parametroTelefono;\n }", "title": "" }, { "docid": "9626b2fe164c7e1c25ba207f49bddd39", "score": "0.73457897", "text": "function Persona(nombre, apellido,altura)\n{\n this.nombre = nombre\n this.apellido = apellido\n this.altura = altura\n}", "title": "" }, { "docid": "4acec7e775e44cdcccdd8860951321e0", "score": "0.734408", "text": "function Persona(){\n\n \t// Propiedades publicas \n \t\n \tthis.nombre;\n \tthis.edad;\n\n\n}", "title": "" }, { "docid": "d70a588c9c8603d0d6763381e733fdbd", "score": "0.7341367", "text": "constructor( ) {}", "title": "" }, { "docid": "f02e448036f66714bfda9782f1b027b7", "score": "0.73402095", "text": "constructor(nombre,saldo,telefono,tipo){\n //Va hacia elconstructor Padre\n super(nombre,saldo);//hereda el constructor\n //no existen en el constructor padre\n this.telefono = telefono;\n this.tipo = tipo;\n }", "title": "" }, { "docid": "d1f19f1300f1c7aed9478be6aa6cef39", "score": "0.7286458", "text": "constructor(name = \"Anonymous\", age = 0) {\n this.name = name; //this viittaa luokan instanssiin\n //tulostaa nimen, jos se on annettu\n this.age = age;\n }", "title": "" }, { "docid": "0d1f3e4567f6ee5668c2f85c4bf8cfef", "score": "0.72699183", "text": "function Persona(primerNombre) {\n this.primerNombre = primerNombre;\n}", "title": "" }, { "docid": "561f1a0b121cd74386ef32ec4c1f0dce", "score": "0.7264274", "text": "constructor(nombre, apellido, altura){\n super(nombre,apellido,altura)\n }", "title": "" }, { "docid": "e6b8ed4ddfbcac6a17abc8e6f6515fc9", "score": "0.72515494", "text": "function Persona(nombre, apellido, altura) {\n this.nombre = nombre;\n this.apellido = apellido;\n this.altura = altura;\n \n}", "title": "" }, { "docid": "e2a2e76df464962f9c1f4fdc8213c71f", "score": "0.72202444", "text": "function Persona(nombre, apellido, altura){\n this.nombre = nombre\n this.apellido = apellido\n this.altura = altura\n}", "title": "" }, { "docid": "c77ca634ea632974f4211b52f0190b6e", "score": "0.72071415", "text": "constructor(){\r\n\t}", "title": "" }, { "docid": "2e7fd338892630a99d7e260da6bb3f37", "score": "0.7202609", "text": "function ConstructorFunt(nomb) {\n this.nombre = nomb;\n}", "title": "" }, { "docid": "2c7e84c4736baec1c7f0716472e7aadb", "score": "0.71987534", "text": "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "title": "" }, { "docid": "c2e79ed420771ace5eb1a7a2b0411751", "score": "0.71816766", "text": "constructor(){\r\n }", "title": "" }, { "docid": "8ec9f8dac54a211100fb45fd224ad78e", "score": "0.7160171", "text": "constructor(nombre, apellido, altura) {\r\n this.nombre = nombre;\r\n this.apellido = apellido;\r\n this.altura = altura;\r\n }", "title": "" }, { "docid": "026765bbfac744da84ad373ee2cbfd15", "score": "0.7152313", "text": "constructor(nome, idade) {\n this.nome = nome\n this.idade = idade\n }", "title": "" }, { "docid": "30115acbd4f943b909258eaf4cb44e53", "score": "0.71419156", "text": "constructor(nombre, ruido) {\n this.nombre = nombre;\n this.ruido = ruido;\n }", "title": "" }, { "docid": "2ccc6f59d41084cbf4948589e4090f94", "score": "0.7140629", "text": "function Person(name) {\n this.name = name // Se crea un constructor\n}", "title": "" }, { "docid": "b5c8166fb422fed49d439b8eda8a4a30", "score": "0.71031296", "text": "constructor() {\n console.log(\"Ini adalah class mahasiswa\");\n }", "title": "" }, { "docid": "bbd8854906ef1b5f54b9e838d0889651", "score": "0.710021", "text": "constructor(nombre,apellido){\n this._nombre=nombre;\n this._apellido=apellido;\n Persona.contadorObjetosPersona++;\n }", "title": "" }, { "docid": "3322f81b160a09f086099b47d0955eaf", "score": "0.70982784", "text": "constructor(nombre, apellido, departamento) { //es necesario colocar los parametros de la clase padre que se utilizaran en la clase hija\n super(nombre, apellido); //con super mandamos a llamar al constructor de la clase padre\n this._departamento = departamento;\n }", "title": "" }, { "docid": "f66ee57414255f4244ad5d088c1767f9", "score": "0.7076019", "text": "constructor() {\n\t\t// ...\n\t}", "title": "" }, { "docid": "289ac40e5c945ab9e2ac3a9022dafe58", "score": "0.70751655", "text": "constructor(name, age){\n this.name = name;\n this.age = age;\n }", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.7071556", "text": "function Constructor() {}", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.7071556", "text": "function Constructor() {}", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.7071556", "text": "function Constructor() {}", "title": "" }, { "docid": "2c62d0b8a7df599646b94db8879b716b", "score": "0.7048962", "text": "function Persona(nombre) {\n this.nombre = nombre;\n //Esto crea una funcion por objeto instanciado. No es correcto este enfoque.\n /* this.saluda = function () {\n console.log('Hola, me llamo', this.nombre);\n \n } */\n}", "title": "" }, { "docid": "9532bba6c6a7bed63c0f7fb88a71d6f5", "score": "0.7039173", "text": "function Persona(nombre, apellido,altura) {\n this.nombre = nombre;\n this.apellido = apellido;\n this.altura = altura ;\n this.estado = \"vivo\";\n \n //return.this implicitamente regresa el objeto que se esta creando\n}", "title": "" }, { "docid": "d17c51571eb46e75fc8868c335cdd8ba", "score": "0.7036263", "text": "constructor(name,age){\n this.name = name;\n this.age = age;\n this.id = Person.getId();\n\n }", "title": "" }, { "docid": "e43cc8aff0c0a266f57933830f0f8d25", "score": "0.7031818", "text": "constructor(){\n\n }", "title": "" }, { "docid": "e43cc8aff0c0a266f57933830f0f8d25", "score": "0.7031818", "text": "constructor(){\n\n }", "title": "" }, { "docid": "1494dca30c3b43ee531a03fb71d51950", "score": "0.7029408", "text": "function Persona(nombre) {\n this.nombre = nombre;\n // this.saluda = function() {\n // console.log('Hola me llamo', this.nombre); \n // }\n}", "title": "" }, { "docid": "b9c36b77abf7c634e8f36f7c0044bcf0", "score": "0.70057243", "text": "constructor(){\r\n\r\n }", "title": "" }, { "docid": "9de82c4103cbccccdf63b295065a9b07", "score": "0.7002281", "text": "constructor(x, y)// un seul constructor possible\n {\n this.x = x;// creations des variables de la classe\n this.y = y;\n }", "title": "" }, { "docid": "d137af80c61e1e90ad9432eae8f932d5", "score": "0.6987397", "text": "constructor() {\n }", "title": "" }, { "docid": "eef90a60d0fc19d30b6a44ffad846585", "score": "0.69861364", "text": "function Person{\n constructor(name,age) {\n this.name = name;\n this.age = age;\n }", "title": "" }, { "docid": "9daaad9f60d421dddb9c1d5de8f27b3e", "score": "0.69723034", "text": "function Mascota(nombre, especie, raza='')//no importa el orden de los datos\n//se pone comillas en la raza para que no te salga undefined por si no lo sabemos\n\n{\n this.nombre = nombre\n this.especie = especie\n this.raza = raza//los parametros de una funcion constructora son parametros y pueden tener valores por defecto\n\n}", "title": "" }, { "docid": "157e8beb2f53444ac740d188d40fd2b2", "score": "0.69704634", "text": "constructor(name,age){\n this.name=name;\n this.age=age;\n }", "title": "" }, { "docid": "c74fc3e65a4e3ab39eabd39c3d02d38b", "score": "0.6963418", "text": "constructor(){\r\n this.prenom = \"\";\r\n this.nom = \"\";\r\n this.mail = \"\";\r\n this.promotion = \"\";\r\n\r\n \tconsole.log('Etudiant construit');\r\n }", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.69631726", "text": "constructor() {}", "title": "" }, { "docid": "b9a6e8a56b9dfde596bee863634ac37d", "score": "0.6960447", "text": "function Person(Nombre, Apellido) {\n this.Nombre = Nombre;\n this.Apellido = Apellido;\n}", "title": "" }, { "docid": "f56d4b2bef6eac4c73ec35747384722a", "score": "0.6957791", "text": "constructor(peso, color){ //propiedades\n this.peso= peso;\n this.color=color;\n }", "title": "" }, { "docid": "7e7c563464ff91cd74e38d86a9f1d0df", "score": "0.69348794", "text": "constructor(prix, type, proprietaire, nbALouer, nbAVendre, nbEtage){\n super(prix, type, proprietaire) //appeler le constructor de la class mere\n this.nbALouer = nbALouer\n this.nbAVendre = nbAVendre\n this.nbEtages = nbEtages\n }", "title": "" }, { "docid": "185413470368fc72b960a2a7c3838c7e", "score": "0.6932178", "text": "constructor(name,age,cellphone,email){\n this.nombre = name,\n this.edad = age,\n this.telefono = cellphone,\n this.correo = email\n }", "title": "" } ]
956f6d0034c34f44aea70a9b9f7a6a97
likes is not accessible here
[ { "docid": "8c7267ea56e730648c1be078acf4d984", "score": "0.0", "text": "function parent() {\n // userName is accessible here\n // likes is not accessible here\n function child() {\n // Innermost level of the scope chain\n // userName is also accessible here\n var likes = 'Coding';\n }\n }", "title": "" } ]
[ { "docid": "c97828c870c9217ef1557f9f40859af7", "score": "0.82442975", "text": "get likes() { return this._likes; }", "title": "" }, { "docid": "cf9001fd4265ce43e31f84e5fa097a6f", "score": "0.7877807", "text": "_getLikes() {\n this._likeAmount.textContent = this.data.likes.length;\n this._likes.forEach((item) => {\n if (item._id === this._currentUser._id) {\n this._likeButton.classList.add(\"place__like-button_enable\");\n }\n });\n }", "title": "" }, { "docid": "faf180a74ad004946d5510954e1f6b69", "score": "0.74853563", "text": "getNumberLikes() {\n return this.likes.length;\n }", "title": "" }, { "docid": "ae0fb4ae7a13cf12f94dec47c4d0b04c", "score": "0.7422732", "text": "getNumLikes() {\n return this.likes.length;\n }", "title": "" }, { "docid": "ae0fb4ae7a13cf12f94dec47c4d0b04c", "score": "0.7422732", "text": "getNumLikes() {\n return this.likes.length;\n }", "title": "" }, { "docid": "c350aeb49179ca235e7a7cc77edfc56d", "score": "0.73866683", "text": "__checkLike() {\n if (this.__context.userLiked) {\n this.like();\n }\n }", "title": "" }, { "docid": "21b211f4c80563ea3007daa247a4d6c9", "score": "0.7306224", "text": "get liked() {\n return this._liked;\n }", "title": "" }, { "docid": "bb8b8dce76ad35e5c4b48b6b246e8164", "score": "0.7289786", "text": "function countDislikes() {\n livros[index - 1].dislikes++;\n getInfo();\n getMoreBooks();\n}", "title": "" }, { "docid": "4a317dbe13cfd1d37654bc6a06ef9ef3", "score": "0.7177723", "text": "get numberOfLikes() {\n return this._numberOfLikes;\n }", "title": "" }, { "docid": "7f691ea5e0dd00e7bf71f2db21d73257", "score": "0.7116646", "text": "function listLikes(fbUserID) {\n FB.api('/' + fbUserID + '/permissions', function(response) {\n var permissionGranted = false;\n for (var i = 0; i < response.data.length; i++) {\n console.log(response.data[i].permission + ', ' + response.data[i].status);\n if (response.data[i].permission === 'user_likes' && response.data[i].status === 'granted') {\n permissionGranted = true;\n $('#loading-message').text('Retrieving your likes from Facebook');\n FB.api('/' + fbUserID + '/likes', collateLikes);\n }\n }\n if (!permissionGranted) {\n $('#loading-message').text('It looks like we don\\'t have your permission to access your Facebook likes. If you\\'d like to try again, please login again and grant all requested permissions.');\n }\n });\n}", "title": "" }, { "docid": "2b07ffbd69070076e0d0e6682cc4f76b", "score": "0.7078317", "text": "function checkLikes(){\n if($scope.likes.indexOf($scope.userId) != -1){\n $scope.liked = true;\n } else {\n $scope.liked = false;\n }\n }", "title": "" }, { "docid": "7c640ef32af602d7f0163531ce8590b0", "score": "0.70568794", "text": "function isLiked() {\n let liked = false;\n post.likes.map((like) => {\n if (like.user_id == session.user_id.toString()) {\n liked = true;\n }\n });\n return liked;\n }", "title": "" }, { "docid": "852231eff9c5c34a15f323157d5c2886", "score": "0.7018645", "text": "async function fetchLikes() {\n const apiData = await API.graphql({ query: listLikes });\n setLikes(apiData.data.listLikes.items);\n }", "title": "" }, { "docid": "97dcae51aa84beeed5ef21e56054576a", "score": "0.6968317", "text": "function displayLikes() {\n var i;\n var likesArr;\n\n // reset everything all likes on the page to LIKE then go back and set the\n // UNLIKE\n const likeElements = document.querySelectorAll('.like');\n console.log(`length: ${likeElements.length}`)\n for (i = 0; i < likeElements.length; i++) {\n likeElements[i].dataset.name='like';\n likeElements[i].innerHTML=`like`;\n }\n\n // fetch the like of current likes for this user (this does not necessarily\n // scale. for larger sites, some sort of partition needs to be considered)\n console.log(`entering -- displayLikes -- function`);\n // get a list of post id's that are currently liked by the logged-in user\n pathAPI = `posts/likes`;\n console.log(`pathAPI = ${pathAPI}`);\n\n fetch(pathAPI)\n .then(response => response.json())\n .then(result => {\n console.log(result),\n likesArr = result.split(','),\n updateUnlike(likesArr)\n });\n}", "title": "" }, { "docid": "3669c09af51aaafb746fd6a5a507bdc0", "score": "0.69376934", "text": "static get properties() { return { liked: Boolean }}", "title": "" }, { "docid": "18ecdfc4b4d64bb5630b8d5b63c47c3d", "score": "0.68611354", "text": "function like(liked){\n pic.liked= liked;\n //se realizara un if en un solo renglon en el que si me gusto se agregara sino se disminuira\n pic.likes += liked ? 1: -1;\n var newEL= render(pic);\n yo.update(el, newEL);\n return false;\n }", "title": "" }, { "docid": "f4b560d6d3e46455fa5cf15aedcbd0c6", "score": "0.6819592", "text": "findUserLike(likes) {\n const { auth } = this.props;\n if (likes.filter(like => like.user === auth.user.id).length > 0) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e891891dd0b18a6ef08f8af275c91664", "score": "0.681908", "text": "async function getLike() {\n try{\n\n if( !localStorage.getItem('user') || !JSON.parse(localStorage.getItem('user')).id )\n return\n\n var response = await likedStatus(\n this.component.state.postId, \n JSON.parse(localStorage.getItem('user')).id\n )\n //if invalid accessToken, try to refresh it, then call function again\n if(hasInvalidAccessToken(response)){\n if(await refreshAccessToken())\n this.component.checkLikeStatus()\n return\n }\n\n var like = response && response.data && response.data.Like;\n //if the current user hasn't liked or disliked the post or an error returned\n if( !like || response.errors)\n return;\n\n //if current user liked this.component post\n if(like.isLike){\n $(`.thumbsUp${this.component.state.componentID}`).css(\"color\", \"#00BFFF\")\n }\n //if current user disliked this.component post\n else{\n $(`.thumbsDown${this.component.state.componentID}`).css(\"color\", \"red\")\n }\n\n }\n catch(err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "5fd9997be71c8f8df817eef6660c362d", "score": "0.68132263", "text": "findUserLike(likes) {\n /*const { auth } = this.props;\n if (likes.filter(like => like.user === auth.user.id).length > 0) {\n return true;\n } else {\n return false;\n }*/ //TOBE TESTED AFTER LOGIN INTEGRATION.REQUIRES USER DATA\n return false;\n }", "title": "" }, { "docid": "bdbd6146026f42a09375b7f0c2192f91", "score": "0.67771494", "text": "function putLikesOnPage(likes){\n \n \n likes.forEach( function(like){\n \n\n likeId = like.id // why does this only work as a global variable?\n\n likeCountDisplay.innerHTML = `Likes: ${like.likecount}`\n })\n \n // debugger\n}", "title": "" }, { "docid": "e0bf98baa203c0bf81d1e3378d26d985", "score": "0.6735399", "text": "function getLikes() {\n var likes = []\n var entries = rows(LIKES)\n for(var i=0; i<entries.length; i++) {\n likes.push(entries[i])\n }\n return likes;\n}", "title": "" }, { "docid": "d5840c3312d307db7a186a630d7f2c15", "score": "0.67021555", "text": "function hasLiked (ratr, list) {\n\n\tif (ratr.likes.indexOf(list._id) === -1) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "23043991c9ee2201ee7b08bd2a693998", "score": "0.66998637", "text": "function showLikes() {\n numLikes.innerHTML = mediaPhotographer.likes+\"&nbsp\";\n bannerMedia.appendChild(likes);\n likes.appendChild(numLikes);\n likes.appendChild(heartBtn);\n heartBtn.appendChild(heart2);\n }", "title": "" }, { "docid": "ccbb475244ed92dbc13823726ef104dc", "score": "0.6697062", "text": "function clickLike(e){var t=$(e.currentTarget).attr(\"love-count\"),n=$(e.currentTarget).attr(\"id\"),r=$(e.currentTarget).find(\".text-like-btn\"),i=2;$.get(\"/lovr\",{id:n,num:t,type:2},function(t){$(e.currentTarget).addClass(\"liked-icon\"),r.text(Number(r.text())+1)})}", "title": "" }, { "docid": "ec45cff5fcec3c54ca0a28d5d5bb874b", "score": "0.66009545", "text": "async like() {\r\n const token = localStorage.token;\r\n const config = {\r\n headers: { Authorization: 'Bearer ' + token }\r\n };\r\n const res = await axios.post(\"https://thomasfaure.fr/opinion/create\", { post: this.props.popUp.id }, config)\r\n\r\n if (res.data.result == \"liked\") {\r\n await this.props.updatePostLike(this.props.post.byId[this.props.popUp.id].post_id, this.props.post.byId[this.props.popUp.id].like + 1)\r\n } else if (res.data.result == \"deleted\") {\r\n await this.props.updatePostLike(this.props.post.byId[this.props.popUp.id].post_id, this.props.post.byId[this.props.popUp.id].like - 1)\r\n\r\n }\r\n\r\n\r\n }", "title": "" }, { "docid": "4f13aa00da7efc5106f7f632d25e708b", "score": "0.65955156", "text": "function toggleLike(photo){\n var Liked = photosHash[photo.id].likedByUser;\n var likeCount = photosHash[photo.id].likeCount;\n\n Photo.toggleLike(photo)\n .then(Liked) // set value\n .then(function(like){\n if(like) likeCount(likeCount() + 1)\n else likeCount(likeCount() - 1)\n }).then(m.redraw);\n }", "title": "" }, { "docid": "332f206dff3d73d2e3c48b97cfe7311e", "score": "0.657552", "text": "isLiked(id) {\n return this.likes.findIndex(elemento => elemento.id === id) != -1;\n }", "title": "" }, { "docid": "79c05f95efba9ceb0ac4ca783f4370b5", "score": "0.65670234", "text": "function addLike(e) {\n e.preventDefault()\n\n //Grab elements\n const captionId = parseInt(this.dataset.id)\n const memeId = parseInt(this.parentElement.parentElement.dataset.id)\n\n //Add likes to element\n this.className = 'btn btn-secondary disabled like-btn'\n this.textContent = parseInt(this.textContent) + 1\n likes = parseInt(this.innerText)\n\n //Update likes function\n updateLikes(captionId, likes, memeId)\n}", "title": "" }, { "docid": "c6558e2afb27a18595cf3bbc4ad52e06", "score": "0.656045", "text": "likePost(state, action) {\n if (!action.payload.currentUser) {\n state.currentPostLikes++;\n state.currentPostLiked = true;\n } else {\n const postIndex = state.trending.findIndex(\n (post) => post._id === action.payload.postId\n );\n state.trending[postIndex].likes.push(action.payload.currentUser);\n }\n }", "title": "" }, { "docid": "4d85ab1683b48512300a7f4a0264dab8", "score": "0.6554408", "text": "like(event) {\n event.target.style.outline = 'none';\n\n const findMyLike = (obj) => {\n if (obj._id === this.myId) {\n return true;\n }\n }\n\n if (!event.target.classList.contains('place-card__like-icon_liked')) {\n event.target.classList.add('place-card__like-icon_liked');\n event.target.firstChild.textContent++;\n this.likes.push(1);\n this.api.renderLikes(this.id, this.likes);\n } else {\n event.target.classList.remove('place-card__like-icon_liked');\n event.target.firstChild.textContent--;\n const myLikeIndex = this.likes.findIndex(findMyLike);\n this.likes.splice(myLikeIndex, 1);\n this.api.unlikeCard(this.id);\n }\n }", "title": "" }, { "docid": "d609c033981d72222965e4b6bf71aecc", "score": "0.6553785", "text": "function handleLike(event) {\n let currentCount = parseInt(counter.textContent)\n let NumLi = document.getElementById(`${currentCount}`)\n\n if (NumLi === null) {\n let newNumLi = document.createElement(\"li\")\n newNumLi.id = `${currentCount}`\n newNumLi.textContent = `1 like on ${currentCount}!`\n likesList.append(newNumLi)\n } else {\n let existingNumLi = document.getElementById(`${currentCount}`)\n let existingNumLiArr = existingNumLi.textContent.split(\" \")\n let numLikes = parseInt(existingNumLiArr[0])\n numLikes++;\n existingNumLiArr[0] = numLikes\n existingNumLi.textContent = existingNumLiArr.join(\" \")\n };\n}", "title": "" }, { "docid": "9dd70f0a32a5c3e0f65d9ef8fe897b7f", "score": "0.65454537", "text": "function handleLikes(counter, total){\n const likesList = document.querySelector('.likes')\n const listElement = document.createElement('li')\n const count = parseInt((counter.textContent),10)\n const msg = `${count} was favorited ${total} times`\n\n if(total === 1){\n listElement.textContent = msg\n likesList.appendChild(listElement)\n }else{\n likesList.lastElementChild.textContent = msg\n }\n}", "title": "" }, { "docid": "61c106372eed08cbb6c11d6c037485b9", "score": "0.6544215", "text": "function likeFunction() {\r\n\t//like increases when call function\r\n\tlike++;\r\n document.getElementById(\"like\").innerHTML = like ;\r\n}", "title": "" }, { "docid": "4134bb1e6bf2a8802fc6f4cfd5fd1570", "score": "0.6530456", "text": "getLikes(str) {\n if (this.access_token) {\n FB.api(\n \"/\" + str + \"/?access_token=\" + this.access_token,\n (response) => {\n console.log('response: ', (response.error) ? response.error : response)\n return (response.error) ? response.error : response;\n }\n );\n } else {\n console.log('No Token');\n }\n\n }", "title": "" }, { "docid": "a8f0cd614e1b85e259b0862d6dde5418", "score": "0.6515893", "text": "function onLikeBtnClick(e) {\n\t\tvar urlToHit = STATE === SysEnum.WINDOWS_AND_STATES.GROUP ? system_url.getUpdateCountGroup_url(e.source.id, e.source.liked) : system_url.getUpdateCount_url(e.source.id, e.source.liked);\n\t\tvar API_Call = require('ui/apiCalling/call_without_indicator');\n\t\tnew API_Call('POST', urlToHit, null, function(json) {\n\t\t\tif (!json.is_success) {\n\t\t\t\talert('You already ' + (e.source.liked ? 'liked ' : 'disliked ') + 'this post');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2f3b04fb2a44ee4d9ebc1482dcdc58da", "score": "0.65104425", "text": "addLike() {\n let userIntoEvent = { _id: this.props.event._id, user: this.props.user };\n eventService.likeEvent(userIntoEvent);\n }", "title": "" }, { "docid": "fb921f7f2c3317f0421937964ece6fb0", "score": "0.6483854", "text": "function countLikes(interactions, likes, screen_name) {\n\tfor (const post of likes) {\n\t\tif (post.user.screen_name.toLowerCase() !== screen_name) {\n\t\t\taddRecord(\n\t\t\t\tinteractions,\n\t\t\t\tpost.user.screen_name,\n\t\t\t\tpost.user.id_str,\n\t\t\t\t\"like\"\n\t\t\t);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "55da5b53eb766b87e69ce06e3e400508", "score": "0.6483026", "text": "static like() {\n // get a copy of the number in the local storage\n let likeNum = Store.getLike();\n // increase the number by one\n likeNum++;\n // append it to the like container\n let likesCon = document.querySelector('.likes-num i');\n likesCon.textContent = likeNum;\n // setting the local storage with the updated number after stringifing it\n localStorage.setItem('likes', JSON.stringify(likeNum));\n }", "title": "" }, { "docid": "8779b7e65b5fc5be129daa1dd379b4b1", "score": "0.646554", "text": "function addtotalLikes (object) {\n const likesArray = [];\n for (let i=0; i<object.length; i++) {\n if (object[i].photographerId==id) {\n likesArray.push(object[i].likes);\n }\n }\n let total = 0;\n likesArray.forEach((like)=>{\n total += like;\n })\n totalLikes.innerHTML += total;\n}", "title": "" }, { "docid": "b3bce29ae1c762f8c5d3828778a61561", "score": "0.64602536", "text": "function increaseLikes(){\n \n newLikes = (parseInt(postLikes.innerText) + 1)\n postLikes.innerText = newLikes\n updateLikes(post.post_id, newLikes)\n }", "title": "" }, { "docid": "9089e7838d5d386947f9f49cbb4d4b33", "score": "0.6454192", "text": "userLiked() {\n var URL =\n \"http://localhost:8084/RoomieRoamer/api/User/like/\" +\n this.state.myId + \"/\" + this.state.targetId;\n fetch(URL, facade.makeOptions(\"PUT\", true))\n .then(response => response.json())\n .then(json => {\n console.log(\"I liked \" + json);\n });\n }", "title": "" }, { "docid": "6b3b57b13c5a8229965fbcda1b629732", "score": "0.64524287", "text": "function postNLajkova(users,N){\n let x \n users.forEach(user => {\n x = user.posts.find(post=>post.likes == N)\n });\n return x\n}", "title": "" }, { "docid": "96af2f7a5199707b7f177a26290ed52e", "score": "0.6445015", "text": "function updateLikes(likes) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/like\",\n data: likes\n }).then(getLikes);\n }", "title": "" }, { "docid": "49d55898026f03a466175ce2e1b2f8a4", "score": "0.643294", "text": "function changeLikeCount(postId, isLiked) {\n console.log(\"In changeLikeCount for \" + postId + \", isLiked=\" + isLiked);\n Q.ninvoke(client, 'hget', KEYS.POSTS, postId\n ).then(function(post) {\n var postJson = JSON.parse(post);\n if (isLiked) {\n postJson.likes = 1 + postJson.likes;\n } else {\n postJson.likes = postJson.likes - 1;\n }\n // put it back\n return Q.ninvoke(client, 'hset', KEYS.POSTS, postJson.postId, JSON.stringify(postJson));\n }).fail(function (error) {\n console.trace('changeLikeCount failed, error=' + error);\n });\n}", "title": "" }, { "docid": "248bf36349cb729263a92961775b85ac", "score": "0.6420623", "text": "function handleLike(evt) {\n updateFriendIndexAtEnd();\n like(friendInfo.id);\n }", "title": "" }, { "docid": "b2d2d7af7e326de0ab72538b94fe7f13", "score": "0.640293", "text": "function likeWant(Id)\n{\n //when using more than 1 data, i'll do the following to find the user based on the id\n //var cursor = Likes.find({ \"post\": this._id, \"likedBy\": Meteor.user()._id });\n //var count = cursor.count();\n // if the user has not liked this post, like it (save post _id and user _id as like)\n\n if (likes == 0) {\n likes = 1;\n }\n // if the user has already liked this post, unlike it (remove like from db.likes)\n else {\n likes -= 1;\n }\n return true; \n}", "title": "" }, { "docid": "a315902638972dc0279ed58cf32d8355", "score": "0.63903713", "text": "function like_request(post_id) {\n fetch(`like/${post_id}`, {\n method: 'PUT'\n })\n .then(response => response.json())\n\t.then(data => {\n const content = document.querySelector(`#total-${post_id}`);\n if (data.liked === true) {\n document.querySelector(`#like-${post_id}`).innerHTML = \"Unlike\";\n\t\t content.innerHTML = \" Total Likes: \" + data.total_likes;\n } else {\n document.querySelector(`#like-${post_id}`).innerHTML = \"Like\";\n content.innerHTML = \" Total Likes: \" + data.total_likes;\n }\n\t});\n}", "title": "" }, { "docid": "00ee992f748e0491b26ae1f234b6951e", "score": "0.63890034", "text": "function addLikeCount(likecounter){\n\t\taddLikeArray = likecounter.split(\" \");\n\t\tlikeNumber = parseInt(addLikeArray[0]);\n\t\taddLikeNumber = likeNumber + 1;\n\t\tupdateLike = likeOrLikes(addLikeNumber);\n\t\treturn updateLike;\n\t}", "title": "" }, { "docid": "e50aa2fe810b74a5caee3ea0cb2a42d2", "score": "0.6386847", "text": "function getBooksLiked(username) {\n return axios.get(`/users/likes?id_user=${username}`, getHeader());\n}", "title": "" }, { "docid": "7ee0a180941578862cc9c2c568df7fd6", "score": "0.63788956", "text": "function getLikes() {\n $.get(\"/api/like\", function(data) {\n likes = data;\n initializeRows();\n });\n }", "title": "" }, { "docid": "a25c681164d1a97ec5657e14fc333c0e", "score": "0.63532865", "text": "function likeNumber(int) {\n let number = findNumberObject(int);\n if (!!number) {\n number.likes++;\n }\n else {\n let newNumber = {id: int, likes: 1};\n likesArray.push(newNumber);\n }\n displayLikes();\n }", "title": "" }, { "docid": "e4393f608056d4ce06303982d976be2b", "score": "0.6345875", "text": "function displayLikes() {\n // remove all children from likesUl\n while (likesUl.firstElementChild) {\n likesUl.removeChild(likesUl.lastElementChild);\n }\n\n // creates li items for numbers with likes and appends them to ul\n likesArray.forEach(function(item) {\n let numberLi = document.createElement(\"li\");\n let liText = document.createTextNode(generateLikeText(item));\n numberLi.appendChild(liText);\n likesUl.appendChild(numberLi);\n });\n }", "title": "" }, { "docid": "4c87fcea6c11f8916b914f6fd20b3519", "score": "0.6345683", "text": "likedNewMedia(post) {\n const index = this.userIdOfLikedPosts.findIndex(id => id === post.ownerId);\n if (index < 0) {\n // not found\n this.userIdOfLikedPosts.push(post.ownerId);\n }\n utils_1.Utils.writeLog(`Liked new post: https://www.instagram.com/p/${post.shortcode}`, 'Like');\n this.likesCountCurrentDay++;\n this.storageService.addLike(post.id);\n this.updateMessage();\n /*if (this.shouldStartDislike() === true) {\n // start to dislike media\n this.startAutoDislike();\n }*/\n }", "title": "" }, { "docid": "c0353b793d61024056c0ce6fc2e4713e", "score": "0.6343955", "text": "function doYouLikeThis (req, res, next) {\n\tvar lystr = req.session.user;\n\tvar response = {};\n\tvar listId = req.params.listId;\n\n\t// TEST\n\tconsole.log('req.params:');\n\tconsole.log(req.params);\n\tconsole.log('req.originalUrl:');\n\tconsole.log(req.originalUrl);\n\n\tif (lystr.likes.indexOf(listId) != -1)\n\t\tresponse.answer = true;\n\telse\n\t\tresponse.answer = false;\n\n\tconsole.log('response:');\n\tconsole.log(response);\n\n\tres.send(response);\n}", "title": "" }, { "docid": "1d8f6f020b458ed587a5a8238427a043", "score": "0.63275725", "text": "handleClick() {\n // Increment the likes property stored in state\n this.setState(prevState => ({\n likes: prevState.likes + 1\n\n }));\n }", "title": "" }, { "docid": "30f71e18a5adc23366a676c2d98b110e", "score": "0.6322033", "text": "function likesManager(chirp) {\n\n var likeId;\n var chirpIndex = vm.chirps.indexOf(chirp);\n var likedIndex;\n var hasLiked = false;\n \n angular.forEach(chirp.Likes, function(value, index){\n if(value.User.Email === vm.username){\n hasLiked = true;\n likeId = chirp.Likes[index].LikeId;\n likedIndex = index;\n }\n });\n\n if(hasLiked === true){\n unlikeChirp(likeId);\n vm.chirps[chirpIndex].Likes.splice(likedIndex, 1);\n }\n else{\n likeChirp(chirp.ChirpId, chirpIndex);\n }\n\n }", "title": "" }, { "docid": "8dd714e2e116c76ae34d30713abd28bc", "score": "0.6301135", "text": "function update_like_counts(_checkState, _attributes) {\n\t\tif ((_checkState === SysEnum.WINDOWS_AND_STATES.POST && (STATE === SysEnum.WINDOWS_AND_STATES.NEWSFEED || STATE === SysEnum.WINDOWS_AND_STATES.PROFILE || STATE === SysEnum.WINDOWS_AND_STATES.PROFILE_BY_ID)) || (_checkState === SysEnum.WINDOWS_AND_STATES.GROUP_POST && STATE === SysEnum.WINDOWS_AND_STATES.GROUP)) {\n\t\t\tvar section_list = listView.getSections();\n\t\t\tfor (var i = 0,\n\t\t\t j = section_list.length; i < j; i++) {\n\t\t\t\tvar items = section_list[i].getItems();\n\t\t\t\tif (items.length === 1) {\n\t\t\t\t\tif (items[0].properties.itemId === _attributes.post_id) {\n\t\t\t\t\t\tif (like_by_current_user(_attributes.post_like_ids)) {\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].liked = true;\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].image = imagePath.like_already_focus;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].liked = false;\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].image = imagePath.like_blur;\n\t\t\t\t\t\t}\n\t\t\t\t\t\titems[0].like_count.text = _attributes.post_likes_count;\n\t\t\t\t\t\tsection_list[i].updateItemAt(0, items[0]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (items[1].properties.itemId === _attributes.post_id) {\n\t\t\t\t\t\tif (like_by_current_user(_attributes.post_like_ids)) {\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].liked = true;\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].image = imagePath.like_already_focus;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].liked = false;\n\t\t\t\t\t\t\tsection_list[i].getFooterView().children[0].children[0].image = imagePath.like_blur;\n\t\t\t\t\t\t}\n\t\t\t\t\t\titems[1].like_count.text = _attributes.post_likes_count;\n\t\t\t\t\t\tsection_list[i].updateItemAt(1, items[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "2ee1a4bbed0821ed0e25f71c2640cfc0", "score": "0.6294981", "text": "function addLike(item) {\n set(LIKES, item.uid, item.endpoint);\n}", "title": "" }, { "docid": "1c2e222634b3cafada494aab8f2f2c39", "score": "0.6279856", "text": "function isVidLiked(vid){\n return $q.when(db.allDocs({include_docs:true,startkey: 'favorite-', endkey: 'favorite-\\uffff'}))\n .then(function(docs){\n // console.log('%%% get favorites',docs.rows)\n var favorites = docs.rows[0].doc\n try{\n var isLiked = _.some(favorites.vidList, function(f){\n return f === vid\n })\n console.log('%%%% is liked', isLiked, vid )\n }catch(e){\n isLiked = false\n }\n return isLiked\n })\n }", "title": "" }, { "docid": "3a7f2b546d4a9f30ee6a79ec7850b78b", "score": "0.6265586", "text": "function updateLike(postId, isLike) {\n\n console.log(`entering -- updateLike -- function`)\n // from the boolean set the integer value for the fetch\n\n pathAPI = `posts/${parseInt(postId)}/${parseInt(isLike)}`;\n console.log(`pathAPI = ${pathAPI}`);\n\n fetch(pathAPI)\n .then(response => response.json())\n .then(result => {\n // update the like count for this like\n //print Likes\n console.log(result);\n });\n}", "title": "" }, { "docid": "fa327b057413f913b69632e68b0659c7", "score": "0.626521", "text": "function likeUsers(uid, msg_id, token, apiBaseUrl, baseUrl, created) {\n noToken(token, baseUrl);\n var encodedata = JSON.stringify({\n \"uid\": uid,\n \"msg_id\": msg_id,\n \"token\": token\n });\n var url = apiBaseUrl + 'api/likeUsers';\n ajaxPost(url, encodedata, function (data) {\n if (data.likeUsers.length) {\n var i = '';\n var j = '';\n $.each(data.likeUsers, function (i, ldata) {\n i = '<a href=\"' + baseUrl + ldata.username + '\" id=\"likeUserFace' + ldata.uid + msg_id + '\" original-title=\"' + ldata.name + '\" class=\"likeUserFace likeUserFace' + ldata.uid + msg_id + created + '\"><img src=\"' + ldata.profile_pic + '\" alt=\"' + ldata.name + '\" class=\"img-circle marginRight\" ></a>';\n j += i;\n });\n $(\".likeUsersBlock\" + msg_id + created).html(j);\n }\n //else\n //$(\"#networkError\").show().html($.networkError);\n });\n}", "title": "" }, { "docid": "07e3c76ac5dfce06fe8cdce23261c51c", "score": "0.62422055", "text": "like(doc_id, likes) {\n //set the new like count\n this.likes = Number(likes) + 1;\n //update like count\n this.productService.updateProduct(doc_id, { likes: this.likes });\n }", "title": "" }, { "docid": "de413ba53db8f82da14a854797b310bf", "score": "0.62249905", "text": "function clickLike(e){\n\t\tvar likeLink = e.target.innerHTML;\n\t\tvar likeCounter = e.target.nextElementSibling.nextElementSibling.innerHTML;\n\t\t\n\t\tif (likeLink == \"Like\"){\n\t\t\te.target.innerHTML = \"Unlike\";\n\t\t\tnewLikeString = addLikeCount(likeCounter);\n\t\t\te.target.nextElementSibling.nextElementSibling.innerHTML = newLikeString;\n\t\t}\n\t\telse {\n\t\t\te.target.innerHTML = \"Like\";\n\t\t\tnewLikeString = subtractLikeCount(likeCounter);\n\t\t\te.target.nextElementSibling.nextElementSibling.innerHTML = newLikeString;\n\t\t}\n\t\te.preventDefault();\n\t}", "title": "" }, { "docid": "097bb9c976a08a48354a134eec997ebe", "score": "0.62222403", "text": "function loadUserAndLikes () {\n FB.api('/me', function(userResponse) {\n React.render(<UserDetails userDetails={userResponse} />,\n document.getElementById('user'));\n\n var fields = { fields: 'category,name,picture.type(normal)'};\n FB.api('/me/likes', fields, function(likesResponse) {\n React.render(<UserLikesList list={likesResponse.data} />,\n document.getElementById('main'));\n });\n });\n}", "title": "" }, { "docid": "ae45fef8d7ae347d6de4432ceb62735f", "score": "0.61869776", "text": "function likes(e){\ne.preventDefault()\n\nlet more_likes = parseInt(e.target.previousElementSibling.innerText.split(\" \")[0])+1\n// debugger\n fetch(`http://localhost:3000/toys/${e.target.dataset.id}` , {\n method:\"PATCH\",\n headers:{\n 'Content-Type': 'application/json'\n\n },\n body: JSON.stringify({\n \"likes\": more_likes //e.something.something or 0 and increment with function\n })\n })\n .then((res) => {return res.json()})\n .then((likeObj) => {\n e.target.previousElementSibling.innerText = `${more_likes} Likes`\n\n //function here to increase like count???\n })\n}", "title": "" }, { "docid": "9cb0c6a1af1a1de0b95f29c1e5dd87ed", "score": "0.6184166", "text": "function likePost(postLike, cb){\n if(cb === undefined) cb = redis.print;\n console.log(\"likePost, postLike=\" + JSON.stringify(postLike));\n \n if (postLike.isLiked) {\n var likeTime = moment().valueOf();\n client.zadd(util.format(KEYS.POST_LIKES, postLike.postId), likeTime, postLike.likerUserId, cb);\n } else {\n client.zrem(util.format(KEYS.POST_LIKES, postLike.postId), postLike.likerUserId, cb);\n }\n // Change like count of the post. Fire and forget.\n changeLikeCount(postLike.postId, postLike.isLiked);\n}", "title": "" }, { "docid": "2946902f7bac37dc018334be9e853f73", "score": "0.6174812", "text": "function like(e){\r\n\t// set user id to the hidden input field\r\n\tdocument.querySelector(\".like-postid\").value = e.target.getAttribute(\"userid\");\r\n\t// get the post id \r\n\tuser_key = e.target.getAttribute(\"userid\");\r\n\t// push it into the array\r\n\tuser_keyArr.push(user_key);\r\n\t// set it into localstorage as user_keyArr_loc\r\n\tlocalStorage.setItem(\"user_keyArr_loc\", JSON.stringify(user_keyArr));\r\n\t// turn the like icon which was clicked to red by passing the posts id\r\n\tdocument.querySelector(`[userid=\"${user_key}\"]`).innerHTML = `<i class=\"fa fa-heart\" id=\"heart\" style=\"color: red\"></i>`;\r\n\t// get all the childs of the posts\r\n\tconst userRef = dbRef.child('users/' + e.target.getAttribute(\"userid\"));\r\n\r\n\tuserRef.on(\"value\", snap => {\r\n\t\t\r\n\t\t\tvar key = \"post_likes\";\r\n\t\t\t// get the value of the post_likes from the key\r\n\t\t\tprelikes = snap.val()[key];\r\n\t});\t\t\r\n\tvar likeListObject = {}\r\n\tusersRef.on(\"value\", snap => {\r\n\t\tsnap.forEach(childSnap => {\r\n\t\t\t// if likes in firebase is undefined that means likes are 0 so do 0+1\r\n\t\t\t\tlet key = childSnap.key,\r\n\t\t\t\tvalue = childSnap.val()\r\n\t\t\t\tlikeListObject.post_likes = value.post_likes\r\n\t\t});\r\n\t});\r\n\t\t// update firebase with the new likes\r\n\t\t// if likes is 0 then in firebase it is stored as NaN\r\n\t\tif (isNaN(likeListObject.post_likes)) {\r\n\t\t\t\t\t// so when the like button with 0 likes is clicked it will change to 1\r\n\t\t\t\t\tlikeListObject.post_likes = 1\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// else the previous likes + 1\r\n\t\t\t\t\tlikeListObject.post_likes = prelikes+ 1;\r\n\t\t\t\t}\r\n\r\n\tuserRef.update(likeListObject);\r\n\t// get the amount of likes\r\n\tvar user_keyArr_likes = JSON.parse(localStorage.getItem(\"user_keyArr_loc\"));\r\n\t// loop through the likes for displaying likes of each post\r\n\tfor(i=0; i<=user_keyArr.length-1; i++){\r\n\t\t// again get the likes by passing the user id/ post id from localstorage to a variable userid\r\n\t\t// as we have set userid attribute to the like icon\r\n\t\t// so here to keep the post liked even after liking other posts we do this\r\n\t\tdocument.querySelector(`[userid=\"${user_keyArr_likes[i]}\"]`).innerHTML = `<i class=\"fa fa-heart\" id=\"heart\" style=\"color: red\"></i>`;\r\n\t}\r\n}", "title": "" }, { "docid": "04ed023694e5dd650daff574e17429af", "score": "0.6174492", "text": "function viewLiked() {\n vm.likedflag = 1;\n vm.profileflag = 0;\n vm.sheetsflag = 0;\n vm.followedflag = 0;\n vm.allusersflag =0;\n vm.allscores= 0;\n vm.editingUserflag = 0;\n vm.likedNotes=[];\n UserService\n .findLiked($rootScope.currentUser._id)\n .then(function (response) {\n if(response.data == null){\n vm.likecount = 0;\n }else{\n var liked = response.data.liked;\n console.log(liked);\n for(i=0; i<liked.length; i++){\n if(liked[i].length <10){\n NoteService\n .findNote(liked[i])\n .then(function (response) {\n console.log(response.data);\n vm.likedNotes.push(response.data);\n });\n }else{\n NoteService\n .findUserScore(liked[i])\n .then(function (response) {\n vm.likedNotes.push(response.data);\n });\n }\n\n }\n }\n })\n }", "title": "" }, { "docid": "8cff1d670e46067f68c464a52c18c799", "score": "0.61726046", "text": "function netLikes (comment)\n\t{\n\t\treturn (comment.likes || 0) - (comment.dislikes || 0);\n\t}", "title": "" }, { "docid": "f4dcdbe44d79f0f153c8596240f9b466", "score": "0.6164427", "text": "getAll() {\n // can do some computation on _links\n return _links.map(link => {\n link.numLikes = Object.keys(link.likedBy).filter(ip => {\n return link.likedBy[ip] && ip !== 'me';\n }).length;\n link.likedBy.me = link.likedBy[myIp];\n link.url = link.url.startsWith('http') ? link.url : 'http://' + link.url;\n link.safe = link.url.startsWith('https');\n return link;\n });\n }", "title": "" }, { "docid": "a4a3458c0d2f066e4882761850563b5c", "score": "0.61633646", "text": "async like() {\n this.mixpanelTrack(\"Purchase Like\");\n var username = await AsyncStorage.getItem(\"username\");\n if (username == null || username == commons.guestuserkey()) {\n this.setState({ gotologinflow: true });\n return;\n }\n\n var acceestoken = await commons.get_token();\n var uuid = await commons.getuuid()\n var statuse = \"false\";\n if (!this.state.isliked)\n statuse = \"true\"\n var reqobj = {\n \"operation\": \"updateuserCount\",\n \"contentid\": this.state.stackid,\n \"category\": this.state.category,\n \"staxtype\": \"like\", //or like,favorite,purchase,downloads\n \"staxvalue\": statuse, //true/false\n \"userid\": this.state.username,\n \"uuid\": uuid, //for history & opperation table primery id\n \"createdate\": commons.gettimestamp() + \"\"\n }\n this.refs.loaderRef.show();\n var aws_data = require(\"./config/AWSConfig.json\");\n var aws_lamda = require(\"./config/AWSLamdaConfig.json\");\n await fetch('' + aws_data.path + aws_data.stage + aws_lamda.contentmanagement, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': acceestoken\n },\n body: JSON.stringify(reqobj),\n }).then((response) => response.json())\n .then(async (responseJson) => {\n var icon = \"\";\n var liked = !this.state.isliked;\n var likecount = parseInt(this.state.likecount);\n if (liked) {\n icon = assetsConfig.iconLikeOrange;\n likecount++;\n }\n else {\n icon = assetsConfig.iconLikeWhite;\n likecount--;\n }\n this.setState({\n likeicon: icon,\n isliked: liked,\n likecount: likecount,\n })\n this.refs.loaderRef.hide();\n })\n .catch((error) => {\n this.refs.loaderRef.hide();\n\n console.error(error);\n });\n }", "title": "" }, { "docid": "8933e6cc9f5467deb9d9def8beec9968", "score": "0.6159589", "text": "function fetchLikes(){\n\n const likesUrl = \"http://localhost:3000/likes\"\n\n\n return fetch(likesUrl)\n .then(r => r.json())\n\n}", "title": "" }, { "docid": "1f392d8be5c0fad42141838b4f4db55e", "score": "0.615863", "text": "function isLiked(item) {\n return get(LIKES, item.uid) !== 0;\n}", "title": "" }, { "docid": "03828daf7bf40d3f5a5db04121597e64", "score": "0.61568016", "text": "function storeLiked(userLiked, results){\n for(var k in results) {\n if(results.hasOwnProperty(k)){\n if(typeof results[k].liked === 'undefined'){\n results[k].liked = userLiked;\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "a693a9a6c87417672da61cf99b51a6bc", "score": "0.61562073", "text": "function reGetPost(api, id, token, liker, likesNum) {\n const getURL = \"post?id=\" + id;\n console.log(getURL);\n api.get(getURL, {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Token ${token}`,\n }\n }).then(\n res => {\n console.log(res);\n const likes = res['meta']['likes'];\n console.log(likes);\n liker.innerHTML = \"\";\n for (let likeID in likes) {\n const b = document.createElement('b');\n const getURL = 'user' + \"?id=\" + likes[likeID];\n api.get(getURL, {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Token ${token}`,\n }\n }).then(\n res => {\n b.innerHTML = res['username'];\n }\n ).catch(err => console.warn(`API_ERROR: ${err.message}`));\n liker.appendChild(b);\n }\n likesNum.innerHTML = likes.length + \" Likes\";\n }).catch(err => console.warn(`API_ERROR: ${err.message}`));\n}", "title": "" }, { "docid": "98d30cf15cf2b959898c131367f217fc", "score": "0.61448026", "text": "function passTheLikeButton() {\r\n (function(){\r\n\r\n var myDiv = document.getElementById(\"likeLoader\");\r\n\r\n var show = function(){\r\n myDiv.style.display = \"block\";\r\n setTimeout(hide, 1000); // 5 seconds\r\n }\r\n\r\n var hide = function(){\r\n myDiv.style.display = \"none\";\r\n }\r\n\r\n show();\r\n\r\n /*function hasClass(element, cls) {\r\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\r\n }\r\n var test = document.getElementById(\"like-status\"),\r\n classes = ['like-btn', 'like-h'];\r\n\r\n // test.innerHTML = \"\";\r\n\r\n\r\n if(hasClass(test, 'like-h')) {\r\n document.getElementById(\"msg-already-liked\").style.display = \"block\";\r\n function hideNote(){\r\n document.getElementById(\"msg-already-liked\").style.display = \"none\";\r\n }\r\n setTimeout(hideNote,1000);\r\n }\r\n else\r\n { */\r\n //Changes the information on the likeers status in real time.\r\n var likeCount = document.getElementById(\"likeCount\").innerHTML;\r\n var dislikeCount = document.getElementById(\"dislikeCount\").innerHTML;\r\n var likeCountInteger = parseInt(likeCount);\r\n var dislikeCountInterger = parseInt(dislikeCount);\r\n likeCountInteger = likeCountInteger + 1;\r\n var totalCount = likeCountInteger + dislikeCountInterger;\r\n var totalLikes = likeCountInteger/totalCount * 100;\r\n //alert(totalLikes);\r\n //var totalKireKhar = totalLikes * 100;\r\n //alert(totalKireKhar);\r\n document.getElementById(\"likeCount\").innerHTML = likeCount;\r\n document.getElementById(\"greenLine\").style.width = totalLikes + \"%\";\r\n document.getElementById(\"redLine\").style.width = 100 - totalLikes + \"%\";\r\n document.getElementById(\"likeCount\").innerHTML = likeCountInteger.toString();\r\n document.getElementById(\"totalCount\").innerHTML = likeCountInteger.toString();\r\n\r\n //}\r\n\r\n\r\n\r\n })();\r\n\r\n\r\n $(function () {\r\n\r\n var songID = $(\"#set-next-song-id\").text();\r\n var userName = getUserID();\r\n console.log(\"Song ID: \" + userName);\r\n\r\n // $('.like-btn').click(function(){\r\n var json = {\"songid\": songID, \"userName\": userName};\r\n //alert( json );\r\n $('.dislike-btn').removeClass('dislike-h');\r\n $('.like-btn').addClass('like-h');\r\n //Call back function to call callLikeAjax when like is clicked\r\n callLikeAjax(json);\r\n // });\r\n\r\n\r\n /*$('.dislike-btn').click(function(){\r\n var json ={ \"act\" : \"dislike\", \"songid\" : songID , \"userid\" : userID };\r\n $('.like-btn').removeClass('like-h');\r\n $(this).addClass('dislike-h');\r\n $.ajax({\r\n type:\"POST\",\r\n url:\"ajax.php\",\r\n data:JSON.stringify(json),\r\n success: function(){\r\n }\r\n });\r\n });*/\r\n\r\n $('.share-btn').click(function () {\r\n $('.share-cnt').toggle();\r\n });\r\n });\r\n\r\n function callLikeAjax(json) {\r\n\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"/userLikesSong.ajax\",\r\n data: JSON.stringify(json),\r\n cache: false,\r\n //onLoading:jQuery(\"#ajaxLoader\").attr('src', 'images/Hypercube_Large_Light.gif'),\r\n\r\n\r\n beforeSend: function (xhr) {\r\n xhr.setRequestHeader(\"Accept\", \"application/json\");\r\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\r\n },\r\n success: function () {\r\n //(\"#ajaxLoader\").hide();\r\n\r\n },\r\n error: function (jqXhr, textStatus, errorThrown) {\r\n console.log(\"error\", arguments);\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "61d30bd4f29670177e6ab85882e45ce2", "score": "0.61282146", "text": "function handleLikeClick(){\n value = videoToken.value\n if(value==\"no\"){\n let videoId= window.location.href.split(\"videos/\")[1]\n if (videoId.includes('?')){\n videoId=videoId.split(\"?\")[0] \n }\n try{\n fetch(`/api/${videoId}/video_like`,{method:\"POST\"})\n let likeNum = parseInt(like.innerText)\n likeNum+=1\n like.innerHTML=likeNum\n videoToken.value=\"like\"\n likeBtn.classList.add(CB)\n videoLikeWrapper.classList.add(BB)\n\n }\n catch(error){\n console.log(error)\n }\n }\n else if(value==\"dislike\"){\n switchDislikeLike()\n }else if(value=\"like\"){\n cancleLike()\n }\n}", "title": "" }, { "docid": "2cbca93bdc0847ec224c846f8849a976", "score": "0.6121932", "text": "function likes(e, artwork){\n e.preventDefault()\n let updateLikes = parseInt(artwork.likes + 1)\n\n fetch(`http://localhost:3000/api/v1/artworks/${artwork.id}`, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n\n },\n body: JSON.stringify({\n likes: updateLikes,\n\n })\n })\n .then(res => res.json())\n .then(\n document.getElementById(artwork.id).querySelector(\"#Likes\").innerHTML= `Likes: ${updateLikes}`\n )\n }", "title": "" }, { "docid": "66fe530b1595a286b6abfb2049adae73", "score": "0.6114459", "text": "set liked(isLiked) {\n this._liked = isLiked;\n this.setAttribute('liked', isLiked);\n }", "title": "" }, { "docid": "f860bbd79a134bef1e2df37f7a220768", "score": "0.6110546", "text": "function loadLikes(data) {\n\t// Llamada ajax que recupera y parsea a json la url pasada\n\tvar htmlProdut = '';\n\tvar i = 0;\n\t$.each(data.items, function(i, asociado) {\n\t\thtmlProdut = htmlProdut + '<a onclick=\"javascript:analytics(' + i\n\t\t\t\t+ ')\" pos=\"' + asociado.pos + '\" class=\"margeneslike\" href=\"'\n\t\t\t\t+ asociado.link + '\"><img src=\"' + asociado.image\n\t\t\t\t+ '\" width=\"88\" height=\"134\" /></a>'\n\t\ti++;\n\t});\n\tif (htmlProdut != '') {\n\t\t$('#mightlike').show();\n\t\t$('#mightlike').after(htmlProdut);\n\t}\n\n}", "title": "" }, { "docid": "8afa2b2f2f088b54a418f4730cc4b530", "score": "0.6105446", "text": "function likeFunction() {\n var like = document.getElementById('likeButton');\n var count = document.getElementById('likes');\n counts++;\n like.innerHTML = \"<i class='fa fa-thumbs-up'></i>\" + \" Liked!\"\n if (counts === 1) {\n count.innerHTML = counts + \" person likes this!\";\n }\n else {\n count.innerHTML = counts + \" people have liked this!\";\n }\n}", "title": "" }, { "docid": "44bb870cf451006f10eea4faf4ff5f35", "score": "0.6105388", "text": "function addStudentLikesToAll(mentors,likes){\n for(i = 0; i < mentors.length; i++){\n mentors[i].addstdlikes(likes);\n\n } \n}", "title": "" }, { "docid": "fb06e3f278ca393f1f7d5f05a6e5426e", "score": "0.6104374", "text": "function renderLikes(likesArray){\n // build our likes HTML\n let likesHTML = `\n <div class=\"content-webmentions--likes\">\n <h4>${likesArray.length} ${likesArray.length === 1 ? ' like' : ' likes'}</h4>\n <ul class='content-webmentions__list no-style'>`;\n\n // map over our likes, build the data object\n likesArray.map(function(l){\n let likeObj = {\n photo: cloudifyPhoto(l.data.author.photo),\n name: l.data.author.name,\n authorUrl: l.data.author.url,\n url: l.data.url,\n date: new Date(l.data.published || l.verified_date)\n }\n\n // create each like\n likesHTML += likeRepostLinkTemplate(likeObj);\n });\n\n // close the like HTML\n likesHTML +=\n ` </ul>\n </div>`;\n\n // append the generated like HTML to the single set of HTML\n webmentionHTML += likesHTML;\n }", "title": "" }, { "docid": "ef1e7e6a6370f4725175506e1253851f", "score": "0.6103053", "text": "likeTweet(tweetId) {\n let ref = this.tweetRef.child(tweetId);\n ref.once('value').then(function(snapshot) {\n var newLikes = parseInt(snapshot.val().likes) + 1;\n\n // Update the number of likes on firebase\n\n });\n }", "title": "" }, { "docid": "3364bc08e64f3e8e1cf6e8d260f4695f", "score": "0.6099932", "text": "function getCurrentUserLikes( paginationId )\r\n{\r\n // console.log(\"Getting likes for current user with pagination: \" + paginationId);\r\n\r\n // check if the current pagination id is the same as the last one\r\n // this is the case if all images habe been loaded and there are no more\r\n if ( (paginationId !== 0) && (paginationId === lastPaginationId) )\r\n {\r\n // console.log(\"Last pagination id matches this one: \" + paginationId + \" - returning\");\r\n return;\r\n }\r\n\r\n // check if this is a new call or loading more images\r\n if (paginationId === 0)\r\n {\r\n errorMessage.visible = false;\r\n loadingIndicator.running = true;\r\n loadingIndicator.visible = true;\r\n }\r\n else\r\n {\r\n notification.useTimer = false;\r\n notification.text = \"Loading more images..\";\r\n notification.show();\r\n }\r\n\r\n\r\n var req = new XMLHttpRequest();\r\n req.onreadystatechange = function()\r\n {\r\n // this handles the result for each ready state\r\n var jsonObject = network.handleHttpResult(req);\r\n\r\n // jsonObject contains either false or the http result as object\r\n if (jsonObject)\r\n {\r\n if (paginationId === 0)\r\n {\r\n // clear likes list\r\n likesGallery.clearGallery();\r\n }\r\n\r\n var imageCache = new Array();\r\n for ( var index in jsonObject.data )\r\n {\r\n // get image object\r\n imageCache = getImageDataFromObject(jsonObject.data[index]);\r\n // cacheImage(imageCache);\r\n\r\n // add image object to gallery list\r\n likesGallery.addToGallery({\r\n \"url\":imageCache[\"thumbnail\"],\r\n \"index\":imageCache[\"imageid\"]\r\n });\r\n\r\n // console.log(\"Appended list with URL: \" + imageCache[\"thumbnail\"] + \" and ID: \" + imageCache[\"imageid\"]);\r\n }\r\n\r\n // check if the page has a following page in the pagination list\r\n // if so then remember it in the gallery component\r\n if (jsonObject.pagination.next_max_like_id != null)\r\n {\r\n likesGallery.paginationNextMaxId = jsonObject.pagination.next_max_like_id;\r\n }\r\n\r\n if (paginationId === 0)\r\n {\r\n loadingIndicator.running = false;\r\n loadingIndicator.visible = false;\r\n likesGallery.visible = true;\r\n }\r\n else\r\n {\r\n // loading additional images\r\n notification.hide();\r\n notification.useTimer = true;\r\n }\r\n\r\n // console.log(\"Done loading likes for user\");\r\n }\r\n else\r\n {\r\n // either the request is not done yet or an error occured\r\n // check for both and act accordingly\r\n if ( (network.requestIsFinished) && (network.errorData['code'] != null) )\r\n {\r\n // console.log(\"error found: \" + network.errorData['error_message']);\r\n\r\n // hide messages and notifications\r\n loadingIndicator.running = false;\r\n loadingIndicator.visible = false;\r\n\r\n // show the stored error\r\n errorMessage.showErrorMessage({\r\n \"d_code\":network.errorData['code'],\r\n \"d_error_type\":network.errorData['error_type'],\r\n \"d_error_message\":network.errorData['error_message']\r\n });\r\n\r\n // clear error message objects again\r\n network.clearErrors();\r\n }\r\n }\r\n }\r\n\r\n var instagramUserdata = auth.getStoredInstagramData();\r\n var url = instagramkeys.instagramAPIUrl + \"/v1/users/self/media/liked?access_token=\" + instagramUserdata[\"access_token\"];\r\n if (paginationId !== 0)\r\n {\r\n url += \"&max_id=\" + paginationId;\r\n lastPaginationId = paginationId;\r\n }\r\n\r\n req.open(\"GET\", url, true);\r\n req.send();\r\n}", "title": "" }, { "docid": "1a9e6203fc0eceeb200a511c17a9d948", "score": "0.6099131", "text": "function likeAction() {\n let btn = document.querySelectorAll('button.like-btn');\n btn.forEach((node) => { \n node.addEventListener(\"click\", (element) => { plusOne(element) })})\n \n function plusOne(element) {\n let newValue = parseInt(element.target.previousElementSibling.innerText) + 1\n let targetId = element.target.parentNode.id \n configHeader('PATCH', { \"likes\": newValue }, `http://localhost:3000/toys/${targetId}`)\n }\n}", "title": "" }, { "docid": "b74059b6274de94a9c85c764125ce9f2", "score": "0.6098027", "text": "function f_js_init_likes(){\n const iconHeart = document.querySelectorAll(\".portfolio-icon\");\n const allSpanLikes = document.querySelectorAll(\".portfolio-like\");\n \n\n iconHeart.forEach((icon,index) => icon.addEventListener('click', () => {\n //INCREMENTATION DES SPAN INDIVIDUELLEMENT\n allSpanLikes[index].innerText=parseInt(allSpanLikes[index].innerText) + 1 ;\n allLikes += 1;\n\n //INCREMENTATION DU SPAN CONTENANT TOTAL LIKE\n spanAllLikes.innerText = allLikes.toLocaleString(); \n \n }));\n}", "title": "" }, { "docid": "ed26c423e4ca14ca4a74d238b98ae498", "score": "0.6095848", "text": "function vote() {\n // Check if has already voted\n if (!hasVoted()) {\n // Make HTTP Request to REST API\n fetch(`http://js-for-wp.local/wp-json/likes/v1/${postID}`, {\n method: \"POST\",\n })\n .then((response) => response.json())\n .then((votes) => {\n // Update the like count\n updateLikeCount();\n // Update local storage\n localStorage.setItem(\n `jsforwp_likes`,\n JSON.stringify([...getVotedFor(), postID])\n );\n });\n }\n}", "title": "" }, { "docid": "c1bcfdc1f88651cc86e373d94839e056", "score": "0.6091058", "text": "function handleLike(){\n setLike((prevValue) => {\n return !prevValue;\n });\n }", "title": "" }, { "docid": "3025ab3753d4402a5954725b44159f57", "score": "0.6089481", "text": "getCurrentLikeCount(callback) {\n const ref = db.database().ref();\n const repoLikesRef = ref.child(\"repositories/\" + this.props.repo + \"/repo_likes\");\n let currentLikeCount = 0;\n repoLikesRef.once(\"value\", (snapshot) => {\n currentLikeCount = snapshot.val();\n let newState = this.state;\n newState.likes = currentLikeCount;\n this.setState(newState);\n callback(currentLikeCount);\n });\n }", "title": "" }, { "docid": "a95fd89526301ed7f976c14cdc310154", "score": "0.60653865", "text": "onLikeClick(id) {\n this.props.addLike(id);\n }", "title": "" }, { "docid": "72cc3ae43d4ed84a7fdc08b3c0297da0", "score": "0.60644203", "text": "function onLike() {\n setLoading(true); // Start loading (disable button)\n if (liked) {\n // If the user clicks a liked song, unlike the song\n // Delete row in UserSong\n Client.delete(\n `/user_song?userIdQuery=${userId}&songIdQuery=${song.song_id}`\n )\n .then((res) => {\n // Set button to unliked, loading false\n setLiked(false);\n setLoading(false);\n\n // Send success toast\n toast({\n title: 'song removed',\n description: `${song.name} has been removed from your likes.`,\n status: 'info',\n isClosable: true,\n });\n })\n .catch((error) => {\n setLoading(false);\n sendErrorToast();\n });\n } else {\n // If the user clicks an unliked song, like the song\n // Create row in UserArtist\n Client.post(`/user_song`, {\n user_id: userId,\n song_id: song.song_id,\n })\n .then((res) => {\n // Set button to be liked, loading false\n setLiked(true);\n setLoading(false);\n\n // Send toast\n toast({\n title: 'Song added',\n description: `${song.name} has been added to your likes.`,\n status: 'success',\n isClosable: true,\n });\n })\n .catch((error) => {\n setLoading(false);\n sendErrorToast();\n });\n }\n }", "title": "" }, { "docid": "31d7f3bb941cd9c883c9435e6215677e", "score": "0.605653", "text": "async function likedAction(){\n\tfor(let i = 0; i < songObjList.length; i++){\n\t\tif(i === currIndex){\n\t\t\tconst curSongObj = songObjList[i];\n\t\t\tconst res = await fetch(`api/like/?id=${curSongObj.id}`)\n\t\t\tconsole.log('liked action success');\n\t\t\treturn\n\t\t}\n\t}\n\tconsole.log('error in liked action');\n}", "title": "" }, { "docid": "dc6e573d030736001a5e0e6aee518395", "score": "0.60515654", "text": "getAllHikes() {\n return hikeList;\n }", "title": "" }, { "docid": "2cbb4a7f5f76a25891797f305b93f859", "score": "0.6050053", "text": "isLiked(id) {\n return this.likes.findIndex(el => el.id === id) !== -1; // if there is no item with passed id in 'this.likes', then this expression will be false.\n }", "title": "" }, { "docid": "fd5b445ac36acba1e33d653821f82d20", "score": "0.6042539", "text": "async function createLike() {\n if (!formData.name || !formData.description) return;\n await API.graphql({ query: createLikeMutation, variables: { input: formData } });\n setLikes([ ...likes, formData ]);\n setFormData(initialFormState);\n }", "title": "" }, { "docid": "a55e9a536878758b22c036f21037e5bc", "score": "0.60416234", "text": "function decrementCounterOnLike() {\n if (cards >= 0) {\n document.getElementById(\"cardsremaining\").innerHTML = cards + \" Cards Remaining\";\n deck[cards].Likes += 1;\n if (myLikes == 0) {\n firstLikedCard = deck[cards];\n }\n myLikes += 1;\n console.log(\"liked\");\n computerRatings();\n }\n}", "title": "" }, { "docid": "753aad9ee08357974d80e9ea7328de4e", "score": "0.6027104", "text": "LikeUser(likedUser) {\r\n\t\tif (this.props.uData.user !== undefined) {\r\n\t\t\tfetch('/api/likeUser', {\r\n\t\t\t\tmethod: 'POST', // *GET, POST, PUT, DELETE, etc.\r\n\t\t\t\tmode: 'cors', // no-cors, cors, *same-origin\r\n\t\t\t\tcache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\r\n\t\t\t\tcredentials: 'same-origin', // include, *same-origin, omit\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t'Content-Type': 'application/json'\r\n\t\t\t\t\t// \"Content-Type\": \"application/x-www-form-urlencoded\",\r\n\t\t\t\t},\r\n\t\t\t\tredirect: 'follow', // manual, *follow, error\r\n\t\t\t\treferrer: 'no-referrer', // no-referrer, *client\r\n\t\t\t\tbody: JSON.stringify({\r\n\t\t\t\t\tuserName: this.props.uData.user,\r\n\t\t\t\t\tlikedUserName: likedUser\r\n\t\t\t\t}) // body data type must match \"Content-Type\" header\r\n\t\t\t})\r\n\t\t\t\t.then((res) => res.json())\r\n\t\t\t\t.then((arrayList) => {})\r\n\t\t\t\t.catch((message) => {\r\n\t\t\t\t\t//console.log(\"Could not Like user \" + likedUser);\r\n\t\t\t\t})\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3f22b85bf8dd0684d391911ca6473331", "score": "0.6024539", "text": "function getRecommendations(likes) {\n const userFeatures = nj.concatenate(mergeMovieFeatures(likes), nj.zeros([MOVIE_FEATURE_SIZE]));\n const results = movies.map((movie) => {\n const movieFeature = nj.array(movie.feature);\n const userMovieFeatures = nj.concatenate(userFeatures, movieFeature);\n const x = nj.array([userMovieFeatures.valueOf()]);\n const y = nj.dot(x, weights);\n const like = y.get(0, 0);\n const dislike = y.get(0, 1);\n const result = {\n id: movie.id,\n title: movie.title,\n img: movie.images.large,\n rate: {\n like,\n dislike,\n value: like - dislike\n }\n };\n return result;\n });\n results.sort((a, b) => b.rate.value - a.rate.value);\n return results;\n}", "title": "" }, { "docid": "d7e988c5cab0856a98360ea80a1b65ff", "score": "0.60202765", "text": "function rate(rating) {\n let current = JSON.parse(getLocal(profilecount));\n rating === 'like' ? current.liked = 1 : current.liked = -1;\n setLocal(profilecount, JSON.stringify(current));\n profilecount++;\n setLocal('profilecount',profilecount);\n checkClick();\n}", "title": "" }, { "docid": "9a175bfcb7d274024a139f83aadea563", "score": "0.60196126", "text": "likeRepo() {\n //this.props.repo is the repository ID\n const ref = db.database().ref();\n //update repo like count\n const repoLikesRef = ref.child(\"repositories/\" + this.props.repo + \"/repo_likes\");\n const currentUID = db.auth().currentUser.uid;\n this.getCurrentLikeCount((lc) => {\n repoLikesRef.set(lc + 1);\n //update button count state\n let newState = this.state;\n newState.likes = lc + 1;\n this.setState(newState);\n });\n \n //push new repo_like with current user id to the current repo\n const repoLikedUsersRef = ref.child(\"repositories/\" + this.props.repo + \"/liked_users\");\n repoLikedUsersRef.push({\n uid: currentUID,\n });\n //push repo id to user's liked repo\n const userLikesRef = ref.child(\"users/\"+ currentUID + \"/likes\");\n userLikesRef.push({\n repo_id: this.props.repo\n });\n\n //update button states\n let newState = this.state;\n newState.buttonText = \"Liked !\";\n newState.buttonFunction = this.unlikeRepo;\n this.setState(newState);\n\n }", "title": "" } ]
a627f34309cb67378a456e0bad80cc39
When the update happens but not until after the Edit View has exited and the user returned to the readonly view
[ { "docid": "25d054a99383f09ef382964e19be916e", "score": "0.0", "text": "async function testSlowSuccess(numberName) {\n server.use(...mocks.transactionPending);\n\n const { phoneNumberInput } = editPhoneNumber(numberName);\n\n // wait for the edit mode to exit\n await waitForElementToBeRemoved(phoneNumberInput);\n\n // check that the \"we're saving your...\" message appears\n const savingMessage = await view.findByText(\n /We’re working on saving your new.*/i,\n );\n expect(savingMessage).to.exist;\n\n server.use(...mocks.transactionSucceeded);\n\n await waitForElementToBeRemoved(savingMessage);\n\n // the edit email button should exist\n expect(\n view.getByRole('button', {\n name: new RegExp(`edit.*${numberName}`, 'i'),\n }),\n ).to.exist;\n // and the updated phone numbers should be in the DOM\n // TODO: make better assertions for this?\n expect(view.getAllByText(newAreaCode, { exact: false }).length).to.eql(\n numbers.length,\n );\n expect(view.getAllByText(newPhoneNumber, { exact: false }).length).to.eql(\n numbers.length,\n );\n // and the 'add' button should be gone\n expect(\n view.queryByText(new RegExp(`new.*${numberName}`, 'i'), {\n selector: 'button',\n }),\n ).not.to.exist;\n}", "title": "" } ]
[ { "docid": "00d0690bc980312ddb12f3027a1b4b66", "score": "0.72372586", "text": "function edit() {\n // Code here ...\n // View Edit\n // if(OK){update() };\n }", "title": "" }, { "docid": "52ee309aac2e17baf2a92acfb37c4125", "score": "0.67930555", "text": "function cancelUpdate() {\n\t\t\tvm.editView = false;\n\t\t\tvm.tableParams.reload();\n\n\t\t} // end of cancelUpdate function", "title": "" }, { "docid": "9a5c0df80bdbec0eb376c8d3e6083076", "score": "0.6657513", "text": "edit() {\n this.fetch();\n }", "title": "" }, { "docid": "12ec3785f684a0292c66b93b300b12b0", "score": "0.65994114", "text": "afterUpdate(success) {\n if (success) {\n this.setState({editMode: false}) \n }\n }", "title": "" }, { "docid": "86078984a9242ab5222e0934c5273548", "score": "0.65751266", "text": "UpdateIfDirtyOrScript() {}", "title": "" }, { "docid": "01230c1bb14a12086fb14aee1f9d61be", "score": "0.6563875", "text": "_onChange() {\n\t\tthis.forceUpdate();\n\t}", "title": "" }, { "docid": "c5ad975a9b8c507823e12df54ff8eedd", "score": "0.64688385", "text": "function view_changed(){\n\t\n}", "title": "" }, { "docid": "7a853fa31216067bab35dae8c9d15dbf", "score": "0.6461361", "text": "update(){\n this._derenderEdit();\n }", "title": "" }, { "docid": "bbc297a72f017c5dabcae031f6735dbe", "score": "0.6411111", "text": "_onChange() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "a5797766b0270a600a5824dbd9f5e683", "score": "0.63920116", "text": "function onEdit(editedItem){\n setUpdateState(editedItem)\n }", "title": "" }, { "docid": "17727d0e5ac7085435832e76f80b410d", "score": "0.6386209", "text": "handleUpdateOperation(updatedRecord) {\n console.log('handleUpdateOperation start1-->' + this.isSpinnerShow);\n this.isSpinnerShow = false;\n console.log('handleUpdateOperation start2-->' + this.isSpinnerShow);\n var message = \"Case \" + this.name + \" has been updated successfully\";\n this.messageHandler(message, 'success', 'SUCCESS!');\n this.showviewform = true;\n this.showecreateform = false;\n this.cannotUpload = true;\n\n if (this.openInEditMode) {\n this.cancel();\n }\n }", "title": "" }, { "docid": "66f6eb063ab4ab07689aa70a87f0f77c", "score": "0.63702875", "text": "_updateView() {\n let viewState = this.view.viewState;\n let $view = this.view;\n let state;\n\n if (viewState === 'all') {\n state = this.collection.get('all');\n } else if (viewState === 'completed') {\n state = this.collection.get('completed');\n } else if (viewState === 'active') {\n state = this.collection.get('active');\n }\n $view.listRender(state);\n $view.infoRender(state);\n }", "title": "" }, { "docid": "ce5eb30679f523af69d6f25f85fc7e7d", "score": "0.63359916", "text": "handleedit(event) {\n this.showviewform = false;\n this.showecreateform = true;\n this.cannotUpload = this.cannotedit;\n }", "title": "" }, { "docid": "d17931eb8cfce0e949230cbc57329c84", "score": "0.63206244", "text": "update() {\n this.forceUpdate(); // Refresh display\n this.updateDB(); // Update the database\n }", "title": "" }, { "docid": "ac0481d366e33d43919398b8e3dfca01", "score": "0.6311015", "text": "function handleWidgetEdit(){\n confirmIfDirty(function(){\n if(WidgetBuilderApp.isValidationError)\n {\n WidgetBuilderApp.dirtyController.setDirty(true,\"Widget\",WidgetBuilderApp.saveOnDirty);\n return;\n }\n $.PercWidgetBuilderService.loadWidgetDefFull(WidgetBuilderApp.selectedModel, renderWidget);\n });\n }", "title": "" }, { "docid": "acc7579ee70075b043c31b86a3f9833e", "score": "0.6290879", "text": "activate() {\n this.allowedUpdate = true;\n }", "title": "" }, { "docid": "8f6b772645fc2dd11a5d574f06070408", "score": "0.6263483", "text": "_onChange () {\n this.forceUpdate()\n }", "title": "" }, { "docid": "cf06b488ebc98343176f9c13a3128ca8", "score": "0.6254319", "text": "function madeChange() {\n //set flag\n unsavedChanges = true;\n\n //set render state to unrendered\n //but don't set if set as disabled, update list re-enabled when allowed\n if (renderState !== \"disabled\") {\n setRenderState(\"unrendered\");\n }\n\n //enable save button and message\n saveBtn.removeClass(\"disabled\");\n saveMsg.removeClass(\"hide-this\");\n }", "title": "" }, { "docid": "19fdf884c7a12ae0e9ae0c9fe443bf2d", "score": "0.61887276", "text": "async edit({ params, request, response, view }) {}", "title": "" }, { "docid": "6b8806854deae25c6dc1e15b4d5885fb", "score": "0.618842", "text": "function scheduledUpdate() {\n isUpdating = true;\n $scope.doneLoading = false;\n $scope.grabData();\n }", "title": "" }, { "docid": "319f363d5b4d251e4a03579ffbd8a580", "score": "0.61833936", "text": "async edit({ params, request, response, view }) {\n\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61786544", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "f65b54b75c348e145b719a8e9ac1724a", "score": "0.617342", "text": "function _manageEditMode() {\n try {\n vm.isPageEdit = false;\n vm.isModuleEdit = false;\n vm.isSectionEdit = false;\n } catch (e) {\n showErrorMsg(e);\n }\n }", "title": "" }, { "docid": "39238b59173ccf6574ba6e83cf4e1f03", "score": "0.6170806", "text": "localChanged() {}", "title": "" }, { "docid": "c6985f01ca412e0df56a5f0fb63dbff7", "score": "0.61693954", "text": "function fnEditEntity(bUnconditional) {\n\t\t\t\toTemplateUtils.oServices.oCRUDManager.editEntity(bUnconditional).then(function(oEditInfo) {\n\t\t\t\t\tif (oEditInfo.draftAdministrativeData) {\n\t\t\t\t\t\tfnExpiredLockDialog(oEditInfo.draftAdministrativeData.CreatedByUserDescription || oEditInfo.draftAdministrativeData.CreatedByUser);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfnStartEditing(oEditInfo.context, false);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "d3aa503b15ee64ca8c03d90277cfccb2", "score": "0.6166902", "text": "readAfterUpdate() {\n const previousPortalIdEditor = this.portalIdEditor;\n this.portalIdEditor = this.refs.portalIdEditor;\n if (!this.previousPortalIdEditor && this.portalIdEditor) {\n this.portalIdEditor.onDidChange(() => {\n const portalId = this.refs.portalIdEditor.getText().trim();\n this.refs.joinButton.disabled = !findPortalId(portalId);\n });\n }\n }", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.6155807", "text": "storeChanged() {}", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.6155807", "text": "storeChanged() {}", "title": "" }, { "docid": "ff7927a97de28ddc7caa88576550d54b", "score": "0.6140052", "text": "postUpdate(){return true;}", "title": "" }, { "docid": "31d085737bd04b6f8f0faa124e2bfdd1", "score": "0.61227196", "text": "refresh() {\n this.changed();\n }", "title": "" }, { "docid": "1e7e6315e241662264855c23e93460b6", "score": "0.61223155", "text": "postUpdate() {}", "title": "" }, { "docid": "2aa6db67603f6aedf73c77dd91ba18a4", "score": "0.6111977", "text": "async function handleEdit(e) {\n setId(e.id);\n setDescription(e.name);\n setFiscalNumber(e.fiscalNumber);\n setIdUser(e.user_id + ' - ' + e.user);\n setLockedEntry(e.closed_entry); //Close entry\n\n const resp = await api.get(`/wmsrm/operation/entry-itens/${e.id}`);\n\n setRawMaterials(resp.data);\n\n handleShow();\n }", "title": "" }, { "docid": "5c8af2f59c2e837a6e1ef20779b76dbf", "score": "0.6105195", "text": "function callbackForEdit() {\n Core.openStatusCreator();\n }", "title": "" }, { "docid": "fd73b9fb99e2c4fcc31be0b142ae0a00", "score": "0.6102001", "text": "function updateEdit(e) {\r\n setEditMode(false);\r\n props.exportEditMode(editMode)\r\n props.exportDetails(details)\r\n\r\n e.preventDefault();\r\n prevEdit = details;\r\n console.log(details)\r\n }", "title": "" }, { "docid": "86b872240bfb54b1d3d995fdf791de2e", "score": "0.6096274", "text": "renderedCallback(){\n if(!this.isRendered){\n this.isRendered = true;\n }\n this.template.addEventListener('refreshApexEvent', ()=>{\n console.log('Received refreshApexEvent event');\n console.log('Refreshing athelete list');\n return refreshApex(this.wiredVenueResult);\n });\n const editForm = this.template.querySelector('.editForm');\n editForm.addEventListener('triggerModel', ()=>{\n if(this.editForm){\n this.editForm = false;\n console.log('this.editForm = false');\n }else{\n this.editForm = true;\n console.log('this.editForm = true');\n }\n });\n\n }", "title": "" }, { "docid": "bea4d392c7c343d7897571329bbe5f4c", "score": "0.6088056", "text": "handleStoreModified() {\n // If waiting for server response\n // ignore any other data updates\n if (this.isProcessing()) {\n return;\n }\n\n // Fetch item\n const item = FlightModel.getEditOutput(this.props.match.params.id);\n\n // Check for errors\n if (item && item.error) {\n this.setState({ loadingError: item.error });\n return;\n }\n\n this.setState({\n item: item,\n loadingError: null\n });\n }", "title": "" }, { "docid": "44342617c9dade8152931c3ea2b57e9f", "score": "0.6082616", "text": "edit() {\n\t}", "title": "" }, { "docid": "8681e2aa05568541b9f83054e4d6c3f8", "score": "0.6071742", "text": "static tryRefresh() {\n\t\t// not while control panel is up!!\n\t\tif (rxStore.getState().editPanel.editingRecord) {\n\t\t\tconsole.info(`not while control panel is up!! ⏰`);\n\t\t\treturn;\n\t\t}\n\n\t\twindow.location = window.location;\n\t}", "title": "" }, { "docid": "068240e5fa566fff7cacc821de02cb88", "score": "0.6063606", "text": "forceUpdateHandler(){\n this.forceUpdate()\n }", "title": "" }, { "docid": "dac5234156074bd07c717f7e0fd68282", "score": "0.6060008", "text": "async edit({\n params,\n request,\n response,\n view\n }) {}", "title": "" }, { "docid": "c4189bead9e11ef7100a13ca10acea16", "score": "0.6057595", "text": "_editModeChanged(newValue, oldValue) {\n if (newValue) {\n // store a content copy of original state as text, waiting for a paint / full setup\n setTimeout(async () => {\n this._originalContent = await HAXStore.activeHaxBody.haxToContent();\n }, 100);\n this.__editIcon = \"icons:save\";\n this.__editText = this.t.save;\n SuperDaemonInstance.appendContext(\"HAX\");\n SuperDaemonInstance.removeContext(\"CMS\");\n } else {\n this.__editIcon = \"hax:page-edit\";\n this.__editText = this.t.edit;\n SuperDaemonInstance.appendContext(\"CMS\");\n SuperDaemonInstance.removeContext(\"HAX\");\n }\n if (typeof oldValue !== typeof undefined) {\n store.editMode = newValue;\n // force tray status to be the opposite of the editMode\n // to open when editing and close when not\n if (newValue) {\n HAXStore.haxTray.collapsed = false;\n }\n }\n }", "title": "" }, { "docid": "0686b443476256e6006e4cb4befe3fb1", "score": "0.6045891", "text": "_change() {\n let editor = this._editor;\n\n if (isEmpty(editor)) {\n return;\n }\n try {\n let json = editor.get();\n //\n this.set('_updating', true);\n this.set('json', json);\n this.set('_updating', false);\n\n // Trigger Change event\n if (this.change) {\n this.change();\n }\n } catch (error) {\n this._error(error);\n }\n }", "title": "" }, { "docid": "f55106944eae5a74adb79e25d9f8a4df", "score": "0.60449415", "text": "handleChange() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "4035b5f64a231a19038410aedbfb563e", "score": "0.60422665", "text": "function updateView() {\n if ($scope.$root.$$phase != '$apply' && $scope.$root.$$phase != '$digest') return $scope.$apply();\n if (logFlag) console.log('$scope.$apply() update view fail');\n }", "title": "" }, { "docid": "325d434086f06a648ffb4851368f0184", "score": "0.60376084", "text": "function update() {\n\n if (!$state.started) {\n\n handleStart();\n }\n\n if (!$state.completed) {\n\n handleChange();\n }\n\n if (!$state.completed && lastValue($data.user)) {\n\n handleComplete();\n }\n }", "title": "" }, { "docid": "2f4bb676b474d0b679ee331995b2a21a", "score": "0.60281545", "text": "onUpdate() {\n\t\tconsole.warn('updating');\n\t\tthis.forceUpdate();\n\t}", "title": "" }, { "docid": "9e4086e7c707160dfa3b85909804caed", "score": "0.60203326", "text": "handleEdit() {\n if (this.state.editable) {\n let dish = {\n id: this.props.dish.id,\n name: this.name.value,\n description: this.description.value\n }\n API.updateDish(dish).then(dish => {\n this.setState({ dish: dish });\n });\n }\n this.setState({\n editable: !this.state.editable\n });\n }", "title": "" }, { "docid": "2ff2008ec2fbc2c6c1833e81d938493e", "score": "0.60194784", "text": "function editOrCancel() {\r\n toggleEditButton();\r\n toggleInput();\r\n}", "title": "" }, { "docid": "810db7bf661070adb39fd00e2ee4015a", "score": "0.60170126", "text": "startEditMode() {\n var modelField = \"model.\" + this.get(\"field\");\n this.set(\"value\", this.get(modelField));\n this.set('editMode', true);\n }", "title": "" }, { "docid": "c38c20bffe2a07b92836e98e44dce7eb", "score": "0.6005323", "text": "onConfirmEdit(event) {\n if (this.state.update) {\n Meteor.call('products.update', this.state);\n\n this.clearStateForm();\n this.setState({ update: false });\n }\n }", "title": "" }, { "docid": "9461733b69f403c15b5d4c7b3e8b8351", "score": "0.5993476", "text": "function _onEdited (e) {\n _onChange()\n }", "title": "" }, { "docid": "fc3e059561f51540741e61aa503460f4", "score": "0.5986114", "text": "function updateChanges() {\n if (controller.onchange !== null) {\n controller.onchange();\n }\n }", "title": "" }, { "docid": "fe8659c45c087a8962fedd9ec1ebc112", "score": "0.5983992", "text": "function updateMode(){\n\tif(editMode){\n\t\tdisableEditionMode();\n\t\tgrid.disable();\n\t\tsaveGrid();\n\t}\n\telse{\n\t\tenableEditionMode();\n\t\tgrid.enable();\n\t}\n}", "title": "" }, { "docid": "8be8bad270695b6f5f7200cb325c793c", "score": "0.5974417", "text": "function editModel(data) {\n /// start edit form data prepare\n /// end edit form data prepare\n dataSource.one('sync', function(e) {\n /// start edit form data save success\n /// end edit form data save success\n\n app.mobileApp.navigate('#:back');\n });\n\n dataSource.one('error', function() {\n dataSource.cancelChanges(itemData);\n });\n\n dataSource.sync();\n app.clearFormDomData('edit-item-view');\n }", "title": "" }, { "docid": "f776b263072f5c6843b8f7cc54defa9f", "score": "0.59735334", "text": "edit(){\n\n }", "title": "" }, { "docid": "efc33ddf26df0ad74ea6a38e19409ccf", "score": "0.59715915", "text": "function endEdit() {\n location.reload(); //Refresh page so changes can take effect\n}", "title": "" }, { "docid": "32da30c88a1f4b196daaa99d885945d7", "score": "0.59215033", "text": "beforeUpdate() {}", "title": "" }, { "docid": "1972abf0c6c2cc67ca71f7bd7fa223d2", "score": "0.59163487", "text": "function onViewModelChange(e) {\r\n (e.field === 'onlyCurrentRecords') && spedProgramsDataSource.read();\r\n }", "title": "" }, { "docid": "dbb18fed028ca2f062c7c62d467addb8", "score": "0.5911315", "text": "function updateViews() {\n // Display the appropriate input form.\n showInputForm();\n // Display notes.\n showNotes();\n }", "title": "" }, { "docid": "12a1c465738b5ca48432f2b7c9a26016", "score": "0.59043217", "text": "registerEditViewEvents() {\n\t\tthis.registerSubmit({\n\t\t\tcallbackAfterSave: (response) => {\n\t\t\t\tif (response) {\n\t\t\t\t\twindow.location.href = 'index.php?module=' + this.moduleName + '&view=DetailView&record=' + response.id;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.container.find('.js-edit-back').on('click', () => {\n\t\t\twindow.history.back();\n\t\t});\n\t}", "title": "" }, { "docid": "fd07c968dd00befff34cc5a1f03d37d2", "score": "0.590365", "text": "updated(event) {}", "title": "" }, { "docid": "71fc49d860be6c5c1c06d23a101f87c6", "score": "0.58997506", "text": "onEdit() {\n this.setState({ isEdit: true });\n }", "title": "" }, { "docid": "a91884c7dc9a665ab2055c671f3fd198", "score": "0.58994985", "text": "toggleEdit () {\n console.log('Toggle View has run', this.props.viewEditor)\n if(this.props.viewEditor == false)\n this.props.toggleEdit()\n }", "title": "" }, { "docid": "adb027ed0c8ca937dcd18412eec9f54e", "score": "0.5895207", "text": "handleUpdate(evt) {\n evt.preventDefault();\n const { title, category, notes, estimated_cost, budget } = this.state;\n this.props.update(this.props.id, \n {title: title, category: category, notes: notes, estimated_cost: estimated_cost, budget: budget });\n\n this.props.toggleForm();\n }", "title": "" }, { "docid": "027e215b28763639cf9bfaa5d2c7a8e5", "score": "0.5885081", "text": "showDetailEdit(){\r\n super.notify(\"showDetailEdit\");\r\n }", "title": "" }, { "docid": "56b11a0ba278a0c4868ff6c59a827608", "score": "0.588303", "text": "function data_changed (obj) {\n\t\t\t\t\t\t\t\tfunction updated () {\n\t\t\t\t\t\t\t\t\t$($ldb.sync).unbind('end', updated);\n\t\t\t\t\t\t\t\t\tself.cancel();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfunction done() {\n\t\t\t\t\t\t\t\t\t$($forms).triggerHandler('save_complete.global', [obj, true]);\n\n\t\t\t\t\t\t\t\t\t$ui.overlay.hide();\n\n\t\t\t\t\t\t\t\t\tif (!self.opt.block.opt.no_refresh)\n\t\t\t\t\t\t\t\t\t\t$ui.page.refresh();\n\n\t\t\t\t\t\t\t\t\tif ($ldb) {\n\t\t\t\t\t\t\t\t\t\t$($ldb.sync).bind('end', updated);\n\n\t\t\t\t\t\t\t\t\t\t$ldb.sync.update();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$(self.opt.block).triggerHandler('save_complete', [obj, done]);\n\n\t\t\t\t\t\t\t\tif ($($forms).triggerHandler('save_complete', [obj, done]) !== false)\n\t\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "3cdd336cc96209de95176a3414613856", "score": "0.5880967", "text": "_update() {\n }", "title": "" }, { "docid": "357fa289398c9dbf7c53b1dc6d87987c", "score": "0.5880217", "text": "_triggerUpdatedData(e) {\n // get fresh data if not published\n if (this.editorBuilder) {\n this._timeStamp = Math.floor(Date.now() / 1000);\n } else {\n this._timeStamp = \"\";\n }\n }", "title": "" }, { "docid": "0610421887ecac78e887a5cced8a1a47", "score": "0.585506", "text": "onStateChange() {\n\t\t// brute force update entire UI on store change to keep demo app simple\n\t\tthis.forceUpdate();\n\t}", "title": "" }, { "docid": "7f0275e2fe1fe3ed3885a0fa98065816", "score": "0.58512187", "text": "function saveEdit() {\n\t\t\t\t// check if the form was submitted; if so,\n\t\t\t\t$('#editEventForm').on('submit', function(event, form) {\n\t\t\t\t\t// close the edit modal,\n\t\t\t\t\t$('#edit-modal').modal('hide');\n\t\t\t\t\t// wait 1/2 seconds to finish bootstrap's animation,\n\t\t\t\t\t$timeout(function(){\n\t\t\t\t\t\t// and go back to the dashboard state\n\t\t\t\t\t\t$state.go('dashboard');\n\t\t\t\t\t}, 500);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "4ab296cf0cb8d7bffe90bf46b0312b03", "score": "0.5849242", "text": "_onUpdate(data, options, userId) {\n this.prepareData();\n this.render(false, {\n action: \"update\",\n data: data,\n });\n }", "title": "" }, { "docid": "0eb0c0200eece19cc835170d8726e598", "score": "0.5844541", "text": "@action makeDataStale () {\n this.isStale = true\n }", "title": "" }, { "docid": "020bb0b9258de9a6c65f9f14f3dbd404", "score": "0.58419794", "text": "updatedFromServer() {}", "title": "" }, { "docid": "0b8d82e310290d05dd891fd3d1292627", "score": "0.5838764", "text": "function onUpdate() {\n onClose();\n onItemUpdate(); // call the function passed by parent\n }", "title": "" }, { "docid": "2086ef290860593ebc3823bc1d35e603", "score": "0.58252144", "text": "cancelEdit() {\n this.initializeUserData();\n }", "title": "" }, { "docid": "b2203d94527fbf9723e3dcf6f720e236", "score": "0.5821843", "text": "finishUpdate() {\n if (this.state.isEditable) {\n this.setState({isEditing: false});\n // we send updates in the form of {name: value}.\n // this could allow us to update multiple values with a single form element in the future\n if (this.props.onUpdate) {\n let update = {};\n update[this.props.name] = this.state.value;\n this.props.onUpdate(update);\n }\n }\n }", "title": "" }, { "docid": "e06467d98e9d4722c209f62724c93554", "score": "0.5820371", "text": "updated(){\n console.log(\"updated()\");\n }", "title": "" }, { "docid": "52e8db357ff3a267393b5e1a32588677", "score": "0.581852", "text": "checkIsDirty() {\n if( this.state.isDirty ){\n this.setState({showDialog: true});\n } else {\n this.cancelEdit();\n }\n }", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.5812003", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.5812003", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.5812003", "text": "update(){}", "title": "" }, { "docid": "57a0a5239730c67fa1fb842fff049c96", "score": "0.581167", "text": "_editingSession() {\n var self = this;\n\t\tif (!this.bound) {\n\t\t\tthis.bindEvents();\n\t\t}\n function editCurrent() {\n layoutDebug.addTextDebug('editLyricSession:_lyricAddedPromise rcvd, _editCurrentLyric for '+self.selection.note.attrs.id);\n self._editCurrentLyric();\n }\n this._lyricAddedPromise().then(editCurrent);\n\t}", "title": "" }, { "docid": "d2b3dcf8f884db6b62e43176b274e8f8", "score": "0.58106136", "text": "function verifyIfInEditing(){\n //var itemInEditing = localStorage.getItem(\"ownerInEdit\");\n var itemInEditing = getOwnerInEditFromLS();\n if(itemInEditing != undefined){\n\n // manage Insert / Save / Save and Clone / Delete / Owner List button\n $(\"#owner-insert\").hide();\n $(\"#owner-save\").show();\n $(\"#owner-save-clone\").show();\n $(\"#owner-delete\").show();\n\n\n var item = getOwnerFromLSbyId(itemInEditing);\n $(\"#name\").val(item.name);\n $(\"#address\").val(item.address);\n $(\"#phone1\").val(item.phone1);\n $(\"#phone2\").val(item.phone2);\n $(\"#where-calls\").val(item.where_calls);\n $(\"#reference\").val(item.reference);\n $(\"#notes\").val(item.notes);\n $(\"#id\").val(item.id);\n }\n}", "title": "" }, { "docid": "c5bb4efee2d4b2dcccca0a5dde69b484", "score": "0.58050746", "text": "__setUpdateTask() {\n this.set('__updateTask', true);\n }", "title": "" }, { "docid": "92445d303ff202e2b7d16428d3d56d23", "score": "0.5799249", "text": "sendUpdateEvent() {\n\t\t\tconst formName = this.modal.name.substr(0, this.modal.name.indexOf('_')); // e.g. 'item_edit' => 'item'\n\t\t\t// Only emit the event (which will trigger the API call) if the user has made changes\n\t\t\tif(!_.isEqual(this.form[formName], this.modal.data)) {\n\t\t\t\t// TODO: this is complicated, can't we organise the data in the trigger component?\n\t\t\t\tif(formName == 'item') {\n\t\t\t\t\tthis.form.item.itemId = this.modal.trigger.itemId;\n\t\t\t\t}\n\t\t\t\tconst eventName = this.event.update + this.capitalise(formName);\n\t\t\t\tbus.$emit(eventName, this.form[formName], this.modal.trigger);\n\t\t\t}\n\t\t\t// In any case, hide the modal and reset the form\n\t\t\tthis.closeModal(this.modal.name);\n\t\t}", "title": "" }, { "docid": "6fbc2e8b92de17c1adb0cf8215d46c19", "score": "0.57947916", "text": "function saveAndExitEditMode()\r\n\t\t{\r\n\t\t\tif (currentEditableAnnotation)\r\n\t\t\t{\r\n\t\t\t\tjQuery(\"form\", \"#editable\").submit();\r\n\t\t\t}\t\t\r\n\t\t}", "title": "" }, { "docid": "d4cd8c5a12e74a64fc0c7b7359373f0c", "score": "0.57921326", "text": "function saveEdit(e) {\n let ID = getID();\n let pillID = config.pillID;\n\n $.ajax({\n url: '/home/' + ID + '/pill/' + pillID,\n type: 'PUT',\n data: {\n pill_id: pillID,\n pill_name: $('#pillName-edit').val(),\n pill_amount: $('#pillAmount-edit').val(),\n pill_strength: $('#pillStrength-edit').val(),\n remaining: $('#pillRemaining-edit').val()\n },\n success: function(result) {\n $('#pill-edit').attr('hidden', 'hidden');\n $('#pill-body').removeAttr('hidden');\n location.reload(); \n }\n });\n}", "title": "" }, { "docid": "58f153a764b5a692bd14620cbfb7eed8", "score": "0.5785463", "text": "function beginEdit() {\n if (selectedBook == null || selectedBook == undefined) {\n return window.alert(\"Must select a book before you can edit it.\")\n }\n else {\n editState();\n }\n }", "title": "" }, { "docid": "082bbf68ba148ad3e00e204371ccb5f2", "score": "0.57794505", "text": "function update() {\n try {\n // implements model change event\n vm.ngModel.onChange();\n // create a copy of the model for rollback if required\n personCopy = vm.ngModel.copy();\n logger.debug('updating', vm.ngModel);\n } catch (ex) {\n // throw non-fatal error\n logger.error('updating', vm.ngModel, ex, false);\n // rollback\n vm.ngModel = personCopy;\n logger.debug('rolling back', vm.ngModel);\n }\n }", "title": "" }, { "docid": "d888fec9c0f8082bcefbb113baa8f6e9", "score": "0.57749826", "text": "_handleModelInstancesChanged(e) {\n console.log(\"controller _handleModelInstancesChanged\" + e.detail);\n // update view\n if (e.detail) {\n this.set('modelInstancesForView',e.detail);\n this.notifyPath('modelInstancesForView');\n }\n }", "title": "" }, { "docid": "91b27ffedbeedd24dfd9c8ec91a077a9", "score": "0.57705134", "text": "function edit(guid) {\n\t\t\n\t\t$.mobile.silentScroll();\n\n\t\t// aktuelle Event merken\n\t\tif (guid != undefined)\n\t\t\tactEvent = EventApp.happenings.getEventByID(guid);\n\n\t\t// Page wechseln\n\t\tif (EventApp.tablet == false)\n\t\t\t$(\"body\").pagecontainer(\"change\", \"#event-details\");\n\n\t\t// Werte setzen\n\t\trefreshEvent();\n\t\tvalid.validate();\n\n\t}", "title": "" }, { "docid": "b6adebbd01fffcb970264ee8b3692b4f", "score": "0.5767006", "text": "willUpdate() {}", "title": "" } ]
d69fb37aa937753175e40664ab707b31
For testing purposes only. This will typically be cron'd NB: This is not thread safe designed for testing only
[ { "docid": "9ee49003b9af0d3d65e64dbc206c9ded", "score": "0.0", "text": "'updatesProcessor.run'() {\n if (!Meteor.userId()) {\n throw new Meteor.Error(403, 'You must be logged in to perform this function');\n }\n if (!AuthenticationHelpers.doIHaveAuthority(['super-admin'])) {\n throw new Meteor.Error(403, 'Not authorised to perform this method');\n }\n if (Meteor.isServer) {\n console.log('Manual trigger of UpdatesProcessor');\n up = new UpdatesProcessor();\n up._process();\n }\n }", "title": "" } ]
[ { "docid": "1a043701c438fd624b72fafea5f32e82", "score": "0.6157382", "text": "sync() {}", "title": "" }, { "docid": "e34afdb4fc65ea63a013be03e75dca55", "score": "0.5854964", "text": "function Synchronized() {\n}", "title": "" }, { "docid": "2430721c3782f709547448003515d4dd", "score": "0.5854432", "text": "function Synchronized () {}", "title": "" }, { "docid": "dd3d2ff5dbf8d0a36bf5b1ffd7bdf676", "score": "0.5832702", "text": "run() {}", "title": "" }, { "docid": "dd3d2ff5dbf8d0a36bf5b1ffd7bdf676", "score": "0.5832702", "text": "run() {}", "title": "" }, { "docid": "dd3d2ff5dbf8d0a36bf5b1ffd7bdf676", "score": "0.5832702", "text": "run() {}", "title": "" }, { "docid": "d14d2f89635c8cd68ecb922e06f025f8", "score": "0.5759083", "text": "sync () {\n\n }", "title": "" }, { "docid": "d8adde47ce72f2ee5f85f4a8d7b6d23d", "score": "0.574831", "text": "once() {}", "title": "" }, { "docid": "82e8e6a7d0d17591b3189978d73652aa", "score": "0.57047975", "text": "function TestRace() {\n }", "title": "" }, { "docid": "1e89fc494541d3c66a00e2562d45ccb2", "score": "0.5683497", "text": "async run() {}", "title": "" }, { "docid": "cb9b986f4754f4bac891d61bb8e2e8c3", "score": "0.5674962", "text": "run () {}", "title": "" }, { "docid": "538017052275471cdcc1d079fd0d173c", "score": "0.559068", "text": "runSafetyCheck() {}", "title": "" }, { "docid": "4b2bc749f31bf3b4a0bde55b8622c872", "score": "0.5560189", "text": "function u(e){t.delayExecution=(t,r)=>{e(t,r);const n={hasRef:()=>{throw new Error(\"For tests only. Not Implemented\")},ref:()=>{throw new Error(\"For tests only. Not Implemented\")},refresh:()=>{throw new Error(\"For tests only. Not Implemented\")},unref:()=>{throw new Error(\"For tests only. Not Implemented\")},[Symbol.toPrimitive]:()=>{throw new Error(\"For tests only. Not Implemented\")}};return n}}", "title": "" }, { "docid": "327da7fce9e44abe4dea6e0e79645d18", "score": "0.5515493", "text": "async run() {\n throw new Error(\"Not implemented yet!\")\n }", "title": "" }, { "docid": "e49bf2020389e9afca89b228560818ab", "score": "0.5479954", "text": "function mock() {}", "title": "" }, { "docid": "f6b906218f463dd6c698f29df413a099", "score": "0.5440823", "text": "function run() {}", "title": "" }, { "docid": "0c33f8f6aa950f5a453866dd162cd606", "score": "0.54028565", "text": "function sync() {}", "title": "" }, { "docid": "68f49a978b82651cfde1e2e8159eba45", "score": "0.53703356", "text": "function cb() { }", "title": "" }, { "docid": "24af358dabb17979ba3567ab0c981012", "score": "0.5356501", "text": "run() {\n }", "title": "" }, { "docid": "714f5ed10ba55eeaeb7d83d3913ac174", "score": "0.5355079", "text": "static get concurrency () {\r\n return 1\r\n }", "title": "" }, { "docid": "30fb0f113b428bd3b353c1e82ac6e7cd", "score": "0.53523844", "text": "static get concurrency() {\n return 1;\n }", "title": "" }, { "docid": "1a515fc3cf303da75aa8bbfca32f6796", "score": "0.5320242", "text": "static get concurrency() {\n return 1\n }", "title": "" }, { "docid": "a811f62cc7fb0635b4c7fe817d05bfa6", "score": "0.5272921", "text": "static get concurrency () {\n return 1\n }", "title": "" }, { "docid": "6c919b1a134c7e302070b988596cf9d6", "score": "0.524165", "text": "ready() { return true; }", "title": "" }, { "docid": "6ec7c31194c496fb80d54cff10720491", "score": "0.5233765", "text": "function futapi() {\n }", "title": "" }, { "docid": "a68493dec818a853e77d60f9aed7d76e", "score": "0.51843286", "text": "__init17() {this.workers = []}", "title": "" }, { "docid": "89b8b2efd42d72c7d3e961a4bd8c2248", "score": "0.5172664", "text": "started () {}", "title": "" }, { "docid": "9c022f71a72399ed272ca2e287fe29fa", "score": "0.5166975", "text": "function PIN_ExecuteAt() {\r\n //XXX: TODO\r\n //synchronize with proxy functions, it should switch after getting out of the Locker\r\n //only valid on AF and replacements.\r\n}", "title": "" }, { "docid": "4fc4bb315305c5b86e41ef450b0103f0", "score": "0.5165416", "text": "static generateSync () {\n throw new Error(`\"static generateSync()\" is not implemented on ${this.name}`)\n }", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5160426", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5160426", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5160426", "text": "started() {}", "title": "" }, { "docid": "aa963aad46c9f76c001194764fd39b48", "score": "0.5143259", "text": "function o1144() {\n try {\nif (Module['calledRun']) try {\nreturn;\n}catch(e){}\n}catch(e){} // run may have just been called while the async setStatus time below was happening\n try {\nModule['calledRun'] = true;\n}catch(e){}\n\n try {\no287();\n}catch(e){}\n\n try {\no288();\n}catch(e){}\n\n try {\nif (Module['_main'] && o1137) {\n try {\nModule['callMain'](o81);\n}catch(e){}\n }\n}catch(e){}\n\n try {\no290();\n}catch(e){}\n }", "title": "" }, { "docid": "bb184b817553564a028aa22369c6ac2c", "score": "0.5126196", "text": "function DailyJobRun() {\n}", "title": "" }, { "docid": "8b71e29f13b51bdf56fb882193e8deb4", "score": "0.5119989", "text": "solved () {\n\n\t}", "title": "" }, { "docid": "b21985ee55130645e6e57011aa4d8e37", "score": "0.5094421", "text": "test()\n {\n flockTest();\n }", "title": "" }, { "docid": "8a9fcdf2b9f15002be4a1693c50ada6b", "score": "0.50546366", "text": "schedule() {}", "title": "" }, { "docid": "31cbd25a06e64df7df3eb83fc1d00afb", "score": "0.504992", "text": "function test_update_webui_ha() {}", "title": "" }, { "docid": "63a3c28c4cf999edfa801dcc2fbf2e4d", "score": "0.50470626", "text": "function run() {\n }", "title": "" }, { "docid": "63a3c28c4cf999edfa801dcc2fbf2e4d", "score": "0.50470626", "text": "function run() {\n }", "title": "" }, { "docid": "63a3c28c4cf999edfa801dcc2fbf2e4d", "score": "0.50470626", "text": "function run() {\n }", "title": "" }, { "docid": "63a3c28c4cf999edfa801dcc2fbf2e4d", "score": "0.50470626", "text": "function run() {\n }", "title": "" }, { "docid": "70be6ca7382b8056102b2783d878683c", "score": "0.5046016", "text": "function run() {\r\n\r\n}", "title": "" }, { "docid": "f59a8f601b5ae82a53d72dbf83d57d4e", "score": "0.5033535", "text": "__init18() {this.masterWorker = null}", "title": "" }, { "docid": "e69a2f7eb4d795c13cb4544cdded01d7", "score": "0.5033264", "text": "function SyncPrivateApi() {}", "title": "" }, { "docid": "da35d9d81999aa53f172c0f0a1918b8e", "score": "0.5031269", "text": "function TestThroneInternals() {\n}", "title": "" }, { "docid": "e87ab65fa11e20e233dec26793391d2b", "score": "0.50193924", "text": "patch() {\n }", "title": "" }, { "docid": "c4f240caacbadb026cf305454bcbce33", "score": "0.50117415", "text": "run () {\n\n }", "title": "" }, { "docid": "97225b3ca805be04a300e3b0ade230a0", "score": "0.50105333", "text": "async __executePeriodic () {\n\t\tthrow new Error(`__executePeriodic must be overridden.`);\n\t}", "title": "" }, { "docid": "11db30d2ebadbbba7f0734c4d11a8e8a", "score": "0.5002297", "text": "_run(cb){cb();}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.499738", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.499738", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.499738", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.499738", "text": "function SYNC() {}", "title": "" }, { "docid": "5265f9d57e9468779338dc0f5c257448", "score": "0.49859664", "text": "spawn() {\n\t\t\n\t}", "title": "" }, { "docid": "4ac6e91033b65d0d47f846287eb31dec", "score": "0.4978525", "text": "function test_update_webui_replication() {}", "title": "" }, { "docid": "6817028f8ad324eef650dbda43897555", "score": "0.49768358", "text": "unlocked() { return true}", "title": "" }, { "docid": "a93d21001f282348cd86003e5c1e0fa2", "score": "0.49747682", "text": "function init() {\n lastTime = Date.now();\n main(); \n }", "title": "" }, { "docid": "70aa18de99d68750ac1c6d51c3075021", "score": "0.49693835", "text": "execute() {}", "title": "" }, { "docid": "70aa18de99d68750ac1c6d51c3075021", "score": "0.49693835", "text": "execute() {}", "title": "" }, { "docid": "70aa18de99d68750ac1c6d51c3075021", "score": "0.49693835", "text": "execute() {}", "title": "" }, { "docid": "70aa18de99d68750ac1c6d51c3075021", "score": "0.49693835", "text": "execute() {}", "title": "" }, { "docid": "70aa18de99d68750ac1c6d51c3075021", "score": "0.49693835", "text": "execute() {}", "title": "" }, { "docid": "50d572e6e8c796506393c7e54b0e9713", "score": "0.49553075", "text": "automate() {\n }", "title": "" }, { "docid": "e5d4f0602e9f2b3e48a6492a34176f84", "score": "0.49490806", "text": "function internalRecover(test){\ntest.semaphore=0;\ninternalStart(test);\n}", "title": "" }, { "docid": "3072a9e88a86e641ca71353bbe86fb78", "score": "0.49477175", "text": "async init() {\n return;\n }", "title": "" }, { "docid": "1df7657376c948be95b3c875848d1b91", "score": "0.49475348", "text": "async _init() {}", "title": "" }, { "docid": "7f01c11e28310106338e205d10429f67", "score": "0.49453348", "text": "function workLoopSync(){\n// Already timed out, so perform work without checking if we need to yield.\nwhile(workInProgress!==null){\nworkInProgress=performUnitOfWork(workInProgress);\n}\n}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.4938609", "text": "started() {\n\n\t}", "title": "" }, { "docid": "ad50658e40878d8c771049d0d0019b86", "score": "0.49378142", "text": "function TruthinessService () {\n return{once:false};\n }", "title": "" }, { "docid": "e9d304f73500ac772c8f6c8eb9b9cae0", "score": "0.49330673", "text": "static Execute() { }", "title": "" }, { "docid": "4653d42e0153006c468ffb12722d0312", "score": "0.49318588", "text": "started() {\n\n\n\t}", "title": "" }, { "docid": "47f2b2b25a473f45ab827952b0995fdb", "score": "0.491127", "text": "function main() {\n var storage = new Storage();\n var scheduler = new Scheduler(storage);\n var itemActioner = new ItemActioner(storage);\n var actionItems = [];\n\n var actionItemsConfig = returnConfig();\n\n // create and collect actionItem objects\n for(var i = 0; i < actionItemsConfig.length; i++) {\n actionItems.push(\n new ActionItem(\n actionItemsConfig[i].id,\n actionItemsConfig[i].type,\n actionItemsConfig[i].schedule,\n actionItemsConfig[i].bigquery,\n actionItemsConfig[i].email_data\n )\n );\n }\n\n // cycle through actionItems and consider actioning\n for(var i = 0; i < actionItems.length; i++) {\n Logger.log(\"Processing item: \"+actionItems[i].id);\n\n // delegate decision of whether report should run to scheduler object\n var schedulerResult = scheduler.shouldAction(actionItems[i]);\n\n if(schedulerResult[0]){\n if(itemActioner.actionItem(actionItems[i], schedulerResult[1])){\n scheduler.updateLastRan(actionItems[i]);\n Logger.log(\"Report run - based on scheduler response. Report status updated.\");\n }\n } else {\n if(schedulerResult[1] == 'partition_already_present'){\n scheduler.updateLastRan(actionItems[i]);\n Logger.log(\"Report not run: Partition already present, status updated.\");\n } else if(schedulerResult[1] == 'no_data'){\n Logger.log(\"Report not run: No data available.\");\n } else if(schedulerResult[1] == 'item_already_processed'){\n Logger.log(\"Report not run: Item already processed.\"); // not thought to ever occur\n } else {\n Logger.log(\"Report not run: Condition for not running not captured.\");\n }\n }\n }\n}", "title": "" }, { "docid": "8854454d3585551308ac5aad861a2fbd", "score": "0.49072635", "text": "function Runner() {}", "title": "" }, { "docid": "8854454d3585551308ac5aad861a2fbd", "score": "0.49072635", "text": "function Runner() {}", "title": "" }, { "docid": "4de9547f24a595ddfb3216a659009b2e", "score": "0.49041444", "text": "function requestSingleInstanceLock() {\n console.log(\"requestSingleInstanceLock\");\n return false;\n }", "title": "" }, { "docid": "1c3993cc3ec285a4c1774c56966327e3", "score": "0.4889223", "text": "start (when = 0) {}", "title": "" }, { "docid": "28227785bc13ae57aba6582df6ea1f8d", "score": "0.4881091", "text": "function ensureMemorizationPending()\n {\n if( isMemorizationPending ) return;\n\n setTimeout( ()=> // No hurry, go easy here on the machine\n {\n isMemorizationPending = false;\n\n // Memorize the cached documents\n // --------\n const locations = [];\n for( const cacheEntry of DocumentCache.entries() )\n {\n if( cacheEntry.document !== null ) locations.push( cacheEntry.uri );\n }\n sessionStorage.setItem( SS_KEY_locations,\n JSON.stringify( locations, /*replacer*/null, SESSION_STRINGIFY_SPACING ));\n }, MS_DELAY_DCP );\n isMemorizationPending = true;\n }", "title": "" }, { "docid": "c0848994b6f8af82518ac600532f8265", "score": "0.4878707", "text": "static BakeAsync() {}", "title": "" }, { "docid": "5d195bebc45f83baf098effd2a749efd", "score": "0.48781365", "text": "function I(){return a.setTimeout(function(){eb=void 0}),eb=fa.now()}", "title": "" }, { "docid": "d62e7dd31b63cc417ef5963169c865ca", "score": "0.4876306", "text": "_callerHungup() {\n assert(false, 'subclass responsibility to override this method');\n }", "title": "" }, { "docid": "d29206cc8fd0d9944e27b6c8714cd975", "score": "0.48757172", "text": "static get completed() {}", "title": "" }, { "docid": "1a909ecfa2a9a2abffed01cc463719ec", "score": "0.48746854", "text": "ready() { }", "title": "" }, { "docid": "d3e43c3d35b769b00b6f419b57256c07", "score": "0.48670492", "text": "static get finished() {\n return 0;\n }", "title": "" }, { "docid": "38f67acf4f7ea2690eeefc3bff7b3fee", "score": "0.486622", "text": "function runOnceAWeek() {\n run_(true);\n}", "title": "" }, { "docid": "4ee1d364b45c3eabe8a82fe0b9789674", "score": "0.48620293", "text": "function init() {\n lastTime = Date.now();\n main();\n }", "title": "" }, { "docid": "ae3311abc009838bca12dc9c1f7cbcef", "score": "0.48572418", "text": "initialize()\n {\n this._runJobLocks = {};\n }", "title": "" }, { "docid": "dd9d102b8e211deff66deced04c8fc12", "score": "0.48513314", "text": "async worker() {\n return null;\n }", "title": "" }, { "docid": "ba40829a48f9fe530fa06845c07c79f2", "score": "0.48464268", "text": "_ready () {\n // override with no-op\n }", "title": "" }, { "docid": "ad299a19f6d2a690f2d58d4beb5925dd", "score": "0.48398712", "text": "async init(){\n try{\n this.storage = new Storage();\n this.preprocCache = new Cache();\n this.configurator = new Configurator();\n const query = this.updatePeriodically.bind(this);\n this.updateTimerId = this.createTimer({period: this.configurator.getUpdatePeriod(), query, firstDelay: 0.5});\n this.zbxPreproc = new ZabbixPreprocessor();\n }catch(e){\n debug.error(\"Error on init: \"+e.message,e);\n }\n }", "title": "" }, { "docid": "7d657dc36d066a81279b5177163c3d12", "score": "0.4837929", "text": "ready() {}", "title": "" } ]
9b2b9ce912a534e8beb50b6ff1a3a93b
muestra la nueva imagen
[ { "docid": "bd74185cb1a0cc86714f84b23000fe05", "score": "0.0", "text": "function addImage(e){\n\t\t \n \tvar file = e.target.files[0],\n \timageType = /image.*/;\n\t\n \tif (!file.type.match(imageType)){\n\t\t \t$('#imgImagen').attr(\"src\",\"http://placehold.it/1000x300&text=[1000x300]\");\n\t\t \t document.getElementById('fileImagen').value ='';\n\t\t \tif($('#imagenName').val() != 0){\n\t\t\t \t$('#imgImagen').attr(\"src\",URL_IMG + \"app/visita/banner/\" + $('#imagenName').val())\n\t\t \t} else {\n\t\t\t\t$('#lblEventImage').addClass('error');\n\t\t\t \t$('#alertImage').empty();\n\t\t\t \t$('#alertImage').append(\"Selecione una imagen\");\n\t\t\t \t$('#alertImage').show();\n\t\t \t}\n \treturn;\n\t \t}\n \t\t//carga la imagen\n var reader = new FileReader();\n reader.onload = fileOnload;\n reader.readAsDataURL(file);\n }", "title": "" } ]
[ { "docid": "fc8d0a2c3a31df3bbe14238b13547221", "score": "0.70648575", "text": "function create(img) {\r\n var imageElement = document.createElement('img');\r\n imageElement.src = img;\r\n imageElement.className = 'sanins'\r\n document.getElementById('3sanins').remove();\r\n page.appendChild(imageElement)\r\n}", "title": "" }, { "docid": "e562197aaf2d48aa7c3844204d59fc9a", "score": "0.68154496", "text": "function imgEstudiante(){ \n if (imagen == null) { //si la emagen es null cree un elemento nuevo\n imagen = document.createElement(\"img\"); \n imagen.id = \"imgEstudiante\";\n imagen.src = 'D:/Universidad/Programacion/Progra 5/proyecto2/Estudiantes/' + foto +''; \n var div = document.getElementById(\"imgEstudiante\"); \n div.appendChild(imagen); \n }\n else //si no esta null remplace el elemento existente\n imagen.src = 'D:/Universidad/Programacion/Progra 5/proyecto2/Estudiantes/' + foto +''; \n var div = document.getElementById(\"imgEstudiante\"); \n div.appendChild(imagen); \n}", "title": "" }, { "docid": "1ae653f5f81848942514af6d2a1582a2", "score": "0.64432216", "text": "createSingleImage(img) {\n const [width, height] = this.getWH();\n const sp = Pool.get('album_sprite', () => new Sprite());\n this.draw({ display: sp, texture: img, width, height });\n this.addChildImageSprite(sp);\n }", "title": "" }, { "docid": "20c2902b7ba4481d8f21cb83e9bdbea5", "score": "0.64417917", "text": "addImage(img, orientation = 0){\n let hold = new Image();\n hold.src = img;\n this.img = hold;\n this.orientation = orientation;\n }", "title": "" }, { "docid": "a9a837fe4b22ed88bcc23db6076f32ed", "score": "0.642261", "text": "function flowerGen()\r\n{\r\n var image=document.createElement('img');\r\n var div=document.getElementById('flex-gen-flower');\r\n image.src=\"D:static/flower.jpg\";\r\n div.appendChild(image);\r\n}", "title": "" }, { "docid": "46e9c9fce6daa836df8e0054b691e086", "score": "0.6410139", "text": "function remplirPlateau() {\n img.src = `../img/jeu/${imgChoisit}`;\n context.drawImage(img, 0, 0);\n}", "title": "" }, { "docid": "e68587fe792659616103546b3ae60996", "score": "0.6399842", "text": "function createPitureNew(title, data, size) {\n // se crea la foto\n console.info('create Picture using: ', title, data, size);\n}", "title": "" }, { "docid": "f337b4da540935063c1a6e5372b8343b", "score": "0.6375845", "text": "function desenhaImagem(){\n imgCam.src = \"img/cctv.png\";\n imgCam.onload = function(){\n ctx.drawImage( imgCam , x, y);\n }\n }", "title": "" }, { "docid": "bbe81ce98827ff54c695145732357483", "score": "0.63657594", "text": "function generate() {\n imageUUID = generateUUID();\n let imageUrl = \"/image_code/\" + imageUUID +\"/\";\n $img.attr(\"src\", imageUrl)\n }", "title": "" }, { "docid": "d2ed09363bc2eb36efff74b64c48700b", "score": "0.6362772", "text": "function createImage() {\n\t\n\tvar image = document.createElement(\"img\");\n\timage.className = \"imgG\";\n\timage.style.width = \"100%\";\n\timage.style.height = \"100%\";\n\timage.style.borderRadius = \"5px\";\n\timage.style.overflow = \"hidden\";\n\t\n\treturn image;\n}", "title": "" }, { "docid": "0b42e7cc6d00031eca2b150856088e81", "score": "0.6351515", "text": "set imagen(value){this._imagen=value;}", "title": "" }, { "docid": "0b42e7cc6d00031eca2b150856088e81", "score": "0.6351515", "text": "set imagen(value){this._imagen=value;}", "title": "" }, { "docid": "fadc5af4af7098fce20c8034fdba8362", "score": "0.633628", "text": "function takepicture() {\r\n const contenedor = document.querySelector(\".canvas-contenedor\");\r\n const canvas = document.createElement(\"canvas\");\r\n canvas.classList.add(\"canvas\");\r\n canvas.width = 400;\r\n canvas.height = 400;\r\n canvas.getContext(\"2d\").drawImage(camara, 0, 0, 400, 400);\r\n\r\n // aggregamos la imagen al contenedor\r\n contenedor.appendChild(canvas);\r\n}", "title": "" }, { "docid": "046ea1d53df05fdf0b49ece90ca4d764", "score": "0.63333315", "text": "function createNewImg(img) {\n var newImg = {\n id: gImgs.length+1,\n url: img.src,\n keywords: ['happy']\n }\n gImgs.push(newImg);\n saveToStorage('ImgsDB' , gImgs)\n}", "title": "" }, { "docid": "569a01aa488d4f0f4ab1f7d1ba16f319", "score": "0.631769", "text": "function imgCompletame(){\n\tposicionOri[0]=\"imagenes/rompecabezas/medio/med01.gif\";\n posicionOri[1]=\"imagenes/rompecabezas/medio/med02.gif\";\n posicionOri[2]=\"imagenes/rompecabezas/medio/med03.gif\";\n posicionOri[3]=\"imagenes/rompecabezas/medio/med04.gif\";\n posicionOri[4]=\"imagenes/rompecabezas/medio/med05.gif\";\n posicionOri[5]=\"imagenes/rompecabezas/medio/med06.gif\";\n posicionOri[6]=\"imagenes/rompecabezas/medio/med07.gif\";\n posicionOri[7]=\"imagenes/rompecabezas/medio/med08.gif\";\n posicionOri[8]=\"imagenes/rompecabezas/medio/med09.gif\";\n\tposicionOri[9]=\"imagenes/rompecabezas/medio/med10.gif\";\n\tposicionOri[10]=\"imagenes/rompecabezas/medio/med11.gif\";\n\tposicionOri[11]=\"imagenes/rompecabezas/medio/med12.gif\";\n\tposicionOri[12]=\"imagenes/rompecabezas/medio/med13.gif\";\n\tposicionOri[13]=\"imagenes/rompecabezas/medio/med14.gif\";\n\tposicionOri[14]=\"imagenes/rompecabezas/medio/med15.gif\";\n\tposicionOri[15]=\"imagenes/rompecabezas/medio/med16.gif\";\n for(var a=0;a<16;a++){//imprimimos\n imagenes[a].src = posicionOri[a];\n }\n}", "title": "" }, { "docid": "4cc5ace6ec8bed20c2305a766f9c43f5", "score": "0.62969995", "text": "function inicializa() {\n canvas = document.getElementById(\"canvas\");\n contxto = canvas.getContext(\"2d\");\n\n //carga img\n imgRex = new Image(); //es un obj imagen\n imgRex.src = \"img/wargreymon.png\";\n\n setInterval(function () {\n principal();\n }, 1000 / FPS);\n}", "title": "" }, { "docid": "1afe4de8654110cb738be0a362ef5fa3", "score": "0.62773776", "text": "function saveimg(){\n let monsterDrawing = get(canvasX1, canvasY1, 550,550);\n monName = nameIn.value();\n save(monsterDrawing, monName+\".jpg\");\n console.log('Image Saved')\n //img = createImg(monName+\".jpg\");\n\n}", "title": "" }, { "docid": "1d6a6c3814f9d9680b26f33eef20e712", "score": "0.6266185", "text": "function Picture() { }", "title": "" }, { "docid": "db38694f97ef682cda65377244f1c1b3", "score": "0.6264073", "text": "function evolucionarPollitos() {\n var imagenPollito = document.getElementById(\"imagen\");\n imagenPollito.src = \"https://cdn.bulbagarden.net/upload/thumb/2/29/256Combusken.png/1200px-256Combusken.png\";\n}", "title": "" }, { "docid": "6d341de613c585da772f4bcad3360eca", "score": "0.62607515", "text": "function imgCompletafa(){\n posicionOri[0]=\"imagenes/rompecabezas/facil/f01.gif\";\n posicionOri[1]=\"imagenes/rompecabezas/facil/f02.gif\";\n posicionOri[2]=\"imagenes/rompecabezas/facil/f03.gif\";\n posicionOri[3]=\"imagenes/rompecabezas/facil/f04.gif\";\n posicionOri[4]=\"imagenes/rompecabezas/facil/f05.gif\";\n posicionOri[5]=\"imagenes/rompecabezas/facil/f06.gif\";\n posicionOri[6]=\"imagenes/rompecabezas/facil/f07.gif\";\n posicionOri[7]=\"imagenes/rompecabezas/facil/f08.gif\";\n posicionOri[8]=\"imagenes/rompecabezas/facil/f09.gif\";\n for(var a=0;a<9;a++){//imprimimos\n imagenes[a].src = posicionOri[a];\n }\n}", "title": "" }, { "docid": "0c40f44888891a5464e2c371d3094515", "score": "0.6259929", "text": "function inicializar_imagenes(id_contenedor){\n\tvar contenedor='';\n\tif(id_contenedor!=undefined) contenedor='#'+id_contenedor+'';\n\n\t$(contenedor+' [data-tipo=imagen]').each(function(ind,obj){\n\t\tvar cont=$('<div class=\"imagen\"></div>');\n\t\tvar cont_prev=$('<img class=\"'+$(obj).attr('data-imagen-class')+'\">');\n\t\tvar cont_bto=$('<div class=\"on_hover\" style=\"float:right;\"></div>');\n\t\tvar hid_prev=$('<input type=\"hidden\" name=\"'+$(obj).attr('name')+'_delete\" value=\"\">');\n\t\tvar bto_mod=$('<a href=\"#\" class=\"btn btn-success btn-xs\"><span class=\"glyphicon glyphicon-pencil\"></span></a> ').click(function(e){e.preventDefault();$(obj).click();});\n\t\tvar bto_eli=$('<a href=\"#\" class=\"btn btn-danger btn-xs\"><span class=\"glyphicon glyphicon-remove\"></span></a>').click(function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t$(hid_prev).val('1');\n\t\t\t\t$(obj).val('');\n\t\t\t\tif($(obj).attr('data-imagen-src-def')!=undefined) $(cont_prev).attr('src',$(obj).attr('data-imagen-src-def')).show();\n\t\t\t\telse $(cont_prev).hide().attr('src','');\n\t\t\t\t$(this).hide();\n\t\t});\n\n\t\t$(cont).append(cont_prev);\n\t\t\t\t\t\t\n\t\t//Agrego los botones de modificar y borrar\n\t\t$(cont_bto).append(bto_mod);\n\t\t$(cont_bto).append(bto_eli);\n\t\t$(cont).append(cont_bto);\n\n\t\t//Agrego el hiden que dira si la imagen se ha borrado\n\t\t$(cont).append(hid_prev);\n\t\t\n\t\t//Agrego el contenedor\n\t\t$(obj).css({width:0,height:0}).after(cont);\n\n\t\tif($(obj).attr('data-imagen-src')!=undefined && $(obj).attr('data-imagen-src')!='') {\n\t\t\t/*\n\t\t\t$(cont_prev).on(\"load\", function(){\n\t\t\t\t//Miro a ver si hay que hacer el crop\n\t\t\t\tif($(obj).attr('data-crop')!=undefined) $(cont_prev).Jcrop({'aspectRatio':1});\n\t\t\t});\n\t\t\t*/\n\t\t\t$(cont_prev).attr('src',$(obj).attr('data-imagen-src')).show();\t\t\t\n\t\t}\n\t\telse $(bto_eli).hide();\n\n\t\t$(obj).change(function(e){\n\t\t\tif($(this).val()!=''){\n\t\t\t\t//Cargo el preview de la imagen\n\t var imagen = new FileReader();\n\t imagen.onload = function (e) {\n\t \t$(cont_prev).attr('src',e.target.result).show();\n\t\t\t\t\t\n\t\t\t\t\t//Miro a ver si hay que hacer el crop\n\t\t\t\t\t/*\n\t\t\t\t\tif($(obj).attr('data-crop')!=undefined) {\n\t\t\t\t\t\tvar jcrop_api;\n\t\t\t\t\t\t$(cont_prev).Jcrop({'aspectRatio':1},function(){jcrop_api = this;});\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t }\n\t imagen.readAsDataURL(this.files[0]);\n\t\t\t\t$(bto_eli).css({display:'inline-block'});\n\t\t\t}else $(bto_eli).click();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "4dbe7b80df0874b56c354d7bf9e47ad7", "score": "0.624984", "text": "function createImage(src)\n{\n var img = new Image();\n img.src = \"images/\" + src;\n return img;\n}", "title": "" }, { "docid": "9f2469f7fedc3fc0b2c694703c7ff669", "score": "0.62258476", "text": "function genPic() {\n var imgw = document.getElementById(\"imgw\").value;\n var imgh = document.getElementById(\"imgh\").value;\n\n precvs.width = imgw*preSize;\n precvs.height = imgh*preSize;\n pic=[];\n var a=[];\n for(var x=0;x<imgw;x++) {\n a.push(0);\n }\n for(var y=0;y<imgh;y++) {\n pic.push(a.slice());\n }\n \n lastSize.x=imgw;\n lastSize.y=imgh;\n}", "title": "" }, { "docid": "455f12e99c9c4921323fa1fb5f7fa10c", "score": "0.62130123", "text": "function generateCat(){\n var image=document.createElement('img');\n var div=document.getElementById('flex-cat-gen');\n image.src=\"https://cdn2.thecatapi.com/images/MTY1OTg4MQ.jpg\";\n div.appendChild(image); \n}", "title": "" }, { "docid": "12c566235dd76f82a658d0e691df10d9", "score": "0.62043875", "text": "function addImgO (id) {\n var img = document.createElement('img');\n img.src = 'o.png';\n document.getElementById(id).appendChild(img);\n}", "title": "" }, { "docid": "403b9cfe0a685c683bf5ccc3a458f7fb", "score": "0.61784434", "text": "function CreateImage(newshape, selectedShape)\n {\n var image = document.createElement(\"img\");\n image.setAttribute(\"height\", \"148\");\n image.setAttribute(\"width\", \"194\");\n \tif (selectedShape == 1)\n\t{\n\t\timage.setAttribute(\"src\", \"img/trapeze.png\");\n\t}\n\telse if (selectedShape == 2)\n\t{\n image.setAttribute(\"src\", \"img/triangle.png\");\n\t}\n\telse if (selectedShape == 3)\n\t{\n image.setAttribute(\"src\", \"img/parallelogram.png\");\n\t}\n\telse if (selectedShape == 4)\n\t{\n image.setAttribute(\"src\", \"img/rectangle.png\");\n\t}\n\telse\n\t{\n image.setAttribute(\"src\", \"img/cone.png\");\n\t}\n\tnewshape.appendChild(image);\n }", "title": "" }, { "docid": "35534d31c2f831cf811c0cf81f8d1721", "score": "0.61764616", "text": "function createImage(img){\n var im,mim,ibox,gim,gel,hold;\n gim=document.getElementById(\"bimage\");\n if(gim){\n gel=document.getElementById(\"map\");\n if(gel.value === \"\"){\n gel=document.getElementById(\"satImage\"); \n }\n if(gel.value === \"\"){\n gel=document.getElementById(\"bgimage\"); \n }\n gim.setAttribute(\"src\",gel.value); \n }\n else{\n im=document.createElement(\"img\");\n mim=document.createElement(\"img\");\n \n im.src=img;//\"body/brain.png\";\n \n im.id=\"bimage\";\n mim.id=\"eimage\";\n // im.style.display=\"none\";\n mim.style.display=\"none\";\n ibox=document.createElement(\"div\");\n ibox.backgroundColor=\"white\";\n ibox.style.width=\"1200px\";\n ibox.style.height=\"600px\";\n ibox.style.margin=\"20px\";\n ibox.style.position=\"relative\";\n ibox.style.left=\"100px\";\n ibox.style.top=\"20px\";\n ibox.id=\"ibox\";\n ibox.appendChild(im);\n //ibox.appendChild(mim); \n document.body.appendChild(ibox); \n document.body.normalize();\n }\n}", "title": "" }, { "docid": "13e761327a2a01779b9fb867dd0635f5", "score": "0.61740726", "text": "function addimg(){\n var add = document.createElement(\"img\");\n add.src = \"./images/pikachu.jpg\";\n add.className=\"imgstyle\";\n document.getElementById(\"imagearea\").appendChild(add);\n}", "title": "" }, { "docid": "6f294a4ec06304d1100346ab52457877", "score": "0.6153194", "text": "ponerImagen() {\n $(\"#\" + this.x + \"-\" + this.y).html(\"<img src='\" + this.imageSrc + \"' height='100%' width='100%'/>\");//le pone la imagen del boton\n }", "title": "" }, { "docid": "821408dee61549f0362783dc30eb7e7c", "score": "0.61392057", "text": "function createNewImg(spr) {\n\tvar newImg = document.createElement(\"img\");\n\tcanvas2div.appendChild(newImg);\n\tnewImg.src=canvas3.toDataURL();\n\tnewImg.style.cssText=\"position:absolute;\";\n\tnewImg.style.width=gridWidth*scale2*spr.nx;\n\tnewImg.style.height=gridHeight*scale2*spr.ny;\n\tnewImg.style.left=spr.x*scale2;//moving.offsetLeft-canvas2div.offsetLeft-canvas2div.clientLeft;\n\tnewImg.style.top=spr.y*scale2;//moving.offsetTop-canvas2div.offsetTop-canvas2div.clientTop;\n\tnewImg.style.display=\"\";\n\tnewImg.draggable=false;\n\tnewImg.sprite = spr;\n\t\n\n\tnewImg.addEventListener('mousedown', function(event) {\n\t\tif(selx>=0)\t// drawing tile\n\t\t\treturn;\n\t\tselimg=this;\n\t\tstartdragleft=this.offsetLeft;\n\t\tstartdragtop=this.offsetTop;\n\t\tstartdragx=event.clientX;\n\t\tstartdragy=event.clientY;\n\t\tthis.style.opacity=0.5;\n\t\tthis.style.pointerEvents=\"none\";\n\t\tevent.stopPropagation();\n\t});\n}", "title": "" }, { "docid": "ecb666f8da374d83472d3a5a84f99566", "score": "0.6132958", "text": "function insert_image() {\r\n image = document.createElement(\"img\");\r\n image_title = document.getElementById(\"file_title\").value;\r\n image.src = `images/${image_title}.png`;\r\n image.id = \"img\" + Math.random().toString();\r\n image.setAttribute(\"onclick\", `clicked(${image.id})`);\r\n image.setAttribute(\"onerror\", `this.src = \"http://localhost:8000/images/${image_title}.png\"`);\r\n image.style.width = \"91.5%\";\r\n image.style.height = \"auto\";\r\n image.style.border = \"1px solid black\";\r\n image.style.marginLeft = \"3.5%\";\r\n image.style.marginRight = \"3.5%\";\r\n image.style.alignItems = \"center\";\r\n image.style.borderRadius = \"2%\";\r\n document.getElementById(parent).after(image); //append the imag tag after parent tag\r\n parent = image.id;\r\n}", "title": "" }, { "docid": "e2b11accbfbe37469f91b9c92970faf2", "score": "0.6132491", "text": "function cargarLamparaRoja(){\n\tif (dispositivos.lamparaRoja.state){\n\t\timgLR.src = './img/animaciones/lamparaRoja/8.png';\n\t\tcont = 8;\n\t}else{\n\t\timgLR.src = './img/animaciones/lamparaRoja/0.png';\n\t\tcont = 0;\n\t}\n\tctxLR = $('#lamparaRoja')[0].getContext('2d');\n\tctxLR.drawImage(imgLR,0,0,300,150);\n}", "title": "" }, { "docid": "75af2fb32f605d7719f8c8f6ab7904a8", "score": "0.61103576", "text": "function generateBear() {\n var image = document.createElement('img');\n var div = document.getElementById(\"flex-bear-gen\");\n image.src = \"static/images/bear.png\"; \n div.appendChild(image);\n}", "title": "" }, { "docid": "1058d2f0391e51b9f0cdfb6526463206", "score": "0.6109155", "text": "gerenciaImagensJogo() {\n let indice_background = 1\n const imagemFundo = this.add.image(0, 0, `floresta_${indice_background}`).setDepth(0);\n imagemFundo.setOrigin(0, 0);\n this.time.addEvent({\n delay: 5000,\n callback: () => {\n if (!this.fimJogo) {\n imagemFundo.setTexture(`floresta_${indice_background}`);\n indice_background++;\n if (indice_background == 7) {\n indice_background = 1;\n }\n }\n },\n callbackScope: this,\n loop: true\n });\n }", "title": "" }, { "docid": "4c9feadc8f84343d254d402142739cf2", "score": "0.6108765", "text": "function createPicture(title, date, size) {\n // se crea la fotografía\n console.log('create picture using:', title, date, size);\n}", "title": "" }, { "docid": "9ff8a8804c16a5c7ca8edf1fbfb5a9dc", "score": "0.61083555", "text": "function getImage (){\n return new Image();\n}", "title": "" }, { "docid": "26fe52baa483459b5d3fa9750efb1efc", "score": "0.6101236", "text": "function createPiture(title, data, size) {\n // se crea la foto\n console.info('create Picture using: ', title, data, size);\n}", "title": "" }, { "docid": "307e56b0f3334cc2345f2b947de9ab5e", "score": "0.60889137", "text": "function newImage(src) {\n\tvar temp = new Image();\n\ttemp.src = src;\n\ttemp.onload = function() {\n\t\tnumObjectsLoaded++;\n\t\t//console.log(numObjectsLoaded);\n\t}\n\treturn temp;\n}", "title": "" }, { "docid": "bdbf5f268704214bc0c43465d0532f53", "score": "0.608747", "text": "generate() {\n // store the generate map as this image texture\n this.image = new Image();\n this.image.src = \"icons/river.png\";\n }", "title": "" }, { "docid": "9862bd61c44ef5862d90eeddff018aa5", "score": "0.608412", "text": "function generateCat()\r\n{\r\n var image = document.createElement('img');\r\n var div = document.getElementById('flex-cat-gen'); \r\n image.src = \"https://cdn2.thecatapi.com/images/d9t.jpg\";\r\n div.appendChild(image);\r\n}", "title": "" }, { "docid": "1c6b605493cbe51598ca7ceb825af85a", "score": "0.60748845", "text": "function cambiarImagenAutomatico() {\n document.slider.src = imagenes[indiceImagen];\n bolas[indiceBall].appendChild(tilde);\n\n if (indiceImagen < 2) {\n indiceImagen++;\n indiceBall++;\n } else {\n indiceImagen = 0;\n indiceBall = 0;\n }\n}", "title": "" }, { "docid": "08dc2fd70b945530eb76497953aea4bb", "score": "0.60689807", "text": "function add_image() {\n let rnd_pic = document.getElementById('pic' + parseInt(Math.random() * 18));\n\n canvas_ctx.drawImage(\n rnd_pic,\n parseInt(Math.random() * (win_width - rnd_pic.width)),\n parseInt(Math.random() * (win_height - rnd_pic.height)));\n}", "title": "" }, { "docid": "0d0032b9485d9fd6bf3d919d188d03ed", "score": "0.6063576", "text": "function SpyImage() {\n var img = new OriginalImage();\n images.push(img);\n return img;\n}", "title": "" }, { "docid": "51c6850625d861e73b7817ac0c96a0db", "score": "0.60587126", "text": "function writeImage() {\r\n /* En la propiedad `result` de nuestro FR se almacena\r\n * el resultado. Ese resultado de procesar el fichero que hemos cargado\r\n * podemos pasarlo como background a la imagen de perfil y a la vista previa\r\n * de nuestro componente.\r\n */\r\n setPhoto(fr.result);\r\n}", "title": "" }, { "docid": "c1d407346a570573a65cf18ea84bf983", "score": "0.6034584", "text": "function createAnimeImage(index){\n const $img = document.createElement(\"img\")\n $img.src = IMAGE_BASE_URL + PICTURE_LIST[index]\n $img.id = `img_${index}`\n $img.classList.add(\"anime-images\")\n return $img\n }", "title": "" }, { "docid": "bb8d122a751716ee1d6bf8b8baa7ff11", "score": "0.60257274", "text": "function newImage(arg) {\n if (document.images) {\n rslt = new Image();\n rslt.src = arg;\n return rslt;\n }\n}", "title": "" }, { "docid": "62acedbde8f32078b8fbc3efb7dbecd0", "score": "0.6023687", "text": "function makePac() {\n let velocity = setToRandom(40); \n let position = setToRandom(200);\n \n // Add image to div with id game\n let game = document.getElementById('pacscreen');\n let newimg = document.createElement('img');\n newimg.style.position = 'absolute';\n newimg.src = './images/PacMan1.png';\n newimg.width = 80;\n newimg.id = imgCounter;\n \n // set position\n newimg.style.left = position.x;\n newimg.style.top = position.y;\n // add new image to the screen\n\n game.appendChild(newimg);\n\n // return details in an object\n return {\n position,\n velocity,\n newimg,\n };\n}", "title": "" }, { "docid": "d50d906840cef431ade78def658aa22a", "score": "0.6021586", "text": "function newImage() {\n\ncurrentIndx=Math.round(Math.random()*3);\n\ndocument.photo.src=images1Preloaded[currentIndx].src;\n\ndocument.nature.src=images2Preloaded[currentIndx].src;\n\ndocument.contart.src=images3Preloaded[currentIndx].src;\n\ndocument.portrait.src=images4Preloaded[currentIndx].src;\n\n}", "title": "" }, { "docid": "2e2b4a11aad3e9ef6e3ff93ed0b2c68f", "score": "0.6017654", "text": "function impresoraCambiarImagen(objeto, extra){\n\tobjeto.children[0]\n\t\t.setAttribute(\"src\", carpetaImpresoras + impresoraObtenerNombre(objeto) + extra +\".png\")\n\t;\n}", "title": "" }, { "docid": "405c233e2a51ebe0cf909a6ccb098635", "score": "0.600191", "text": "function generateCat(){\n let myId = document.getElementById('flex-cat-gen')\n let img = document.createElement('img')\n myId.append(img)\n img.src = 'http://thecatapi.com/api/images/get?format=src&type=gif' \n}", "title": "" }, { "docid": "a3d1acbdb9ad85bd60e4c9a4648097f9", "score": "0.59988254", "text": "function newImage(arg) {\r\n\tif (document.images) {\r\n\t\trslt = new Image();\r\n\t\trslt.src = arg;\r\n\t\treturn rslt;\r\n\t}\r\n}", "title": "" }, { "docid": "9c2b00188e075bd9ff010417cb3fc16e", "score": "0.5995689", "text": "function rotarImagenes()\n {\n // obtenemos un numero aleatorio entre 0 y la cantidad de imagenes que hay\n var index=Math.floor((Math.random()*imagenes.length));\n \n // cambiamos la imagen\n document.getElementById(\"imgpres\").src=imagenes[index];\n }", "title": "" }, { "docid": "476a8ee14f79a7e1eda74643877630fa", "score": "0.5994786", "text": "image(fn){\n this.image = new Image();\n return fn(this.image);\n }", "title": "" }, { "docid": "4de6e780cc314bb3439fb95d59ae9d4f", "score": "0.5987716", "text": "function addImage(x,y,scaleFactor,imgURL){\n var img55 = new Image();\n // img55.crossOrigin='anonymous';\n img55.onload = startInteraction;\n images.push({image:img55,x:x,y:y,scale:scaleFactor,isDragging:false,isAnchorDragging:false,url:imgURL,width:60,height:60});\n NUM_IMAGES++;\n}", "title": "" }, { "docid": "76e29eb9fec5b60e9d4c67072cb7f38a", "score": "0.5987355", "text": "function sketchtoimage()\r{\r\timg = new Image(sketch);\r}", "title": "" }, { "docid": "8ee2f3e3be2e673c53334779b89adc75", "score": "0.5984804", "text": "pickRandom(){\n let randomImg = this.images[Math.floor(Math.random() * this.images.length)];\n let wallyImage = new Image ()\n wallyImage.src = randomImg.url;\n this.pickedImage = randomImg;\n ctx.clearRect(0,0,1300,1200)\n wallyImage.onload= function () {\n ctx.drawImage(wallyImage,200,0)\n }\n}", "title": "" }, { "docid": "60249251a8917744f5a55b9d01e2e468", "score": "0.5982046", "text": "function load_img() {\n\t// write code to Upload golf image on the canvas\n\n\tfabric.Image.fromURL(\"golf-h.png\", function (Img) {\n\t\tholeObj = Img;\n\t\tholeObj.scaleToWidth(hole.size);\n\t\tholeObj.scaleToHeight(hole.size);\n\t\tholeObj.set({\n\t\t\ttop: hole.y,\n\t\t\tleft: hole.x\n\t\t});\n\n\t\tcanvas.add(holeObj);\n\t});\n\n\tnew_image();\n}", "title": "" }, { "docid": "883ed762aa32a08924fe50349a73f800", "score": "0.5972922", "text": "function reset(){\n imageIsLoaded();\n grayImage = new SimpleImage(file); // gray pic\n redImage = new SimpleImage(file); // red pic\n windowImage = new SimpleImage(file); // windows pic\n rainbowImage = new SimpleImage(file); // rainbow pic\n \n originalImage.drawTo(canvas);\n}", "title": "" }, { "docid": "36691869b6493dee9e4b17b894e6cf40", "score": "0.59636897", "text": "async function updatePicture() {\n maker.MAX_STEPS += 20;\n area.picture = await maker.make(area.pictureX, area.pictureY, area.pixelSize);\n}", "title": "" }, { "docid": "553969365e49adbaaa347e8cbf736d7c", "score": "0.5957898", "text": "function cargarImagenCanvas() {\r\n var canvas = document.getElementById(\"canvasTrazarRuta\");\r\n var cxt = canvas.getContext(\"2d\");\r\n// cxt.fillStyle=\"blue\";\r\n// cxt.fillRect(0,0,100,50);\r\n var img = document.getElementById(\"source\");\r\n //pasamos la imagen al 2d del canvas y se dibujará\r\n //en 0 0 podemos poner las cordenadas de donde empezar a dibujar la imagen\r\ncxt.drawImage(img, 0, 0);\r\n\r\n}", "title": "" }, { "docid": "8e7afb223e538bb00bc63fd4ef3f9fee", "score": "0.5957449", "text": "function GenerateCat() {\r\n var image = document.createElement('img');\r\n image.src = \"https://cdn2.thecatapi.com/images/81b.gif\";\r\n document.querySelector('.flex-box-container-2').appendChild(image);\r\n\r\n}", "title": "" }, { "docid": "01548e13790b14b5a75c0aae0930dcf5", "score": "0.5956209", "text": "function createImage(url, isExternal){\n var placeHolder = document.getElementById('virtualArea');\n placeHolder.innerHTML= \"<div class='loadText'>your image is loading</div>\"; //must update to change the texture instead\n var img = document.createElement('img');\n img.setAttribute('id', 'texture')\n img.src = (isExternal)?url:window.URL.createObjectURL(url);\n img.onload = function() {\n \n var sky = document.createElement('a-sky');\n var scene = document.createElement('a-scene');\n var assets = document.createElement('a-assets');\n virtualPlaceholder = document.getElementById('virtualArea');\n virtualPlaceholder.innerHTML = \"\";\n\n assets.appendChild(img);\n sky.setAttribute('src', '#texture');\n scene.appendChild(assets);\n scene.appendChild(sky);\n virtualPlaceholder.appendChild(scene);\n\n if(!isExternal)\n window.URL.revokeObjectURL(this.src);\n }\n}", "title": "" }, { "docid": "7eec751f249837609b01fb266cb26a86", "score": "0.594921", "text": "function createImg(id)\r\n\t{\r\n\t\tvar img = document.createElement(\"img\");\r\n\t\timg.setAttribute('alt', 'attention');\r\n\t\timg.setAttribute('width', '20px');\r\n\t\timg.setAttribute('src', 'images/attention!.png');\r\n\t\tdocument.getElementById(id).appendChild(img);\r\n\t}", "title": "" }, { "docid": "c0e7e3228d2940b0df98fb9ca5b81640", "score": "0.594811", "text": "function makeGhost() {\r\n\r\n // returns an object with values scaled {x: 33, y: 21}\r\n let velocity = setToRandom(10);\r\n let position = setToRandom(200);\r\n\r\n // Add image to div id = game\r\n let game = document.getElementById('game');\r\n let ghostimg = document.createElement('img');\r\n ghostimg.style.position = 'absolute';\r\n ghostimg.src = 'redghost.jpg';\r\n ghostimg.width = 150;\r\n ghostimg.style.left = position.x;\r\n ghostimg.style.top = position.y;\r\n game.appendChild(ghostimg); \r\n\r\n // new style of creating an object\r\n return {\r\n position,\r\n velocity,\r\n ghostimg\r\n }\r\n}", "title": "" }, { "docid": "5db660054cd7b420df87a28a5131597b", "score": "0.5943874", "text": "constructor () {\n this.image = new Image()\n this.canvas = document.createElement('canvas')\n this.ctx = this.canvas.getContext('2d')\n this.imageData = null\n this.width = 0\n this.height = 0\n this.src = \"\"\n\n /**\n * see ImageOlive.draw function for details\n */\n this.drawMode = \"top-left\"\n }", "title": "" }, { "docid": "1586136906d8b0e17759ad77ad9567b4", "score": "0.5942275", "text": "function cargaroptiontitle(){\r\n paper.drawImage(optiontitle.imagen,300,0, 650,150)\r\n}", "title": "" }, { "docid": "de7efca6093b3390a00e57d02e1933bd", "score": "0.5941414", "text": "function generateCat() {\n var image = document.createElement('img');\n var div = document.getElementById('flex-cat-gen');\n image.src = \"https://placekitten.com/g/200/300\";\n div.appendChild(image);\n}", "title": "" }, { "docid": "5d01d6903403e2cea72802c572c3b167", "score": "0.59373605", "text": "function nuevaImagen( basepath, name, controlador, controlador_id ){\r\n\r\n\t$.ajax({\r\n\t url: basepath+'index.php?c=jcrop_ajax&m=new_image&controlador='+controlador+'&controlador_id='+controlador_id,\r\n\t context: document.body,\r\n\t beforeSend: function(){\r\n\t\t$(\"#jcrop_\"+name).html('<img src=\"'+basepath+'core/images/ajax-loader.gif\"/>');\r\n\t },\r\n\t error: function(){\r\n\t\t$(\"#jcrop_\"+name).html('<br><span class=\"error\">Ocurrió un error al intentar cargar la imagen.</span>');\r\n\t },\r\n\t success: function(foto_id){\r\n\t\t//cargarImagen( basepath, name, controlador, controlador_id, foto_id );\r\n\t\tcargarUploader( basepath, name, controlador, controlador_id );\r\n\t }\r\n\t});\r\n}", "title": "" }, { "docid": "25b3758f72e6590478cbfb3dc83e7e66", "score": "0.5936741", "text": "function cambiarImagenManual() {\n document.slider.src = imagenes[indiceImagen];\n bolas[indiceBall].appendChild(tilde);\n\n if (indiceImagen < 2) {\n indiceImagen++;\n indiceBall++;\n } else {\n indiceImagen = 0;\n indiceBall = 0;\n }\n clearInterval(intervalo);\n}", "title": "" }, { "docid": "debc66abf31965e8ecbe6d0fcb6a1120", "score": "0.59306943", "text": "function generateCat(){\r\n var image = document.createElement('img');\r\n var div = document.getElementById('flex-cat-gen');\r\n image.src = \"http://thecatapi.com/api/images/get?format=src&type=gif&size=small\";\r\n div.appendChild(image);\r\n}", "title": "" }, { "docid": "84f93e6c1bdc2e30fa0b26bfdbe6dbd8", "score": "0.5924602", "text": "function createImage(name, promo) {\n var image = document.createElement('img');\n\n image.setAttribute('src', 'assets/images/' + promo + '/' + name + '.jpg');\n image.setAttribute('alt', name);\n\n subImagesContainer.appendChild(image);\n }", "title": "" }, { "docid": "797a5f5cc788d233d35fd7d59c2ada29", "score": "0.59217465", "text": "function pintaImagen(src, x, y) {\n // Consigue el canvas\n var canvas = document.getElementById('visor');\n var context = canvas.getContext('2d');\n var base_image = new Image();\n base_image.src = \"./media/images/\"+src;\n base_image.onload = function () {\n // Pinta imagen en el canvas\n context.drawImage(this, x, y);\n }\n}", "title": "" }, { "docid": "797a5f5cc788d233d35fd7d59c2ada29", "score": "0.59217465", "text": "function pintaImagen(src, x, y) {\n // Consigue el canvas\n var canvas = document.getElementById('visor');\n var context = canvas.getContext('2d');\n var base_image = new Image();\n base_image.src = \"./media/images/\"+src;\n base_image.onload = function () {\n // Pinta imagen en el canvas\n context.drawImage(this, x, y);\n }\n}", "title": "" }, { "docid": "24df4aaea036205bcbedbf38260b0814", "score": "0.5917605", "text": "function img_to(nombre,imagen) {\t\n\t//if (ns) {nsdoc=eval(nombre+'.nsdoc'); eval(nsdoc+'.src='+imagen+'.src');}\n\t//else {\n //eval('document.images[\"'+nombre+'\"].src='+imagen+'.src');\n document.images[nombre].src=eval(imagen+\".src\")\n //}\n}", "title": "" }, { "docid": "32ef964ecbd64dee556622fc08d7b691", "score": "0.591409", "text": "function genCat(){\n var div = document.getElementById(\"flex-cat-gen\");\n var img= document.createElement(\"img\");\n img.setAttribute(\"id\",\"genCat\");\n img.src = \"https://media1.tenor.com/images/f6fe8d1d0463f4e51b6367bbecf56a3e/tenor.gif?itemid=6198981\";\n img.alt = \"CAT IMAGE\";\n div.appendChild(img);\n}", "title": "" }, { "docid": "74e90957c29ec7e45cb79e1007a9269a", "score": "0.5913757", "text": "function generateCat(){\n\tvar image = document.createElement('img');\n\tvar div = document.getElementById('other');\n\timage.src = \"img.png\";\n\tdiv.appendChild(image);\n}", "title": "" }, { "docid": "4945681d42c63cbf00b26421d3118d2c", "score": "0.59131485", "text": "function generateNewCat(){\n var img = document.createElement(\"img\");\n img.src = \"https://thecatapi.com/api/images/get?format=src&type=gif&size=small\";\n var div = document.getElementById(\"flex-cat-gen\");\n div.appendChild(img);\n}", "title": "" }, { "docid": "1d4f9233113b6231fad3331b35d003f9", "score": "0.5877946", "text": "crearTablero(img) {\n for (let x = 0; x < this.j; x++) {\n this.board[x] = [];\n for (let y = 0; y < this.i; y++) {\n let posX = x * 100 + 270;\n let posY = y * 100 + 90;\n let space = new Casillero(this.context, posX, posY);\n space.addImage(posX, posY, img);\n this.board[x][y] = space;\n }\n }\n }", "title": "" }, { "docid": "3cdac276c7c00fd379a442e21a3aaba2", "score": "0.5874531", "text": "function draw() {\nvar canvas = document.getElementById('motoCanvas'); \n// canvas with id=\"motoCanvas\"\nif (canvas.getContext) {\n\tvar ctx = canvas.getContext('2d');\n\n\n\tvar img = new Image();\n\timg.onload = function() {\n\t\tctx.drawImage( img, -50, 200, 600, 300 );\n\t} // close img.onload function \n\t\n\t\n\timg.src = 'images/motorcycle.png'; \n\t// src path is relative to the HTML file, NOT to this JS file \n\n\n} // close \"if\"\n\n} // close draw() ", "title": "" }, { "docid": "763af848d5c959d03affc1124b69a163", "score": "0.58699405", "text": "function getImage(tipo,rarita) {\n\n return \"img/\"+tipo.toString()+rarita.toString()+\".jpg\";\n}", "title": "" }, { "docid": "989780a08b2baf58c6b25b59c8d7689f", "score": "0.5848178", "text": "function createImage(data) {\n //create each image element\n var $img = $('<img class=\"flex-img\">');\n if (data !== \"\") {\n //add image\n $img.attr(\"src\", data);\n //clear image search value\n $(\".contextual-choice input\").val(\"\");\n //append to DOM\n $(\".contextual-output\").append($img);\n }\n }", "title": "" }, { "docid": "b9dc36c7ab4e05c2814bfa53f5642bdc", "score": "0.58474165", "text": "function cambiarImagenManual2() {\n document.slider2.src = imagenes2[indiceImagen2];\n bolas2[indiceBall2].appendChild(tilde2);\n\n if (indiceImagen2 < 2) {\n indiceImagen2++;\n indiceBall2++;\n } else {\n indiceImagen2 = 0;\n indiceBall2 = 0;\n }\n}", "title": "" }, { "docid": "247d83c4cf12c980dcfd049af782debb", "score": "0.5840129", "text": "function generateCat() {\n var image = document.createElement('img');\n var div = document.getElementById('flex-cat-gen');\n image.src = \"http://thecatapi.com/api/images/get?format=src&type=gif\";\n div.appendChild(image);\n}", "title": "" }, { "docid": "77e3b6e11a4ffa0ef6b2a900dc680d66", "score": "0.58377373", "text": "function imageInput (imageUrl, canvas){\n // centext is 2 dimentional \n var context = canvas.getContext('2d');\n // new image\n var myImage = getImage();\n // upon image loading \n myImage.onload = function() {\n // positioning and draw the image \n context.drawImage(myImage,0,0);\n }; \n // setting the empty image to an image \n myImage.src = imageUrl;\n}", "title": "" }, { "docid": "0a0ef353665d23fcd55002dc17351af8", "score": "0.58297175", "text": "function Planta(codigo, nombre, alturaMax, precioVenta, imagen) {\n\tthis.codigo = codigo;\n\tthis.nombre = nombre;\n\tthis.alturaMax = alturaMax;\n\tthis.precioVenta = precioVenta;\n\tthis.imagen = new Image(70, 70);\n\tthis.imagen.src = Imagen;\n}", "title": "" }, { "docid": "247314bc77fcbad4a50752daa7fbda5f", "score": "0.5828106", "text": "function cambioFoto(){\n\tvar nuevaFoto = $(\"#mod_imagen_paciente\").val().split(\"\\\\\").pop();\n\t$(\"#muestraImagenActual\").attr(\"src\", \"./images/\" + nuevaFoto);\n}", "title": "" }, { "docid": "0e66edd31c3ac128c43b15d78935dfdf", "score": "0.58261395", "text": "function newImage() {\n document.getElementById('image').src = 'images/bags/bag-4.png';\n}", "title": "" }, { "docid": "a73d54be2ade669fd4576ffa8f196da8", "score": "0.5822023", "text": "function addImage() {\n\t\tvar x = document.createElement(\"IMG\");\n\n\t\tconsole.log(carGame.paddleC.x);\n\t // var img = document.getElementById('tetris_image')\n\t\tx.classList.add('.missle');\n\t\tx.setAttribute(\"src\", \"../images/Missle.png\");\n\t\tx.setAttribute(\"width\", \"50\");\n\t\tx.setAttribute(\"height\", \"50\");\n\t //\tx.style.marginLeft = carGame.paddleC.x+ 'px';\n\t x.style.x = '100px';\n\t\t x.style.position = \"absolute\";\n\t\t console.log(carGame.paddleC.x);\n\n\n\t\tx.setAttribute(\"alt\", \"The Pulpit Rock\");\n\t\tdocument.body.appendChild(x);\n\t\t//document.body.appendChild(domElement);\n\t}", "title": "" }, { "docid": "f567865fae2526784a4457ee1a33a44e", "score": "0.5817068", "text": "function generateCat(){\n var catImage = document.createElement('img');\n let catDiv = document.getElementById('cats');\n catImage.src = '/home/jakub/JavaScript/Challenges/images/cats.png';\n catDiv.appendChild(catImage);\n}", "title": "" }, { "docid": "c994270e48ba7d1828c66c887b985d93", "score": "0.5816447", "text": "function createLogo(image){\r\n console.log('Creating logo')\r\n var logo = document.createElement('img');\r\n logo.src = image;\r\n //add the logo class\r\n logo.classList.add(\"logo\");\r\n getElement().appendChild(logo);\r\n}", "title": "" }, { "docid": "b5661bf61ddb5a7c121f1c64bf9ecb89", "score": "0.5814453", "text": "function mousePressed(){\n //escoge un numero aleatorio entre 0 y el numero de imagenes de cabeza\n var randCabeza = int(random(cabezaImagenes.length))\n //dibujar la imagen que corresponde\n image(cabezaImagenes[randCabeza], 0, 0, width, height/2)\n\n //escoge un numero aleatorio entre 0 y el numero de imagenes de piernas\n var randPierna = int(random(piernaImagenes.length))\n //dibujar la imagen que corresponde\n image(piernaImagenes[randPierna], 0, height/2, width, height/2)\n}", "title": "" }, { "docid": "8f8815565427c6f9f790c2f689d374b2", "score": "0.5813853", "text": "init() {\n // création d'une variable nommé img spécifique à la class (this.)\n this.img;\n // on indique que la variable img est un élément html de type <img >\n this.img = document.createElement(\"IMG\");\n // on indique une source d'image à la variable img\n this.img.src = \"../assets/sprite.gif\";\n // on place notre img dans l'id ImageFondEcran de la page html\n document.querySelector(\"#ImageFondEcran\").appendChild(this.img);\n // on donne à img une propriété css position qui a la valeur fixed\n this.img.style.position = \"fixed\";\n // on donne à img une width qui a la valeur 50 (pixels)\n this.img.width = \"50\";\n // on donne à img une propriété css top qui a la valeur aléatoire entre 0 et 300 : position x de départ du sprite\n this.img.style.top =\n parseInt(Math.floor(Math.random() * Math.floor(300))) + \"px\";\n // on donne à img une propriété css top qui a la valeur aléatoire entre 0 et 300 : position y de départ du sprite\n this.img.style.left =\n parseInt(Math.floor(Math.random() * Math.floor(300))) + \"px\";\n }", "title": "" }, { "docid": "6dd0075369d34fd257a20ad04bdeff9e", "score": "0.581013", "text": "function createImage(imgName, imgUrl){\n // Create Elements\n const imageContainer = document.createElement('div')\n const imageTag = document.createElement('img')\n const deleteImg = document.createElement('span')\n const a = document.createElement('a')\n \n // Set Attributes for delete Btn\n deleteImg.setAttribute('onclick', 'deleteImg(this)')\n deleteImg.innerHTML = '&Cross;'\n deleteImg.className = 'deleteImg'\n\n // Set Attributes for a tag\n a.className = 'link'\n a.href = imgUrl\n\n // Set Attributes for image & image container\n imageTag.title = imgName\n imageTag.src = imgUrl\n imageContainer.className = 'render-image'\n imageContainer.dataset.query = imgName\n\n // Create UI After Image loads \n imageTag.onload = e => {\n closeSpinner()\n renderImageWrap.appendChild(imageContainer)\n imageContainer.appendChild(a)\n a.appendChild(imageTag)\n open_Close_Modal(a)\n imageContainer.appendChild(deleteImg)\n }\n}", "title": "" }, { "docid": "eb2a5329c14e7f72cd32cf34a02dd220", "score": "0.58089775", "text": "function cambiaOn() {\n this.src = this.imagenOn.src;\n\n}", "title": "" }, { "docid": "6c2fe883ca74dd6a79ccd81688e155da", "score": "0.57913524", "text": "async crear({request, response, auth}){\n const data = request.only(['nombre'])\n\n const imagen = request.file('foto', {\n types: ['image'],\n size: '2mb'\n })\n const nombreF = data['nombre'] + \".\" + imagen.extname;\n\n await imagen.move(Helpers.tmpPath('fotosperritos'), {\n name: nombreF,\n overwrite: true\n })\n\n if(! imagen.moved())\n {\n return response.status(422).send({\n res:false,\n message: foto.error()\n })\n }\n//CAMBIO MINIMO\n//otro cambio xd\n const usuario = await auth.getUser()\n const perr = new Perrito()\n perr.nombre = data['nombre']\n perr.foto = nombreF\n perr.path = 'fotosperritos/' + nombreF.toString(),\n perr.due = usuario['id']\n await perr.save()\n return response.created({\n data,due:usuario\n })\n }", "title": "" }, { "docid": "a34b531b55dd4350d214148d4d78f437", "score": "0.5790949", "text": "function setPictureOfMe() {\n index += 1;\n var img = document.createElement('img');\n if (index % 2 === 0) {\n img.setAttribute('src', ['img.jpg']);\n }\n else {\n img.setAttribute('src', ['img1.jpg'])\n }\n img.setAttribute('style', ['width: 300px', 'height: 200px'].join(';'));\n document.body.appendChild(img);\n img.addEventListener('click', removePictureOfMe)\n}", "title": "" }, { "docid": "4267f0174143b4d0c75412a6070dbe81", "score": "0.5790863", "text": "function addPhotoField(){\n //pegar o container de fotos #images\n const container = document.querySelector('#images')\n // pegar o container pra duplicar o .new-image\n const fieldsContainer = document.querySelectorAll('.new-upload')\n // realizar o clone da ultima imagem adicionadas\n const newFieldContainer = fieldsContainer[fieldsContainer.length -1].cloneNode(true) // .length conta quantos tem, o -1 é logica de array\n // impedir de adicionar campo vazio, verificar se está, se sim adicionar ao container de imagens\n const input = newFieldContainer.children[0]\n if (input.value == \"\") {\n //limpar o campo antes de adicionar ao container de imagens\n return //quando uma aplicação encontra um return numa function ela para o resto do codigo\n }\n \n // limpar o campo antes de adicionar o container de imagens/\n input.value=\"\"\n \n \n // depois, adicionar o clone ao container de imagens\n container.appendChild(newFieldContainer)\n }", "title": "" }, { "docid": "acda3a8524171e409c6e92653a77d393", "score": "0.57854617", "text": "function loadimg() {\n\t// c.drawImage(backgrounder, 0, 0, canvas.width, canvas.height);\n\tc.drawImage(mango, center - 380, cent - 190);\n}", "title": "" }, { "docid": "2da8866e97a6328ebb3a03a13842f779", "score": "0.5777289", "text": "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = img.length - 1;\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "a45f1b6785e1426b40da1d4772d1ebfa", "score": "0.57745117", "text": "image(path){\n return new Promise((resolve, reject) => {\n\n const image = new Image();\n image.onload = _ => {\n this.add(\"image\", path.id, image);\n resolve();\n };\n image.src = path.src;\n \n });\n }", "title": "" }, { "docid": "886f1ab0de231745c1a516a28430b396", "score": "0.5773599", "text": "function createFirst() {\n var temp = imageTemplate;\n temp += \"v\" + version[index] + \"/\" + id[index] + \".\" + format[index];\n document.body.style.backgroundImage = \"url(\" + temp + \")\";\n /*$(`<img id=\"image\" src=`+temp+` class=\"image center\">`).appendTo($(\"#Location\"));*/\n //document.getElementById(\"image\").remove();\n //$(`<img id=\"image\" src=`+temp+` class=\"image center\">`).appendTo($(\"#Location\"));\n //setInterval(goRight, 3000);\n}", "title": "" } ]
aae0304ab9d76210445339e68bc339fd
stops the timer that checks for update.
[ { "docid": "857927d867064eb1f84e2cec4ce34dc9", "score": "0.0", "text": "stop() {\n console.log(`Elevator : ${this.id} Stopped.`);\n clearInterval(this.timer);\n }", "title": "" } ]
[ { "docid": "62d84bde64d0ed94a3ae2690b4d3cc87", "score": "0.82744396", "text": "function stop () {\n if (updateTimer) {\n clearInterval(updateTimer)\n }\n }", "title": "" }, { "docid": "44f74f5879da0b4fd0e6e9b55165b063", "score": "0.78525037", "text": "stopUpdateTime() {\n clearInterval(timeInterval);\n }", "title": "" }, { "docid": "1679487c12c1040cc5b782fa52a2108a", "score": "0.78012335", "text": "function stop() {\n\tclearTimeout(updating);\n}", "title": "" }, { "docid": "dc14af865935649d3d570690741176d6", "score": "0.7778622", "text": "function stopTimer() {\n clearInterval(timer);\n timer = null;\n update = 0;\n $(\"#update\").html(update);\n }// end inner function stopTimer", "title": "" }, { "docid": "509cfd517639b63ba680189529e332d2", "score": "0.77571183", "text": "stop() {\r\n\t\tthis.timer.force_stop();\r\n\t}", "title": "" }, { "docid": "2555312fd3396e95ebd5268a9d799f18", "score": "0.7628504", "text": "function stop() {\n\t// Stop updating\n\tclearTimeout(updating);\n}", "title": "" }, { "docid": "6b880f3c2f7b0acc0ce3a03c738421ae", "score": "0.7603941", "text": "function stopTimer() {\n secondsElapsed = 0;\n setTime();\n renderTime();\n }", "title": "" }, { "docid": "8795098c0db4a272e757b1fef78314e4", "score": "0.7563666", "text": "stopWatchingTime () {\n window.clearInterval(this.timeUpdateId)\n }", "title": "" }, { "docid": "38f0d58e1ca3153761b87e2444c5ea6a", "score": "0.7411763", "text": "function stopTimer(){\r\n\r\n \tclearInterval(newTime);\r\n\r\n }", "title": "" }, { "docid": "642c717771b7f4bc31dae2b4e8f856f2", "score": "0.7364637", "text": "function stop_timer() {\n clearTimeout(timeout);\n time_on = 0;\n }", "title": "" }, { "docid": "24480913d3c463cb0af5027d8b7c2b43", "score": "0.73604375", "text": "function stopTimer() {\n\n secondsElapsed = 0\n\n setTime()\n renderTime()\n}", "title": "" }, { "docid": "4ea51c257cd294eb652143a8220c4776", "score": "0.73408204", "text": "$_stopTimer () {\n\t\t\tif (this.$_timer) {\n\t\t\t\tclearInterval(this.$_timer)\n\t\t\t\tthis.$_timer = null\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d54b6ca96f185dca0650e7e95f25fbb7", "score": "0.73288876", "text": "function stop() {\n\n clearInterval(timer);\n clockRunning = false;\n }", "title": "" }, { "docid": "7c1aed67c60e6e3a0c3e2ea25356a9dd", "score": "0.72962976", "text": "function stop() {\n stopTimer();\n resetCounters();\n dispatchEvent('stopped');\n }", "title": "" }, { "docid": "bf40d99f4f25aed9348e90f9ed6f9eb9", "score": "0.72786796", "text": "function stopTimer() {\n time = 0;\n if (timer) {\n clearInterval(timer);\n }\n }", "title": "" }, { "docid": "9372f6df992293fac4ec228f30c1c770", "score": "0.72766894", "text": "stopTimer () {\n clearInterval(this._interval)\n this.timeUsed += this.totalTime - this.countdown\n }", "title": "" }, { "docid": "be0449607ac3b9d132d53f3df903a700", "score": "0.7274373", "text": "function stopTimer() {\n clearInterval(timecount);\n }", "title": "" }, { "docid": "b86311e004501fcb2544abe4c84ae9eb", "score": "0.7268811", "text": "stopTimer() {\n if (this.start) {\n this.totalTime = new Date().getTime() - this.start;\n }\n }", "title": "" }, { "docid": "59d3cd788d798e9ef68e10a81a180604", "score": "0.72627944", "text": "function stopTime() {\n timerRun = false;\n clearInterval(intervalId);\n\n\n }", "title": "" }, { "docid": "5c33d6c1e5e1f1b1799c6f179ca08655", "score": "0.7235796", "text": "cancelTimer_() {\n this.consecutiveUpdates = 0;\n\n if (this.timer_) {\n this.logger_('cancelTimer_');\n clearTimeout(this.timer_);\n }\n\n this.timer_ = null;\n }", "title": "" }, { "docid": "5835226acbd6fa61882a3991a9982a64", "score": "0.7203088", "text": "function stop() {\n if (timer) {\n // Stop timer\n clearInterval(timer);\n timer = null;\n lastTick = 0;\n }\n }", "title": "" }, { "docid": "aa51f99da7e91271c89350601234c447", "score": "0.71788436", "text": "function stopTimer(){\n\t\tif(timerIntervalFunction != undefined){\n\t\t\tclearInterval(timerIntervalFunction);\n\t\t\ttimerIntervalFunction = undefined;\t\n\t\t}\n\t\t\n\t\tupdateModalTime(timeRun);\n\t\tconsole.log(\"time passed: \"+timeRun);\n\t}", "title": "" }, { "docid": "4a16e0572323b80663e1aaba0034457b", "score": "0.7123719", "text": "_updateTimeChanged(){\n Mainloop.source_remove(this._timeoutId);\n this._addTimer();\n }", "title": "" }, { "docid": "7ce706b7df6dff3279744eae6b4cd2cf", "score": "0.71150064", "text": "function stopTimer() {\n clearInterval(timer);\n }", "title": "" }, { "docid": "f7e2eefbf3fd0af11820fd47adceba7a", "score": "0.71147335", "text": "function stopTimer(){\n\tclearInterval(timerIntervalId);\n\tsetElapsedTime();\n}", "title": "" }, { "docid": "29d00c7cc98c8a782c9ab6cbeaea4542", "score": "0.710066", "text": "function stop() {\n\n\t//lets me know that the timer is stopping\n\tconsole.log(\"stopping\");\n\tclearInterval(intervalId);\n}", "title": "" }, { "docid": "f4de5d764493c83f7eabfbff6da09eb7", "score": "0.70908177", "text": "function refresh_timer(){\n\t\tif(!stop){\n\t\t\ttimerCounter--;\n\t\t\ttimertext.setText(timerCounter);\n\n\t\t\tif(timerCounter<=0 ){\n\t\t\t\t\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "22f6ce93ca837fada2062f9c7a51d4a9", "score": "0.7055643", "text": "function stop() {\n clearInterval(time);\n }", "title": "" }, { "docid": "70ff70763f148736cdfec105615288ef", "score": "0.70554346", "text": "function stopTimer() {\n interval = clearInterval(interval);\n }", "title": "" }, { "docid": "c78278d66fc3002e513c35b3450fe50c", "score": "0.70076144", "text": "async stopWatch() {\n if(this.observeIntervalObject) {\n clearInterval(this.observeIntervalObject);\n this.observeIntervalObject = null;\n await Utils.sleep(this.observeInterval);\n await this.update();\n }\n }", "title": "" }, { "docid": "6a2a15c50681b7e99882a5cdc35fc65a", "score": "0.70009387", "text": "stopTimer() {\n if (this.timer != null) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n }", "title": "" }, { "docid": "722336889ed17c53ffac0203c6051bb7", "score": "0.6999236", "text": "stopTimer() {\n clearInterval(this.internalTimer);\n }", "title": "" }, { "docid": "d42091e4c28207fbe6f02c26cebf2e08", "score": "0.6987941", "text": "function stop() {\n clearInterval(countDown);\n clockRunning = false;\n number = 30;\n }", "title": "" }, { "docid": "9f9647c6e1f54a43c434ec400c8b9f31", "score": "0.69865525", "text": "function stopTimer() {\r\n\t\t\tassert(timer.timing);\r\n timer.timing = false;\r\n timer.timerStop = new Date().getTime();\r\n\r\n timer.pendingTime = true;\r\n\t\t\tfunction fireNewTime() {\r\n\t\t\t\ttimer.stopRender(); // this will cause a redraw()\r\n\t\t\t\ttimer.fireNewTime();\r\n\t\t\t}\r\n\t\t\tif(that.HTML5_FULLSCREEN && that.isFullscreenWhileTiming()) {\r\n\t\t\t\tdocument.cancelFullScreen();\r\n\t\t\t\t// Apparently the page is still resizing when we fire the new time\r\n\t\t\t\t// right after cancelling fullscreen. This screws up scrollling to the\r\n\t\t\t\t// bottom of the times table, unless we wait for a moment first.\r\n\t\t\t\tsetTimeout(fireNewTime, 100);\r\n\t\t\t} else {\r\n\t\t\t\tfireNewTime();\r\n\t\t\t}\r\n }", "title": "" }, { "docid": "fe14f57c0242481421eedca858bda809", "score": "0.69816285", "text": "function stopTimer() {\r\n if (stoptime == false) {\r\n stoptime = true;\r\n }\r\n}", "title": "" }, { "docid": "39ada19c1dbdf4d5717588631e29c983", "score": "0.6981184", "text": "function stopTime() {\n clearInterval(timer);\n}", "title": "" }, { "docid": "ad4124de8865905dbb91358f94b83ff0", "score": "0.69763786", "text": "function _stopTimer() {\n\n\tif ($._progressTimer) {\n\n\t\tclearInterval($._progressTimer);\n\n\t\t$._progressTimer = null;\n\t}\n\n}", "title": "" }, { "docid": "ed52f963c902c428dfc6dac43da26a37", "score": "0.6975336", "text": "function stopTime() {\n clearInterval(timerInterval);\n }", "title": "" }, { "docid": "01f0d222a95c0e6b5b0240acc5ce48cf", "score": "0.6937111", "text": "stopUpdateSignal() {\n clearInterval(signalInterval);\n }", "title": "" }, { "docid": "bbc52ac8760f18c5e536ce626a4ed19c", "score": "0.6907341", "text": "stop () {\n if (this.timer) {\n this.timer.stop()\n }\n }", "title": "" }, { "docid": "173f03366fe7e4206da55b298f0f5602", "score": "0.69054973", "text": "stop() {\n if (this.timeout) {\n window.gameController.game_clear_timeout(this.timeout);\n }\n }", "title": "" }, { "docid": "933e19540f16d1aa1dee86abe68e659a", "score": "0.6892665", "text": "function timestop(){\r\n clearInterval(timerr);\r\n timerr = null ;\r\n}", "title": "" }, { "docid": "cb71c93406a4f4db8ca00bee45d4a8bb", "score": "0.6880597", "text": "function stopTimer() {\n isTimer = false;\n clearInterval(timeInterval);\n}", "title": "" }, { "docid": "499d848003e7f29ae105ce388d35c05a", "score": "0.6879326", "text": "function stopCountdown() {\n \n }", "title": "" }, { "docid": "48c75f2686ce0ef517f7b2f119d5f476", "score": "0.68779194", "text": "function stopTimer() {\n clearInterval(currentTime);\n}", "title": "" }, { "docid": "e49860a7f534eb41857df50b605db8e8", "score": "0.68583417", "text": "function stopTimer() {\n clearTimeout(t);\n}", "title": "" }, { "docid": "58b0697d21b6d3bbd7dbad628bb2162c", "score": "0.6856434", "text": "stopTimer() {\n clearInterval(this.timer);\n this.timer = undefined;\n }", "title": "" }, { "docid": "e24bab24948cef25c14861e11b8240a1", "score": "0.6842641", "text": "function stopCountdown() {\n if (timeoutRef) {\n clearTimeout(timeoutRef);\n timeoutRef = null;\n debug('countdown stopped');\n }\n }", "title": "" }, { "docid": "c365ecbf4d64e67b85ea17c8cea26690", "score": "0.6829888", "text": "function stop() {\n total = getTime();\n running = false;\n paused = true;\n}", "title": "" }, { "docid": "f74353b8830e7b3a51024f6d0b2f62b2", "score": "0.6809324", "text": "function stop() {\n\n clearInterval(timerInterval);\n\n }", "title": "" }, { "docid": "f84e9ed5b5d459a790099dedc2c327f2", "score": "0.6807449", "text": "stop() {\n\t\tthis._stopped = true;\n\t\tthis.heartbeatTimer.enabled = false;\n\t}", "title": "" }, { "docid": "2e7e243c4aeca0e40f3f7f6201c44248", "score": "0.68061066", "text": "function stopTimer() {\n clearInterval(timer);\n time = 0;\n printTimer();\n}", "title": "" }, { "docid": "2ada4fc63ae371454749a57cc1343554", "score": "0.67982846", "text": "function stopTimer() {\n clearInterval(timer);\n}", "title": "" }, { "docid": "cdf7907b30b9f14de6e36ae0c1a58445", "score": "0.67971814", "text": "function deactivate() {\n\ttimer && clearInterval(timer);\n}", "title": "" }, { "docid": "27f514525672c2fb0fb1c199d4f32f76", "score": "0.6796777", "text": "EndTimer() {\n this.Timer = 0;\n }", "title": "" }, { "docid": "2b96ff693c0590888c27a4828988ab17", "score": "0.67957497", "text": "stop(){\n try{\n clearTimeout(this.timer);\n }catch(error){\n console.error(error);\n }\n this.status = moleStatus.ASLEEP;\n }", "title": "" }, { "docid": "1bc294602b35c24d78045c5d632dbc59", "score": "0.6791896", "text": "function stopCountdownTimer() {\n timeRemaining = stopTime - Date.now();\n if (countdownTicker !== 0) {\n clearInterval(countdownTicker);\n countdownTicker = 0;\n }\n }", "title": "" }, { "docid": "3565fd632ee61adf7a0e4549fd83dd8c", "score": "0.67907375", "text": "function stopTimer() {\n clearInterval(timer);\n seconds = 0;\n minutes = 0;\n}", "title": "" }, { "docid": "fc8dc1b14b22b9e2d42bb43868ef4104", "score": "0.67836696", "text": "function stopTimer() {\n clearInterval(timer);\n timer = false;\n}", "title": "" }, { "docid": "cc43e027c1eb8bead721dc0d090577d0", "score": "0.6778116", "text": "function stopTiming() {\n clearInterval(timing);\n}", "title": "" }, { "docid": "1554f3a060f5de03a26b6af3eb71da27", "score": "0.6774775", "text": "function stopTime() {\n\n //clears \"timeCounter\" interval.\n clearInterval(timeCounter);\n }", "title": "" }, { "docid": "f5f1d5caf09001a137438efad0f1714d", "score": "0.677385", "text": "function stopTimer() {\n\tchangeStatus(\"stop\");\n\t// Reset controls\n\t$('#stop-button').hide();\n\t$('.pause-panel').hide();\n\t$('#start-button').show();\n\t$('#resume-button').hide();\n\t$('#pause-button').show();\n\t$('.gif-panel').slideUp();\n\t// Reset stretch player\n\t$($currStretch).removeClass('active');\n\tclearInterval(timer);\n\tclearInterval(stretchPlayer);\n\tcurrTime = 0;\n\tstretchTime = 0;\n\tdisplayTime(localStorage.getItem(\"interval\"));\n}", "title": "" }, { "docid": "847856a3081c542030f9379637c48c8b", "score": "0.67662895", "text": "stop() {\n this.leftTime = 0;\n this.requestTime = 0;\n }", "title": "" }, { "docid": "38e9165f0626d90edc430ca7077ba026", "score": "0.676366", "text": "pause() { this._stopTimer(); }", "title": "" }, { "docid": "2263bf482971104d7d0beed2350cb917", "score": "0.67627716", "text": "stop() {\n\t\tif (this._state !== STATE_IDLE) {\n\t\t\tthis._state = STATE_IDLE;\n\t\t\tthis._timerQueue.length = 0;\n\t\t\tthis._editor.setOption('readOnly', false);\n\t\t\tthis.trigger('stop');\n\t\t}\n\t}", "title": "" }, { "docid": "5f36d7aac15606ffe6866b8ee49283bb", "score": "0.67562366", "text": "function stopPolling() {\n _pollingEnabled = false; //when timer fires, if disabled then is simply ignored in pollIt function and not reset\n}", "title": "" }, { "docid": "0473324a4e856961b25c60d79d79624d", "score": "0.67560035", "text": "function endTimer() {\n\t\tclearInterval(timer);\n\t}", "title": "" }, { "docid": "0da05c136a95dc0c6a802a45f3356ba0", "score": "0.67534477", "text": "function stopTimer() {\n clearInterval(timer);\n}", "title": "" }, { "docid": "c51b3055fb480da29479784c8deb1a89", "score": "0.67528236", "text": "function killTimeBonusTimer() {\n\t\tclearInterval(timeBonusTimer);\n\t}", "title": "" }, { "docid": "02ad1675dd418b76368afe424b74f8a8", "score": "0.6745679", "text": "stopTimer() {\n clearInterval(this.intervalTimer);\n this.intervalTimer = null;\n }", "title": "" }, { "docid": "8a30d0ef386f6cfcd6727ea22b348add", "score": "0.67402023", "text": "function stopTimer(){\r\n if(stopTime == false){\r\n stopTime = true;\r\n }\r\n}", "title": "" }, { "docid": "85fe07b5ac765f36a450d6dd006381ad", "score": "0.6732092", "text": "function stopTimer() {\r\n clearInterval(gTimerInetrval);\r\n gTimerInetrval = 0;\r\n resetTimer();\r\n}", "title": "" }, { "docid": "cda7e02cdb519ea57f650b50e1e934d3", "score": "0.67256176", "text": "function stopTimer(){\n clearInterval(intervalID);\n clockRunning = false;\n}", "title": "" }, { "docid": "62b5836a2905553a9fdacb8055753d60", "score": "0.6719077", "text": "function stop_timer() {\n clearInterval(timer_id);\n}", "title": "" }, { "docid": "4f0cadc5ec9d0902a66b6a50f111f476", "score": "0.6718091", "text": "updateAndStop() {\n this.onStop(true);\n }", "title": "" }, { "docid": "604e408917c9af044bbfed8bcaf21ec9", "score": "0.6712299", "text": "stopScrolly() {\n if(this.timer) clearInterval(this.timer);\n }", "title": "" }, { "docid": "e1b72c61f4e10e1dc95b0c04bce7f686", "score": "0.6710725", "text": "function stopTimer(){\n\tclearInterval(timeInterval);\n}", "title": "" }, { "docid": "a5b11645727bfecb59bbff251b67b433", "score": "0.67066824", "text": "function stop() {\n clearInterval(timer);\n}", "title": "" }, { "docid": "a5b11645727bfecb59bbff251b67b433", "score": "0.67066824", "text": "function stop() {\n clearInterval(timer);\n}", "title": "" }, { "docid": "a094ea73d6b9caac6cc0c710f8d18d48", "score": "0.6703847", "text": "function stopTimer()\r\n{\r\n if (w) {\r\n w.terminate();\r\n timerStart = true;\r\n w = null;\r\n }\r\n}", "title": "" }, { "docid": "daecbf4de1bed05beae1b9a6555db97e", "score": "0.668787", "text": "function timerStop() {\n\t\tclearInterval(guessTimer);\n\t}", "title": "" }, { "docid": "66e10f67a7c02aaab11c9fa29f407939", "score": "0.66715074", "text": "function stop() {\n\t\n\tclearInterval(intervalId);\n\n\tconsole.log(\"Timer stopped\");\n}", "title": "" }, { "docid": "7bc7948a1c32a216c2715b979e2196c3", "score": "0.6662173", "text": "stop() {\n //Jump the animationto the final state by adding a day to the current time.\n this._triggerFrameAnimation(performance.now() + 1000 * 60 * 60 * 24);\n this._start = null;\n }", "title": "" }, { "docid": "de11f4d442ca36b7e3e685d90cb84958", "score": "0.66619754", "text": "function stop() {\n running = false;\n clearTimeout(timer);\n previousTime = (new Date).getTime() - startTime;\n startTime = null;\n startStopBtn.innerHTML = \"start\";\n resetLapBtn.innerHTML = \"reset\";\n resetLapBtn.dataset.action = \"reset\";\n resetLapBtn.classList.remove(\"stopwatch-header__btn_green\");\n resetLapBtn.classList.add(\"stopwatch-header__btn_red\");\n }", "title": "" }, { "docid": "42f5ef7186554ee3a37b4b2346b60c1c", "score": "0.6658846", "text": "stopUpdating() { // probably wouldn't write something like this normally\n this.unbind();\n }", "title": "" }, { "docid": "d60b1e49383c4a3e298e855f8eb96531", "score": "0.6643929", "text": "function stopCountDown() {\n clearInterval(intervalId);\n allottedTime = 10;\n }", "title": "" }, { "docid": "5bb4f2365b1d2cc1af48a8e306915566", "score": "0.66381586", "text": "function stopTimer() {\n moreFocusButton.disabled = false;\n lessFocusButton.disabled = false;\n moreBreakButton.disabled = false;\n lessBreakButton.disabled = false;\n clearInterval(timer);\n }", "title": "" }, { "docid": "8be0114f1757d7407161995dd051edbe", "score": "0.6623536", "text": "function stopTimer() {\n if (timer.running) {\n storeTimer();\n timer.running = false;\n chrome.browserAction.setBadgeBackgroundColor({color: \"#AAAAAA\"}); // Grey\n clearInterval(timer.interval);\n }\n}", "title": "" }, { "docid": "b80637eb5e72342ac9000e7201fc11a9", "score": "0.6612125", "text": "function breakTimerUIUpdate() {\n timerDisplay();\n }", "title": "" }, { "docid": "b30aa3ddcbcd92a977111adbcd1fd7f4", "score": "0.6610851", "text": "function stopTime() {\n window.clearInterval(mainTimer);\n window.clearInterval(lapTimer);\n hide(stopButton);\n show(resetButton);\n hide(lapButton);\n show(resumeButton);\n}", "title": "" }, { "docid": "0fa7be498e3137ee344e5c802885b7b2", "score": "0.66048014", "text": "function stopWatch() {\n // If the count down is finished, write some text \n var timerInterval = setInterval(function () {\n timer--;\n timeEl.textContent = timer;\n if (timer <= 0) {\n clearInterval(timerInterval);\n endGame();\n\n }\n }, 1000);\n}", "title": "" }, { "docid": "68046ef380bee612baf9d25c1e700dfb", "score": "0.6600315", "text": "function stopTimer() {\n clearInterval(timeStart); \n timeStart = '';\n}", "title": "" }, { "docid": "7fee708e2a3a26511a8e255b931b434e", "score": "0.65949684", "text": "function stop() {\n\n clearTimeout(timer);\n}", "title": "" }, { "docid": "de64661021096fce2ba6dc5aca82169f", "score": "0.65938205", "text": "function runTimer() {\n timeChange = setInterval(decrement, 1000);\n }", "title": "" }, { "docid": "f3c59b682998f771deaf23b17fe41508", "score": "0.6592501", "text": "function stop(){\n clearInterval(interval);\n second = 0;\n minute = 0;\n hour = 0;\n}", "title": "" }, { "docid": "3f35a5213582241b8a3d1f0ab9fac29f", "score": "0.6592251", "text": "stopWatch()\n {\n this.t += this.t_s;\n\n this.t_mil += 5;\n if(this.t_mil > 95){\n this.t_mil = 0;\n this.t_sec ++;\n if(this.t_sec >= 60){\n this.t_sec = 0;\n this.t_min ++;\n }\n }\n\n this.clock.html((this.t_min ? (this.t_min > 9 ? this.t_min : '0'+t_min) : '00') + ':' + (this.t_sec ? (this.t_sec > 9 ? this.t_sec : '0'+this.t_sec) : '00') + ':' + (this.t_mil ? (this.t_mil > 5 ? this.t_mil : '0'+this.t_mil) : '00'));\n }", "title": "" }, { "docid": "602d3811473a25648a1ae47c458bddce", "score": "0.65897346", "text": "function stopTimer() {\n window.clearTimeout(timerId);\n isPaused = true;\n timerId = -1;\n }", "title": "" }, { "docid": "717d1defb6d36d53e6b6549456811a86", "score": "0.6589005", "text": "function stopTimer() {\n clearInterval(intervalId);\n keepScore();\n}", "title": "" }, { "docid": "7da5e2daefb1f24eb6fcbfcab6401180", "score": "0.657239", "text": "function stopTimer () {\n timerRunning = false;\n clearInterval(guessInterval);\n}", "title": "" }, { "docid": "8d5130023f815f7d5d4bfbb1efe93d59", "score": "0.65712774", "text": "function stop() {\n\n clearInterval(intervalId)\n console.log(\"stopped\")\n // update HTML with final numbers of game. stop timer. \n // if (gameData.endGame) {\n // $('.gameJumbo').empty()\n // } \n }", "title": "" }, { "docid": "ede4011276f82e1639ae2fb9d001e077", "score": "0.65666133", "text": "function resetTimer(){\n\n clearInterval(timerId);\n timerDisplay.html(\"Stop Watch\");\n seconds = 0;\n\n}", "title": "" } ]
52073b48d79ae033a90b6a76906dafd8
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
[ { "docid": "136117fa7e3823dc6aa76ecf2e24ebee", "score": "0.0", "text": "function shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}", "title": "" } ]
[ { "docid": "119ce444b94eb3fc782b58dd7f7c9388", "score": "0.6679366", "text": "function equalForKeys(a, b, keys) {\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n }\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n }\n return true;\n }", "title": "" }, { "docid": "e8e3e5b52552b2b5fc1f9b47b22b9696", "score": "0.65826035", "text": "function vaildateKeys(obj, expectedKeys) {\r\n\r\n //console.log(Object.entries(obj));\r\n //console.log(typeof expectedKeys);\r\n \r\n for (let i=0; i < expectedKeys.length; i++) {\r\n if(!obj.hasOwnProperty(expectedKeys[i])){\r\n \r\n return false;\r\n }\r\n }\r\n if(Object.keys(obj).length != expectedKeys.length){\r\n \r\n return false;\r\n }\r\n return true;\r\n \r\n // if(Object.keys(obj) == expectedKeys){\r\n // return true;\r\n // } else{\r\n // return false;\r\n // }\r\n \r\n}", "title": "" }, { "docid": "8a0f49942f79ffcebde2d7b9f30b89b1", "score": "0.658074", "text": "function equals() {\n for (var index = 0, length = arguments.length; index < length - 1;) {\n // Apply the comparison function left-to-right until all the provided\n // arguments have been consumed.\n if (!eq(arguments[index], arguments[index += 1], [])) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "3fb404b2d34cdb17b8923d1e471c99f9", "score": "0.646508", "text": "objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n }", "title": "" }, { "docid": "956d68ffabcd25736db0d0ad9972e77f", "score": "0.6364313", "text": "function checkKeysAreDiff(keys_data) {\n for (let i = 0; i < keys_data.length; i++) {\n for (let j = 0; j < keys_data.length; j++) {\n if( i!=j && keys_data[i].value == keys_data[j].value)\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "173a74ceb2fec38df939df00f2f0058c", "score": "0.628458", "text": "function eqObjects(object1, object2){\n //if the length of object1 is equal to the length of object2\n if (Object.keys(object1).length === Object.keys(object2).length){\n //loop through object keys\n for(let key of Object.keys(object1) ){\n //compare both objects values for the key\n if(Array.isArray(object1[key]) && Array.isArray(object2[key])){\n //implement eqArrays function to support array value comparisons\n if (!eqArrays(object1[key],object2[key])){\n return false; \n }\n }\n \n }\n return true;\n }\n return false; \n}", "title": "" }, { "docid": "ed769bcefd4a181af62831f84ab194d7", "score": "0.6212661", "text": "function objectEq(prev, next) {\n var prevKeys = Object.keys(prev || {}),\n nextKeys = Object.keys(next || {});\n\n if (prevKeys.length !== nextKeys.length) {\n return false;\n }\n\n return nextKeys.every(function(key) {\n return prev[key] === next[key];\n });\n}", "title": "" }, { "docid": "1a562d955bcd090212c81b6df65f9bcf", "score": "0.6199998", "text": "function _equal(thing1, thing2) {\n\t\tif(typeof thing1 == typeof thing2) {\n\t \tif(typeof thing1 != \"object\") { // its a simple object\n\t return thing1 == thing2;\n\t } else {\n\t if(thing1 && (thing1.length !== undefined)) {\n\t \t if(thing1.length == thing2.length) {\n\t for(var i = 0, iL = thing1.length; i < iL; i++) {\n\t if(!_equal(thing1[i], thing2[i])) { \n\t return false;\n\t }\n\t } \n\t return true;\n\t } \n\t } else {\n\t // compare key values in each object\n\t for(var key in thing1) {\n\t if(!_equal(thing1[key], thing2[key])) { \n\t return false;\n\t }\n\t }\n\t // make sure have the same amount of keys\n\t var l1 = 0;\n\t var l2 = 0;\n\t for(var key in thing1) {\n\t l1++;\n\t }\n\t for(var key in thing2) {\n\t l2++;\n\t }\n\t return l1 == l2;\n\t }\n\t }\n\t }\n\t return false;\n\t}", "title": "" }, { "docid": "a3bbbbb8ed03dc0b73e10c66b2eba42b", "score": "0.615542", "text": "function objEquals(obj1, obj2)\r\n{\r\n //get the key arrays of both objects\r\n let keys1 = Object.keys(obj1);\r\n let keys2 = Object.keys(obj2);\r\n\r\n //objects must have the same number of properties\r\n if(keys1.length !== keys2.length)\r\n {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < keys1.length; i++)\r\n {\r\n //all properties must be the same\r\n if(keys1[i] !== keys2[i])\r\n {\r\n return false;\r\n }\r\n //the values of all properties must be the same\r\n if(JSON.stringify(obj1[keys1[i]]) !== JSON.stringify(obj2[keys2[i]]))\r\n {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "8be74aa635cc20a7bffad26cb00a49ec", "score": "0.6138265", "text": "function hasSamePair(object_1, object_2){\n for (var key_i in object_1){\n for (var key_j in object_2){\n \n if ((key_j == key_i) && (object_1[key_i] == object_2[key_j])) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "c8634e465f8702f34cf0a82e98ed5943", "score": "0.6120278", "text": "function setsEqual(a, b) {\n var ka = Object.keys(a).sort();\n var kb = Object.keys(b).sort();\n if (ka.length != kb.length) {\n return false;\n }\n for (var i in ka) {\n if (kb[i] != ka[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "0b958fb38a86a3bf7ec783a883c1b240", "score": "0.60805875", "text": "function mapsAreEqual(inputKeys, inputMap, outputMap) {\n const outputKeys = Object.keys(outputMap);\n if (inputKeys.length !== outputKeys.length) {\n return true;\n }\n for (let i = 0, n = inputKeys.length; i <= n; i++) {\n let key = inputKeys[i];\n if (key !== outputKeys[i] || inputMap[key] !== outputMap[key]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "7d2d059230a6aff097ee71a1e941df79", "score": "0.60461766", "text": "function verifyAllKeysAreSet(obj,arr) {\n var valueAreSet = false;\n var objProperties = Object.getOwnPropertyNames(obj);\n objProperties = objProperties.sort();\n arr = arr.sort();\n return objProperties.toString() === arr.toString();\n\n}", "title": "" }, { "docid": "dbbf4763ccf40f54503be8e052f966da", "score": "0.60249335", "text": "function objectEquals(x, y) {\n if (typeof(x) === 'number') {\n x = x.toString();\n }\n if (typeof(y) === 'number') {\n y = y.toString();\n }\n if (typeof(x) != typeof(y)) {\n return false;\n }\n\n if (Array.isArray(x) || Array.isArray(y)) {\n return x.toString() === y.toString();\n }\n\n if (x === null && y === null) {\n return true;\n }\n\n if (typeof(x) === 'object' && x !== null) {\n x_keys = Object.keys(x);\n y_keys = Object.keys(y);\n if (x_keys.sort().toString() !== y_keys.sort().toString()) {\n console.error('Object do not have the same keys: ' +\n x_keys.sort().toString() + ' vs ' +\n y_keys.sort().toString()\n );\n return false;\n }\n equals = true;\n for (key of x_keys) {\n equals &= objectEquals(x[key], y[key]);\n }\n return equals;\n }\n return x.toString() === y.toString();\n }", "title": "" }, { "docid": "c776cab96dad84a17441a5a0d5462a0c", "score": "0.6022403", "text": "function mapsAreEqual(inputKeys, inputMap, outputMap) {\n var outputKeys = Object.keys(outputMap);\n if (inputKeys.length !== outputKeys.length) {\n return true;\n }\n for (var i = 0, n = inputKeys.length; i <= n; i++) {\n var key = inputKeys[i];\n if (key !== outputKeys[i] || inputMap[key] !== outputMap[key]) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "781fe94a1d7cd2e73a3c2223ee4b9f82", "score": "0.60127115", "text": "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.keys(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3['return']) {\n _iterator3['return']();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return true;\n }\n return a === b;\n}", "title": "" }, { "docid": "781fe94a1d7cd2e73a3c2223ee4b9f82", "score": "0.60127115", "text": "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.keys(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3['return']) {\n _iterator3['return']();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return true;\n }\n return a === b;\n}", "title": "" }, { "docid": "b59ff68f927c6c2b5ac3ea15b554400e", "score": "0.6009599", "text": "function key_value_match(object1, object2) {\n\tvar keys = Object.keys(object1);\n\tvar keys2 = Object.keys(object2);\n\tfor (var i = 0; keys.length > i; i++) {\n\t\tif (object1[keys[i]] == object2[keys[i]]) {\n\t\t\treturn console.log(true)\n\t\t}\n\t}\n\tconsole.log(false)\n}", "title": "" }, { "docid": "9888076302d37be2d96fc1b6e4672500", "score": "0.60039103", "text": "function objectEq(a, b) {\n var akeys = Object.keys(a),\n bkeys = Object.keys(b),\n r;\n\n if (akeys.length !== bkeys.length) {\n return false;\n }\n\n r = true;\n\n detectRecursion(a, b, function () {\n var i, len, key;\n\n for (i = 0, len = akeys.length; i < len; i++) {\n key = akeys[i];\n if (!b.hasOwnProperty(key)) {\n r = false;break;\n }\n if (!eq(a[key], b[key])) {\n r = false;break;\n }\n }\n });\n\n return r;\n}", "title": "" }, { "docid": "caa346efce38ea5466321cd791609054", "score": "0.59717447", "text": "function matchObjects(object1, object2) {\n\tfor (var key in object1) {\n\t\tif (object2[key] == object1[key]) {\n\t\t\tconsole.log(\"Do these two objects share a key-value pair?\");\n\t\t\treturn true;\n\t\t}\n\t}\n\tconsole.log(\"Do these two objects share a key-value pairs?\");\n\treturn false;\n\n}", "title": "" }, { "docid": "1fad2dd6f0fac8e8016c8cd416a41b97", "score": "0.59531426", "text": "function isEqual(dict, other) {\n var dictKeys = keys(dict);\n var otherKeys = keys(other);\n\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n\n var _iterator7 = _createForOfIteratorHelper(dictKeys),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var key = _step7.value;\n\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n\n return true;\n }", "title": "" }, { "docid": "12aceb13d45ae6351680104b6a681d29", "score": "0.5950513", "text": "function compareObjects(left, right) {\n var left_keys = Object.keys(left);\n var right_keys = Object.keys(right);\n if (!compareArrays(left_keys, right_keys)) {\n return false;\n }return left_keys.every(function (key) {\n return compare(left[key], right[key]);\n });\n}", "title": "" }, { "docid": "5c979eed190afccb7500a3801bc4107b", "score": "0.59459823", "text": "function keyValueMatch(object1, object2) {\n\n\tvar tally = [];\n\n\tfor (var i = 0; i < Object.keys(object1).length; i++) {\n\n\t\tif (Object.keys(object1)[i] != Object.keys(object2)[i]) {\n\t\t\ttally.push(\"false\");\n\t\t} else {\n\t\t\tif (Object.values(object1)[i] == Object.values(object2)[i]) {\n\t\t\t\ttally.push(\"true\");\n\t\t\t} else {\n\t\t\t\ttally.push(\"false\");\n\t\t\t}\n\t\t} \n\t}\n\n\t\tif (tally.includes(\"true\")) {\n\t\t\tconsole.log(\"true\");\n\t\t\treturn true\n\t\t} else {\n\t\t\tconsole.log(\"false\");\n\t\t\treturn false\n\t\t} \n\t\t}", "title": "" }, { "docid": "d52f56844c2cafd38d98f9a57f3cdbbb", "score": "0.5917786", "text": "function _is_same(a, b){\n\t//bark('typeof(a, b): ' + typeof(a) + ',' + typeof(b));\n\n\tvar ret = false;\n\tif( a == b ){ // atoms, incl. null and 'string'\n\t //bark('true on equal atoms: ' + a + '<>' + b);\n\t ret = true;\n\t}else{ // is list or obj (ignore func)\n\t if( typeof(a) === 'object' && typeof(b) === 'object' ){\n\t\t//bark('...are objects');\n\t\t\n\t\t// Null is an object, but not like the others.\n\t\tif( a == null || b == null ){\n\t\t ret = false;\n\t\t}else if( Array.isArray(a) && Array.isArray(b) ){ // array equiv\n\t\t //bark('...are arrays');\n\t\t \n\t\t // Recursively check array equiv.\n\t\t if( a.length == b.length ){\n\t\t\tif( a.length == 0 ){\n\t\t\t //bark('true on 0 length array');\n\t\t\t ret = true;\n\t\t\t}else{\n\t\t\t ret = true; // assume true until false here\n\t\t\t for( var i = 0; i < a.length; i++ ){\n\t\t\t\tif( ! _is_same(a[i], b[i]) ){\n\t\t\t\t //bark('false on diff @ index: ' + i);\n\t\t\t\t ret = false;\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\n\t\t}else{ // object equiv.\n\n\t\t // Get unique set of keys.\n\t\t var a_keys = Object.keys(a);\n\t\t var b_keys = Object.keys(b);\n\t\t var keys = a_keys.concat(b_keys.filter(function(it){\n\t\t\treturn a_keys.indexOf(it) < 0;\n\t\t }));\n\t\t \n\t\t // Assume true until false.\n\t\t ret = true;\n\t\t for( var j = 0; j < keys.length; j++ ){ // no forEach - break\n\t\t\tvar k = keys[j];\n\t\t\tif( ! _is_same(a[k], b[k]) ){\n\t\t\t //bark('false on key: ' + k);\n\t\t\t ret = false;\n\t\t\t break;\n\t\t\t}\n\t\t }\n\t\t}\n\t }else{\n\t\t//bark('false by default');\n\t }\n\t}\n\t\n\treturn ret;\n }", "title": "" }, { "docid": "1e631611a22c0fd4434a57283780ba10", "score": "0.5907743", "text": "function _areEquals(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!_areEquals(a[i], b[i]))\n return false;\n return true;\n }\n if (arrA != arrB)\n return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length)\n return false;\n for (i = length; i-- !== 0;)\n if (!b.hasOwnProperty(keys[i]))\n return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return a !== a && b !== b;\n }", "title": "" }, { "docid": "8666af53340fea2f680609799ba88ba4", "score": "0.5904951", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "8b9a959ed3fb638bee92e9cfc22aafb0", "score": "0.59004414", "text": "function deepEquals(a,b) {\n // handle nulls\n if(a === null || b === null) {\n return a === b;\n }\n // handle different types\n if(typeof a !== typeof b) {\n return false;\n }\n // handle primitves\n if(typeof a != 'object') {\n return a === b;\n }\n // objects - if different keys, !equal\n if(!arrayEquals(Object.keys(a),Object.keys(b))) {\n return false;\n } \n // loop through keys, comparing values\n return Object.keys(a).every(key => {\n \treturn deepEquals(a[key],b[key]); \n });\n}", "title": "" }, { "docid": "bf79120a1f6e87417cb575c53af656af", "score": "0.58730537", "text": "function looseEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (_typeof(a) !== _typeof(b)) {\n return false;\n }\n\n var validTypesCount = [isDate(a), isDate(b)].filter(Boolean).length;\n\n if (validTypesCount > 0) {\n return validTypesCount === 2 ? a.getTime() === b.getTime() : false;\n }\n\n validTypesCount = [isFile(a), isFile(b)].filter(Boolean).length;\n\n if (validTypesCount > 0) {\n return validTypesCount === 2 ? a === b : false;\n }\n\n validTypesCount = [(0, _array.isArray)(a), (0, _array.isArray)(b)].filter(Boolean).length;\n\n if (validTypesCount > 0) {\n return validTypesCount === 2 ? a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i]);\n }) : false;\n }\n\n validTypesCount = [isObject(a), isObject(b)].filter(Boolean).length;\n\n if (validTypesCount > 0) {\n /* istanbul ignore if: this if will probably never be called */\n if (validTypesCount === 1) {\n return false;\n }\n\n var aKeysCount = (0, _object.keys)(a).length;\n var bKeysCount = (0, _object.keys)(b).length;\n\n if (aKeysCount !== bKeysCount) {\n return false;\n }\n\n if (aKeysCount === 0 && bKeysCount === 0) {\n return String(a) === String(b);\n } // Using for loop over `Object.keys()` here since some class\n // keys are not handled correctly otherwise\n\n\n for (var key in a) {\n if ([a.hasOwnProperty(key), b.hasOwnProperty(key)].filter(Boolean).length === 1 || !looseEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "be796909386ec8b0203755b2efb5bcc5", "score": "0.58602995", "text": "function deepEqual(x, y) {\n const ok = Object.keys,\n tx = typeof x,\n ty = typeof y;\n return x && y && tx === \"object\" && tx === ty\n ? ok(x).length === ok(y).length &&\n ok(x).every((key) => deepEqual(x[key], y[key]))\n : x === y;\n }", "title": "" }, { "docid": "c7a6d3bd694db8a8ed90d5400a20d996", "score": "0.5849713", "text": "function keyValueMatch (object1, object2){\r\n\tfor (var key in object1){\r\n\t\tif (object1[key] == object2[key]) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "92db87b18c2264afb9961be915a6e1e0", "score": "0.58324105", "text": "function looseEqual(a, b) {\n if (a === b) {\n return true\n }\n let aValidType = isDate(a)\n let bValidType = isDate(b)\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.getTime() === b.getTime() : false\n }\n aValidType = isArray(a)\n bValidType = isArray(b)\n if (aValidType || bValidType) {\n return aValidType && bValidType\n ? a.length === b.length && a.every((e, i) => looseEqual(e, b[i]))\n : false\n }\n aValidType = isObject(a)\n bValidType = isObject(b)\n if (aValidType || bValidType) {\n /* istanbul ignore if: this if will probably never be called */\n if (!aValidType || !bValidType) {\n return false\n }\n const aKeysCount = keys(a).length\n const bKeysCount = keys(b).length\n if (aKeysCount !== bKeysCount) {\n return false\n }\n for (const key in a) {\n const aHasKey = a.hasOwnProperty(key)\n const bHasKey = b.hasOwnProperty(key)\n if ((aHasKey && !bHasKey) || (!aHasKey && bHasKey) || !looseEqual(a[key], b[key])) {\n return false\n }\n }\n }\n return String(a) === String(b)\n}", "title": "" }, { "docid": "a58d9890c161c05ef87d70b8e592da28", "score": "0.58317167", "text": "function keyValue(obj1, obj2){\n //The fuction should check to see if the objects share a k:v pair\n for (var key in obj1){\n if(obj1[key] === obj2[key]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "0d8e87aa3edf92f7c4ac76a9c10cea81", "score": "0.582405", "text": "function recsAreEqual(r1, r2) {\n if (typeof r1 === 'object' && typeof r2 === 'object') {\n const keys1 = Object.keys(r1);\n const keys2 = Object.keys(r2);\n return keys1.count === keys2.count &&\n keys1.every(key => r1[key] === r2[key]);\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "c8d396d1d517d4cb945b025d2147b214", "score": "0.58232814", "text": "function _areEquals(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!_areEquals(a[i], b[i]))\n return false;\n return true;\n }\n if (arrA != arrB)\n return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length)\n return false;\n for (i = length; i-- !== 0;)\n if (!b.hasOwnProperty(keys[i]))\n return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "c8d396d1d517d4cb945b025d2147b214", "score": "0.58232814", "text": "function _areEquals(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!_areEquals(a[i], b[i]))\n return false;\n return true;\n }\n if (arrA != arrB)\n return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length)\n return false;\n for (i = length; i-- !== 0;)\n if (!b.hasOwnProperty(keys[i]))\n return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "ff85f06495b0350da1877591b81123c0", "score": "0.5807219", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "ff85f06495b0350da1877591b81123c0", "score": "0.5807219", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "ff85f06495b0350da1877591b81123c0", "score": "0.5807219", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.5800233", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "2e5e02a657581539a32bdd3dc317edfd", "score": "0.578932", "text": "function deepEqual(a, b) {\n if (a === b) return true; // Strict comparison for primitive values\n \n if (typeof a == \"object\" && typeof b == \"object\") {\n if (a == null || b == null) return false; // null also returns typeof object\n const aKeys = Object.keys(a), bKeys = Object.keys(b);\n\n // Check whether they have same set of keys\n if (aKeys.length != bKeys.length) return false;\n\n for (let i=0; i<aKeys.length; i++) {\n if (aKeys[i] != bKeys[i]) return false;\n if (deepEqual(a[aKeys[i]], b[bKeys[i]])) continue;\n else return false;\n }\n return true;\n } \n return false;\n\n}", "title": "" }, { "docid": "804bca4e0db320c9ca2d23d3fb95aaaf", "score": "0.5785342", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "e6c06ca09e640ab4f5588d7ec7cbcb83", "score": "0.5777132", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n }", "title": "" }, { "docid": "3a9c689cee7fd713e26f68572e7dd249", "score": "0.57762575", "text": "function equals(o1, o2) {\n if (o1 === o2)\n return true;\n if (o1 === null || o2 === null)\n return false;\n if (o1 !== o1 && o2 !== o2)\n return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 == t2 && t1 == 'object') {\n if (Array.isArray(o1)) {\n if (!Array.isArray(o2))\n return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key]))\n return false;\n }\n return true;\n }\n }\n else {\n if (Array.isArray(o2)) {\n return false;\n }\n keySet = Object.create(null);\n for (key in o1) {\n if (!equals(o1[key], o2[key])) {\n return false;\n }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && typeof o2[key] !== 'undefined') {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "94b866c55918e0df63473b827e8ef404", "score": "0.5774755", "text": "function deepEqual(a, b) {\n\n // Si la variable es de tipo object, iteramos sobre el arreglo verificando que ambos objects tengan\n // la misma cantidad de keys. Si es asi, llamamos de forma recursiva a deepEqual pero con los values\n // correspondientes a la key de esa iteración.\n // Si en cualquier punto de la iteración los values no son iguales, retorna false.\n if ((typeof a === 'object') || (typeof b === 'object')) {\n\n if (Object.keys(a).length === Object.keys(b).length) {\n\n for (const i of Object.keys(a)) {\n if (deepEqual(a[i], b[i]) === false) return false\n }\n\n return true\n }\n\n return false\n }\n else {\n if (a === b) {\n return true;\n }\n false\n return false;\n }\n}", "title": "" }, { "docid": "36809ba9bb87827235ff3953c28230c0", "score": "0.5730505", "text": "function deepEqual (a, b) {\n console.log(\"######################\")\n //if a is 'exactly' equal to b, return true\n if (a === b){\n console.log(\"Here's a and b\");\n console.log(a);\n console.log(b);\n console.log(\"a === b :D EZ\");\n return true;\n };\n\n // if a is equal to null or a is not an object...\n // or b equals null, or b is not an object, return false.\n\n // the reason we check both is because typeof null returns an object:D\n if (a == null || typeof a != \"object\" ||\n b == null || typeof b != \"object\") {\n console.log(\"Something is null or not object\");\n console.log(\"Here's a and b\");\n console.log(a);\n console.log(b);\n return false;\n };\n\n //assign the keys a to keys a, same for b\n let keysA = Object.keys(a), keysB = Object.keys(b)\n console.log(\"Here's a and b:\")\n console.log(keysA)\n console.log(keysB)\n\n // if both lists are not the same length, return false\n if (keysA.length != keysB.length) {\n console.log(\"Looks like they arenet the same length\");\n return false;\n }\n\n // for every key listed in keysA...\n for (let key of keysA) {\n // if key has no counterpart in keysB or...\n // a.key or b.key is a list that has no counterpart, return false\n if (!keysB.includes(key) || !deepEqual(a[key], b[key])) return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "3f0969b47933c5156476acb0bc63207c", "score": "0.5727039", "text": "function objectsEqual(firstObject, secondObject) {\n var firstKeys = Object.keys(firstObject).sort();\n var secondKeys = Object.keys(secondObject).sort();\n var i;\n\n for (i = 0; i < firstKeys.length; i += 1) {\n var firstKey = firstKeys[i];\n var secondKey = secondKeys[i];\n\n if (firstObject[firstKey] !== secondObject[secondKey] ||\n firstKey !== secondKey) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "6bbf651412c39a2fb18b067d98023771", "score": "0.5721194", "text": "function deepEqual(obj_1, obj_2) {\n // base case\n if(obj_1 === obj_2) return true;\n\n // return false if not object or null\n if(typeof obj_1 !== \"object\" || obj_1 === null ||\n typeof obj_2 !== \"object\" || obj_2 === null)\n return false;\n\n // compare lengths, return false if lengths are not equal at the end\n var aLength = 0;\n var bLength = 0;\n\n for(var keys in obj_1)\n aLength++;\n\n for(var keys in obj_2) {\n bLength++;\n\n // check if keys are the same\n if((keys in obj_1) === false) return false;\n\n // check properties now (via recursion)\n if(deepEqual(obj_1[keys], obj_2[keys]) === false) return false;\n }\n\n // check whether lengths are the same\n if(aLength !== bLength) return false;\n\n // if all conditions are met, return true\n return true;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.57152426", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "600e9fa2f3b90b95904bc89c5a6fea8e", "score": "0.5703017", "text": "function objectsEqual(obj1, obj2) {\n if (obj1 === obj2) return true;\n\n let keys1 = Object.keys(obj1);\n let keys2 = Object.keys(obj2);\n let i;\n\n if (keys1.length !== keys2.length) return false;\n\n for (i = 0; i < keys1.length; i += 1) {\n if (obj1[keys1[i]] !== obj2[keys2[i]]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "df43d9ef5ea5f6ac716714811d0e515c", "score": "0.569608", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a)\n var isObjectB = isObject(b)\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a)\n var isArrayB = Array.isArray(b)\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a)\n var keysB = Object.keys(b)\n return keysA.length === keysB.length && keysA.every(function(key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n return false\n }\n } catch (error) {\n return false\n }\n } else if (!isObject && !isObjectB) {\n return String(a) == String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "b09ad49c3eb156026e7d89f074d94058", "score": "0.56960416", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n\n return true;\n } // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n\n\n var it;\n\n if (hasMap && a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) if (!b.has(i.value[0])) return false;\n\n it = a.entries();\n\n while (!(i = it.next()).done) if (!equal(i.value[1], b.get(i.value[0]))) return false;\n\n return true;\n }\n\n if (hasSet && a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) if (!b.has(i.value[0])) return false;\n\n return true;\n } // END: Modifications\n\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false;\n\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; // END: fast-deep-equal\n // START: react-fast-compare\n // custom handling for DOM elements\n\n\n if (hasElementType && a instanceof Element) return false; // custom handling for React/Preact\n\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n continue;\n } // all other properties should be traversed as usual\n\n\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n } // END: react-fast-compare\n // START: fast-deep-equal\n\n\n return true;\n }\n\n return a !== a && b !== b;\n} // end fast-deep-equal", "title": "" }, { "docid": "e7ca6f3678bad0d5190d4a5b7e1dcdfd", "score": "0.56883687", "text": "function object_key_check(object /*, key_1, key_2... */)\n {\n // First check if provided variable is object\n if (typeof object !== 'object') {\n return false;\n }\n\n // Get object keys and set current level\n var keys = Array.prototype.slice.call(arguments, 1);\n var current = object;\n\n // Iterate over keys\n for (var i = 0; i < keys.length; i++) {\n\n // Check if current key exists\n if (typeof current[keys[i]] === 'undefined') {\n return false;\n }\n\n // Check if all but last keys are for object\n if (i < (keys.length - 1) && typeof current[keys[i]] !== 'object') {\n return false;\n }\n\n // Go one step down\n current = current[keys[i]];\n }\n\n // If we reached this point all keys from path\n return true;\n }", "title": "" }, { "docid": "886214786def0d3ea2ee6a69aa3c73b2", "score": "0.5684748", "text": "function deepEqual(a, b) {\n if (a === b) return true;\n \n if (a == null || typeof a != \"object\" ||\n b == null || typeof b != \"object\") return false;\n \n let keysA = Object.keys(a), keysB = Object.keys(b);\n \n if (keysA.length != keysB.length) return false;\n \n for (let key of keysA) {\n if (!keysB.includes(key) || !deepEqual(a[key], b[key])){\n return false;\n }\n }\n \n return true;\n }", "title": "" }, { "docid": "ce1bd4c20f9636cd99cffe25001f69de", "score": "0.5663326", "text": "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(a instanceof Date&&b instanceof Date){return a.getTime()===b.getTime();}else if(!isArrayA&&!isArrayB){var keysA=Object.keys(a);var keysB=Object.keys(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5659796", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5659796", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5659796", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "8ea1ca5a6201e4871b2f26253d80eb26", "score": "0.5651176", "text": "function looseEqual(a, b) { if (a === b) { return true; } var isObjectA = isObject(a); var isObjectB = isObject(b); if (isObjectA && isObjectB) { try { var isArrayA = Array.isArray(a); var isArrayB = Array.isArray(b); if (isArrayA && isArrayB) { return a.length === b.length && a.every(function (e, i) { return looseEqual(e, b[i]); }); } else if (_instanceof(a, Date) && _instanceof(b, Date)) { return a.getTime() === b.getTime(); } else if (!isArrayA && !isArrayB) { var keysA = Object.keys(a); var keysB = Object.keys(b); return keysA.length === keysB.length && keysA.every(function (key) { return looseEqual(a[key], b[key]); }); } else {/* istanbul ignore next */return false; } } catch (e) {/* istanbul ignore next */return false; } } else if (!isObjectA && !isObjectB) { return String(a) === String(b); } else { return false; } }", "title": "" }, { "docid": "1f2a695727aa3f6f3de9ca22ed12c506", "score": "0.5639492", "text": "isAllKeysInObject(arr, obj) {\r\n\t\t \tfor (let key in arr) {\r\n\t\t \t\tif (!obj.hasOwnProperty(arr[key])) {\r\n\t\t \t\t\treturn false;\r\n\t\t \t\t}\r\n\t\t \t}\r\n\r\n\t\t \treturn true;\r\n\t\t }", "title": "" }, { "docid": "a0bee319ce507517c3d07dc528cd47d1", "score": "0.5639267", "text": "function deepEqual (value1, value2) {\n if (value1 === value2) {\n return true\n } else if (typeof value1 === 'object' && typeof value2 === 'object' && value1 != null && value2 != null) {\n return Object.keys(value1).filter((key) => Object.keys(value2).includes(key)).every((key) => {\n return deepEqual(value1[key], value2[key])\n })\n }\n return false\n}", "title": "" }, { "docid": "b9323fb18e267d0a447a2bf394492844", "score": "0.5638468", "text": "allKeysMatch() {\n const { cursors } = this;\n // Note that result is true if only one cursor, so start comparison\n // from second position.\n for( let i = 1; i < cursors.length; i++ ) {\n if( cursors[i].primaryKey != cursors[i - 1].primaryKey ) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "754f63061846005921fe3b5b6b9f5f23", "score": "0.5625", "text": "function isEqual(a, b) {\n var i;\n\n if (a === b) {\n return true;\n } else if (isArray(a) && isArray(b) && a.length === b.length) {\n for (i = 0; i < a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n } else if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) {\n var akeys = Object.keys(a);\n var bkeys = Object.keys(b);\n if (!isEqual(akeys, bkeys)) {\n return false;\n }\n\n for (i = 0; i < akeys.length; i++) {\n if (!isEqual(a[akeys[i]], b[akeys[i]])) {\n return false;\n }\n }\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "433084b3b277b51a08634ce675e9d590", "score": "0.56197333", "text": "function matching_pair(object1, object2){\r\n\tvar keys = Object.keys(object1);\r\n\tfor (var i = 0; i < keys.length; i++){\r\n\t\tif (object1[keys[i]] == object2[keys[i]]){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "03c838a3c57da44ad80008ea157e1f0c", "score": "0.56189597", "text": "function shallowCompare(from, to) {\n return Object.keys(from).every(function (key) { return from[key] === to[key]; });\n }", "title": "" }, { "docid": "7d791f10ee9200865b02038b6ae2233e", "score": "0.5618833", "text": "function equalTo() {\n for (let key in tests.equal_to) {\n if (key !== input) {\n return tests.equal_to[key];\n }\n }\n }", "title": "" }, { "docid": "7cd89a1dae782442108e7457c085f2ea", "score": "0.55976105", "text": "function ShallowEquals(objA, objB) {\n if (Object.is(objA, objB))\n return true;\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null)\n return false;\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length)\n return false;\n // test for A's keys different from B\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.55923826", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" } ]
2a981436d4f596c70a6e5917c46ac1a7
Para validar el formato en nombre de profesores
[ { "docid": "ce5158dfb036532fe3c7d960f17d6493", "score": "0.0", "text": "function validarLetras(event) {\n var input = document.getElementsByClassName(\"letras\").value;\n \tvar key = event.key;\n \tvar keyCode = event.keyCode;\n \tvar expresion = /^[A-Za-záéíóúÁÉÍÓÚñÑ\\s\\.\\',']+$/;\n \tif (!expresion.test(input+key)) {\n \t alert(\"Este campo permite solo permite letras.\");\n \t event.preventDefault();\n \t}\n}", "title": "" } ]
[ { "docid": "c5f70c9c5e9d120445f2996e70122283", "score": "0.6598355", "text": "function verifName(champ, msgErreur) {\n //accepte seulement les lettres, apostrophes, tirets et espaces\n //pas de tiret en debut et fin de champ\n //majuscule seulement au debut\n // accepte champ >=2 et <=25\n const regexNom = /^[a-zA-ZéèîïÉÈÎÏ][a-zéèêàçîï]+([-'\\s][a-zA-ZéèîïÉÈÎÏ][a-zéèêàçîï]+)?$/;\n\n\n //si format incorrect : false, si format correct : true\n if ((regexNom.test(champ.value) == false) || (champ.value.length < 2 || champ.value.length > 25)) {\n msgErreur.textContent = \"Format incorrect\";\n msgErreur.style.color = \"red\";\n return false;\n } else {\n msgErreur.textContent = \"\";\n return true;\n }\n}", "title": "" }, { "docid": "b2d8ed8cfa4626ef6d465b5b5eba9e03", "score": "0.6304768", "text": "function validateSurname() {\n\tvalue = document.getElementById(\"surnameInput\").value;\n\tregex=/^[a-z A-Z]+$/;\n\n\tif (value.match(regex)) {\n\t\tlabels[1].innerHTML = \"Apellidos\";\n\t\tgoodLabel(1);\n\t\tclient.surname = value;\n\t} else {\n\t\tlabels[1].innerHTML = \"Los apellidos solo pueden contener letras\";\n\t\tbadLabel(1);\n\t}\n}", "title": "" }, { "docid": "a515da2d9dcc15bdbc58f94a51b5b1e9", "score": "0.6162282", "text": "function ValidateFName(f_name) {\n regx = /^[a-zA-Z ]*$/;\n\n // Function invoking for validating empty fields.\n if (!validateEmptyFields(f_name)) {\n return false;\n } else if (!validateMinMax(f_name, 8, 24)) {\n return false;\n } else if (regx.test(f_name.value)) {\n // userDet.push(f_name.name = f_name.value);\n // userDet['firstname'] = f_name.value;\n return true;\n } else {\n alert(\"User First Name should be Alphabet\");\n }\n }", "title": "" }, { "docid": "b9cd5a0248b6ba55915216373b689370", "score": "0.61342007", "text": "function validateName(i,o,n){\r\n\tif(!/^[a-zA-Z ]+$/.test(o.val())){\r\n\t\to.parent().addClass(\"has-error\");\r\n\t\tupdateTips(i,n+\" not a valid name!\");\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t\treturn true; \r\n}", "title": "" }, { "docid": "12842311fe327a40de74e6c4bbbb546c", "score": "0.61039853", "text": "userNameValidation(e) {\n let str = e.target.value;\n let splitByAt = str.split(\"@\");\n if(splitByAt.length !== 2) {\n return false;\n }\n let splitByPeriod = splitByAt[1].split(\".\");\n if(splitByPeriod.length !== 2 ) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "cacb64629de5986eebf49cc0340f9b70", "score": "0.6096561", "text": "function validateName(){ \n //NO cumple longitud minima \n if(name.val().length < 2){ \n $('#form-group-name').addClass('wrong-entry');\n $('#alertSmall').fadeIn(500); \n $('.faName').css(\"visibility\", \"hidden\"); \n booleanName = false;\n console.log(\"Nombre false: \" + booleanName);\n } \n //SI longitud pero NO solo caracteres A-z \n else if(!name.val().match(/^[a-zA-Z]+$/)){ \n $('#form-group-name').addClass('wrong-entry');\n $('#alertEsp').fadeIn(500);\n booleanName = false;\n console.log(\"Nombre false: \" + booleanName);\n $('.faName').css(\"visibility\", \"hidden\");\n } \n // SI longitud, SI caracteres A-z \n else{\n $('#form-group-name').removeClass('wrong-entry'); \n $('#alertSmall').hide();\n $('#alertEsp').hide();\n\n $('.faName').css(\"visibility\", \"visible\");\n booleanName = true;\n console.log(\"Nombre true: \" + booleanName);\n } \n } // validate Name", "title": "" }, { "docid": "d773f3d4c18e45e3e80a656f70fbd24e", "score": "0.6049858", "text": "function validateProfesor(){\n\tvar name = $('.nombreA').val(\"\");\n\tvar ap = $('.apellidoP').val(\"\");\n\tvar am = $('.apellidoM').val(\"\");\n\tvar curp = $('.curp').val(\"\");\n\tvar tl = $('.tel-cel').val(\"\");\n\tvar mail = $('.email').val(\"\");\n\tvar prom = $('.promedio').val(\"\");\n\tvar carre = $('.carreras').val();\n\tvar res = false;\n\t\n\tif (name = \"\" || ap == \"\" || am == \"\" || curp == \"\" || tl == \"\" || mail == \"\" || prom == \"\" || carre == 0 || carre == null) {\n\t\tres = true;\n\t}\n\n\treturn res;\n}", "title": "" }, { "docid": "66200fb8b174553e0cd8ca92b7b0d8d6", "score": "0.6048229", "text": "format_name (name) {\n\t\tlet text = name;\n\n\t\tif (text.match(/[^A-Za-zА-Яа-яЁё,. 0-9]/g )){\n \t\ttext = text.replace(/[^A-Za-zА-Яа-яЁё,. 0-9]/g, '');\n\t\t}\n\n \t\tif(text.length > this._elements._name.maxlength){\n \t\t\ttext = text.slice(0, this._elements._name.maxlength); \n \t\t}\n\n \t\tthis.Name = text;\n\n \t\tthis._elements._name.value = this.Name;\n\t}", "title": "" }, { "docid": "d5a5684e251c5160f66ea9d203d2e4f6", "score": "0.6039199", "text": "function validateName() {\n\tvalue = document.getElementById(\"nameInput\").value;\n\tregex=/^[a-z A-Z]+$/;\n\n\tif (value.match(regex)) {\n\t\tlabels[0].innerHTML = \"Nombre\";\n\t\tgoodLabel(0);\n\t\tclient.name = value;\n\t} else {\n\t\tlabels[0].innerHTML = \"El nombre solo puede contener letras\";\n\t\tbadLabel(0);\n\t}\n}", "title": "" }, { "docid": "e7f0276a0598f51e68a1eaaf6e653927", "score": "0.601066", "text": "function validateName(fld) {\n \"use strict\";\n var error = \"\";\n\n if (fld.value === '' || fld.value === 'Nickname' || fld.value === 'Enter Your Name..' || fld.value === 'Your Name..') {\n error = \"You didn't enter Your First Name.\";\n } else if ((fld.value.length < 2) || (fld.value.length > 200)) {\n error = \"First Name is the wrong length.\";\n }\n return error;\n}", "title": "" }, { "docid": "124daf54ed20240c0dd09be5b46fc298", "score": "0.6006827", "text": "function nameValidate() {\n const words = this.value.split(\" \");\n\n if (words.length !== 2) {\n removePassive('Please write your first and last name');\n } else {\n if((2 < words[0].length && words[0].length < 20) && (2 < words[1].length && words[1].length < 20)) {\n messageContainer.classList.add('passive');\n messageContainer.classList.remove('active');\n return validation[1] = true;\n } else {\n removePassive('Each word must be between 3 to 20 symbols.')\n }\n }\n }", "title": "" }, { "docid": "ba40668a57bbf2a944111b81f60fb5b5", "score": "0.60005647", "text": "function validarNombre(){\n\tif(expresiones.nombre.test(nombre.value)){\n\t\tcampos['nombre'] = true;\n\t\tdocument.getElementById('nombre_error').style.visibility = \"hidden\";\n\t}else{\n\t\tcampos['nombre'] = false;\n\t\tdocument.getElementById('nombre_error').style.visibility = \"visible\";\n\t\tdocument.getElementById('nombre_error').style.color = \"red\";\n\t}\t\n}", "title": "" }, { "docid": "9940e763f7df8bc17bcfdeedfc08d2aa", "score": "0.5982127", "text": "function validateNameSurName() {\n var name = document.formPedido.name.value;\n var elemento = document.getElementById(\"name\");\n if (!isNaN(name)) {\n alert(\"Hay un error en campo para numero de nombre y apellido.\");\n elemento.classList.add(\"denegado\");\n return false;\n } else {\n elemento.classList.add(\"accpetado\");\n return true;\n }\n}", "title": "" }, { "docid": "a76f00b1bbf6b19a0b56a972522244e8", "score": "0.59768164", "text": "function ValidarNom(nombre) {\r\n var tstnom = /^([a-zA-Z])/;\r\n return tstnom.test(nombre);\r\n}//fin validacion nombre y apellidos", "title": "" }, { "docid": "d4503f1cb7273251f2d008d2116a9519", "score": "0.59685045", "text": "function checkName(name) {\n let good_format = true;\n let name_without_legal_chars = name.replace(/[A-Za-z0-9\" \"]/g,\"\");\n\n if (name_without_legal_chars.length > 0) {\n good_format = false;\n }\n return good_format;\n}", "title": "" }, { "docid": "2f10853af044bccbf748a7bdc4a233d8", "score": "0.5961707", "text": "validateName() {\n let length = this.state.patentName.length;\n if (length === 0) {\n return null;\n } else if (length <= 100) {\n return \"success\"\n } else {\n return \"error\";\n }\n }", "title": "" }, { "docid": "0fad08e1caa7da9f20fceb9039ba468c", "score": "0.5952328", "text": "function checkIfValidFullName () {\n let value = document.getElementById(\"fullName\").value;\n let re = /^[A-Za-z]+\\s([A-Za-z]+\\s*)+$/;\n let message = document.getElementById(\"errorFullName\");\n\n if (re.test(value)) {\n message.className = alertMessage;\n fullNameValid = true;\n } else {\n message.className = alertMessageInvalid;\n fullNameValid = false;\n }\n\n enableSend();\n}", "title": "" }, { "docid": "62643c9689e838b012c184738b87e4bd", "score": "0.5944341", "text": "function validateJoinedFields( scope, n ){\n\n // check ime\n if( ! (/^[a-zA-Z蚞ȊŽ]{3,21}$/.test(n.ime)) || angular.isUndefined(n.ime) ){\n // invalid name\n scope.extraInfo += \"Ime lahko ima samo črke, vsaj 3, največ 21.\\n\";\n }\n\n // check priimek\n if( ! (/^[a-zA-Z蚞ȊŽ]{3,21}$/.test(n.priimek)) || angular.isUndefined(n.priimek) ){\n // invalid name\n scope.extraInfo += \"Priimek lahko ima samo črke, vsaj 3, največ 21.\\n\";\n }\n return scope.extraInfo;\n }", "title": "" }, { "docid": "38d498d36a64eec165deaf6fb1df5e44", "score": "0.59402406", "text": "function validarNombre(){\n if(expresion.test(nombre.value)){\n validar.push(true);\n }else{\n validar.push(false);\n errores.push(\"Nombre Incorrecto\");\n }\n return expresion.test(nombre.value);\n }", "title": "" }, { "docid": "d72e523a9118395b7c59748061d54577", "score": "0.5938669", "text": "function validateName() {\n \n var textMsg = '';\n\n if (names.value.length==0){ \n textMsg = 'Field empty';\n }else{\n var countSpace = 0;\n var countLetter = 0;\n var arrayNames = names.value.split(''); //create an array with all the chars as elements\n \n arrayNames.forEach(element => {\n var ascii = element.charCodeAt();\n if (element == ' ') { // sum the occurrences of spaces\n countSpace++;\n }else if ( (ascii>=65 && ascii<=90)||(ascii>=97 && ascii<=122)){\n countLetter++; // sum the occurrences of letters\n }\n });\n\n if (countSpace == 0) { //validate the occurrence of at least 1 space\n textMsg += 'Must contain an space. ';\n }\n if (countLetter <= 6){\n textMsg += 'Must have at least 6 letters. '; //validate the occurrence of at least 6 letters\n }\n if (arrayNames.length - countLetter - countSpace !=0) { // validate the name is made of letters and spaces\n textMsg += 'Must be made only of letters and spaces. ';\n }\n }\n if (textMsg!=''){ // if exist an error, show it\n nameMsg.innerText = textMsg; \n names.parentElement.appendChild(nameMsg);\n }\n }", "title": "" }, { "docid": "a418d4ffe5ae582cf585ae93ba40cca4", "score": "0.5931947", "text": "function usernameValidate () {\n \n \n var Format = /^[0-9a-zA-z ]+$/ ;\n \n \n if (username.value != \"\" && username.value.length < 3){\n username_error.textContent = \" يجب أن يحتوي الإسم على أكثر من ثلاثة أحرف\"\n }\n else if(username.value != \"\" && !username.value.match(Format)){\n username_error.textContent = \" /^[0-9a-zA-z ]+$/ يجب أن يكون إسم المستخدم على هيئة \"\n }\n else{\n username.style.border = \"3px solid #c2c2a3\";\n username_error.innerHTML = \"\";\n \n }\n \n \n \n }", "title": "" }, { "docid": "a5bf25996adcd600970cf626f361127d", "score": "0.5916457", "text": "function validar_nombre(nom){\n\n\t\t\t var filtro = /^[a-zA-ZáéíóúÁÉÍÓÚ\\s]{2,15}$/;\n\t\t\t var result = filtro.test(nom);\t\t \n\t\t\t return result;\n\t\t\t }", "title": "" }, { "docid": "369a9af5cc3e6f431917a38bd9c175c4", "score": "0.5915904", "text": "function validateSurname(errMessages){ // \n var stringName = document.pizza.surname.value;\n var stringLength = stringName.length;\n if (stringLength == 0){\n errMessages += \"<tr><td><mark>Name</mark></td><td>field is empty.</td></tr>\";\n } \n else {\n if (stringLength < 4){\n errMessages += \"<tr><td><mark>Name</mark></td><td>must have minimum 4 letters plus 1 optional apostrophe.</td></tr>\";\n } else {\n stringName = stringName.toUpperCase(); // easier to check - uppercase the data in \"stringName\"\n \n var countNonAlpha= 0; \n var countApostrophe = 0;\n var countAlpha = 0;\n\n for (var i=0; i<stringLength; i++ ){\n if (stringName.charCodeAt(i) == 39){ // if the code is an apostrophe\n countApostrophe++;\n } else {\n if ( (stringName.charCodeAt(i) > 64) && (stringName.charCodeAt(i) < 91) ){ // if _ is a letter\n countAlpha++;\n } else {\n countNonAlpha++;\n } \n } \n } \n\n //-------------------------------------------------------------------------\n \n var multiMessages =\"\";\n var ind=\"no\";\n\n // ---------------------------------------------------------------------------------\n if (countNonAlpha > 0) // if non-letters are present \n {\n multiMessages +=\"can have only letters and one optional apostrophe.<br />\";\n ind=\"yes\";\n }\n //----------------------------------------------------------------------------------\n\n \n if (countApostrophe > 1) \n {\n multiMessages += \"can have only one apostrophe.<br />\";\n ind=\"yes\";\n }\n //----------------------------------------------------------------------------------\n\n \n if ( (stringName.indexOf(\"'\") == 0) || (stringName.indexOf(\"'\") == (stringLength - 1)) ){ // if apostrophe's position is 1 or last\n multiMessages +=\"cannot have an apostrophe at the start or the end of the Name.<br />\";\n ind=\"yes\";\n }\n //----------------------------------------------------------------------------------\n\n \n if (countAlpha < 4) {\n multiMessages += \"must be at least 4 letters plus an optional apostrophe.<br />\";\n ind=\"yes\";\n }\n //----------------------------------------------------------------------------------\n if (ind == \"yes\"){\n errMessages += \"<tr><td> <mark>Name</mark> </td><td>\" + multiMessages + \"</td></tr>\";\n } \n } \n} \nreturn errMessages;\n} // validateSurname(errMessages)", "title": "" }, { "docid": "ab23913d93a48fd51b18217b2a984ce0", "score": "0.5912635", "text": "function validateName(flag) {\n let name = document.getElementById('name').value;\n let namePatt = /[0-9]+/gi;\n let sp = document.getElementsByClassName('name-note')[0]\n if (name.replace(' ', '').length == 0) {\n sp.innerText = '*This field is required';\n sp.style.display = 'block';\n flag = false;\n } else if (namePatt.test(name)) {\n sp.innerText = '*Invalid name talent';\n sp.style.display = 'block';\n flag = false;\n }\n if (flag == true) sp.style.display = \"none\";\n return flag;\n}", "title": "" }, { "docid": "ab23913d93a48fd51b18217b2a984ce0", "score": "0.5912635", "text": "function validateName(flag) {\n let name = document.getElementById('name').value;\n let namePatt = /[0-9]+/gi;\n let sp = document.getElementsByClassName('name-note')[0]\n if (name.replace(' ', '').length == 0) {\n sp.innerText = '*This field is required';\n sp.style.display = 'block';\n flag = false;\n } else if (namePatt.test(name)) {\n sp.innerText = '*Invalid name talent';\n sp.style.display = 'block';\n flag = false;\n }\n if (flag == true) sp.style.display = \"none\";\n return flag;\n}", "title": "" }, { "docid": "aa1be36bff14041cfddd13a944d71916", "score": "0.5911456", "text": "function checkNameLength() {\n if($(this).val().length < 1) {\n $('#nameresult').addClass(\"has-danger\");\n $('#nameresult').removeClass(\"has-success\");\n } else {\n $('#nameresult').addClass(\"has-success\");\n $('#nameresult').removeClass(\"has-danger\");\n }\n}", "title": "" }, { "docid": "408daf456e97e532abe37221dc7cf8e0", "score": "0.59087276", "text": "function validateNames(name) {\n name.classList.remove('error__iput');\n if((isNaN(name.value)) && (name.value.length > 5 || name.value.length < 15)) {\n name.classList.add('success__input');\n name.classList.remove('error__input');\n return true;\n } else {\n name.classList.add('error__input');\n name.classList.remove('success__input');\n return false;\n }\n }", "title": "" }, { "docid": "280c2e1b6663e7ebc4a1bf9a8fcf56a7", "score": "0.5897426", "text": "function validarNombre(nombre) {\r\n if (nombre === \"\" || nombre.length > 30) {\r\n return -1;\r\n } else {\r\n return nombre;\r\n }\r\n}", "title": "" }, { "docid": "18f6652a1a12235c00f796100145a25d", "score": "0.5892523", "text": "function validename(){\n var name = document.getElementById('name').value;\n var er = document.getElementById('erreur1');\n if(name.match(/^[A-Za-z]+ [A-Za-z]{3,}$/)){\n text = 'le nom est valid';\n er.innerHTML = text;\n er.style.color = \"green\";\n return true;\n }else{\n text = \"le nom est n'est pas valid\";\n er.innerHTML = text;\n er.style.color = \"red\";\n return false;\n }\n }", "title": "" }, { "docid": "ee9d87d2c9fbfc545e7a3bc7a9549ec5", "score": "0.5889745", "text": "function trueSurname() {\r\n var elemento = document.getElementById(\"apellidos\");\r\n\r\n if (!elemento.checkValidity()) {\r\n if (elemento.validity.valueMissing)\r\n errorRegistro(elemento, \"El campo apellido es obligatorio\");\r\n if (elemento.validity.patternMismatch)\r\n errorRegistro(elemento, \"El campo apellido no cumple los requisitos\");\r\n return false;\r\n }\r\n elemento.className = \"Correcto\";\r\n return true;\r\n}", "title": "" }, { "docid": "5756cf4d95f4719e2620e139c9f7fd62", "score": "0.5881066", "text": "validate_name(value) {\n if (!this.cleanStringField(value)) return t(\"Name does not specified\");\n return \"\";\n }", "title": "" }, { "docid": "5756cf4d95f4719e2620e139c9f7fd62", "score": "0.5881066", "text": "validate_name(value) {\n if (!this.cleanStringField(value)) return t(\"Name does not specified\");\n return \"\";\n }", "title": "" }, { "docid": "a65b3d98efb85d3885236dcf0caf8d90", "score": "0.58576626", "text": "function checkfullname1() {\r\n let fullName = document.querySelector(\"#full-name\"); // input for fullname\r\n let nameData = document.querySelector(\"#name-data\"); //error span for full name\r\n let checkName = \"^[a-zA-Z]+$\"; //regex for valid fullname\r\n if (fullName.value == null || fullName.value.length < 1) {\r\n nameData.innerHTML =\r\n '<i class=\"fas fa-exclamation-circle\"><span>Please input this field</span>';\r\n nameData.style.opacity = 1;\r\n return false;\r\n }\r\n if (!fullName.value.match(checkName)) {\r\n nameData.innerHTML =\r\n '<i class=\"fas fa-exclamation-circle\"> <span>Name only include letters</span>';\r\n nameData.style.opacity = 1;\r\n return false;\r\n } else {\r\n nameData.style.opacity = 0;\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "9a6e8d8a3b9bb4e3525146a04e87f3f3", "score": "0.5839152", "text": "displayName (first, last) {\n // Make sure the user entered both a first and last name.\n if (!first || typeof first !== 'string' || !last || typeof last !== 'string') {\n return 'Please enter a first and last name.';\n }\n\n // Make sure the name has no numbers or symbols.\n else if (regex.numbers.test(first) || \n regex.numbers.test(last) || \n regex.symbols.test(first) || \n regex.numbers.test(last)) {\n return 'Your first and last name should contain no numbers or symbols.';\n }\n\n // Good.\n return '';\n }", "title": "" }, { "docid": "ae7a018270124e5855c4edf7b22dad37", "score": "0.5838465", "text": "function validate_name(name){\n\treturn /^[A-Za-z\\s-]+$/.test(name.value) || /^[a-zA-Z ]+$/.test( name.value);\n\n}", "title": "" }, { "docid": "7137366b0b7d0605d36dc5e6a0158426", "score": "0.5837361", "text": "function validationCourriel(inputId, spanId){\n\tvar value = document.getElementById(inputId).value;\n\tvar regex = /\\w+@\\w+\\.\\w+/i;\n\tif (!regex.test(value)) {\n\t\tdocument.getElementById(spanId).innerHTML = \"Votre courriel n'est pas valide !\";\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "cccdddfbc49ead45961762d51e9b1c5e", "score": "0.58322936", "text": "function firstNameCheck(){\n\tvar firstName = $('#firstName').val()\n\tif(firstName == ''){\n\t\treturn 'Please enter your name'\n\t}\n\n\tif(firstName.length < 3 || firstName.length > 12) {\n\t\treturn 'Please enter a name from 3 to 12 characters'\n\t}\n\n\tif (firstName.indexOf('@') != -1) {\n\t\treturn 'Please use letters only'\n\t} \n\tif(isNaN(firstName) == false){\n\t\treturn 'Please use letters only'\n\t}\n}", "title": "" }, { "docid": "1add1e59330b26ce0c31c693b58ef7be", "score": "0.5831271", "text": "function validateName() {\n let isValid = true;\n const firstName = $(\"#fullName\");\n const firstNameVal = firstName.val().trim();\n const pattern = /^([a-zA-Z]){2}/;\n \n if (firstNameVal == \"\") {\n firstName.next().text(\"This field is required.\");\n isValid = false;\n } \n else if (! pattern.test(firstNameVal)) \n {\n firstName.next().text(\"Must be at least two letters\");\n isValid = false;\n } \n else \n {\n firstName.next().text(\"\"); // Clear error or asterisk\n }\n \n return isValid; \n }", "title": "" }, { "docid": "f0bb4efde98b6f4db72f0b0cea00d104", "score": "0.58312005", "text": "function validate_name(name) {\n return /^[A-Za-z\\s-]+$/.test(name.value) || /^[a-zA-Z ]+$/.test(name.value);\n\n}", "title": "" }, { "docid": "295850dcf4fc52f0afa63b6856c1a809", "score": "0.5822275", "text": "function validateOname()\n\t{\n\t\t\n\t\tvar a = $(\"#oname\").val();\n\t\tvar filter = /^[a-z A-Z '_-]+$/;\n//if it's NOT valid\n\t\t\n\t\t\n\t\t//if it's valid email\n\tif(filter.test(a))\n\t{\n\t\t\toname.removeClass(\"error\");\n\t\t\tonameInfo.text(\"\");\n\t\t\tonameInfo.removeClass(\"error\");\n\t\t\treturn true;\n\t\t}\n\t\t//if it's NOT valid\n\t\telse{\n\t\t\toname.addClass(\"error\");\n\t\t\tonameInfo.text(\"Please enter Other Names!\");\n\t\t\tonameInfo.addClass(\"error\");\n\t\t\treturn false;\n\t\t\t\n\t\t}\t\t\n\t\t\n\t}", "title": "" }, { "docid": "759f8dcce6088aa238ba08af9061e639", "score": "0.58172405", "text": "function ValidateLName(l_name) {\n regx = /^[a-zA-Z ]*$/;\n\n // Function invoking for validating lenght.\n if (l_name.value) {\n if (!validateMinMax(l_name, 8, 24)) {\n return false;\n } else if (regx.test(l_name.value)) {\n // userDet['lastname'] = l_name.value;\n return true;\n } else {\n alert(\"User Last Name should be Alphabet\");\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "6deac613983ebfa28e94f0da0845afc2", "score": "0.58166105", "text": "function validateFName() {\r\n var fName = document.getElementById(\"first-name\");\r\n var fNameValue = fName.value;\r\n var fNameRegExp1 = /^[a-zA-Z]+$/;\r\n var fNameRegExp2 = /^[A-Z]/;\r\n var fNameRegExp3 = /^[a-zA-Z]{1,15}$/;\r\n var fNameError = document.getElementById(\"first-name-error\");\r\n try {\r\n if (fNameRegExp1.test(fNameValue) === false) {\r\n throw(\"First name must only contain letters\");\r\n } else if (fNameRegExp2.test(fNameValue) === false) {\r\n throw(\"First name must start with a capital letter\");\r\n } else if (fNameRegExp3.test(fNameValue) === false) {\r\n throw(\"First name must contain a maximum of 15 letters\");\r\n }\r\n // Remove previous error message if first name form field now has valid data.\r\n fNameError.style.display = \"none\";\r\n fName.style.background = \"\";\r\n }\r\n catch(message){\r\n // Display error message if first name form field has invalid data.\r\n fNameError.style.display = \"block\";\r\n fNameError.innerHTML = message;\r\n fName.style.background = \"rgb(255,233,233)\";\r\n formValidity = false;\r\n }\r\n}", "title": "" }, { "docid": "2a9350acf04cbef9dc2359aa2d8db4d3", "score": "0.58137786", "text": "function name_validate(name){\n var name_regex = new RegExp(/[0-9]/g)\n var num_in_name = name_regex.test(name)\n\n switch (true){\n case (name.length == 0):\n return \"NAME is required\"\n case (name.length <= 2):\n return \"NAME must be more than 2 characters\"\n case num_in_name:\n return \"NAME is not valid. Must not have numbers\"\n default:\n return true\n }\n}", "title": "" }, { "docid": "a2a5b8ff2e954c239dd393c030efcada", "score": "0.58064", "text": "function isName(str){\r\n //var reg = /^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/;\r\n var reg2 = /^1[3|4|5|8][0-9]\\d{4,8}$/;\r\n // return reg.test(str);\r\n // if (reg.test(str)) {\r\n // $('.input-E').show(); \r\n // $('.input-M').hide(); \r\n // return reg.test(str);\r\n // }else if (reg2.test(str)) {\r\n if (reg2.test(str)) {\r\n $('.input-M').show();\r\n return reg2.test(str);\r\n }else if(reg2.test(str)){\r\n return false;\r\n };\r\n}", "title": "" }, { "docid": "c745ab41f9ee85fa40f58a81bcb6333f", "score": "0.579149", "text": "function validateFirstName(){\n\tlet outcome = 0;\n\tvar item = document.querySelector('#firstName');\n\t\n const regex=/^[A-Za-z]+$/;\n\n let firstNameError=document.createElement('span');\n firstNameError.style.color='red';\n firstNameError.classList.add('firstname-error');\n\t\n\tlet shownErrors=document.querySelectorAll('.firstname-error');\n\tif(shownErrors.length >0){\n\t\tfor(let i=0;i<shownErrors.length;i++){\n\t\t\tshownErrors[i].style.display='none';\n\t\t}\n\t}\n\t\n\tremoveGeneralWarnig();\n\n if(regex.test(item.value)){\n\t\tdocument.querySelector('#firstName').classList.remove('notdone');\n console.log('First name is valid.')\n\t\toutcome = 1;\n\t}\n else{\n firstNameError.innerText='First Name may only include letters.';\n\t\tdocument.querySelector('#firstName').classList.add('notdone');\n item.after(firstNameError);\n\t\toutcome = 0;\n }\n\t\n\treturn outcome;\n}", "title": "" }, { "docid": "dd4058908985aa0732dfaeb8b7a0aa96", "score": "0.5787065", "text": "validate(val) {\n // val = 123\n val = parseInt(val)\n // val = 123\n\n // akan bernilai true jika inputan dari user merupakan sebuah angka\n if (!isNaN(val)) {\n throw new Error(\"Name harus merupakan sebuah string\")\n }\n }", "title": "" }, { "docid": "48c9ff6670d6f2d92aac6a5d9e0de6fb", "score": "0.5786785", "text": "function validaNombre(){\n var elemento = document.getElementById(\"nombre\")\n if(!elemento.checkValidity()){\n if(elemento.validity.valueMissing){\n error2(elemento,\"Debe introducir un Nombre\")\n }\n if(elemento.validity.patternMismatch){\n error2(elemento,\"El nombre debe tener entre 2 y 30 caracteres.\")\n }\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e3960e11f9cc8975dcd3810e90fbd2ae", "score": "0.5786401", "text": "function formatarNome() {\n let tmp = nome.split(\" \");\n if (tmp[1]) {nome = tmp[0]}\n\n return nome;\n }", "title": "" }, { "docid": "8aa788ed08cde6c2e1cc6d5000980b0d", "score": "0.5784234", "text": "function genderCheck(cnp){\n //initierea primei cifre din cnp\n var firstNumber= cnp.toString().split(\"\")[0];\n //interogare daca e par pentru F\n if (firstNumber%2===0){\n return \"Persoana verificata este de sexul F\";\n }\n //interogare daca e impar si mai mic ca 9 pentru M\n else if (firstNumber%2===1 && firstNumber<9 ){\n return \"Persoana verificata este de sexul M\";\n }\n //altfel cetatean strain\n else{\n return \"Cetatean strain\";\n }\n }", "title": "" }, { "docid": "6cd10ceffff4ba2ff0f48fdf58259065", "score": "0.57799184", "text": "function betterNameCheck(firstName, lastName) {\n firstName = document.getElementById(\"fName\").value;\n lastName = document.getElementById(\"lName\").value;\n //first letter capitalized; more than one character; no special characters\n let nameRegex = /^[A-Z][a-z]+$/g;\n firstName.match(nameRegex) ? console.log(\"First name is correct\") : alert(\"First name is not valid\");\n lastName.match(nameRegex) ? console.log(\"Last name is correct\") : alert(\"Last name is not valid\");\n alert(\"Your name is correct.\")\n }", "title": "" }, { "docid": "55d977bbf4b6433145ddef92fab40d7f", "score": "0.576841", "text": "function checkfullname2() {\r\n let fullName = document.querySelector(\"#full-name\"); // input for fullname\r\n let nameData = document.querySelector(\"#name-data\"); //error span for full name\r\n let checkName = \"^[a-zA-Z]+$\"; //regex for valid fullname\r\n if (fullName.value == \"\") {\r\n nameData.innerHTML =\r\n '<i class=\"fas fa-exclamation-circle\"><span>Please input this field</span>';\r\n nameData.style.opacity = 1;\r\n return false;\r\n }\r\n if (!fullName.value.match(checkName)) {\r\n nameData.innerHTML =\r\n '<i class=\"fas fa-exclamation-circle\"> <span>Name only include letters</span>';\r\n nameData.style.opacity = 1;\r\n return false;\r\n }\r\n if (fullName.value.match(checkName)) {\r\n nameData.innerHTML =\r\n '<i class=\"fas fa-exclamation-circle\"> <span>Name only include letters</span>';\r\n nameData.style.opacity = 0;\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "7602336f1fa2f241daa66bc3864d9cdc", "score": "0.57648516", "text": "function validate_name_field(form) {\n console.log(\"name called\");\n if (/[,]/.test(form.value)) {\n console.log(form.value);\n form.setCustomValidity('Name must not contain a comma');\n form.reportValidity();\n form.style.border = '2px solid #ff0000';\n return false;\n } \n else {\n form.setCustomValidity('');\n form.style.border = '';\n return true;\n }\n}", "title": "" }, { "docid": "6a5635082462f074c4c3a515822ebb46", "score": "0.5753487", "text": "function validateName() {\n //name field - can't be blank\n //regex pattern for non-blank text string:\n const regex = /^[A-Za-z '-]+$/;\n const input = $('#name').val();\n //if the string contains the pattern, then the name field isn't blank\n if(regex.test(input)) {\n //return input to default style if the user enters the proper input\n $('#name').removeAttr('style');\n //remove any error messages\n $('#name-blank-error').remove();\n $('#name-length-error').remove();\n //name is valid\n return true;\n } else { //otherwise, the name field is in error\n $('#name')\n .css({'border': 'solid 2px #e8a29d', 'backgroundColor': '#e8a29d'});\n //real time error messages\n if(!input.trim()) {\n //name field is empty\n $('label[for=\"name\"]')\n .append('<span id=\"name-blank-error\" style=\"color:firebrick\"> ' +\n 'name field can not be blank</span>');\n //remove other error message if it exists\n if($('#name-length-error').length) {\n $('#name-length-error').remove();\n }\n } else { //name field contains non-alphabetic characters\n $('label[for=\"name\"]')\n .append('<span id=\"name-length-error\" style=\"color:firebrick\"> ' +\n 'name field must contain only alphabetic characters</span>');\n //remove other error message if it exists\n if($('#name-blank-error').length) {\n $('#name-blank-error').remove();\n }\n }\n //name field is not valid\n return false;\n }\n }", "title": "" }, { "docid": "6beaa1250c40792986b691a334de6017", "score": "0.5752603", "text": "function employer() {\r\n\t\tconst pattern = /^[a-zA-Z_][a-zA-Z_ ]*[a-zA-Z_]$/;\r\n\t\tconst employer = $('#employer').val();\r\n\t\tif (pattern.test(employer) && employer !== '') {\r\n\t\t\t$('.employer-error').hide();\r\n\t\t\t$('#employer').css('border', '2px solid #34F458');\r\n\t\t} else {\r\n\t\t\t$('.employer-error').html('Should contain only Characters');\r\n\t\t\t$('.employer-error').show();\r\n\t\t\t$('#employer').css('border', '2px solid #F90A0A');\r\n\t\t\temployerError = true;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "883c9cebcff384dd0711c670ae0dc172", "score": "0.5749181", "text": "function nameValidate() {\n\n document.getElementById(\"fullname\").addEventListener(\"blur\" , e=> {\n \n let validityMessage = \"\"; \n\n \n if(e.target.value.length < 1) {\n validityMessage = \"Invalid name\";\n }\n\n document.getElementById(\"name-validate\").textContent = validityMessage;\n\n // if the length of validity message is greater than 1, return false\n // otherwise, return true\n\n if(validityMessage.length > 1) {\n isNameValid =false;\n return false;\n }\n\n isNameValid=true;\n return true;\n })\n \n}", "title": "" }, { "docid": "e7e0bd928cabbe16cca9ceadd2695e79", "score": "0.5736739", "text": "function validatewronglastname() {\r\n var b = $(\"#lastName\").val();\r\n var regexp3 = /^[A-Za-z]+$/;\r\n var regexp4 = /[A-Za-z0-9\\s\\[\\]\\.\\-#']+$/; //check references document.\r\n if(regexp3.test(b)) {\r\n lastNameErrorMsg.text(\"OK\");\r\n } else {\r\n if(regexp4.test(b)) { \r\n lastNameErrorMsg.text(\"Last name can only contain letters.\"); \r\n }\r\n }\r\n }", "title": "" }, { "docid": "4ec6cd89606cf0466c2a2cea920023c8", "score": "0.5716435", "text": "function validarProduccion(oEvento){\n\tvar oForm = document.frmAltaProduccion;\n\tvar oE = oEvento || window.event;\n\tvar bValido = true;\n\tvar sErrores = \"\";\n\tvar nombre = oForm.nombre.value.trim();\n\tvar director = oForm.Director.value.trim();\n\n\t\n\t\n\t\n\tif (director==\"NoExistenDirector\"){\n\n\t\tif(bValido == true){\n\t\t\tbValido = false;\t\t\n\t\t\t//Este campo obtiene el foco\n\t\t\tdocument.frmAltaProduccion.Director.focus();\t\t\n\t\t}\n\n\t\tsErrores += \"\\nNo podras crear producciones sin haber añadido antes un director<hr>\";\n\t\t\n\t\t//Marcar error\n\t\tdocument.frmAltaProduccion.Director.className = \"form-control error\";\n\n\t}\n\telse {\n\t\t//Desmarcar error\n\t\tdocument.frmAltaProduccion.Director.className = \"form-control\";\n\n\t}\n\t\n\t\n\tvar oExpReg = /^[A-ZÁÉÍÓÚ][A-Za-zñáéíóú\\s]{1,40}$/;\n\t\n\tif (oExpReg.test(nombre) == false){\n\t\tif(bValido == true){\n\t\t\tbValido = false;\t\t\n\t\t\t//Este campo obtiene el foco\n\t\t\tdocument.frmAltaProduccion.nombre.focus();\t\t\n\t\t}\n\t\tsErrores += \"\\nNombre incorrecto(Debe contener entre 2 y 40 caracteres y empezar por mayúsculas)<hr>\";\n\t\t//Marcar error\n\t\tdocument.frmAltaProduccion.nombre.className = \"form-control error\";\n\t}\n\telse {\n\t\t//Desmarcar error\n\t\tdocument.frmAltaProduccion.nombre.className = \"form-control\";\t\t\n\t}\n\t\n\tvar tipo = oForm.tipoProduccion.value.trim();\n\tif (tipo == \"Serie\") \n\t{\n\t\tvar numCapitulos = oForm.numCapitulos.value.trim();\n\t\tvar oExpReg = /^\\d{1,4}$/;\n\n\t\tif (oExpReg.test(numCapitulos) == false){\n\t\t\tif(bValido == true){\n\t\t\t\tbValido = false;\t\t\n\t\t\t\t\t//Este campo obtiene el foco\n\t\t\t\t\tdocument.frmAltaProduccion.numCapitulos.focus();\t\t\n\t\t\t\t}\n\t\t\t\tsErrores += \"\\nNúmero incorrecto (Debe contener entre 1 y 3 dígitos)\";\n\t\t\t\t//Marcar error\n\t\t\t\tdocument.frmAltaProduccion.numCapitulos.className = \"form-control error\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//Desmarcar error\n\t\t\t\tdocument.frmAltaProduccion.numCapitulos.className = \"form-control\";\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (tipo == \"Obra\") \n\t\t\t{\n\t\t\t\tvar tipoObra = oForm.tipoObra.value.trim();\n\t\t\t\tvar oExpReg = /^[A-ZÁÉÍÓÚa-zñáéíóú\\s]{5,20}$/;\n\n\t\t\t\tif (oExpReg.test(tipoObra) == false){\n\t\t\t\t\tif(bValido == true){\n\t\t\t\t\t\tbValido = false;\t\t\n\t\t\t\t\t\t\t//Este campo obtiene el foco\n\t\t\t\t\t\t\tdocument.frmAltaProduccion.tipoObra.focus();\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsErrores += \"\\nGénero incorrecto(Debe contener entre 5 y 20 caracteres)\";\n\t\t\t\t\t\t//Marcar error\n\t\t\t\t\t\tdocument.frmAltaProduccion.tipoObra.className = \"form-control error\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//Desmarcar error\n\t\t\t\t\t\tdocument.frmAltaProduccion.tipoObra.className = \"form-control\";\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\treturn sErrores;\n\t\t}", "title": "" }, { "docid": "f90d3a39b86126974531c0403678972b", "score": "0.571144", "text": "function validateFirstName(val) {\n console.log(val)\n // check for malicious scripts\n if (isMaliciousString(val)) {\n console.log(\"MALICIOUS\")\n return false\n }\n // check that val is entered\n if (val.length === 0){\n console.log(\"LENGTH\")\n return false\n }\n return true\n}", "title": "" }, { "docid": "ebd6a6a2e6ace1e952f8c3ac180bd785", "score": "0.57042104", "text": "function validarProduccion(oEvento){\n\tvar oForm = document.frmAltaProduccion;\n \tvar oE = oEvento || window.event;\n\tvar bValido = true;\n\tvar sErrores = \"\";\n\tvar nombre = oForm.nombre.value.trim();\n\tvar director = oForm.Director.value.trim();\n\n\t\n\t\n\t\n\tif (director==\"NoExistenDirector\"){\n\t\n\t\tif(bValido == true){\n\t\tbValido = false;\t\t\n\t\t\t//Este campo obtiene el foco\n\t\t\t document.frmAltaProduccion.Director.focus();\t\t\n\t\t}\n\t\n\t\tsErrores += \"\\nNo podras crear producciones sin haber añadido antes un director<hr>\";\n\t\t\n\t\t//Marcar error\n\t\t document.frmAltaProduccion.Director.className = \"form-control error\";\n\t\n\t}\n\telse {\n\t\t//Desmarcar error\n\t\t document.frmAltaProduccion.Director.className = \"form-control\";\n\t\t\t\n\t}\n\t\n\t\n\tvar oExpReg = /^[A-ZÁÉÍÓÚ][A-Za-zñáéíóú\\s]{1,40}$/;\n\t\n\tif (oExpReg.test(nombre) == false){\n\t\tif(bValido == true){\n\t\tbValido = false;\t\t\n\t\t\t//Este campo obtiene el foco\n\t\t\tdocument.frmAltaProduccion.nombre.focus();\t\t\n\t\t}\n\t\tsErrores += \"\\nNombre incorrecto(Debe contener entre 2 y 40 caracteres y empezar por mayúsculas)<hr>\";\n\t\t//Marcar error\n\t\tdocument.frmAltaProduccion.nombre.className = \"form-control error\";\n\t}\n\telse {\n\t\t//Desmarcar error\n\t\tdocument.frmAltaProduccion.nombre.className = \"form-control\";\t\t\n\t}\n\t\n\tvar tipo = oForm.tipoProduccion.value.trim();\n\t\tif (tipo == \"Serie\") \n\t\t{\n\t\t\tvar numCapitulos = oForm.numCapitulos.value.trim();\n\t\t\tvar oExpReg = /^\\d{1,4}$/;\n\t\n\t\t\tif (oExpReg.test(numCapitulos) == false){\n\t\t\t\tif(bValido == true){\n\t\t\t\tbValido = false;\t\t\n\t\t\t\t\t//Este campo obtiene el foco\n\t\t\t\t\tdocument.frmAltaProduccion.numCapitulos.focus();\t\t\n\t\t\t\t}\n\t\t\t\tsErrores += \"\\nNúmero incorrecto (Debe contener entre 1 y 3 dígitos)\";\n\t\t\t\t//Marcar error\n\t\t\t\tdocument.frmAltaProduccion.numCapitulos.className = \"form-control error\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//Desmarcar error\n\t\t\t\tdocument.frmAltaProduccion.numCapitulos.className = \"form-control\";\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tif (tipo == \"Obra\") \n\t\t\t\t{\n\t\t\t\t\tvar tipoObra = oForm.tipoObra.value.trim();\n\t\t\t\t\tvar oExpReg = /^[A-ZÁÉÍÓÚa-zñáéíóú\\s]{5,20}$/;\n\t\t\t\n\t\t\t\t\tif (oExpReg.test(tipoObra) == false){\n\t\t\t\t\t\tif(bValido == true){\n\t\t\t\t\t\tbValido = false;\t\t\n\t\t\t\t\t\t\t//Este campo obtiene el foco\n\t\t\t\t\t\t\tdocument.frmAltaProduccion.tipoObra.focus();\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsErrores += \"\\nGénero incorrecto(Debe contener entre 5 y 20 caracteres)\";\n\t\t\t\t\t\t//Marcar error\n\t\t\t\t\t\tdocument.frmAltaProduccion.tipoObra.className = \"form-control error\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//Desmarcar error\n\t\t\t\t\t\tdocument.frmAltaProduccion.tipoObra.className = \"form-control\";\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\treturn sErrores;\n}", "title": "" }, { "docid": "38674448c45f7c670672d549359b4d6d", "score": "0.56988156", "text": "function userLastNameValidation(input_field,err_field,mandatory){ \n var valid = 1;\n\n var myRegEx = /[|\\\\<>/]/gi;\n var isValid = !(myRegEx.test($(input_field).val()));\n var last_name = $(input_field).val();\n \n if(last_name == '' && mandatory ==1){\n valid = 0;\n $(err_field).html(\"Please enter the last name.\").show();\n }else if((last_name != '') && (isValid == false)){\n valid = 0;\n $(err_field).html(\"Please do not use special characters (< , > , | , &#47; and &#92;)\").show();\n }\n\n return valid; \n\n}", "title": "" }, { "docid": "de47f0a2911d652f5a86ac7d498aec10", "score": "0.5688209", "text": "function validateLName() {\r\n var lName = document.getElementById(\"last-name\");\r\n var lNameValue = lName.value;\r\n var lNameRegExp1 = /^[a-zA-Z]+$/;\r\n var lNameRegExp2 = /^[A-Z]/;\r\n var lNameRegExp3 = /^[a-zA-Z]{1,15}$/;\r\n var lNameError = document.getElementById(\"last-name-error\");\r\n try {\r\n if (lNameRegExp1.test(lNameValue) === false) {\r\n throw(\"Last name must only contain letters\");\r\n } else if (lNameRegExp2.test(lNameValue) === false) {\r\n throw(\"Last name must start with a capital letter\");\r\n } else if (lNameRegExp3.test(lNameValue) === false) {\r\n throw(\"Last name must contain a maximum of 15 letters\");\r\n }\r\n // Remove previous error message if last name form field now has valid data.\r\n lNameError.style.display = \"none\";\r\n lName.style.background = \"\";\r\n }\r\n catch(message){\r\n // Display error message if last name form field has invalid data.\r\n lNameError.style.display = \"block\";\r\n lNameError.innerHTML = message;\r\n lName.style.background = \"rgb(255,233,233)\";\r\n formValidity = false;\r\n }\r\n}", "title": "" }, { "docid": "cfa9106187c03d1c3b463ae6aea69d2f", "score": "0.56807977", "text": "function validateName() {\n var name1 = $(\"#name\").val();\n var regexName = /[A-Zščćđž\\s-.0-9]/gi;\n var find = name1.match(regexName);\n if (name1.length === 0) {\n //console.log(\"ovdje sam\");\n return false;\n } else if (name1.length < 3 || name1.length > 45) {\n return false;\n } else if (find.length !== name1.length) {\n //postoji znak koji se ne poklapa s regularnim izrazom\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "2371d094806385ffade10a8a19150c76", "score": "0.5675958", "text": "function validateName(field) {\n\tvar error = \"\";\n\n // Change the regex to represent any illegal characters (non-word character).\n\tvar illegalChars = / /;\n\n // Change the conditional to test against an empty input.\n\tif (true) {\n\t\tfield.className = 'missing';\n\t\terror = \"The required name field must be filled in.\\n\";\n\t}\n\n // Change the conditional to test against an input that contains illegalChars.\n\telse if (true) {\n\t\tfield.className = 'invalid';\n\t\terror = \"The name contains illegal characters.\\n\"\n\t}\n\telse {\n\t\tfield.className = '';\n\t}\n\treturn error;\n}", "title": "" }, { "docid": "799bed377fda4e1230f6a58fcd088c92", "score": "0.56735176", "text": "function validate() {\n let namePattern = /^(?=.{1,40}$)[a-zA-Z]+(?:[-'\\s][a-zA-Z]+)*$/;\n\nvar name = document.getElementById('user').value;\n\n// console.log(namePattern.test(name));\nif ( namePattern.test(name)) {\n alert('valid name');\n} else {\n alert('invalid name')\n}\n\nreturn false;\n}", "title": "" }, { "docid": "743f3d840f3be9f68b1de750c2afbedd", "score": "0.5669489", "text": "function validateGM03NAME(input) {\n var text = input.value.toUpperCase();\n var validDigits = \"0123456789\";\n var validChars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var chars = validChars + validDigits;\n var valid = true;\n if (text.length > 0) {\n var firstChar = text.charAt(0);\n if (validChars.indexOf(firstChar) == -1)\n valid = false;\n }\n for (i = 0; i < text.length; i++) {\n character = text.charAt(i);\n if (chars.indexOf(character) == -1)\n valid = false;\n }\n\n if (!valid) {\n input.addClassName('error');\n return false;\n } else {\n input.removeClassName('error');\n return true;\n }\n}", "title": "" }, { "docid": "f821455e05d4f2e37f5f5d5a63c39bd5", "score": "0.56639785", "text": "function validateMinLengthTwo(e) {\n let value = e.target.value //get the value of the object that sent the event\n let goodName = nameRegExp.test(value);// compare regex with the input and retourn boolean\n if(goodName) {\n if (value.length < 2) {\n nameDiv.classList.add(\"display-none\");\n e.target.classList.add(\"border-wrong\");\n e.target.classList.remove(\"border-good\");\n e.target.setCustomValidity(\"Veuillez entrer 2 caractères ou plus.\"). \n e.target.reportValidity()\n validatorOne = false\n } else {\n nameDiv.classList.add(\"display-none\");\n e.target.classList.add(\"border-good\");\n e.target.classList.remove(\"border-wrong\");\n e.target.setCustomValidity(\"\");\n validatorOne = true\n }\n } else {\n validatorOne = false\n e.target.classList.add(\"border-wrong\");\n e.target.classList.remove(\"border-good\");\n nameDiv.classList.remove(\"display-none\");\n e.target.reportValidity()\n }\n}", "title": "" }, { "docid": "146424c102da7a6a258cf2533ce04af1", "score": "0.5656387", "text": "function validarNombreOApellido(pNombre) {\n let nombreValido = false;\n let nombreSinEsp = pNombre.trim()\n let noTieneNumero = validarNingunCaracterEsNum(nombreSinEsp)\n if (nombreSinEsp.length >= 2 && nombreSinEsp.charAt(0) === nombreSinEsp.toUpperCase().charAt(0) && noTieneNumero) {\n nombreValido = true;\n }\n return nombreValido;\n}", "title": "" }, { "docid": "fb161843271319d81fc8568fd4477e20", "score": "0.5652926", "text": "function validaNome() {\r\n let txtNome = document.querySelector(\"#txtNome\")\r\n if (nome.value.length < 3) {\r\n txtNome.innerHTML = \"Nome inválido\"\r\n txtNome.style.color =\"salmon\"\r\n }\r\n else {\r\n txtNome.innerHTML = \"Nome válido\"\r\n txtNome.style.color = \"green\"\r\n }\r\n \r\n }", "title": "" }, { "docid": "da19fa43426aa62e142a2c01155cb6b9", "score": "0.56414247", "text": "function validateForename(field){\n//return (field == \"\") ? \"No Forename was entered.\\n\" : \"\"\n return (field.replace(/\\s+/g,\"\") == \"\") ? \"No Forename was entered.\\n\" : \"\"\n}", "title": "" }, { "docid": "9253d6a552f379bae61020d590ac43da", "score": "0.5641156", "text": "function validatewrongfirstname() {\r\n var a = $(\"#firstName\").val();\r\n var regexp = /^[A-Za-z]+$/; \r\n var regexp2 = /[A-Za-z0-9\\s\\[\\]\\.\\-#']+$/; //check references document.\r\n if(regexp.test(a)) {\r\n firstNameErrorMsg.text(\"OK\");\r\n } else {\r\n if(regexp2.test(a)) { \r\n firstNameErrorMsg.text(\"First name can only contain letters.\");\r\n \r\n }\r\n }\r\n }", "title": "" }, { "docid": "46f8b5488909134ef302c0e212f61e1a", "score": "0.56328094", "text": "function validateName() {\n const name = nameInput.value;\n // validation for empty field \n if (name.length === 0) {\n errorMessage('* Name is required.', nameLabel, 'red', nameInput, '2px solid red', '#fff');\n return false;\n // validation for letters only and also name + surname \n } else if (!name.match(nameValidation)) {\n errorMessage('* Name and surname are required. Only letters will be accepted.', nameLabel, 'red', nameInput, '2px solid red', '#fff');\n return false;\n // when valid the label returns to original values \n } else {\n errorMessage('Name:', nameLabel, '', nameInput, '', '');\n return true\n }\n}", "title": "" }, { "docid": "c6b3c7a5c9c368909a8c4f53f7d23737", "score": "0.56308794", "text": "validate(value){\n if(!/^[a-zA-Z\\s]+$/.test(value)){\n throw new Error('Name can only have letters and spaces')\n }\n }", "title": "" }, { "docid": "95aa978e042f5c5b1323ab6cf0953c23", "score": "0.5627632", "text": "nameValidation(){\n let ul = document.querySelector(\"#name-error\");\n ul.innerHTML = \"\";\n if(this._inputName.value == \"\"){\n this._hasErrors = true;\n return this.showErrors(this._inputName, 'Campo nome não pode ser vazio!', ul);\n }\n this._inputName.className = \"valid\";\n }", "title": "" }, { "docid": "288edbc57b4b51b8c2714cdbb8f39e07", "score": "0.56274325", "text": "function validateName (v) {\n var pattern = /^[a-z|åäö]{1,20}[-]{0,1}[a-z|åäö]{1,20}$/i\n if (!pattern.test(v.trim()))\n return false;\n else\n return true;\n}", "title": "" }, { "docid": "7cccafae9c26248bc6f6e9cbdfe39c82", "score": "0.562042", "text": "function isValidName(name) {\n return name.trim().length >= 2;\n }", "title": "" }, { "docid": "33a6c32306897d9a52c6611e79933cae", "score": "0.56190187", "text": "function nameValidation(){\n const nameValue = userName.value;\n const isNameValid = /^[a-zA-Z]+ ?[a-zA-Z]*? ?[a-zA-Z]*?$/.test(nameValue);\n return isNameValid;\n}", "title": "" }, { "docid": "679250128fef3cea9a1ca320b7a66188", "score": "0.5615108", "text": "function ValidateName() { \r\n var x = document.getElementById(\"txtName\").value;\r\n var regex = /^[a-zA-Z]+(([',. -][a-zA-Z ])?[a-zA-Z]*)*$/;\r\n if (!x.match(regex)) \r\n document.getElementById(\"spName\").style.display = \"inline\"; \r\n else \r\n document.getElementById(\"spName\").style.display = \"none\";\r\n }", "title": "" }, { "docid": "a2f4b620034ec0617066c61e6e7775b3", "score": "0.56134015", "text": "isValidUsername (newUser) {\n newUser = newUser.trim()\n // Check if the username is alphanumeric characters only\n if (!validator.matches(newUser, '^(([A-Za-zÄÖÜäöü\\\\d\\\\-_])+[ ]?)*[A-Za-zÄÖÜäöü\\\\d\\\\-_]+$')) {\n return {\n type: p.MESSAGE_NICKNAME_INVALID,\n data: {message: 'Der Benutzername enthält ungültige Zeichen'}\n }\n }\n // Check if the username is too short\n if (newUser.length < minNicknameLength) {\n return {\n type: p.MESSAGE_NICKNAME_INVALID,\n data: {message: 'Der Benutzername ist zu kurz'}\n }\n }\n // check if the username is too long\n if (newUser.length > maxNicknameLength) {\n return {\n type: p.MESSAGE_NICKNAME_INVALID,\n data: {message: 'Der Benutzername ist zu lang'}\n }\n }\n // check if the username is already taken\n if (this.users.filter(u => u.nickname === newUser).length) {\n return {\n type: p.MESSAGE_NICKNAME_INVALID,\n data: {message: 'Der Benutzername wird bereits verwendet'}\n }\n }\n newUser = newUser.toLowerCase().replace(/[0-9]/g, '')\n // check if the username is already taken\n if (pfui.some(w => newUser.indexOf(w) !== -1)) {\n return {\n type: p.MESSAGE_NICKNAME_INVALID,\n data: {message: 'Der Benutzername enthält nicht erlaubte Wörter'}\n }\n }\n // all checks passed: return no error\n return null\n }", "title": "" }, { "docid": "b579339b2e064d03a5924dc769d343ea", "score": "0.5613366", "text": "function rule419(input) {\n\t\treturn _(input)\n\t\t.filter(function(e){ \n\t\t\treturn e.name === \"John\"; \n\t\t})\n\t\t.value().length == 1 ? \"OK\" : \"Scam\";\n\t}", "title": "" }, { "docid": "90f4bf99ec5de913bcf230441f8fa92c", "score": "0.56130344", "text": "function checkName(){\n let nameLength = $('#username').val().length;\n\t\tif((nameLength < 2) || (nameLength > 20)){\n\t\t\t$('#error1').html('Username should be betweem 2 and 20 characters.');\n\t\t\t$('#error1').show();\n\t\t\tusernameError1 = true;\n\t\t}else {\n\t\t\t$('#error1').hide();\n\t\t\tusernameError1 = false;\n\t\t} \n\t\tlet pattern = /^[-a-zA-Z0-9]*$/;\n\t\tif(pattern.test($('#username').val())){\n\t\t\t$('#error2').hide();\n\t\t\tusernameError2 = false;\n\t\t}else{\n\t\t\t$('#error2').html('Only letters and numbers are allowed in Username field.');\n\t\t\t$('#error2').show();\n\t\t\tusernameError2 = true;\n\t\t}\n\t}", "title": "" }, { "docid": "e9dec3695729b1b3d5d5cdcce02d1d58", "score": "0.5607406", "text": "function validarProvinciaa(cpostal){\n let cp_provincias = {\n 1: \"\\u00C1lava\", 2: \"Albacete\", 3: \"Alicante\", 4: \"Almer\\u00EDa\", 5: \"\\u00C1vila\",\n 6: \"Badajoz\", 7: \"Baleares\", 8: \"Barcelona\", 9: \"Burgos\", 10: \"C\\u00E1ceres\",\n 11: \"C\\u00E1diz\", 12: \"Castell\\u00F3n\", 13: \"Ciudad Real\", 14: \"C\\u00F3rdoba\", 15: \"Coruña\",\n 16: \"Cuenca\", 17: \"Gerona\", 18: \"Granada\", 19: \"Guadalajara\", 20: \"Guip\\u00FAzcoa\",\n 21: \"Huelva\", 22: \"Huesca\", 23: \"Ja\\u00E9n\", 24: \"Le\\u00F3n\", 25: \"L\\u00E9rida\",\n 26: \"La Rioja\", 27: \"Lugo\", 28: \"Madrid\", 29: \"M\\u00E1laga\", 30: \"Murcia\",\n 31: \"Navarra\", 32: \"Orense\", 33: \"Asturias\", 34: \"Palencia\", 35: \"Las Palmas\",\n 36: \"Pontevedra\", 37: \"Salamanca\", 38: \"Santa Cruz de Tenerife\", 39: \"Cantabria\", 40: \"Segovia\",\n 41: \"Sevilla\", 42: \"Soria\", 43: \"Tarragona\", 44: \"Teruel\", 45: \"Toledo\",\n 46: \"Valencia\", 47: \"Valladolid\", 48: \"Vizcaya\", 49: \"Zamora\", 50: \"Zaragoza\",\n 51: \"Ceuta\", 52: \"Melilla\"\n };\n if(cpostal.length == 5 && cpostal <= 52999 && cpostal >= 1000){\n \tcampos['provincia'] = true;\n return cp_provincias[parseInt(cpostal.substring(0,2))];\n }\n else{\n \tcampos['provincia'] = false;\n return \"----\";\n }\n \n }", "title": "" }, { "docid": "3c39705aa2f4b75c851fdb3cd1d4e484", "score": "0.560736", "text": "function validar_input_txt(objinput,nominput,lenmin,lenmax)\n{\n\n if(objinput.length == 0 && lenmin > 0)\n {\n \n $('#resultado').text(nominput + ' se encuentra vacio').addClass('msg_error'); \n return false; \n }\n else if(objinput.length > 0 && objinput.length < 3)\n {\n $('#resultado').text(nominput + ' no valido'); \n return false; \n }\n else if(objinput.length > lenmax)\n {\n $('#resultado').text(nominput + ' exede el número de caracteres permitidos, max: ' + lenmax); \n return false; \n }\n else{\n $('#resultado').text(''); \n return true; \n }\n}", "title": "" }, { "docid": "56a5e15e2d36b4e2ab4e9d9167cc7924", "score": "0.5606001", "text": "function formatName(name, type) {\r\n var nameArray = name.split('');\r\n var finalArray = [];\r\n $.each(nameArray, function(i, d){\r\n if(i==0){\r\n if((/[a-zA-Z]/.test(d))){\r\n finalArray.push(d);\r\n }\r\n }\r\n else{\r\n if((/[a-zA-Z0-9]/.test(d))){\r\n finalArray.push(d);\r\n }\r\n }\r\n })\r\n return finalArray.join('')+\"-\"+type;\r\n }", "title": "" }, { "docid": "c9e1c3a663ac140f97e908e477f419c1", "score": "0.55998933", "text": "function validation() {\n //Pupil first name checking\n if (!nameRegex.test(pupilFname.value)) {\n pupilFname.style.backgroundColor = \"red\";\n pupilFname.focus();\n return false;\n } else {\n pupilFname.style.backgroundColor = \"white\";\n }\n //Pupil last name checking\n if (!nameRegex.test(pupilLname.value)) {\n pupilLname.style.backgroundColor = \"red\";\n pupilLname.focus();\n return false;\n } else {\n pupilLname.style.backgroundColor = \"white\";\n }\n //Pupil age\n if (!ageRegex.test(pupilAge.value)) {\n pupilAge.style.backgroundColor = \"red\";\n pupilAge.focus();\n return false;\n } else {\n pupilAge.style.backgroundColor = \"white\";\n }\n }", "title": "" }, { "docid": "87c8b4b971df03fe89a2e1719e13d93c", "score": "0.5599288", "text": "function fingNombre(){\n\n\tif (ingnombre.value == usuario.ufname){\n\t\t\n\t\tiINombre.style.color = \"#7a9fe8\"; \n\t\tiINombre.style.transition = \".7s\" \n\t\terrorIN.innerHTML=\"\";\n\t\t\n\t}\n\n\telse if (ingnombre.value == \"\") {\n\tiINombre.style.color = \"transparent\";\n\tiINombre.style.transition = \".7s\"\t\n\terrorIN.innerHTML=\"<p>\" + \"(no puedes dejar este campo vacio)\" +\"</p>\";\n\t}\n\t\n\telse {\n\n\t\tiINombre.style.color = \"transparent\"; \n\t\tiINombre.style.transition = \".7s\" \n\t\terrorIN.innerHTML=\"<p>\" + \"(esto no coincide con los datos de registro)\" +\"</p>\";\n\t}\n}", "title": "" }, { "docid": "3dbdfe0d99774a4964d6fd33603e4f06", "score": "0.55983853", "text": "function isValidNickname (txt){\n if(txt.includes(\".\") || txt.includes(\"#\") || txt.includes(\"$\") || txt.includes(\"/\") || txt.includes(\"[\") || txt.includes(\"]\") || txt.includes(\",\")){\n return false\n }\n else{\n return true\n }\n}", "title": "" }, { "docid": "fde2be8be25846376079f79d027244b9", "score": "0.5595901", "text": "function formatName(firstName, lastName, page){\n\t// catch when name is empty\n\tif (firstName == undefined && lastName == undefined){\n\t\treturn undefined;\n\t}\n\n\t// console.log(\"format name\");\n\tvar length;\n\tif (page === 'profile'){\n\t\tlength = maxProfileNameLength;\n\t}\n\telse if (page === 'race'){\n\t\tlength = maxRaceNameLength;\n\t}\n\n\tvar displayName;\n\tif (firstName.length >= length-3){\n\t\tdisplayName = firstName;\t\t\t//first name only\n\t}\n\telse{\n\t\tif (page === 'race' || firstName.length + lastName.length +1 >= length){\n\t\t\tdisplayName = firstName + \" \" + lastName.charAt(0) + \".\";\t\t// first + last initial\n\t\t}\n\t\telse{\n\t\t\tdisplayName = firstName + \" \" + lastName;\t\t\t\t\t\t// full name\n\t\t}\n\t}\n\treturn displayName;\n\n}", "title": "" }, { "docid": "7accdd82cc76d4a45fc008a966f6db15", "score": "0.5592234", "text": "function isValidName(name) {\n\n return typeof(name) === \"string\" && name.replace(/\\s/g, \"\").length > 1;\n\n // Gelen değerin string olup olmadığı kontrol edilir, ardından name değerindeki tüm boşluk karakterleri silinir ve kalan değerin uzunluğununun 1'den büyük olup olmadığına bakılır (>=2). \n // RegEx'teki \\s ->boşluk karakterleri ile eşleştirme ; g -> global search(tüm string'i tarama) için kullanılır.\n\n}", "title": "" }, { "docid": "c6682e9276702b6b2439b2d82a1be00b", "score": "0.55919194", "text": "function verifName() {\n let div_name = document.querySelector('#js-name')\n let name = div_name.querySelector('.js-input-name')\n let tooltipStyleName = getTooltip(div_name).style;\n if(name.value.length < 2 || name.value.length > 25) {\n name.style.border = \"1px solid #cd5353\";\n tooltipStyleName.display = \"block\";\n return false;\n } else {\n name.classList.add('valid');\n name.style.border = \"\";\n tooltipStyleName.display = \"none\";\n return true;\n }\n}", "title": "" }, { "docid": "3f376638887784e74a6463b3858b522e", "score": "0.5585471", "text": "function ValidateName(inputText) {\n\n var nameformat = /^[a-zA-Z]+$/;\n if (inputText.match(nameformat)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "0864d5088864f47d44b5c0d074ed16ca", "score": "0.55852103", "text": "function validateName(name) {\n let regexNoNumbers = /\\D{1,20}/;\n if (!name || !name.trim() || !regexNoNumbers.test(name)) {\n return false;\n } else return true;\n}", "title": "" }, { "docid": "a4e9a535d85631b19d0c364495518c84", "score": "0.55847776", "text": "function validarCPF(Objcpf, nameInput) {\n var cpf = Objcpf.value;\n exp = /\\.|\\-/g\n cpf = cpf.toString().replace(exp, \"\");\n var digitoDigitado = eval(cpf.charAt(9) + cpf.charAt(10));\n var soma1 = 0, soma2 = 0;\n var vlr = 11;\n\n for (i = 0; i < 9; i++) {\n soma1 += eval(cpf.charAt(i) * (vlr - 1));\n soma2 += eval(cpf.charAt(i) * vlr);\n vlr--;\n }\n soma1 = (((soma1 * 10) % 11) == 10 ? 0 : ((soma1 * 10) % 11));\n soma2 = (((soma2 + (2 * soma1)) * 10) % 11);\n\n var digitoGerado = (soma1 * 10) + soma2;\n if (digitoGerado != digitoDigitado)\n alert('CPF Invalido!');\n document.getElementById(\"cpf\").value=\"\";\n}", "title": "" }, { "docid": "8a1d070ffe6bd7a7fec6a17c9e708c87", "score": "0.55818367", "text": "function checkLN(input){\n var lastName = input.value;\n if(lastName !== null){\n if(lastName.length<=1||lastName.length>30){\n input.setCustomValidity(\"Last Name must be between 2 and 30 characters\");\n }else{\n input.setCustomValidity('');\n }\n }\n}", "title": "" }, { "docid": "8a1d070ffe6bd7a7fec6a17c9e708c87", "score": "0.55818367", "text": "function checkLN(input){\n var lastName = input.value;\n if(lastName !== null){\n if(lastName.length<=1||lastName.length>30){\n input.setCustomValidity(\"Last Name must be between 2 and 30 characters\");\n }else{\n input.setCustomValidity('');\n }\n }\n}", "title": "" }, { "docid": "ecc78433f8ce604f03862ecf91ea82b9", "score": "0.557948", "text": "function validatefnameLength(){\r\n var first = document.form.fname.value;\r\n var reg1 = /^[a-zA-Z\\'\\-]{2,15}$/;\r\n\r\n if (reg1.test(first)) {\r\n return true;\r\n } else {\r\n alert(\"Please input a valid First name!\");\r\n document.form.fname.focus();\r\n return false; \r\n }\r\n}", "title": "" }, { "docid": "01696a750a777d82ff5e99c2f5cee48c", "score": "0.5570306", "text": "function valid_name(name){\n var div_name=document.getElementById(\"div_name\")\n console.log(name);\n if(name.length < 4){\n var p=document.createElement(\"p\")\n p.textContent=\"****username must have min 4 Characters****\"\n div_name.appendChild(p)\n return 0\n }\n}", "title": "" }, { "docid": "bac4c2c7d64ae76014752fb408c66199", "score": "0.55677736", "text": "validateName(type, label, isRequired = false) {\n let name = this.state.user[type],\n error = null;\n\n if (isRequired && (!name || name.length <= 3)) {\n error = `${label} should be 3 or more characters`;\n }\n // Checks for alphabhets and space\n else if (name && !/^[a-z\\s]+$/i.test(name)) {\n error = `${label} can only contain alphabets`;\n }\n\n if (!error) {\n return true;\n }\n\n this.showToast(error);\n return false;\n }", "title": "" }, { "docid": "a62ae35af6c4c30fd6c38b66af3258e2", "score": "0.55643904", "text": "function validate() {\n\t\n game.firstName = info[0].value;\n game.LastName = info[1].value;\n var val = true;\n\t\n var reg = /^[a-zA-Z ]{1,15}$/\n\t\n if (reg.test(game.firstName)) {\n val = true;\n }else{\n\tinfo[0].setAttribute('placeholder', 'You Must Enter Your First Name');\n\tval=false;\n\t}\n\t\n\tif (reg.test(game.LastName)) {\n val = true;\n }else{\n\tinfo[1].setAttribute('placeholder', 'You Must Enter Your Last Name');\n\tval=false;\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\treturn val;\n\t\n // if (val) {\n // userName.innerHTML = game.firstName;\n // return val;\n // }\n}", "title": "" }, { "docid": "0b1a876e2289e48abfc278729ad33e94", "score": "0.55606854", "text": "function inputFormatCheck(mot) {\n let regex = /^[a-z]{1}$/\n let check = regex.test(mot);\n return check;\n}", "title": "" }, { "docid": "71273c109c9c1f48def6fef7961e3e4e", "score": "0.55568963", "text": "function validarComentario()\r\n{\r\n\r\n\tvar comentario = $(\"#comentario\").val();\r\n\r\n\tif(comentario != \"\")\r\n\t{\r\n\t\tvar expresion = /^[,\\\\.\\\\a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]*$/;\r\n\r\n\t\tif(!expresion.test(comentario))\r\n\t\t{\r\n\t\t\t$(\"#comentario\").parent().before('<div class=\"alert alert-danger\"><strong>ERROR:</strong> No se permiten caracteres especiales como por ejemplo !$%&/?¡¿[]*</div>');\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$(\"#comentario\").parent().before('<div class=\"alert alert-warning\"><strong>ERROR:</strong> Campo obligatorio</div>');\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\r\n\treturn true;\r\n\r\n}", "title": "" }, { "docid": "7d6a707da8ab97f2400f65b537d93430", "score": "0.55510724", "text": "function valNombre(){\r\n \r\n var elemento = document.getElementById(\"name\");\r\n \r\n if(!elemento.checkValidity()){\r\n \r\n if(elemento.validity.valueMissing) error(elemento, \"Nombre requerido\");\r\n if(elemento.validity.patternMismatch) error(elemento, \"Nombre mal introducido\");\r\n return false;\r\n \r\n }\r\n \r\n elemento.className = \"valido\";\r\n return true;\r\n \r\n}", "title": "" } ]
b39cb880d3f1b38c375deb84d579b143
Merge two option objects into a new one. Core utility used in both instantiation and inheritance.
[ { "docid": "490b0c86e2500eda9a00f6fc9ccdc388", "score": "0.65490943", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" } ]
[ { "docid": "513080177a1d2c4654e2b930b839bcb8", "score": "0.7287277", "text": "function merge_options(o1, o2) {\r\n\r\n\t\t\tvar o3 = {},\r\n\t\t\t\tattrname;\r\n\r\n\t\t\tfor (attrname in o1) {\r\n\t\t\t\tif (o1.hasOwnProperty(attrname)) {\r\n\t\t\t\t\to3[attrname] = o1[attrname];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (attrname in o2) {\r\n\t\t\t\tif (o2.hasOwnProperty(attrname)) {\r\n\t\t\t\t\to3[attrname] = o2[attrname];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn o3;\r\n\t\t}", "title": "" }, { "docid": "0017ac46ddce01d58ae583ce57330cfd", "score": "0.7285419", "text": "function merge_options(obj1,obj2){\n var obj3 = {};\n for (var attr in obj1) { obj3[attr] = obj1[attr]; }\n for (var attr in obj2) { obj3[attr] = obj2[attr]; }\n return obj3;\n}", "title": "" }, { "docid": "31345313827f5535ec18fb80693219f1", "score": "0.72174054", "text": "function _mergeOptions(obj1,obj2) {\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n }", "title": "" }, { "docid": "31345313827f5535ec18fb80693219f1", "score": "0.72174054", "text": "function _mergeOptions(obj1,obj2) {\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n }", "title": "" }, { "docid": "31345313827f5535ec18fb80693219f1", "score": "0.72174054", "text": "function _mergeOptions(obj1,obj2) {\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n }", "title": "" }, { "docid": "31345313827f5535ec18fb80693219f1", "score": "0.72174054", "text": "function _mergeOptions(obj1,obj2) {\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n }", "title": "" }, { "docid": "31345313827f5535ec18fb80693219f1", "score": "0.72174054", "text": "function _mergeOptions(obj1,obj2) {\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n }", "title": "" }, { "docid": "31345313827f5535ec18fb80693219f1", "score": "0.72174054", "text": "function _mergeOptions(obj1,obj2) {\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n }", "title": "" }, { "docid": "2bdf96b4fa1735ec3309d50d3397e816", "score": "0.7212734", "text": "function mergeOptions() {\n var mergedOptions = {};\n var args = arguments;\n // Iterate over all specified options objects and add all properties to the new options object\n for (var i = 0; i < args[_LENGTH_]; i++) {\n var argument = args[i];\n for (var key in argument) {\n if (argument.hasOwnProperty(key)) {\n mergedOptions[key] = argument[key];\n }\n }\n }\n return mergedOptions;\n }", "title": "" }, { "docid": "d76982543cf8e56de6f056d70539403f", "score": "0.72024983", "text": "function merge_options(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n}", "title": "" }, { "docid": "73d1df3e46da2af17eaea5bad35d6989", "score": "0.7179916", "text": "function merge_options(obj1,obj2){\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n }", "title": "" }, { "docid": "1ace4f235bfdbffc2a367fa49d86e2e9", "score": "0.7139866", "text": "function _mergeOptions(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n }", "title": "" }, { "docid": "8801d56daba9b9d1d7d852906f57e753", "score": "0.71215516", "text": "function mergeOpts(opts1, opts2) {\n var newOpts = __assign({}, opts1);\n if (opts2.hasOwnProperty(\"discover\")) {\n newOpts.discover = opts2.discover;\n }\n if (opts2.hasOwnProperty(\"numberedExpressions\")) {\n newOpts.numberedExpressions = opts2.numberedExpressions;\n }\n if (opts2.extract && opts2.extract.location) {\n if (newOpts.extract) {\n newOpts.extract.location = opts2.extract.location;\n }\n else {\n newOpts.extract = opts2.extract;\n }\n }\n return newOpts;\n}", "title": "" }, { "docid": "1233d26c8affda5a7ad32e06a51878a8", "score": "0.7109513", "text": "function mergeOption(oldOption, newOption) {\n\t newOption = newOption || {};\n\t\n\t each(newOption, function (newCptOpt, mainType) {\n\t if (newCptOpt == null) {\n\t return;\n\t }\n\t\n\t var oldCptOpt = oldOption[mainType];\n\t\n\t if (!ComponentModel.hasClass(mainType)) {\n\t oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n\t }\n\t else {\n\t newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n\t oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\t\n\t var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\t\n\t oldOption[mainType] = map(mapResult, function (item) {\n\t return (item.option && item.exist)\n\t ? merge(item.exist, item.option, true)\n\t : (item.exist || item.option);\n\t });\n\t }\n\t });\n\t }", "title": "" }, { "docid": "640b5e6efdab45aafaf81dc25b4b8e35", "score": "0.7096427", "text": "function mergeOptions(optionObjs) {\n return mergeProps(optionObjs, complexOptions);\n } // TODO: move this stuff to a \"plugin\"-related file...", "title": "" }, { "docid": "d52a5f2ecb2ce59cc1495c53bd1136a4", "score": "0.7093047", "text": "function mergeOptions(optionObjs){return util_1.mergeProps(optionObjs,complexOptions);}", "title": "" }, { "docid": "72f30df73cbc06fb798ba85cbfe777e2", "score": "0.7079222", "text": "function mergeOptions(optionObjs){return mergeProps(optionObjs,complexOptions);}", "title": "" }, { "docid": "9c74e351181803dc6564b9acf4c3f947", "score": "0.70722127", "text": "function mergeOption(oldOption, newOption) {\n\t newOption = newOption || {};\n\n\t each(newOption, function (newCptOpt, mainType) {\n\t if (newCptOpt == null) {\n\t return;\n\t }\n\n\t var oldCptOpt = oldOption[mainType];\n\n\t if (!ComponentModel.hasClass(mainType)) {\n\t oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n\t }\n\t else {\n\t newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n\t oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\n\t var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\n\t oldOption[mainType] = map(mapResult, function (item) {\n\t return (item.option && item.exist)\n\t ? merge(item.exist, item.option, true)\n\t : (item.exist || item.option);\n\t });\n\t }\n\t });\n\t }", "title": "" }, { "docid": "9c74e351181803dc6564b9acf4c3f947", "score": "0.70722127", "text": "function mergeOption(oldOption, newOption) {\n\t newOption = newOption || {};\n\n\t each(newOption, function (newCptOpt, mainType) {\n\t if (newCptOpt == null) {\n\t return;\n\t }\n\n\t var oldCptOpt = oldOption[mainType];\n\n\t if (!ComponentModel.hasClass(mainType)) {\n\t oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n\t }\n\t else {\n\t newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n\t oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\n\t var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\n\t oldOption[mainType] = map(mapResult, function (item) {\n\t return (item.option && item.exist)\n\t ? merge(item.exist, item.option, true)\n\t : (item.exist || item.option);\n\t });\n\t }\n\t });\n\t }", "title": "" }, { "docid": "9c74e351181803dc6564b9acf4c3f947", "score": "0.70722127", "text": "function mergeOption(oldOption, newOption) {\n\t newOption = newOption || {};\n\n\t each(newOption, function (newCptOpt, mainType) {\n\t if (newCptOpt == null) {\n\t return;\n\t }\n\n\t var oldCptOpt = oldOption[mainType];\n\n\t if (!ComponentModel.hasClass(mainType)) {\n\t oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n\t }\n\t else {\n\t newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n\t oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\n\t var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\n\t oldOption[mainType] = map(mapResult, function (item) {\n\t return (item.option && item.exist)\n\t ? merge(item.exist, item.option, true)\n\t : (item.exist || item.option);\n\t });\n\t }\n\t });\n\t }", "title": "" }, { "docid": "8fd9bc568ddf9ce2e0c49bfd6a47d09a", "score": "0.70531046", "text": "function mergeOption(oldOption, newOption) {\n\t newOption = newOption || {};\n\t each(newOption, function (newCptOpt, mainType) {\n\t if (newCptOpt == null) {\n\t return;\n\t }\n\n\t var oldCptOpt = oldOption[mainType];\n\n\t if (!ComponentModel.hasClass(mainType)) {\n\t oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n\t } else {\n\t newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n\t oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\t var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\t oldOption[mainType] = map(mapResult, function (item) {\n\t return item.option && item.exist ? merge(item.exist, item.option, true) : item.exist || item.option;\n\t });\n\t }\n\t });\n\t}", "title": "" }, { "docid": "710211e10cc74477d304b565b2dbfbc3", "score": "0.70522285", "text": "mergeOptions(obj1, obj2) {\n let obj3 = {};\n for (let attr1 in obj1) { obj3[attr1] = obj1[attr1] }\n for (let attr2 in obj2) { obj3[attr2] = obj2[attr2] }\n return obj3;\n }", "title": "" }, { "docid": "b328f7e5b68aba9e353016324f844cdb", "score": "0.7029882", "text": "function mergeOptions(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n if (obj1.hasOwnProperty(attrname)) {\n obj3[attrname] = obj1[attrname];\n }\n }\n for (var attrname in obj2) {\n if (obj2.hasOwnProperty(attrname)) {\n obj3[attrname] = obj2[attrname];\n }\n }\n return obj3;\n}", "title": "" }, { "docid": "e0554711592184413c6c318592f02a25", "score": "0.7020577", "text": "function mergeOption(oldOption, newOption) {\n\t newOption = newOption || {};\n\n\t each(newOption, function (newCptOpt, mainType) {\n\t if (newCptOpt == null) {\n\t return;\n\t }\n\n\t var oldCptOpt = oldOption[mainType];\n\n\t if (!ComponentModel.hasClass(mainType)) {\n\t oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n\t } else {\n\t newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n\t oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\n\t var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\n\t oldOption[mainType] = map(mapResult, function (item) {\n\t return item.option && item.exist ? merge(item.exist, item.option, true) : item.exist || item.option;\n\t });\n\t }\n\t });\n\t}", "title": "" }, { "docid": "efb1562f68723eeb5bcafa8815d8461b", "score": "0.6981539", "text": "function mergeOption(oldOption, newOption) {\n newOption = newOption || {};\n\n each(newOption, function (newCptOpt, mainType) {\n if (newCptOpt == null) {\n return;\n }\n\n var oldCptOpt = oldOption[mainType];\n\n if (!ComponentModel.hasClass(mainType)) {\n oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n }\n else {\n newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\n var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\n oldOption[mainType] = map(mapResult, function (item) {\n return (item.option && item.exist)\n ? merge(item.exist, item.option, true)\n : (item.exist || item.option);\n });\n }\n });\n }", "title": "" }, { "docid": "efb1562f68723eeb5bcafa8815d8461b", "score": "0.6981539", "text": "function mergeOption(oldOption, newOption) {\n newOption = newOption || {};\n\n each(newOption, function (newCptOpt, mainType) {\n if (newCptOpt == null) {\n return;\n }\n\n var oldCptOpt = oldOption[mainType];\n\n if (!ComponentModel.hasClass(mainType)) {\n oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);\n }\n else {\n newCptOpt = modelUtil.normalizeToArray(newCptOpt);\n oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);\n\n var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);\n\n oldOption[mainType] = map(mapResult, function (item) {\n return (item.option && item.exist)\n ? merge(item.exist, item.option, true)\n : (item.exist || item.option);\n });\n }\n });\n }", "title": "" }, { "docid": "67b93a4b4c95d992339b3ed45f1cfb91", "score": "0.6959447", "text": "function mergeOption(oldOption, newOption) {\n newOption = newOption || {};\n\n each$4(newOption, function (newCptOpt, mainType) {\n if (newCptOpt == null) {\n return;\n }\n\n var oldCptOpt = oldOption[mainType];\n\n if (!ComponentModel.hasClass(mainType)) {\n oldOption[mainType] = merge$1(oldCptOpt, newCptOpt, true);\n }\n else {\n newCptOpt = normalizeToArray(newCptOpt);\n oldCptOpt = normalizeToArray(oldCptOpt);\n\n var mapResult = mappingToExists(oldCptOpt, newCptOpt);\n\n oldOption[mainType] = map$1(mapResult, function (item) {\n return (item.option && item.exist)\n ? merge$1(item.exist, item.option, true)\n : (item.exist || item.option);\n });\n }\n });\n}", "title": "" }, { "docid": "15a83e92a2a52b345674a33dc6406507", "score": "0.6889666", "text": "function merge() {\n var i,\n args = arguments,\n len,\n ret = {},\n doCopy = function (copy, original) {\n var value, key;\n\n // An object is replacing a primitive\n if (typeof copy !== 'object') {\n copy = {};\n }\n\n for (key in original) {\n if (original.hasOwnProperty(key)) {\n value = original[key];\n\n // Copy the contents of objects, but not arrays or DOM nodes\n if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' &&\n key !== 'renderTo' && typeof value.nodeType !== 'number') {\n copy[key] = doCopy(copy[key] || {}, value);\n\n // Primitives and arrays are copied over directly\n } else {\n copy[key] = original[key];\n }\n }\n }\n return copy;\n };\n\n // If first argument is true, copy into the existing object. Used in setOptions.\n if (args[0] === true) {\n ret = args[1];\n args = Array.prototype.slice.call(args, 2);\n }\n\n // For each argument, extend the return\n len = args.length;\n for (i = 0; i < len; i++) {\n ret = doCopy(ret, args[i]);\n }\n\n return ret;\n }", "title": "" }, { "docid": "230470edc989d54fe09c369fffe73c58", "score": "0.6868251", "text": "function mergeOptions(target) {\n\n\tfunction mergeIntoTarget(name, value) {\n\t\tif ($.isPlainObject(value) && $.isPlainObject(target[name]) && !isForcedAtomicOption(name)) {\n\t\t\t// merge into a new object to avoid destruction\n\t\t\ttarget[name] = mergeOptions({}, target[name], value); // combine. `value` object takes precedence\n\t\t}\n\t\telse if (value !== undefined) { // only use values that are set and not undefined\n\t\t\ttarget[name] = value;\n\t\t}\n\t}\n\n\tfor (var i=1; i<arguments.length; i++) {\n\t\t$.each(arguments[i], mergeIntoTarget);\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "230470edc989d54fe09c369fffe73c58", "score": "0.6868251", "text": "function mergeOptions(target) {\n\n\tfunction mergeIntoTarget(name, value) {\n\t\tif ($.isPlainObject(value) && $.isPlainObject(target[name]) && !isForcedAtomicOption(name)) {\n\t\t\t// merge into a new object to avoid destruction\n\t\t\ttarget[name] = mergeOptions({}, target[name], value); // combine. `value` object takes precedence\n\t\t}\n\t\telse if (value !== undefined) { // only use values that are set and not undefined\n\t\t\ttarget[name] = value;\n\t\t}\n\t}\n\n\tfor (var i=1; i<arguments.length; i++) {\n\t\t$.each(arguments[i], mergeIntoTarget);\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "638d26ffd6c0875f4ffa6c0516d6ce1e", "score": "0.6814243", "text": "function mergeOptions(parent,child,vm){if(true){checkComponents(child);}if(typeof child==='function'){child=child.options;}normalizeProps(child,vm);normalizeInject(child,vm);normalizeDirectives(child);// Apply extends and mixins on the child options,\n// but only if it is a raw options object that isn't\n// the result of another mergeOptions call.\n// Only merged options has the _base property.\nif(!child._base){if(child.extends){parent=mergeOptions(parent,child.extends,vm);}if(child.mixins){for(var i=0,l=child.mixins.length;i<l;i++){parent=mergeOptions(parent,child.mixins[i],vm);}}}var options={};var key;for(key in parent){mergeField(key);}for(key in child){if(!hasOwn(parent,key)){mergeField(key);}}function mergeField(key){var strat=strats[key]||defaultStrat;options[key]=strat(parent[key],child[key],vm,key);}return options;}", "title": "" }, { "docid": "7c9710a7eb462d73eab9317ec2b20c19", "score": "0.6805658", "text": "function merge() {\n\tvar i,\n\t\targs = arguments,\n\t\tlen,\n\t\tret = {},\n\t\tdoCopy = function (copy, original) {\n\t\t\tvar value, key;\n\n\t\t\t// An object is replacing a primitive\n\t\t\tif (typeof copy !== 'object') {\n\t\t\t\tcopy = {};\n\t\t\t}\n\n\t\t\tfor (key in original) {\n\t\t\t\tif (original.hasOwnProperty(key)) {\n\t\t\t\t\tvalue = original[key];\n\n\t\t\t\t\t// Copy the contents of objects, but not arrays or DOM nodes\n\t\t\t\t\tif (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' &&\n\t\t\t\t\t\t\tkey !== 'renderTo' && typeof value.nodeType !== 'number') {\n\t\t\t\t\t\tcopy[key] = doCopy(copy[key] || {}, value);\n\t\t\t\t\n\t\t\t\t\t// Primitives and arrays are copied over directly\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcopy[key] = original[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t};\n\n\t// If first argument is true, copy into the existing object. Used in setOptions.\n\tif (args[0] === true) {\n\t\tret = args[1];\n\t\targs = Array.prototype.slice.call(args, 2);\n\t}\n\n\t// For each argument, extend the return\n\tlen = args.length;\n\tfor (i = 0; i < len; i++) {\n\t\tret = doCopy(ret, args[i]);\n\t}\n\n\treturn ret;\n}", "title": "" }, { "docid": "aba11436b16df0b4274a1d7b4539f2a0", "score": "0.6805645", "text": "function mergeOptions(dstOptions, srcOptions) {\n if (!dstOptions && !srcOptions) { \n return {};\n }\n\n if (!dstOptions) {\n return angular.copy(srcOptions);\n }\n\n if (!dstOptions) {\n return dstOptions;\n }\n\n return angular.extend({}, srcOptions, dstOptions);\n }", "title": "" }, { "docid": "8fc74ef0205fa8fb6b6ae046488e3ea5", "score": "0.67938226", "text": "function _mergeOptions(opts)\n\t{\n\t\tif (EZ.isObject(opts))\n\t\t{\n\t\t\tif ('.defaults.groups'.ov(opts))\t\t\n\t\t\t{\n\t\t\t\tObject.keys(opts).forEach(function(key)\n\t\t\t\t{\n\t\t\t\t\tif (typeof(opts[key]) == 'function') return;\n\t\t\t\t\t\n\t\t\t\t\tvar value = getValue(key, opts[key]);\n\t\t\t\t\tif (value instanceof Object)\n\t\t\t\t\t\tvalue = value.cloneObject({objects:false, functions:false})\t\n\t\t\t\t\t\n\t\t\t\t\toptions[key] = value;\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\t\t\t\t\t\t\t\t\t//11-11-2016 replaced by above (deep clone) \n\t\t\t{\n\t\t\t\tfor (var key in opts)\n\t\t\t\t{\n\t\t\t\t\tif (typeof(opts[key]) != 'function')\n\t\t\t\t\t\toptions[key] = getValue(key, opts[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e613d38a7edfd43e8b0e77e2ed4ddb45", "score": "0.67908484", "text": "function merge() {\n\tvar i,\n\t\targs = arguments,\n\t\tlen,\n\t\tret = {},\n\t\tdoCopy = function (copy, original) {\n\t\t\tvar value, key;\n\n\t\t\t// An object is replacing a primitive\n\t\t\tif (typeof copy !== 'object') {\n\t\t\t\tcopy = {};\n\t\t\t}\n\n\t\t\tfor (key in original) {\n\t\t\t\tif (original.hasOwnProperty(key)) {\n\t\t\t\t\tvalue = original[key];\n\n\t\t\t\t\t// Copy the contents of objects, but not arrays or DOM nodes\n\t\t\t\t\tif (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]'\n\t\t\t\t\t\t\t&& key !== 'renderTo' && typeof value.nodeType !== 'number') {\n\t\t\t\t\t\tcopy[key] = doCopy(copy[key] || {}, value);\n\t\t\t\t\n\t\t\t\t\t// Primitives and arrays are copied over directly\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcopy[key] = original[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t};\n\n\t// If first argument is true, copy into the existing object. Used in setOptions.\n\tif (args[0] === true) {\n\t\tret = args[1];\n\t\targs = Array.prototype.slice.call(args, 2);\n\t}\n\n\t// For each argument, extend the return\n\tlen = args.length;\n\tfor (i = 0; i < len; i++) {\n\t\tret = doCopy(ret, args[i]);\n\t}\n\n\treturn ret;\n}", "title": "" }, { "docid": "05bf668711d18c4edf6ec2a7316ae1c6", "score": "0.67806876", "text": "function merge() {\n var i,\n args = arguments,\n len,\n ret = {};\n\n function doCopy(copy, original) {\n var value, key;\n\n // An object is replacing a primitive\n if (typeof copy !== 'object') {\n copy = {};\n }\n\n for (key in original) {\n if (original.hasOwnProperty(key)) {\n value = original[key];\n\n // Copy the contents of objects, but not arrays or DOM nodes\n if (value && key !== 'renderTo' && typeof value.nodeType !== 'number' &&\n typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]') {\n copy[key] = doCopy(copy[key] || {}, value);\n }\n // Primitives and arrays are copied over directly\n else {\n copy[key] = original[key];\n }\n }\n }\n\n return copy;\n }\n\n // If first argument is true, copy into the existing object. Used in setOptions.\n if (args[0] === true) {\n ret = args[1];\n args = Array.prototype.slice.call(args, 2);\n }\n\n // For each argument, extend the return\n len = args.length;\n for (i = 0; i < len; i++) {\n ret = doCopy(ret, args[i]);\n }\n\n return ret;\n }", "title": "" }, { "docid": "6a4c4aa3456cf9418c9b207b2846d2f2", "score": "0.67135435", "text": "function mergeOptions(parent, child, vm) {\n // if (\"development\" !== 'production') {\n // checkComponents(child)\n // }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key = void 0;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn$1(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n}", "title": "" }, { "docid": "8b5d625fe4aa196e96cf7209b593a3f9", "score": "0.6656754", "text": "function mergeOptions(parent, child, vm) {\n {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n }", "title": "" }, { "docid": "8b5d625fe4aa196e96cf7209b593a3f9", "score": "0.6656754", "text": "function mergeOptions(parent, child, vm) {\n {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n }", "title": "" }, { "docid": "48c731b26a6a69a683b883860578f67e", "score": "0.6640406", "text": "function mergeOptions(parent, child, vm) {\n if (process.env.NODE_ENV !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n}", "title": "" }, { "docid": "48c731b26a6a69a683b883860578f67e", "score": "0.6640406", "text": "function mergeOptions(parent, child, vm) {\n if (process.env.NODE_ENV !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n}", "title": "" }, { "docid": "9b51cbe8b88ce4acc6c375d623e22071", "score": "0.6627543", "text": "function mergeOptions(parent, child, vm) {\n if (\"development\" !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "e18f51f149be9cae404cb5a219632f6b", "score": "0.66095877", "text": "function common_mergeOptions( tgt, src )\n{\n // If the target evaluates to something that is false, then there\n // is likely nothing to merge. Return src.\n if (!tgt)\n return src;\n // If the source isn't a real value, then there is likely nothing\n // to merge. Return tgt.\n if (typeof src === 'undefined' || src === null)\n return tgt;\n\n for (var key in src)\n {\n if (src.hasOwnProperty( key ))\n {\n var srcCopy = src[ key ];\n\n // Prevent never-ending loop\n if (tgt === srcCopy)\n continue;\n\n // Check to see if the source is an object that evaluates to true\n // (ie, not null). Do not merge arrays!\n if (srcCopy && common_toType( srcCopy ) == 'object')\n {\n // Make sure the target is an object, or create a new one\n var tgtCopy = (tgt[ key ] && common_toType( tgt[ key ] ) == 'object') ? tgt[ key ] : {};\n\n tgt[ key ] = common_mergeOptions( tgtCopy, srcCopy );\n }\n else\n tgt[ key ] = srcCopy;\n }\n }\n\n return tgt;\n}", "title": "" }, { "docid": "7874f937ba29458ed2d0c0adc269ccab", "score": "0.6609153", "text": "function mergeOptions(parent, child, vm) {\n if ('production' !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child);\n normalizeInject(child);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n }", "title": "" }, { "docid": "8debb3ac9f3061699ca7ae0db3f940c7", "score": "0.6595811", "text": "function mergeOptions(optionObjs) {\n return mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "8debb3ac9f3061699ca7ae0db3f940c7", "score": "0.6595811", "text": "function mergeOptions(optionObjs) {\n return mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "6b17beb91ea1e293c3c8808eb1646789", "score": "0.6595082", "text": "function mergeOptions(optionObjs) {\r\n return util_1.mergeProps(optionObjs, complexOptions);\r\n}", "title": "" }, { "docid": "1a5f94dc0a7479f09ba4e071ed3abbf7", "score": "0.6593696", "text": "function mergeOptions(parent, child, vm) {\n {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n }", "title": "" }, { "docid": "dd8e0d61b9be34b81c15733bc8c84667", "score": "0.6590598", "text": "function mergeOptions() {\n for (var _len = arguments.length, opts = Array(_len), _key = 0; _key < _len; _key++) {\n opts[_key] = arguments[_key];\n }\n\n var headers = opts.reduce(function (merged, options) {\n if (!merged && !options.headers) {\n return null;\n }\n return assign(merged || {}, options.headers || {});\n }, null);\n return assign.apply(undefined, opts.concat([headers ? { headers: headers } : {}]));\n}", "title": "" }, { "docid": "4b3fe6538d5be8a53b009ec6f157b9f4", "score": "0.65845937", "text": "function mergeOptions(optionObjs) {\n return util_1.mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "4b3fe6538d5be8a53b009ec6f157b9f4", "score": "0.65845937", "text": "function mergeOptions(optionObjs) {\n return util_1.mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "2af43f12e2eb7ff97e6f0d8cd12997af", "score": "0.65826386", "text": "function mergeOptions(parent,child,vm){if(true){checkComponents(child);}if(typeof child==='function'){child=child.options;}normalizeProps(child);normalizeInject(child);normalizeDirectives(child);var extendsFrom=child.extends;if(extendsFrom){parent=mergeOptions(parent,extendsFrom,vm);}if(child.mixins){for(var i=0,l=child.mixins.length;i<l;i++){parent=mergeOptions(parent,child.mixins[i],vm);}}var options={};var key;for(key in parent){mergeField(key);}for(key in child){if(!hasOwn(parent,key)){mergeField(key);}}function mergeField(key){var strat=strats[key]||defaultStrat;options[key]=strat(parent[key],child[key],vm,key);}return options;}", "title": "" }, { "docid": "c432972cca20b5039181a4e0764c2ac6", "score": "0.6577554", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (Object({\"BROWSER\":true}).NODE_ENV !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "498859eeef3a2cebb1c2af27bf3e4b7a", "score": "0.65662956", "text": "function mergeOptions(options) {\n return Object.assign({\n width: 250,\n height: 80,\n color: '#ebebeb',\n alpha: 0.8,\n font: '10px Arial'\n }, options);\n }", "title": "" }, { "docid": "e1ca1e8756d0574c7482d6e873960db9", "score": "0.6564025", "text": "function mergeOptions(mergeTarget, options, option) {\n var globalOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n // Local helpers\n var isPresent = function isPresent(obj) {\n return obj !== null && obj !== undefined;\n };\n\n var isObject = function isObject(obj) {\n return obj !== null && _typeof_1(obj) === 'object';\n }; // https://stackoverflow.com/a/34491287/1223531\n\n\n var isEmpty = function isEmpty(obj) {\n for (var x in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, x)) {\n return false;\n }\n }\n\n return true;\n }; // Guards\n\n\n if (!isObject(mergeTarget)) {\n throw new Error('Parameter mergeTarget must be an object');\n }\n\n if (!isObject(options)) {\n throw new Error('Parameter options must be an object');\n }\n\n if (!isPresent(option)) {\n throw new Error('Parameter option must have a value');\n }\n\n if (!isObject(globalOptions)) {\n throw new Error('Parameter globalOptions must be an object');\n } //\n // Actual merge routine, separated from main logic\n // Only a single level of options is merged. Deeper levels are ref'd. This may actually be an issue.\n //\n\n\n var doMerge = function doMerge(target, options, option) {\n if (!isObject(target[option])) {\n target[option] = {};\n }\n\n var src = options[option];\n var dst = target[option];\n\n for (var prop in src) {\n if (Object.prototype.hasOwnProperty.call(src, prop)) {\n dst[prop] = src[prop];\n }\n }\n }; // Local initialization\n\n\n var srcOption = options[option];\n var globalPassed = isObject(globalOptions) && !isEmpty(globalOptions);\n var globalOption = globalPassed ? globalOptions[option] : undefined;\n var globalEnabled = globalOption ? globalOption.enabled : undefined; /////////////////////////////////////////\n // Main routine\n /////////////////////////////////////////\n\n if (srcOption === undefined) {\n return; // Nothing to do\n }\n\n if (typeof srcOption === 'boolean') {\n if (!isObject(mergeTarget[option])) {\n mergeTarget[option] = {};\n }\n\n mergeTarget[option].enabled = srcOption;\n return;\n }\n\n if (srcOption === null && !isObject(mergeTarget[option])) {\n // If possible, explicit copy from globals\n if (isPresent(globalOption)) {\n mergeTarget[option] = Object.create(globalOption);\n } else {\n return; // Nothing to do\n }\n }\n\n if (!isObject(srcOption)) {\n return;\n } //\n // Ensure that 'enabled' is properly set. It is required internally\n // Note that the value from options will always overwrite the existing value\n //\n\n\n var enabled = true; // default value\n\n if (srcOption.enabled !== undefined) {\n enabled = srcOption.enabled;\n } else {\n // Take from globals, if present\n if (globalEnabled !== undefined) {\n enabled = globalOption.enabled;\n }\n }\n\n doMerge(mergeTarget, options, option);\n mergeTarget[option].enabled = enabled;\n }", "title": "" }, { "docid": "5a28b4248df7c6bac53752bce1a2ac2d", "score": "0.65639913", "text": "function mergeOptions(parent, child, vm) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child[\"extends\"]) {\n parent = mergeOptions(parent, child[\"extends\"], vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "aa2d494d5d2ca0236b5d2b78ac61ddae", "score": "0.65609413", "text": "function mergeOptions(parent, child, vm) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "3e7777e99629c3de6ae58ff6b7aebf3c", "score": "0.6554239", "text": "function mergeOptions(parent, child, vm) {\n if (\"production\" !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "daa73fa6ea689031cfc75a2a2e3cc5cc", "score": "0.6552376", "text": "function mergeOptions(parent, child, vm) {\n if (\"development\" !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "daa73fa6ea689031cfc75a2a2e3cc5cc", "score": "0.6552376", "text": "function mergeOptions(parent, child, vm) {\n if (\"development\" !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "daa73fa6ea689031cfc75a2a2e3cc5cc", "score": "0.6552376", "text": "function mergeOptions(parent, child, vm) {\n if (\"development\" !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "daa73fa6ea689031cfc75a2a2e3cc5cc", "score": "0.6552376", "text": "function mergeOptions(parent, child, vm) {\n if (\"development\" !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "daa73fa6ea689031cfc75a2a2e3cc5cc", "score": "0.6552376", "text": "function mergeOptions(parent, child, vm) {\n if (\"development\" !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child); // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n\n for (key in parent) {\n mergeField(key);\n }\n\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n\n return options;\n}", "title": "" }, { "docid": "e9ee2e77d925abc56e139f39a64db406", "score": "0.6550996", "text": "function mergeOptions(optionObjs) {\r\n\treturn mergeProps(optionObjs, complexOptions);\r\n}", "title": "" }, { "docid": "dfdda32252a3e0989cbe2137606f96fd", "score": "0.65461665", "text": "function mergeOptions(parent, child, vm) {\n if (typeof child === \"function\") {\n child = child.options\n }\n\n normalizeProps(child)\n normalizeInject(child)\n normalizeDirectives(child)\n var extendsFrom = child.extends\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm)\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm)\n }\n }\n var options = {}\n var key\n for (key in parent) {\n mergeField(key)\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key)\n }\n }\n\n function mergeField(key) {\n var strat = strats[key] || defaultStrat\n options[key] = strat(parent[key], child[key], vm, key)\n }\n return options\n }", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "cfcfd4f19302c7777830b2b59080e1b8", "score": "0.65453386", "text": "function mergeOptions(optionObjs) {\n\treturn mergeProps(optionObjs, complexOptions);\n}", "title": "" }, { "docid": "586f1409ba0483d0fd66aa209d17c4be", "score": "0.65414274", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child);\n normalizeInject(child);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "7c5bfc290e0b2e98c7328ee23c8d128a", "score": "0.6538862", "text": "function mergeJsonOptions(a, b) {\n var _a, _b;\n let c = Object.assign(Object.assign({}, a), b);\n c.typeRegistry = [...((_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : []), ...((_b = b === null || b === void 0 ? void 0 : b.typeRegistry) !== null && _b !== void 0 ? _b : [])];\n return c;\n}", "title": "" }, { "docid": "f6104e8821ba5e38c67b3f451b1a9e1c", "score": "0.653158", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child);\n normalizeInject(child);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "f6104e8821ba5e38c67b3f451b1a9e1c", "score": "0.653158", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child);\n normalizeInject(child);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" }, { "docid": "452ee1e976f2e262f9c193671c47770d", "score": "0.65301037", "text": "function mergeOptions (\n parent,\n child,\n vm\n) {\n if (true) {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n var extendsFrom = child.extends;\n if (extendsFrom) {\n parent = mergeOptions(parent, extendsFrom, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}", "title": "" } ]
0afb8286473f04f728375bd26f2b4a7d
Button Functions / Description : Button Response function to insert the Custom Properties Table at the current location Author : Hany Elkady Reference : Created : 26NOV2019 Modified : 26NOV2019 Status : WiP
[ { "docid": "307e9a83673bc67c0cb229bd96c67820", "score": "0.6770707", "text": "function GeneTabPGInsertPTable(event) {\n\n //Debug Button Press\n fDEBUG ?\n insertText(`<br><font color=\"red\"><strong>DEBUG[${sDEBUG }]:</strong></font> You Have Pressed the Insert Properties Table Button`) :\n null;\n\n //Provide Warning to User\n insertText('<br><em>DELETE ME Before Sending to Customer</em>');\n\n //Testing Insert Properties Table\n insertPropertiesTable();\n //getTableCell(theTable, 2, 2, \"Hello World!\"); \n\n //Event Completed\n event.completed();\n}", "title": "" } ]
[ { "docid": "b8a0ce792f01894ad8b5a6547a6aa1ae", "score": "0.6883298", "text": "async function insertPropertiesTable() {\n await Word.run(async (context) => {\n //Define Table Basic Outline\n const theTableData = [[\"Property\", \"Original Value\", \"New Value\"],\n [\"Title\", \"\", \"\"],\n [\"Subject\", \"\", \"\"]];\n\n //Create Table after the current insertion point\n var thePropertiesTable = context.document.body.insertTable(3, 3, Word.InsertLocation.end, theTableData);\n \n //Format Table with the correct Style\n thePropertiesTable.styleBuiltIn = Word.Style.gridTable5Dark_Accent3;\n thePropertiesTable.styleFirstColumn = false;\n\n await context.sync();\n\n return thePropertiesTable;\n });\n}", "title": "" }, { "docid": "083b71b079c30c52a5e030b36b748974", "score": "0.61556107", "text": "function addOutputWSO2EventProperty(dataType) {\n var propName = document.getElementById(\"output\" + dataType + \"DataPropName\");\n var propValueOf = document.getElementById(\"output\" + dataType + \"DataPropValueOf\");\n var propertyTable = document.getElementById(\"output\" + dataType + \"DataTable\");\n var noPropertyDiv = document.getElementById(\"noOutput\" + dataType + \"Data\");\n\n var error = \"\";\n\n if (propName.value == \"\") {\n error = \"Name field is empty.\\n\";\n }\n\n if (propValueOf.value == \"\") {\n error = \"Value Of field is empty.\\n\";\n }\n\n if (error != \"\") {\n CARBON.showErrorDialog(error);\n return;\n }\n propertyTable.style.display = \"\";\n\n\n var newTableRow = propertyTable.insertRow(propertyTable.rows.length);\n var newCell0 = newTableRow.insertCell(0);\n newCell0.innerHTML = propName.value;\n\n YAHOO.util.Dom.addClass(newCell0, \"property-names\");\n\n var newCell1 = newTableRow.insertCell(1);\n newCell1.innerHTML = propValueOf.value;\n\n YAHOO.util.Dom.addClass(newCell1, \"property-names\");\n\n var newCel3 = newTableRow.insertCell(2);\n newCel3.innerHTML = ' <a class=\"icon-link\" style=\"background-image:url(../admin/images/delete.gif)\" onclick=\"removeOutputProperty(this,\\'' + dataType + '\\')\">Delete</a>';\n\n YAHOO.util.Dom.addClass(newCel3, \"property-names\");\n\n propName.value = \"\";\n noPropertyDiv.style.display = \"none\";\n\n}", "title": "" }, { "docid": "8933796f100320a063e34e669f611fad", "score": "0.5981271", "text": "function EnterProperties(propeties) {\n $.each(propeties, function (index, Property) {\n $('#productInfoTB > tbody').append('<tr><th><label>' + Property.Name + '</th><td>' + Property.Description + '</td></tr>');\n });\n\n\n\n}", "title": "" }, { "docid": "74f6478cf6e6dac187247f79b46a3233", "score": "0.5856329", "text": "function GeneTabPGUpdtAllProprty(event) {\n\n //Debug Button Press\n fDEBUG ?\n insertText(`<br><font color=\"red\"><strong>DEBUG[${sDEBUG }]:</strong></font> You Have Pressed the Update All Properties Button`) :\n null;\n\n //Event Completed\n event.completed();\n}", "title": "" }, { "docid": "a71484abc7cbb0c3c4f3b918cf63729e", "score": "0.5801013", "text": "function addToTable(data){\r\n\r\n //Get the total number of properties\r\n var count = Object.keys(data.features).length;\r\n console.log(count);\r\n\r\n //Holds the last child element\r\n var last_child;\r\n\r\n //Find the table\r\n var table = document.querySelector(\"table\");\r\n\r\n //Loop through the data and parse it to the table\r\n for(var i = 0; i < count; i++)\r\n {\r\n\r\n var html= '<tr>'+\r\n '<td>' + data.features[i].properties.year + '</td>'+\r\n '<td>' + data.features[i].properties.property_n + '</td>'+\r\n '<td>' + data.features[i].properties.property_a + '</td>'+\r\n '<td>' + data.features[i].properties.primary_us + '</td>'+\r\n '<td>' + data.features[i].properties.energy_sta + '</td>'+\r\n '<td>' + data.features[i].properties.compliance + '</td>'+\r\n '<td>' + data.features[i].properties.site_energ + '</td>'+\r\n '<td>' + data.features[i].properties.building_s + '</td>'+\r\n '<td>' + data.features[i].properties.lat + '</td>'+\r\n '<td>' + data.features[i].properties.long + '</td>'+\r\n '<td>' + data.features[i].properties.total_annu + '</td>'+\r\n '<td>' + data.features[i].properties.parcel + '</td>'+\r\n '<td>' + data.features[i].properties.building_i + '</td>'+\r\n '<td>' + data.features[i].properties.ayb + '</td>'+\r\n '<td>' + data.features[i].properties.weather_no + '</td>'+\r\n '</tr>';\r\n\r\n //Find the last child element in the table\r\n last_child = table.lastElementChild;\r\n\r\n //Add new elements to the table\r\n last_child.insertAdjacentHTML('afterend', html);\r\n\r\n }\r\n}", "title": "" }, { "docid": "78988ffdd0964c861fe456759421cc38", "score": "0.5662224", "text": "function AddOpLocationRow() {\n // get the field values\n var area = $(\"#area\").val();\n var country = $(\"#country\").val();\n var location = $(\"#location\").val();\n\n // create the markup that needs to be added to the table\n var markup = \"<tr><td><input type='checkbox' name='olRecord'></td><td>\" + area + \"</td><td>\" + country + \"</td><td>\" + location + \"</tr>\";\n // append the markup to the tbody element of the specified table\n $(\"#opLocationInfo > tbody:last-child\").append(markup);\n\n var itemList = [];\n // decode the JSON data in the hidden control\n var existingData = JSON.parse($(\"#opLocations\").val());\n\n // create a new record using the field values entered\n var item = {\n OrganisationId: 0,\n OperationalAreaId: area,\n CountryId: country,\n Location: location\n };\n\n // check if this is the first record being inserted into the control\n if (existingData == []) {\n // push it into the blank array\n itemList.push(item);\n // encode the newly created array and save the data to the hidden control\n $(\"#opLocations\").val(JSON.stringify(itemList));\n }\n else {\n // add the new entry to the existing decoded JSON data\n existingData.push(item);\n // encode the updated array and save the data to the hidden control\n $(\"#opLocations\").val(JSON.stringify(existingData));\n }\n\n // clear the controls\n $(\"#area\").val('');\n $(\"#country\").val('');\n $(\"#location\").val('');\n}", "title": "" }, { "docid": "3576170e28b0505c1de3a4aabdad3ee1", "score": "0.5626655", "text": "_createTable(){\n let chooseFields = this._componentRoot.querySelector(\"#chooseFields\");\n\n this._updateData();\n\n window.customTbl = new TableCustom({}, this._userDataStyle, this._correctData);\n\n if (chooseFields.parentNode) {\n chooseFields.parentNode.removeChild(chooseFields);\n }\n\n this._createMessage();\n\n this.options.tableRender = true;\n }", "title": "" }, { "docid": "5e3386cfcb20a63bebd8402aaaad792e", "score": "0.5621113", "text": "function addToAdmin(newObject){\n var line = {};\n line.Brand = newObject.brand;\n line.skuCode = newObject.skuCode;\n var supplierCode = newObject.supplierCodeList; \n line.attribute = newObject.attribute;\n line.attributeCount = newObject.attributeCount;\n line.ohmies = newObject.ohmies;\n line.wholesale = newObject.wholesale;\n line.msrp = newObject.msrp;\n var supplierRow = searchString(supplierCode);\n addNewRows(\"ADMIN_INFO\", supplierRow, 1, line)\n \n}", "title": "" }, { "docid": "576b80c5f6c193c971d0857b36a7e94c", "score": "0.559536", "text": "function settable(title,fname,lname,Email,numOfAppointments,mobile,address)\n{\n t.row.add( [\n title,\n fname,\n lname,\n Email,\n numOfAppointments,\n mobile,\n address\n ] ).draw( false );\n \n\n}", "title": "" }, { "docid": "29ab902db14233647fd3b42967df7766", "score": "0.55864453", "text": "function build_rows_prop(property_list){\n rows = []\n header = \"<thead class='thead-dark'><th>S.No.<th>Property Category</th> <th>Property Type</th> <th>Property Nature</th> <th>Description</th> <th>Estimated Value</th><th>Edit</th> <th>Delete</th></thead>\"\n i = 1;\n property_list.forEach(function(row, index){\n if(row['soft_delete'] == \"Yes\"){\n return true;\n }\n index += 1;\n edit_button = \"<td><a class='delete' title='Edit' data-toggle='tooltip' onclick='edit_prop_row(\\\"prpoerty_datatable\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-edit'></i></a></td>\";\n delete_button = \"<td><a class='delete' title='Delete' data-toggle='tooltip' onclick='delete_prop_row(\\\"prpoerty_datatable\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-trash-2'></i></a></td>\";\n no = '<td>'+i+'</td>'\n html = '<tr id=\"'+index+'\">'+no+row.category+row.type+row.nature+row.desc+row.value+edit_button+delete_button+'</tr>';\n rows.push(html);\n i += 1;\n });\n return header+\"<tbody>\"+rows+\"</tbody>\";\n}", "title": "" }, { "docid": "e802f1f9a5713c5f9d32b9d4ce92daf7", "score": "0.5573478", "text": "function build_rows_property(property_list){\n rows = []\n header = \"<thead class='thead-dark'><th>S.No.</th><th>Stolen Property</th> <th>Value</th><th>Qty</th><th>Edit</th> <th>Delete</th></thead>\"\n i = 1;\n property_list.forEach(function(row, index){\n if(row['soft_delete'] == \"Yes\"){\n return true;\n }\n index += 1;\n edit_button = \"<th><a class='delete' title='Edit' onclick='edit_property_row(\\\"property_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-edit'></i></a></th>\";\n delete_button = \"<th><a class='delete' title='Delete' data-toggle='tooltip' onclick='delete_property_row(\\\"property_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-trash-2'></i></a></th>\";\n no = '<th>'+i+'</th>';\n html = '<tr id=\"'+index+'\">'+no+row.category+row.value+row.qty+edit_button+delete_button+'</tr>';\n rows.push(html);\n i += 1;\n });\n return header+\"<tbody>\"+rows+\"</tbody>\";\n}", "title": "" }, { "docid": "581aafc7915e2914e63176fb549e94a6", "score": "0.55607927", "text": "newPropertiesSheet() {\n this.properties_sheet = new MysqlDatabaseSystemProperties(this.artefact)\n }", "title": "" }, { "docid": "03625d0a5e2ebc1c7ec3a922abe0b6f5", "score": "0.553466", "text": "function setupTable() {\n window.actionEvents = {\n \"click .edit\": function (e, value, row, index) {\n showEditDialog(row);\n },\n \"click .remove\": function (e, value, row, index) {\n showRemoveDialog(row);\n }\n };\n }", "title": "" }, { "docid": "03625d0a5e2ebc1c7ec3a922abe0b6f5", "score": "0.553466", "text": "function setupTable() {\n window.actionEvents = {\n \"click .edit\": function (e, value, row, index) {\n showEditDialog(row);\n },\n \"click .remove\": function (e, value, row, index) {\n showRemoveDialog(row);\n }\n };\n }", "title": "" }, { "docid": "170e8a1edc4b7dc259c67247ffa0a11c", "score": "0.5520111", "text": "function CreateTblRow(tblName, field_setting, data_dict) {\n //console.log(\"========= CreateTblRow =========\", tblName);\n //console.log(\" data_dict\", data_dict);\n\n const field_names = field_setting.field_names;\n const field_tags = field_setting.field_tags;\n const filter_tags = field_setting.filter_tags;\n const field_align = field_setting.field_align;\n const field_width = field_setting.field_width;\n const column_count = field_names.length;\n\n const map_id = (data_dict.mapid) ? data_dict.mapid : null;\n\n// --- lookup index where this row must be inserted\n const ob1 = (data_dict.sb_code) ? data_dict.sb_code : \"\";\n const ob2 = (data_dict.username) ? data_dict.username : \"\";\n\n const row_index = b_recursive_tblRow_lookup(tblBody_datatable, setting_dict.user_lang, ob1, ob2);\n\n// --- insert tblRow into tblBody at row_index\n const tblRow = tblBody_datatable.insertRow(row_index);\n tblRow.id = map_id\n\n// --- add data attributes to tblRow\n tblRow.setAttribute(\"data-pk\", data_dict.id);\n if (!data_dict.is_active){\n tblRow.setAttribute(\"data-inactive\", \"1\");\n };\n\n// --- add data-sortby attribute to tblRow, for ordering new rows\n tblRow.setAttribute(\"data-ob1\", ob1);\n tblRow.setAttribute(\"data-ob2\", ob2);\n // NIU: tblRow.setAttribute(\"data-ob3\", ---);\n\n// --- add EventListener to tblRow\n tblRow.addEventListener(\"click\", function() {HandleTblRowClicked(tblRow)}, false);\n\n// +++ insert td's into tblRow\n for (let j = 0; j < column_count; j++) {\n const field_name = field_names[j];\n\n // - skip column if field_name in columns_hidden;\n const hide_column = columns_hidden.includes(field_name);\n if (!hide_column){\n const field_tag = field_tags[j];\n const class_width = \"tw_\" + field_width[j];\n const class_align = \"ta_\" + field_align[j];\n\n // --- insert td element,\n let td = tblRow.insertCell(-1);\n\n // --- create element with tag from field_tags\n let el = document.createElement(field_tag);\n\n // --- add data-field attribute\n el.setAttribute(\"data-field\", field_name);\n\n // --- add text_align\n el.classList.add(class_width, class_align);\n\n // --- append element\n td.appendChild(el);\n\n // --- add data-field Attribute when input element\n if (field_tag === \"input\") {\n el.setAttribute(\"type\", \"text\")\n el.setAttribute(\"autocomplete\", \"off\");\n el.setAttribute(\"ondragstart\", \"return false;\");\n el.setAttribute(\"ondrop\", \"return false;\");\n // --- add class 'input_text' and text_align\n // class 'input_text' contains 'width: 100%', necessary to keep input field within td width\n el.classList.add(\"input_text\");\n }\n\n // --- add EventListener to td\n if (field_name === \"select\") {\n // select multiple users option added PR2023-04-12\n } else if (field_name === \"username\"){\n if(tblName ===\"userallowed\"){\n el.addEventListener(\"click\", function() {MUPS_Open(el)}, false)\n } else {\n el.addEventListener(\"click\", function() {MUA_Open(\"update\", el)}, false)\n };\n el.classList.add(\"pointer_show\");\n add_hover(el);\n\n } else if ([\"sb_code\", \"school_abbrev\", \"username\", \"last_name\", \"email\"].includes(field_name)){\n el.addEventListener(\"click\", function() {MUA_Open(\"update\", el)}, false)\n el.classList.add(\"pointer_show\");\n add_hover(el);\n\n } else if ([\"role\", \"page\"].includes(field_name)){\n el.addEventListener(\"click\", function() {MUPM_Open(\"update\", el)}, false)\n el.classList.add(\"pointer_show\");\n add_hover(el);\n\n } else if ([\"role\", \"page\", \"action\", \"sequence\"].includes(field_name)){\n el.addEventListener(\"change\", function(){HandleInputChange(el)});\n\n } else if (field_name.slice(0, 5) === \"group\") {\n // attach eventlistener and hover to td, not to el. No need to add icon_class here\n td.addEventListener(\"click\", function() {UploadToggleMultiple(el)}, false)\n add_hover(td);\n\n } else if (field_name.includes(\"allowed\")) {\n if (field_name === \"allowed_clusters\") {\n if (permit_dict.permit_crud && permit_dict.requsr_same_school) {\n td.addEventListener(\"click\", function() {MSM_Open(el)}, false);\n add_hover(td);\n };\n } else {\n // users may always view allowed_sections\n el.addEventListener(\"click\", function() {MUPS_Open(el)}, false);\n add_hover(td);\n };\n\n } else if (field_name === \"activated\") {\n el.addEventListener(\"click\", function() {ModConfirmOpen(\"user\", \"send_activation_email\", el)}, false)\n\n } else if (field_name === \"is_active\") {\n el.addEventListener(\"click\", function() {ModConfirmOpen(\"user\", \"is_active\", el)}, false)\n el.classList.add(\"inactive_0_2\")\n add_hover(el);\n\n } else if ( field_name === \"last_login\") {\n // pass\n };\n\n// --- put value in field\n UpdateField(el, data_dict);\n\n } // if (!columns_hidden.includes(field_name))\n } // for (let j = 0; j < 8; j++)\n\n return tblRow;\n }", "title": "" }, { "docid": "40c4fecf03764a225f280d9e1dc501d7", "score": "0.551282", "text": "function AddColumnToTable() {\n\n $('#loadingModal').modal('show');\n\n GetCustomers(function(myObject) {\n\n var customHeader = [\n\n { 'customColumnName': ' ', 'customColumnValue': '<button class=\"btn btn-sm btn-primary\" value=\"{{Country}}\">{{CustomerID}}</button>' },\n { 'orginalColumnName': 'CustomerID', 'newColumnName': 'ID', 'Visible': false },\n { 'orginalColumnName': 'CompanyName', 'newColumnName': 'Company', 'Visible': true },\n //{ 'customColumnName': ' ', 'customColumnValue': '<button class=\"btn btn-sm btn-primary\">Submit</button>' },\n { 'orginalColumnName': 'City', 'newColumnName': 'City', 'Visible': true },\n { 'orginalColumnName': 'Country', 'newColumnName': 'Country', 'Visible': true },\n\n ];\n\n j2HTML.Table({\n Data: myObject,\n TableID: '#tbTest',\n AppendTo: '#divTable',\n CustomHeader: customHeader,\n DefaultHeader: false,\n }).Paging({\n TableID: '#tbTest',\n RowsPerPage: 5,\n ShowPages: 8,\n PaginationAppendTo: '#divPagination',\n StartPage: 7\n\n });\n\n setTableMenu('AddColumn');\n $('#loadingModal').modal('hide');\n\n });\n}", "title": "" }, { "docid": "348b5928ed9eb0661b4f46d2b6e99b3e", "score": "0.5499818", "text": "function saveAdd() {\n const name = document.getElementById('entity-name').value;\n let pk = document.getElementById('primary-key').value;\n let attributes = document.getElementById('attribute').value;\n let attribute_types = document.getElementById('attribute-types').value;\n //let subtypes = document.getElementById('subtypes').value;\n let supertype = document.getElementById('subtypes').value;\n let cannot_exist_without = document.getElementById('cannot-exist-without').value;\n \n var new_ent = createEntity(name, pk, attributes, attribute_types, supertype, cannot_exist_without);\n // console.log(new_ent.name);\n // passentity();\n\n let entity_id = 0;\n let my_html_content = \n `\n <tr>\n <td>${name}</td>\n <td style=\"display: flex; justify-content: flex-end; height: 54px\">\n <button id=${name + \"add\"} type=\"button\" class=\"btn btn-outline-secondary relationshipButton\" data-bs-toggle=\"modal\" data-bs-target=\"#addRow\">\n <img src=\"assets/plus.svg\">\n </button>\n <button type=\"button\" class=\"btn btn-outline-secondary\" id = ${name + 'Info'} data-bs-toggle=\"modal\" data-bs-target=\"#entityInfoModal\">\n <img src=\"assets/info-circle.svg\">\n </button>\n <button type=\"button\" class=\"btn btn-outline-secondary\" id = ${name + 'Remove'}>\n <img src=\"assets/trash.svg\">\n </button>\n </td>\n </tr>`;\n\n \n let table_ref = document.getElementById('entTable');\n let new_row = table_ref.insertRow(table_ref.rows.length);\n new_row.innerHTML = my_html_content;\n \n document.getElementById(name + \"add\").addEventListener(\"click\", function () {\n let att = entity_data.get(name).attributes;\n let att_types = entity_data.get(name).attribute_types;\n \n let split_attribute = att.split(\", \");\n let split_types = att_types.split(\", \");\n console.log(split_attribute, split_types);\n\n document.getElementById(\"addRowBody\").innerHTML = \"\";\n\n for (let i=0; i<split_attribute.length; i++) {\n let temp = document.createElement(\"div\");\n temp.className = \"mb-3\";\n temp.innerHTML = `\n <div class=\"mb-3\">\n <label for=\"recipient-name\" class=\"col-form-label\">${split_attribute[i]}:</label>\n <input type=\"text\" class=\"form-control\" id=${split_attribute[i] + \"input\"} placeholder=${split_types[i]}>\n </div>\n `\n document.getElementById(\"addRowBody\").append(temp);\n }\n\n //<button type=\"button\" class=\"btn btn-primary\">Save changes</button>\n let confirm = document.createElement(\"button\");\n confirm.className = \"btn btn-primary\";\n confirm.innerHTML = \"Save Changes\";\n\n document.getElementById(\"rowFooter\").innerHTML = `\n <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button>\n `\n document.getElementById(\"rowFooter\").append(confirm);\n\n let list = [];\n confirm.addEventListener(\"click\", function () {\n for (let i=0; i<split_attribute.length; i++) {\n let value = document.getElementById(split_attribute[i] + \"input\").value;\n let att = split_attribute[i];\n let obj = {}\n obj[att] = value;\n list.push(obj);\n }\n console.log(list);\n addRow(name, list);\n });\n });\n // button to delete entities from global data structure and visual table\n const trash = document.getElementById(`${name + 'Remove'}`);\n trash.onclick = () => {\n entity_data.delete(name);\n \n const row_child_child = document.getElementById(`${name + 'Info'}`);\n row_child_child.parentNode.parentNode.remove();\n }\n \n // button to show info of entities\n const info = document.getElementById(`${name + 'Info'}`);\n info.onclick = () => {\n document.getElementById('ent-info-name').value = new_ent.name;\n document.getElementById('ent-info-key').value = new_ent.primary_key;\n document.getElementById('ent-info-attribute').value = new_ent.attributes;\n document.getElementById('ent-info-attribute-types').value = new_ent.attribute_types;\n document.getElementById('ent-info-subtypes').value = new_ent.supertype;\n document.getElementById('ent-info-cannot-exist-without').value = new_ent.cannot_exist_without;\n\n }\n\n let myModalEl = document.getElementById('entityModal');\n let modal = bootstrap.Modal.getInstance(myModalEl);\n modal.hide();\n}", "title": "" }, { "docid": "2f14a18a0b8e1160ac12e789cc4abf47", "score": "0.54810137", "text": "function addParkingStandsPopup(that){\n // Input form for Objects\n var tmp = '<form id=\"saveMarker\" class=\"tabledisplay\">' +\n '<p><label> <strong>Name: </strong></label>' +\n '<input type=\"text\" id=\"name\" name=\"name\" required=\"true\"/>' +\n '</p><br><p><label><strong>Type: </strong></label>' +\n '<select type=\"text\" id=\"type\" name=\"type\" required=\"true\">' +\n '<option value=\"Parking\">Parking</option><option value=\"Stands\">Stands</option></select>' +\n '</p><br><p><label><strong>Capacity: </strong></label>' +\n '<input type=\"number\" min=\"0\" id=\"cap\" name=\"capacity\" required=\"true\">' +\n '</p><br><p><label><strong>Price: </strong></label>' +\n '<input type=\"number\" min=\"0\" id=\"price\" name=\"price\" required\"true\">' +\n '</p><br><p><label><strong>Description: </strong></label>' +\n '<textarea class=\"form-control\" rows=\"1\" id=\"info\" name=\"description\"></textarea>' +\n '<input class=\"hidden\" value=\"-9999\" type=\"text\" id=\"picture\" name=\"picture\"/>' +\n '<div style=\"text-align:center;\"><button type=\"submit\" value=\"Save\" class=\"btn btn-primary trigger-submit\">Save</button></div>' + '</div>' +\n '</form>';\n createObjectCreationPopup(tmp);\n}", "title": "" }, { "docid": "1ab6c1cbfd09224fcb97cdb1dd95aae8", "score": "0.5475306", "text": "function getNewCategoryDetails() {\n var category = {};\n var properties = new Array\n category.Name = $('#newCategoryName').val();\n category.Description = $('#newCategoryDescruption').val();\n category.DateModified = $.now()\n category.Email = email;\n count = 0;\n var rowCount = $('#AddCategoryProperties tr').length;\n $('#AddCategoryProperties tr').each(function () {\n properties[count] = $(this).find(\"td > label\").html();\n count++;\n });\n InsertNewCategory(category, properties);\n}", "title": "" }, { "docid": "f3dcec5c34608ff804d3a086b59541a5", "score": "0.5466778", "text": "addToTable() {\n let tr = document.createElement('tr')\n tr.classList.add('padding')\n\n tr.innerHTML =\n this.createCell(\"name\") +\n this.createCell(\"breed\") +\n this.createCell(\"sex\") +\n this.editButtonWithID()\n\n tableBody().appendChild(tr)\n }", "title": "" }, { "docid": "630259c93f5fa567e3da896a81fb560a", "score": "0.54544705", "text": "function add_rowVariations()\n{\n var new_variation=document.getElementById(\"new_variation\").value;\n var table=document.getElementById(\"variations_table\");\n var table_len=(table.rows.length)-1;\n var row = table.insertRow(table_len).outerHTML=\"<tr id='row\"+table_len+\"'><td id='variation_row\"+table_len+\"'>\"+new_variation+\"</td><td><a id='edit_button\"+table_len+\"' class='edit' onclick='edit_rowVariations(\"+table_len+\")'><i class='pe-7s-pen'></i></a> <a id='save_button\"+table_len+\"' class='save' onclick='save_rowVariations(\"+table_len+\")'><i class='pe-7s-diskette'></i></a> <a class='delete' onclick='delete_rowVariations(\"+table_len+\")'><i class='pe-7s-trash'></i></a></td></tr>\";\n var outputVariation = table_len;\n document.getElementById(\"new_variation\").value=\"\";\n document.getElementById(\"save_button\"+table_len).style.display=\"none\";\n}", "title": "" }, { "docid": "63501cb05f1222be37cec93391e3319e", "score": "0.5454367", "text": "function insertNewData(data){\n var table = document.getElementById(\"studentlist\").getElementsByTagName('tbody')[0];\n var newrow = table.insertRow(table.length);\n cell1 = newrow.insertCell(0);\n cell1.innerHTML = data.namamahasiswa;\n cell2 = newrow.insertCell(1);\n cell2.innerHTML = data.NomorInduk;\n cell3 = newrow.insertCell(2);\n cell3.innerHTML = data.Jurusan;\n cell4 = newrow.insertCell(3);\n cell4.innerHTML = data.Angkatan;\n cell4 = newrow.insertCell(4);\n cell4.innerHTML = `<button onClick=\"ModalEdit(this)\" class=\"editbutton\">Edit</button><br>\n <button onClick=\"Delete(this);alertDelete()\" class=\"deletebutton\">Delete</button>`;\n}", "title": "" }, { "docid": "174465ce83d2fecc35c46567ffc60512", "score": "0.541117", "text": "newPropertiesSheet() {\n this.properties_sheet = new NatGatewayProperties(this.artefact)\n }", "title": "" }, { "docid": "d0a4a24030d14c790252b6fa07bb48be", "score": "0.5365703", "text": "function dispOperationsData(){\n //console.log(localStorage.getItem('formData'));\n let {uname,email,fname, lname, roles, pwd} = JSON.parse(localStorage.getItem('formData'));//destructuring\n var optable = document.getElementById(\"optable\");\n var row = optable.insertRow();\n var cell1 = row.insertCell();\n var cell2 = row.insertCell();\n var cell3 = row.insertCell();\n var cell4 = row.insertCell();\n var cell5 = row.insertCell();\n var cell6 = row.insertCell();\n cell1.innerHTML= `${uname}`;\n cell2.innerHTML= `${email}`;\n cell3.innerHTML=`${fname}`;\n cell4.innerHTML=`${lname}`;\n cell5.innerHTML=`${roles}`;\n cell6.innerHTML=`${pwd}`;\n }", "title": "" }, { "docid": "520f62bf56f76ed7944bea1bf84bd67c", "score": "0.5350605", "text": "function addMiscellaneousPopup(that) {\n var tmp = '<form id=\"saveMarker\" class=\"tabledisplay\">' +\n '<p><label> <strong>Name: </strong></label>' +\n '<input type=\"text\" id=\"name\" name=\"name\" required=\"true\"/>' +\n '</p><br><p><label><strong>Type: </strong></label>' +\n '<select type=\"text\" id=\"type\" name=\"type\" required=\"true\"/>' +\n '<option value=\"Misc\">Miscellaneous</option></select>' +\n '<input class=\"hidden\" min=\"0\" id=\"cap\" name=\"capacity\" value=\"-9999\"/>' +\n '<input class=\"hidden\" min=\"0\" id=\"price\" name=\"price\" value =\"-9999\"/>' +\n '</p><br><p><label><strong>Picture: </strong></label>' +\n '<input type=\"text\" id=\"picture\" name=\"picture\"/>' +\n '</p><br><p><label><strong>Description: </strong></label>' +\n '<textarea class=\"form-control\" rows=\"1\" id=\"info\" name=\"description\"></textarea>' +\n '<p><br><div style=\"text-align:center;\"><button type=\"submit\" value=\"Save\" class=\"btn btn-primary trigger-submit\">Save</button></div>' + '</div>' +\n '</form>';\n createObjectCreationPopup(tmp);\n}", "title": "" }, { "docid": "bbc451aacab090e28cafd04b33602421", "score": "0.53505385", "text": "function CreateTblRow(tblName, field_setting, data_dict, col_hidden) {\n //console.log(\"========= CreateTblRow =========\", tblName);\n //console.log(\" data_dict\", data_dict);\n\n const field_names = field_setting.field_names;\n const field_tags = field_setting.field_tags;\n const filter_tags = field_setting.filter_tags;\n const field_align = field_setting.field_align;\n const field_width = field_setting.field_width;\n const column_count = field_names.length;\n\n const map_id = (data_dict.mapid) ? data_dict.mapid : null;\n\n// --- lookup index where this row must be inserted\n const ob1 = (data_dict.username) ? data_dict.username : \"\";\n const ob2 = (data_dict.subjbase_code) ? data_dict.subjbase_code : \"\";\n const ob3 = (data_dict.sb_code) ? data_dict.sb_code : \"\";\n\n const row_index = b_recursive_tblRow_lookup(tblBody_datatable, setting_dict.user_lang, ob1, ob2, ob3);\n\n// --- insert tblRow into tblBody at row_index\n const tblRow = tblBody_datatable.insertRow(row_index);\n tblRow.id = map_id;\n\n// --- add data attributes to tblRow\n tblRow.setAttribute(\"data-pk\", data_dict.uc_id);\n\n// --- add data-sortby attribute to tblRow, for ordering new rows\n tblRow.setAttribute(\"data-ob1\", ob1);\n tblRow.setAttribute(\"data-ob2\", ob2);\n tblRow.setAttribute(\"data-ob3\", ob3);\n\n// --- add EventListener to tblRow\n tblRow.addEventListener(\"click\", function() {HandleTblRowClicked(tblRow)}, false);\n\n// +++ insert td's into tblRow\n for (let j = 0; j < column_count; j++) {\n const field_name = field_names[j];\n\n // - skip column if field_name in col_hidden;\n if (!col_hidden.includes(field_name)){\n const field_tag = field_tags[j];\n const class_width = \"tw_\" + field_width[j];\n const class_align = \"ta_\" + field_align[j];\n\n // --- insert td element,\n let td = tblRow.insertCell(-1);\n\n // --- create element with tag from field_tags\n let el = document.createElement(field_tag);\n\n // --- add data-field attribute\n el.setAttribute(\"data-field\", field_name);\n\n // --- add text_align\n el.classList.add(class_width, class_align);\n\n // --- append element\n td.appendChild(el);\n\n // --- add data-field Attribute when input element\n if (field_tag === \"input\") {\n el.setAttribute(\"type\", \"text\")\n el.setAttribute(\"autocomplete\", \"off\");\n el.setAttribute(\"ondragstart\", \"return false;\");\n el.setAttribute(\"ondrop\", \"return false;\");\n // --- add class 'input_text' and text_align\n // class 'input_text' contains 'width: 100%', necessary to keep input field within td width\n el.classList.add(\"input_text\");\n }\n\n // --- add EventListener to td\n // only input fields are: \"uc_corr_amount\", \"uc_corr_meetings\"\n // only auth1 of auth2 vfrom role corrector may edit them\n if (field_tag === \"input\") {\n if (permit_dict.permit_make_corrections){\n el.addEventListener(\"change\", function() {UploadInputChange(el)}, false)\n add_hover(td);\n };\n el.readOnly = !permit_dict.permit_make_corrections;\n\n } else if (field_name === \"select\") {\n // TODO add select multiple users option PR2020-08-18\n\n } else if (field_name === \"uc_meetings\") {\n el.addEventListener(\"click\", function(){MCH_Open(td)});\n add_hover(td);\n } else if (field_name === \"uc_meetingsxx\") {\n // attach eventlistener and hover to td, not to el. No need to add icon_class here\n td.addEventListener(\"click\", function() {UploadToggle(el)}, false)\n add_hover(td);\n\n } else if (field_name === \"allowed_clusters\") {\n if (permit_dict.permit_crud && permit_dict.requsr_same_school) {\n td.addEventListener(\"click\", function() {MSM_Open(el)}, false);\n add_hover(td);\n };\n\n } else if (field_name === \"status\"){\n\n const is_published = (data_dict.uc_published_id) ? true : false;\n const has_comp = (!!data_dict.uc_amount || !!data_dict.uc_meetings);\n if(!is_published && has_comp && permit_dict.permit_approve_comp){\n td.addEventListener(\"click\", function() {UploadToggleStatus(el)}, false)\n add_hover(td);\n };\n\n } else if ([\"last_name\", \"idnumber\", \"cribnumber\", \"bankname\", \"bankaccount\", \"beneficiary\"].includes(field_name)){\n el.addEventListener(\"click\", function() {MUD_Open(el)}, false)\n el.classList.add(\"pointer_show\");\n add_hover(el);\n };\n// --- put value in field\n UpdateField(el, data_dict)\n };\n };\n return tblRow;\n }", "title": "" }, { "docid": "d0d2408b85589e65d42379432ea60dac", "score": "0.53473574", "text": "function insertNewRecord(data) {\n var table = document.getElementById(\"demo\").getElementsByTagName(\"tbody\")[0];\n var newRow = table.insertRow(table.length);\n cell1 = newRow.insertCell(0);\n cell1.innerHTML = data.name;\n cell2 = newRow.insertCell(1);\n cell2.innerHTML = data.age;\n cell3 = newRow.insertCell(2);\n cell3.innerHTML = data.mobileNumber;\n cell4 = newRow.insertCell(3);\n cell4.innerHTML = data.email;\n cell5 = newRow.insertCell(4);\n cell5.innerHTML = data.address;\n cell6 = newRow.insertCell(5);\n cell6.innerHTML = data.gender;\n cell7 = newRow.insertCell(6);\n cell7.innerHTML = data.hobbies;\n cell8 = newRow.insertCell(7);\n cell8.innerHTML = `<a style=\"color: blue;\"onClick=\"onEdit(this)\">Edit</a>`;\n cell9 = newRow.insertCell(8);\n cell9.innerHTML = `<a style=\"color: blue;\" onClick=\"onDelete(this)\">Delete</a>`;\n}", "title": "" }, { "docid": "d20badba2b67c5c29bacf48d0529f9ad", "score": "0.53446317", "text": "function addNewPropertyKeyToProduct(data)\n{\n var key = viewModel.productEditNewPropertyDialog();\n\n if (key == SEARCH_PROPERTY_KEY)\n {\n viewModel.product().Product.SearchPropertyList.push(new Property(data));\n }\n else if (key == CHECKOUT_PROPERTY_KEY)\n {\n var NewProperty = new Property(data);\n\n viewModel.product().Product.CheckoutPropertyList.push(NewProperty);\n\n addNewCheckoutPropertyNameToAllCustomCheckout(data);\n }\n\n viewModel.productEditNewPropertyDialog(null);\n}", "title": "" }, { "docid": "04c61c9f8f2950c568f0cdd41fc2d2d7", "score": "0.5341642", "text": "function displayPropertyTable(markets, properties) {\n // Create a hashmap containing market name as key and (sub) market ID as \n // value.\n markets.forEach(function(item, index) {\n marketIdMap[item] = index;\n });\n\n // Display table\n content = \"<table>\";\n content += \"<tr>\";\n content += \"<th>Name</th>\";\n content += \"<th>Address</th>\";\n content += \"<th>Market</th>\";\n content += \"<th>Latitude</th>\";\n content += \"<th>Longitude</th>\";\n content += \"<th>Edit</th>\";\n content += \"</tr>\";\n for (var i = 0; i < properties.length; ++i) {\n // Property name\n var nameId = \"name\" + i;\n var propName = properties[i].name;\n var propId = properties[i].id;\n var marketId = properties[i].submarketId;\n var funcCall = \"editRecord(\" + i + \", \" + propId + \", \" + marketId + \")\";\n content += \"<tr>\";\n content += \"<td id='\" + nameId + \"' onclick='\" + funcCall + \"'>\" \n + propName + \"</td>\";\n\n // Property address\n var addrId = \"addr\" + i;\n var propAddr = properties[i].address1;\n content += \"<td id='\" + addrId + \"'>\" + propAddr + \"</td>\";\n\n // (Sub) market\n var submarketId = \"submarketId\" + i;\n var market = markets[properties[i].submarketId];\n content += \"<td id='\" + submarketId + \"'>\" + market + \"</td>\";\n\n // Property latitude\n var latId = \"lat\" + i;\n var propLat = properties[i].latitude;\n content += \"<td id='\" + latId + \"'>\" + propLat + \"</td>\";\n\n // Property longitude\n var longId = \"long\" + i;\n var propLong = properties[i].longitude;\n content += \"<td id='\" + longId + \"'>\" + propLong + \"</td>\";\n\n // Edit link\n var editId = \"edit\" + i;\n var editLink = \"<a onclick='\" + funcCall + \"'>Edit</a>\";\n content += \"<td id='\" + editId + \"'>\" + editLink + \"</td>\";\n content += \"</tr>\";\n }\n content += \"<tr>\";\n content += \"<td><input type='text' id='propName'/></td>\";\n content += \"<td><input type='text' id='propAddr'/></td>\";\n content += \"<td><input type='text' id='propMarket'/></td>\";\n content += \"<td><input type='text' id='propLat'/></td>\";\n content += \"<td><input type='text' id='propLong'/></td>\";\n content += \"<td><a onclick='addRecord();'>Add</a></td>\";\n content += \"</tr>\";\n content += \"</table>\";\n $(\"#grid\").html(content);\n}", "title": "" }, { "docid": "6effe36ecdf423ae23fcc0f600ab4b2e", "score": "0.53325605", "text": "function AirlineParameterTab()\n{\n $('#Txt1AirlineName').remove();\n if (pageType.toUpperCase() == 'READ') {\n $(\"#tblAirlineParameterTrans\").before(\"<div id='Txt1AirlineName' class='k-content k-state-active' style='display: block;'><table><tr><td style='font-weight:bold;'>Airline Name : </td><td>\" + $('#ApplicationTabs-1 table tr').find('#AirlineName').text() + \"</td></tr></table></div>\");\n\n }\n else if (pageType.toUpperCase() == 'EDIT') {\n $(\"#tblAirlineParameterTrans\").before(\"<div id='Txt1AirlineName' class='k-content k-state-active' style='display: block;'><table><tr><td style='font-weight:bold;'>Airline Name : </td><td>\" + $('#AirlineName').val() + \"</td></tr></table></div>\");\n }\n var dbtableName = \"AirlineParameterTrans\";\n $(\"#tbl\" + dbtableName).appendGrid({\n tableID: \"tbl\" + dbtableName,\n contentEditable: pageType == 'EDIT',\n masterTableSNo: $(\"#htmlkeysno\").val(),\n currentPage: 1,\n itemsPerPage: 10,\n whereCondition: null,\n rowUpdateExtraFunction: onAppendGridLoaded,\n dataLoaded: null,\n sort: \"\",\n isGetRecord: true,\n servicePath: \"./Services/Master/AirlineService.svc\",\n getRecordServiceMethod: \"GetAirlineParameterRecord\",\n createUpdateServiceMethod: \"CreateUpdateAirlineParameter\",\n caption: \"Airline Parameter\",\n deleteServiceMethod: \"DeleteAirlineParameter\",\n initRows: 1,\n columns: [{ name: \"SNo\", type: \"hidden\", value: 0 },\n { name: \"SeqNo\", type: \"hidden\", value: 0 },\n { name: 'AirlineSNo', type: 'hidden', value: $(\"#htmlkeysno\").val() },\n { name: \"AirlineParameterText\", display: \"Airline Parameter Text\", type: \"text\", ctrlCss: { width: '300px', height: '25px' }, ctrlAttr: { maxlength: 100, controltype: \"alphanumericupper\" }, isRequired: true },\n { name: \"ParameterType\", display: \"Type\", type: \"select\", ctrlOptions: { 0: '--Select--', 1: 'Number', 2: 'Decimal', 3: 'Text' , 4 : \"IP\" }, ctrlCss: { width: '150px', height: '25px' }, ctrlAttr: { maxlength: 35, controltype: \"alphanumericupper\", onchange: \"return changeType(event);\" }, isRequired: true },\n { name: \"AirlineParameterValue\", display: \"Airline Parameter Value\", type: \"text\", ctrlAttr: { maxlength: 100, controltype: \"default\", onkeypress: \"return checkvalue(event);\", onblur: \"return blurcheckvalue(event);\" }, ctrlCss: { width: \"300px\", height: '25px' }, isRequired: false },\n { name: \"ParameterRemarks\", display: \"Remarks\", type: \"textarea\", ctrlAttr: { maxlength: 400, controltype: \"default\", onkeypress: \"return checkvalue(event);\", onblur: \"return OnBlur(this);\" }, ctrlCss: { width: \"300px\", height: '25px' }, isRequired: false },\n { name: pageType == \"EDIT\" ? \"IsVisible\" : \"Visible\", display: \"Visible\", type: \"radiolist\", ctrlOptions: { 0: \"No\", 1: \"Yes\" }, selectedIndex: 1 },\n { name: pageType == \"EDIT\" ? \"IsActive\" : \"Active\", display: \"Active\", type: \"radiolist\", ctrlOptions: { 0: \"No\", 1: \"Yes\" }, selectedIndex: 1 },\n { name: 'Insert', display: 'Action', type: 'button', ctrlClass: 'btn btn-success', ctrlAttr: { maxlength: 100 }, value: 'Update', ctrlCss: { width: '55px', height: '20px' }, onClick: function (e, i) { } }\n ],\n hideButtons: { updateAll: true, append: userContext.GroupName.toUpperCase() == \"SUPER ADMIN\" ? false : true, insert:true, remove: true, removeLast: userContext.GroupName.toUpperCase() == \"SUPER ADMIN\" ? false : true, },\n isPaging: true\n });\n \n \n //$(\"button[id^=tblAirlineParameterTrans_Insert_]\").click(function (event) {\n // debugger;\n // var Id = event.currentTarget.id.split('Insert_')[1];\n // var Remarks = $(\"input[id=tblAirlineParameterTrans_ParameterRemarks_\" + Id + \"]\").val()\n // var pV = $('#tblAirlineParameterTrans_AirlineParameterValue_' + Id).val();\n // var pType = $('#tblAirlineParameterTrans_ParameterType_' + Id + ' :selected').text().toUpperCase()\n\n\n // if (pV == \"\") {\n // ShowMessage('warning', 'Warning - Airline Parameter.', \"Please Enter Airline Parameter Value \");\n // // window.stop();\n // event.stopPropagation();\n // return ;\n // }\n // else if (pType != \"DAYS\" || pType != \"PERCENTAGE\" || pType != \"ACTIVE\") {\n // ShowMessage('warning', 'Warning - Airline Parameter.', \"Please Select Airline Parameter Type \");\n // // window.stop();\n // event.stopPropagation();\n // return \n // }\n // else if (Remarks == \"\") {\n // ValidateTxtbox(Id)\n // // ShowMessage('warning', 'Warning - Airline Parameter.', \"Please Enter Remarks\");\n\n // return;\n // alert('helo');\n // }\n //})\n //$(document).on('blur', '[id^=tblAirlineParameterTrans_AirlineParameterText],[id^=tblAirlineParameterTrans_AirlineParameterValue],[id^=tblAirlineParameterTrans_ParameterRemarks]', function (e) {\n // var id = e.target.id;\n // var idNo = e.target.id.split('_')[2];\n // ValidateTxtbox(idNo)\n // if ($('#tblAirlineParameterTrans_ParameterType_' + idNo).val() == \"0\" && (id.indexOf('ParameterRemarks_') != -1 || id.indexOf('ParameterValue_') != -1)) {\n // ShowMessage('warning', 'Warning - Airline Parameter.', \"Kindly Select Type !\");\n // }\n //});\n}", "title": "" }, { "docid": "ae68ae86cb1671ec9668ed6a1a445513", "score": "0.5323809", "text": "newPropertiesSheet() {\n this.properties_sheet = new InstanceProperties(this.artefact)\n }", "title": "" }, { "docid": "034caaf76d29a615635e46673d415a74", "score": "0.5304517", "text": "addRow() {\n if (!this.state.columnsLoaded || this.state.columnsError != null) {\n return;\n }\n const emptyRow = {};\n\n if (this.state.isEditMode) {\n const columnData = this.state.columns;\n\n const i = columnData.length + 1;\n emptyRow[\"Column_name\"] = \"col_\" + i;\n emptyRow[\"Column_type\"] = \"varchar(45)\";\n emptyRow[\"Referenced_table_name\"] = \"\";\n\n this.setState({\n columns: [emptyRow, ...columnData]\n });\n } else {\n this.state.columns.map((v) => {\n const col = capitalizeFirstLetter(v.Column_name || \"Table\");\n emptyRow[col] = '';\n });\n const tableData = this.state.tableData;\n this.setState({\n tableData: [emptyRow, ...tableData]\n });\n }\n }", "title": "" }, { "docid": "b3fccdb9a51df99dba0ed991ea133ec4", "score": "0.5267265", "text": "function build_hidden_programs_button_l3()\n{\n \n var btnTable = document.createElement(\"table\"); // a table element is created\n document.getElementById(\"hidden_program_list_level3_button\").appendChild(btnTable);// adds the new table to the div\n btnTable.id = \"hidden_program_button_l3\";// gives the table an id\n \n \n table = document.getElementById(\"hidden_program_button_l3\");// gets the table that was created\n var oNewNode = document.createElement(\"tr\");//adds an tr element to the table\n oNewNode.id=\"program_button_id_l3\";//gives an id to the new element\n \n table.appendChild(oNewNode);//appends the the tr too the table\n\n \n //inserts the button\n oNewNode.innerHTML=\"<td id='level3_bad_programslist' onclick='hidden_program_list_level3_button_clicked(this);' background='\" + l2_menu_tab_image + \"' > <img src ='/images/bullet_arrow_up_level3.png'</img></td>\";\n}", "title": "" }, { "docid": "a43e3aa6de7f717c180464a8a6e8022d", "score": "0.5260037", "text": "function addPropertyToPlayerWallet(player, property){\n\n\n\n let propertyColor = property.color;\n\n\n player.propertiesCount += 1;\n\n\n \n player.propertiesByColor[propertyColor.index].properties.push(property);\n\n property.landLord = player;\n\n player.cash -= property.value;\n\n \n if(property.type == rentalProperty){\n\n insertNonMonopolyProperty(player, property);\n \n //check if the current property resulted in a monopoly\n\n if(monopolyCheck(player, propertyColor) == true){\n\n newMonopoly(player, propertyColor);\n \n };\n\n\n }\n\n //updateBoardGraphs(player)\n \n boardJournal.innerHTML += ( ' <br> ' +player.name + ' just bought ' + property.name + ' ! ');\n\n addNotif(' <br> ' +player.name + ' just bought ' + property.name + ' ! ', buyNotif);\n\n squareBorderOn(property.square);\n\n \n}", "title": "" }, { "docid": "2d9fd2b44572418581d4cb91ec613ff3", "score": "0.5254096", "text": "add(properties) {\r\n const postBody = jsS(extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\r\n return this.postCore({ body: postBody }).then((data) => {\r\n return {\r\n action: this.getById(data.Id),\r\n data: data,\r\n };\r\n });\r\n }", "title": "" }, { "docid": "61346da3aab91d97092b9e76ad645e5c", "score": "0.5252504", "text": "function createProperty(property) {\n const accountType = getAccountType();\n const propertyHTML = `\n <div class=\"property\">\n <div class=\"property-title\">\n <h3 class=\"street-address-1\">${property.street_num} ${property.street_name} ${property.apt_num ? \"Apt \" + property.apt_num : \"\"}</h3>\n <h3 class=\"street-address-2\">${property.city}, ${property.state} ${property.zip}</h3>\n\n <p class=\"price\">$${property.price}</p>\n <p class=\"listed-date\">Listed on ${new Date(property.time_listed).toISOString().slice(0,10)}</p>\n ${accountType === \"client\" ? \"<button onclick='location.href=`mailto:[email protected]`'>Contact Agent</button>\" : \"\"}\n </div>\n \n <div class=\"property-description\">\n <div class=\"description\">\n <b class=\"property-name\">Number of Beds</b>\n <p class=\"property-value\">${property.number_of_beds}</p>\n </div>\n <div class=\"description\">\n <b class=\"property-name\">Number of Baths</b>\n <p class=\"property-value\">${property.number_of_baths}</p>\n </div>\n <div class=\"description\">\n <b class=\"property-name\">Square Feet</b>\n <p class=\"property-value\">${property.square_ft}</p>\n </div>\n <div class=\"description\">\n <b class=\"property-name\">Year Built</b>\n <p class=\"property-value\">${property.year_built}</p>\n </div>\n </div>\n </div>\n `;\n \n const propertyContainer = document.getElementById(\"property-container\");\n \n propertyContainer.innerHTML += propertyHTML;\n}", "title": "" }, { "docid": "f6a59d5540154f07c0938ff31367c490", "score": "0.52350855", "text": "function addEnhancedActions() {\n let ticketListDoc = getTicketListDocument();\n let ticketTable = ticketListDoc.querySelector(\"#dataGrid\");\n //header row\n let headerRow = ticketTable.querySelector(\"thead tr\");\n let firstColTxt = headerRow.querySelector(\"th\").innerText;\n if (firstColTxt == \"Actions\") return; //skip if actions have been loaded already\n\n let th = document.createElement(\"th\");\n th.setAttribute(\"scope\", \"col\");\n th.setAttribute(\"colspan\", \"1\");\n th.setAttribute(\"class\", \"ui-state-default ui-th-column ui-th-ltr\");\n th.innerHTML = \"<p class=table_column_header_text>Actions</p>\";\n headerRow.prepend(th);\n // weird spacer row in CA\n let spacerRow = ticketTable.querySelector(\"tbody tr\");\n let spacerTD = document.createElement(\"td\");\n spacerTD.setAttribute(\"style\", \"height: 0px;\");\n spacerRow.prepend(spacerTD);\n // ticket rows\n \n\n ticketTable.querySelectorAll(\"tbody tr[id]\").forEach(function(ticket){\n let actionTD = document.createElement(\"td\");\n ticket.prepend(actionTD);\n if (isPasswordScrambleTicket(ticket)) {\n createBtn(ticket);\n }\n });\n}", "title": "" }, { "docid": "ce826d6e6c74070e5bff9020eefcc4a7", "score": "0.5234117", "text": "function displayfirstpropertiestab() {\n document.getElementById('propertiesmain').click();\n}", "title": "" }, { "docid": "5c3a1d9cee6a59e27cdc60c53f6a6ad1", "score": "0.5226796", "text": "function createActionsRow(data, id, label) {\n // create actions row\n var actionsStart = '<tr height=\"24\"><td title=\"[[k2actionslabel]]\" class=\"ms-crm-ReadField-Normal ms-crm-FieldLabel-LeftAlign\" id=\"[[k2actionsid]]_c\"><span class=\"ms-crm-InlineEditLabel\"><span style=\"max-width: 102px;\">[[k2actionslabel]]</span><div class=\"ms-crm-Inline-GradientMask\" style=\"display: none;\"></div></span></td><td class=\"ms-crm-Field-Data-Print\" id=\"[[k2actionsid]]_d\" data-height=\"24\"><div tabindex=\"1750\" title=\"Select an action\" class=\"ms-crm-Inline-Chrome picklist k2actions\" id=\"[[k2actionsid]]\" aria-describedby=\"[[k2actionsid]]_c\" data-picklisttype=\"1\" data-raw=\"\" data-layout=\"0\" data-fdeid=\"PrimaryEntity\" data-formid=\"8448b78f-8f42-454e-8e2a-f8196b0419af\" data-attributename=\"[[k2actionsid]]\" data-initialized=\"true\" haserror=\"false\"><div class=\"ms-crm-Inline-Value ms-crm-Inline-EmptyValue\" style=\"display: block;\"><span>--<div class=\"ms-crm-Inline-GradientMask\"></div></span></div><!-- start --> <span class=\"ms-crm-Inline-LockIcon\" title=\"Click to action worklist item\"><img width=\"1\" height=\"1\" class=\"ms-crm-ImageStrip-inlineedit_save k2actionsbutton\" alt=\"\" src=\"/_imgs/imagestrips/transparent_spacer.gif\"></span> <!-- end --> <div class=\"ms-crm-Inline-Edit ms-crm-Inline-OptionSet noScroll ms-crm-Inline-HideByZeroHeight\"><select tabindex=\"-1\" title=\"[[k2actionslabel]]\" class=\"ms-crm-SelectBox ms-crm-Inline-OptionSet-AutoOpen ms-crm-Inline-HideByZeroHeight-Ie7\" id=\"[[k2actionsid]]_i\" aria-labelledby=\"[[k2actionsid]]_c [[k2actionsid]]_w\" size=\"5\" defaultselected=\"\" attrname=\"[[k2actionsid]]\" attrpriv=\"7\" controlmode=\"normal\" defaultvalue=\"\">';\n\n var actionshtml = '';\n var len = data.Actions.length;\n for (var i = 0; i < len; i++) {\n actionshtml += '<option value=\"' + data.Actions[i].Name + '\">' + data.Actions[i].Name + '</option>';\n }\n\n var actionsEnd = '</select></div><span class=\"ms-crm-Inline-LockIcon\" style=\"display: none;\"><img width=\"1\" height=\"1\" class=\"ms-crm-ImageStrip-inlineedit_locked\" alt=\"\" src=\"/_imgs/imagestrips/transparent_spacer.gif\"></span><span title=\"\" class=\"ms-crm-Inline-WarningIcon\" style=\"display: none;\"><img width=\"1\" height=\"1\" class=\"ms-crm-ImageStrip-inlineedit_warning\" id=\"[[k2actionsid]]_warn\" alt=\"Error\" src=\"/_imgs/imagestrips/transparent_spacer.gif\"><div class=\"ms-crm-Hidden-NoBehavior\" id=\"[[k2actionsid]]_w\"></div></span></div></td></tr>';\n\n var actionsOutput = actionsStart + actionshtml + actionsEnd;\n\n\n return actionsOutput.replace(/\\[\\[k2actionsid\\]\\]/g, id).replace(/\\[\\[k2actionslabel\\]\\]/g, label);\n}", "title": "" }, { "docid": "b93a7849b2d9cbe23e54b10388910db2", "score": "0.52261627", "text": "function addWizardRow(name: string, description: string) {\n\n let tableRef = tblWizard.getElementsByTagName('tbody')[0];\n let row: any = tableRef.insertRow(-1);\n row.style.cursor = \"pointer\";\n\n let cellName = row.insertCell(0);\n cellName.innerHTML = name;\n cellName.style.width = \"900px\";\n //cellName.classList.add(\"ctext\");\n\n let cellDescription = row.insertCell(1);\n cellDescription.innerHTML = description;\n cellDescription.style.width = \"60%\";\n //cellDescription.classList.add(\"ctext\");\n\n adjustWizardHeader();\n}", "title": "" }, { "docid": "44d0912bb398e5714d0ff283b5bd603d", "score": "0.5224753", "text": "function CrearTablaProviders(myJson) {\n\n var tabla = new grid(\"oTabla\");\n var j = 0;\n\n var obj = JSON.parse(myJson);\n deleteLastRow(\"oTabla\");\n//alert(obj.length);\n for (j = 0; j <= (obj.length - 1); j++)\n {\n //alert(obj[j].Descripcion);\n var row = tabla.AddRowTable(j + 1);\n\n //tabla.AddRowCellText(row, 0, obj[j].ID);\n \n var celda = tabla.AddRowCellText(row, 0, obj[j].ID);\n celda.setAttribute('hidden', 'true'); // ocultar la columna ID\n \n tabla.AddRowCellText(row, 1, obj[j].Nif);\n tabla.AddRowCellText(row, 2, obj[j].Nombre);\n tabla.AddRowCellText(row, 3, obj[j].Direccion);\n tabla.AddRowCellText(row, 4, obj[j].Movil);\n tabla.AddRowCellText(row, 5, obj[j].Mail);\n tabla.AddRowCellText(row, 6,\n '<ul class=\"table-controls\"><li ><a onclick=\"EditarProveedor('+(j+1)+');\" class=\"btn tip\" title=\"Ver/Editar Proveedor\"> <i class=\"icon-pencil\"> </i> </a></li></ul>');\n\n }\n \n obj=null;\n\n}", "title": "" }, { "docid": "b84b2b7631c27c417336734610635d3c", "score": "0.5223882", "text": "function openproperties(){\n //post(\"openproperties\" + myNodeID + \" \" + myNodeTitle + \" \" + myNodeAddress + \" \" + myNodePropsFileName + \"\\n\");\n if(myNodeEnableProperties){\n\t\t//post(\"color \" + colr + \" \\n\");\n outlet(2, \"shroud\", \"bs.vpl.node.props\", myNodeID, myNodeTitle, myNodeAddress, myNodePropsFileName, myNodeColorOn);\n }\n}", "title": "" }, { "docid": "1f2a95d32d677995e764474834712279", "score": "0.52062815", "text": "initTableCellProperties(element, localValue, isRtl) {\n let sizeDiv = createElement('div', { styles: 'width: 100%;' });\n let div = createElement('div', {\n innerHTML: localValue.getConstant('Size'), className: 'e-de-table-dialog-options-label',\n styles: 'width: 100%;',\n });\n let parentdiv = createElement('div', { styles: 'width: 100%;display: inline-flex;' });\n let childdiv1 = createElement('div', {\n className: 'e-de-table-cell-header-div', styles: 'margin-top:9px'\n });\n let preferredCellWidthCheckBox = createElement('input', {\n attrs: { 'type': 'checkbox' }, id: element.id + '_Prefer_Width_CheckBox_cell'\n });\n let childdiv2 = createElement('div', {\n styles: 'padding:0px 20px',\n });\n this.preferredCellWidth = createElement('input', {\n id: element.id + 'tablecell_Width_textBox', attrs: { 'type': 'text' }\n });\n let child2 = createElement('div', {\n className: 'e-de-ht-wdth-type'\n });\n let child3 = createElement('div');\n let child4 = createElement('div');\n let controlDiv = createElement('div');\n let cellWidthType = createElement('select', {\n innerHTML: '<option>' + localValue.getConstant('Points') + '</option><option>' +\n localValue.getConstant('Percent') + '</option>', 'id': element.id + '_measure_type_cell'\n });\n let labeltext = createElement('label', {\n innerHTML: localValue.getConstant('Measure in'),\n styles: 'font-size: 11px;font-weight: normal;display:block;margin-bottom:8px'\n });\n sizeDiv.appendChild(div);\n element.appendChild(sizeDiv);\n childdiv1.appendChild(preferredCellWidthCheckBox);\n parentdiv.appendChild(childdiv1);\n childdiv2.appendChild(this.preferredCellWidth);\n parentdiv.appendChild(childdiv2);\n controlDiv.appendChild(cellWidthType);\n child3.appendChild(labeltext);\n child4.appendChild(controlDiv);\n child2.appendChild(child3);\n child2.appendChild(child4);\n parentdiv.appendChild(child2);\n element.appendChild(parentdiv);\n let alignmentDiv = createElement('div', {\n innerHTML: localValue.getConstant('Vertical alignment'),\n styles: 'width: 100%;margin: 0px;',\n className: 'e-de-table-dialog-options-label'\n });\n let classDivName = element.id + 'e-de-table-cell-alignment';\n let divAlignment = createElement('div', {\n styles: 'width: 100%;height: 100px;'\n });\n let divStyle = 'width:54px;height:54px;margin:2px;border-style:solid;border-width:1px';\n let topAlignDiv = createElement('div', { className: 'e-de-table-dia-align-div' });\n this.cellTopAlign = createElement('div', {\n styles: divStyle, id: element.id + '_cell_top-alignment',\n className: 'e-icons e-de-tablecell-alignment e-de-tablecell-top-alignment ' + classDivName\n });\n topAlignDiv.appendChild(this.cellTopAlign);\n let centerAlignDiv = createElement('div', { className: 'e-de-table-dia-align-div' });\n this.cellCenterAlign = createElement('div', {\n styles: divStyle, id: element.id + '_cell_center-alignment',\n className: 'e-icons e-de-tablecell-alignment e-de-tablecell-center-alignment ' + classDivName\n });\n centerAlignDiv.appendChild(this.cellCenterAlign);\n let bottomAlignDiv = createElement('div', { className: 'e-de-table-dia-align-div' });\n this.cellBottomAlign = createElement('div', {\n styles: divStyle, id: element.id + '_cell_bottom-alignment',\n className: 'e-icons e-de-tablecell-alignment e-de-tablecell-bottom-alignment ' + classDivName\n });\n bottomAlignDiv.appendChild(this.cellBottomAlign);\n let topLabel = createElement('label', {\n innerHTML: localValue.getConstant('Top'), className: 'e-de-table-dia-align-label'\n });\n let centerLabel = createElement('label', {\n innerHTML: localValue.getConstant('Center'), className: 'e-de-table-dia-align-label'\n });\n let bottomLabel = createElement('label', {\n innerHTML: localValue.getConstant('Bottom'), className: 'e-de-table-dia-align-label'\n });\n this.cellOptionButton = createElement('button', {\n innerHTML: localValue.getConstant('Options'), id: element.id + '_table_cellmargin',\n className: 'e-control e-btn e-flat', attrs: { type: 'button' }\n });\n this.cellOptionButton.style.cssFloat = isRtl ? 'left' : 'right';\n divAlignment.appendChild(topAlignDiv);\n divAlignment.appendChild(centerAlignDiv);\n divAlignment.appendChild(bottomAlignDiv);\n topAlignDiv.appendChild(topLabel);\n centerAlignDiv.appendChild(centerLabel);\n bottomAlignDiv.appendChild(bottomLabel);\n element.appendChild(alignmentDiv);\n element.appendChild(divAlignment);\n element.appendChild(this.cellOptionButton);\n this.cellOptionButton.addEventListener('click', this.showCellOptionsDialog);\n this.cellWidthBox = new NumericTextBox({\n value: 0, decimals: 2, min: 0, max: 1584, width: 120, enablePersistence: false\n });\n this.cellWidthBox.appendTo(this.preferredCellWidth);\n this.preferredCellWidthCheckBox = new CheckBox({ label: localValue.getConstant('Preferred Width'), enableRtl: isRtl });\n this.preferredCellWidthCheckBox.appendTo(preferredCellWidthCheckBox);\n this.cellWidthType = new DropDownList({ width: '120px', enableRtl: isRtl });\n this.cellWidthType.appendTo(cellWidthType);\n if (isRtl) {\n childdiv2.classList.add('e-de-rtl');\n child3.classList.add('e-de-rtl');\n child4.classList.add('e-de-rtl');\n this.cellOptionButton.classList.add('e-de-rtl');\n topAlignDiv.classList.add('e-de-rtl');\n centerAlignDiv.classList.add('e-de-rtl');\n bottomAlignDiv.classList.add('e-de-rtl');\n }\n }", "title": "" }, { "docid": "1301b608cb7be3f53f4a69e66546a00a", "score": "0.5193778", "text": "function fnGetProperties() {\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 //The blueprint of the HTML elements\n var sProperty = '<div class=\"lblProperty\">\\\n <div class=\"lblPropertyInformation\">\\\n <div class=\"lblPropertyId\">{{id}}</div>\\\n <div class=\"lblPropertyAddress\">{{address}}</div>\\\n <div class=\"lblPropertyPrice\">{{price}}</div>\\\n <div data-go-to=\"wdwCreateProperty\" class=\"fa fa-pencil fa-fw link\"></div>\\\n <div class=\"fa fa-trash fa-fw btnDeleteProperty\"></div>\\\n </div>\\\n <div class=\"lblPropertyImages\" id=\"{{P-id}}\">\\\n </div>\\\n </div>';\n //Remove all elements from the DOM\n $(\"#wdwProperties\").empty();\n //Append a title\n $(\"#wdwProperties\").append(\"<h2>Properties</h2>\");\n //Append navigation\n $(\"#wdwProperties\").append(\"<a data-go-to='wdwMenu' class='link'>Go to menu</a>\");\n //Append email button\n $(\"#wdwProperties\").append(\"<button class='btnSendProperties'>Receive Email with list of properties</button>\");\n //Loop through the array of jData\n for (var i = 0; i < jData.length; i++) {\n //sPropertyTemplate is now the same as sProperty\n var sPropertyTemplate = sProperty;\n //Replace the string '{{id}}', with the data passed from jData\n sPropertyTemplate = sPropertyTemplate.replace(\"{{id}}\", jData[i].id);\n //Replace the string 'P{{id}}', with the data passed from jData\n sPropertyTemplate = sPropertyTemplate.replace(\"{{P-id}}\", \"property-\" + jData[i].id);\n //Replace the string '{{address}}', with the data passed from jData\n sPropertyTemplate = sPropertyTemplate.replace(\"{{address}}\", jData[i].address);\n //Replace the string '{{price}}', with the data passed from jData\n sPropertyTemplate = sPropertyTemplate.replace(\"{{price}}\", jData[i].price);\n //Append the property template to the wdw with the id wdwProperties\n $(\"#wdwProperties\").append(sPropertyTemplate);\n //Declare the path to folder where the images are located\n var sPath = jData[i].id;\n //Variable where a string of the images is stored\n var sImages = jData[i].images;\n //Loop through the string of images\n for(var j = 0; j < sImages.length; j++) {\n //Path to the image\n var sImageTemplate = '<img src=\"services/properties/images/' + sPath + '/' + sImages[j] + '\">';\n //Append the images to the property\n $(\"#property-\" + jData[i].id).append(sImageTemplate);\n }\n }\n });\n}", "title": "" }, { "docid": "509777c92647110fdf240b8c400adc98", "score": "0.51843375", "text": "function addField() {\n ctrl.productProperties.push({'key': '', 'value': ''});\n }", "title": "" }, { "docid": "e093d8b405d30dd772bc6a5d445b3182", "score": "0.5179554", "text": "function clickedOK()\n{\n var anAjaxDataTable = new ajaxDataTable(\"\",\"\",_LIST_SPRY_ODD_CLASSES.get(),_LIST_SPRY_EVEN_CLASSES.get(),_LIST_SPRY_HOVER_CLASSES.get(),_LIST_SPRY_SELECT_CLASSES.get());\n \n var colList = _TREELIST_AJAX_COLS.getRowValue('all');\n \n if (colList.length)\n {\n //set the current row behavior\n anAjaxDataTable.setColumnList(colList);\n anAjaxDataTable.setCurrentRowBehavior(_SET_CUR_BEHAVIOR_CHECKBOX.getCheckedState());\n \n INSERT_OPTIONS_OBJ.setOptions({ajaxDataTable: anAjaxDataTable});\n \n // save the data set url, root element and all columns names to detect \n // at insertion time if the actual data set is the same as the \n // one used when the user customized this insert option\n INSERT_OPTIONS_OBJ.setDatasetURL(DS_DESIGN_TIME_OBJ.getDataSetURL());\n INSERT_OPTIONS_OBJ.setRootElement(DS_DESIGN_TIME_OBJ.getRootElement());\n INSERT_OPTIONS_OBJ.setDatasetColumnsNames(DS_DESIGN_TIME_OBJ.getColumnNames());\n \n dwscripts.setCommandReturnValue(INSERT_OPTIONS_OBJ);\n }\n \n window.close();\n}", "title": "" }, { "docid": "9f3a6ed2e6e816f75302a7ca3e324b20", "score": "0.5166714", "text": "function update_property_row(row_id){\n create_property_list(row_id, from='update');\n}", "title": "" }, { "docid": "d00037d7a05352ba05b30a66e32febf9", "score": "0.5161991", "text": "function GeneTabPGUpdateProperty(event) {\n\n //Debug Button Press\n fDEBUG ?\n insertText(`<br><font color=\"red\"><strong>DEBUG[${sDEBUG }]:</strong></font> You Have Pressed the Update a Single Property Button`) :\n null;\n\n //Event Completed\n event.completed();\n}", "title": "" }, { "docid": "3c9f3573a8fe01f0b67876904df3a558", "score": "0.5158174", "text": "function addItemTable() { }", "title": "" }, { "docid": "8db0cc4cd4bc81e6579b87da11e84cf5", "score": "0.51557416", "text": "function AddtblReqAreaRevSharing(btnAdd, cellNum) {\n AddRow(btnAdd, cellNum);\n}", "title": "" }, { "docid": "5a5962e554d29c4ceece041e840781c3", "score": "0.5150535", "text": "function edit_prop_row(data_table_id, row_no){\n $(\"#prop_addRow\").parent().attr(\"style\", \"display:none\");\n $(\"#prop_updateRow\").parent().attr(\"style\", \"display:block\");\n $(\"#prop_cancelRow\").parent().attr(\"style\", \"display:block\");\n row_no -= 1;\n load_property(property_list[row_no]);\n $('#prop_updateRow').attr(\"onclick\", \"update_property(\"+row_no+\")\");\n}", "title": "" }, { "docid": "151317416e59d6f3fd075693b59d1b7f", "score": "0.5150332", "text": "function createFieldMappingRow() {\n var table = document.getElementById(\"mapping\");\n// var tbody = document.getElementById(\"ProfileSync1\");\n var new_row = table.rows[2].cloneNode(true);\n // console.log(new_row);\n var len = table.rows.length;\n new_row.cells[0].innerHTML = len;\n\n var inp1 = new_row.cells[1].getElementsByTagName('select')[0];\n //new_row.id = \"row\" + len;\n //inp1.id += len;\n// inp1.value = '';\n// console.log(new_row.children[4]);\n new_row.children[3].style.display = \"block\";\n for (var i = 1; i < table.tBodies[0].children.length; i++) {\n table.tBodies[0].children[i].children[0].innerHTML = i + 1;\n }\n\n\n table.tBodies[0].appendChild(new_row);\n table.tBodies[0].children[len - 1].children[1].children[0].value = \"\";\n table.tBodies[0].children[len - 1].children[2].children[0].value = \"\";\n table.tBodies[0].children[len - 1].children[3].children[0].value = \"\";\n gadgets.window.adjustHeight();\n}", "title": "" }, { "docid": "cee868b67559f4e9d3f5d7423d78b5ef", "score": "0.51462924", "text": "function createAttributeEditorTable(tableDiv, divClass, node, children) {\n \n \n // Dimension member list. \n \n \n var sproc = \"spDMLeafAttributes\"; \n var param = [\n {name: \"node\", value: node},\n {name: \"dimension\", value: dimension},\n {name: \"Hierarchy\", value: hierarchy},\n {name: \"Children\", value: children} \n ];\n \n var grid = getSPData(storedProcServer, sproc, param, rngData); \n var headings = getSPData(storedProcServer, sproc, param, rngHeader); \n \n headings = headings[0];\n \n // Provides information about the souce table data types and foreign keys. \n sproc = \"spDMTableDefinition\"; \n param = [ \n {name: \"Dimension\", value: dimension},\n {name: \"Hierarchy\", value: hierarchy},\n {name: \"TableType\", value: \"Leaf\"} \n ];\n var schema = getSPData(storedProcServer, sproc, param, rngData); \n\n \n // Grid's Column Definitions.\n var columnSchema = []; \n columnSchema.push({width: 50, title: \"ID\", field: \"value\" });\n columnSchema.push({width: 90, title: \"Member Name\", field: \"label\" });\n \n // Build the dynamic datasource definition. \n var sfields = \"var fields = {value: {type: \\\"number\\\", readonly: true}, label: {type: \\\"string\\\"}\"; \n for (var prop in schema) { \n for (var col in headings) { \n \n if (headings[col] === schema[prop][0]) { \n switch(schema[prop][schemaColDataType]){\n case \"int\":\n\n \n // build Schema definition\n sfields = sfields + \", \" + schema[prop][schemaColColumnName] + \": { type: \\\"number\\\", validation: { required: true, min: 1} }\";\n \n // Add as Column to Kendo Grid \n if (schema[prop][schemaColLookupTable] === \"\" || schema[prop][schemaColLookupTable] === undefined) {\n \n columnSchema.push({width: 5 * parseInt(schema[prop][schemaColLenghtNumeric]), \n title: schema[prop][schemaColColumnName], \n field: schema[prop][schemaColColumnName] \n }); \n } else {\n \n columnSchema.push({width: 5 * parseInt(schema[prop][schemaColLenghtNumeric]), \n title: schema[prop][schemaColColumnName], \n field: schema[prop][schemaColColumnName],\n values: foreginKeyData(schema[prop][schemaColLookupTable],\n schema[prop][schemaColLookupColumn])}); \n }\n\n break;\n default:\n \n // build Schema definition\n sfields = sfields + \", \" + schema[prop][schemaColColumnName] + \": {type: \\\"string\\\"}\"; \n \n // Add as Column to Kendo Grid\n if (schema[prop][schemaColLookupTable] === \"\" || schema[prop][schemaColLookupTable] === undefined) {\n \n columnSchema.push({width: 2.5 * parseInt(schema[prop][schemaColLenghtText]), \n title: schema[prop][schemaColColumnName], \n field: schema[prop][schemaColColumnName]});\n } else {\n \n columnSchema.push({width: 2.5 * parseInt(schema[prop][schemaColLenghtText]), \n title: schema[prop][schemaColColumnName], \n field: schema[prop][schemaColColumnName],\n values: foreginKeyData(schema[prop][schemaColLookupTable],\n schema[prop][schemaColLookupColumn])}); \n }\n break;\n }\n } \n } \n } \n sfields = sfields + \"};\"; \n \n // Create the Data Fields object.\n eval(sfields);\n \n // Create the Grid Datasource. \n var gridDataSource = report.api.getKendoDataSource(grid, true, headings, fields); \n \n report.api.getElements(tableDiv).kendoGrid({ \n dataSource : gridDataSource,\n filterable: true, \n columns: columnSchema,\n editable: true,\n sortable: true, \n resizable: true,\n reorderable: true \n });\n \n // if there's no data to display then hide then grid view.\n if (gridDataSource.view().length > 0) {\n report.api.getElements(divClass).show();\n \n // Bind the Save event to the handler function.\n var q = report.api.getElements(tableDiv).data(\"kendoGrid\");\n q.bind(\"save\", fireAttributeUpdate);\n \n } else {\n report.api.getElements(divClass).hide();\n }\n\n}", "title": "" }, { "docid": "0bfd079bbfd434b13dde7300bfab88db", "score": "0.51398724", "text": "function addButtonLine(){\n var obj = tdpersonnalised.myTable.find(tdpersonnalised.actionCell);\n $.each(obj,function(){\n $(this).append(\"<button title='\"+tdpersonnalised.modifiedtitle+\"' class=\\\"\"+ tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.modifiedclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.modifiedglyph +\"\\\" aria-hidden=\\\"true\\\"></span></button>\");\n\n $(this).append(\"<button title='\"+tdpersonnalised.ToSavetitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.ToSaveclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.ToSaveglyph +\"\\\" aria-hidden=\\\"true\\\"></span></button>\");\n\n $(this).append(\"<button title='\"+tdpersonnalised.canceltitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.cancelclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.cancelglyph +\"\\\" aria-hidden=\\\"true\\\"></span></button>\");\n });\n\n obj.children(\"button:nth-child(2),button:nth-child(3)\").hide();\n\n }", "title": "" }, { "docid": "e6422b1105a7aaf032942f8d636644ae", "score": "0.5132439", "text": "function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) {\n mwCustomEditButtons[mwCustomEditButtons.length] =\n {\"imageId\": imageId,\n \"imageFile\": imageFile,\n \"speedTip\": speedTip,\n \"tagOpen\": tagOpen,\n \"tagClose\": tagClose,\n \"sampleText\": sampleText};\n}", "title": "" }, { "docid": "04ab040129bb11cb47d015f7ff451538", "score": "0.51310164", "text": "function addNewCustomCheckoutPropertySetting()\n{\n var NewCustomCheckoutProp = new CheckoutPropertySetting();\n\n $.each(viewModel.product().Product.CheckoutPropertyList(), function (i, mainElement)\n {\n NewCustomCheckoutProp.CheckoutPropertySettingKeys.push(new CheckoutPropertySettingKey(mainElement.Name(), \"\"));\n });\n\n viewModel.product().Product.CheckoutPropertySettingsList.push(NewCustomCheckoutProp);\n}", "title": "" }, { "docid": "33f098e84aedc5fc8a3b4caa8ef5f87d", "score": "0.51300216", "text": "function initMap() {\r\n var j = JSON.parse(data);\r\n console.log(j[0].property_1);\r\n const hall2 = { lat: 1.2423, lng: 103.83684};\r\n\r\n const map = new google.maps.Map(document.getElementById(\"googleMap\"), {\r\n zoom: 15,\r\n center: hall2,\r\n });\r\n\r\n const contentString =\r\n '<div id=\"content\">' +\r\n '<div id=\"siteNotice\">' +\r\n \"</div>\" +\r\n '<h1 id=\"firstHeading\" class=\"firstHeading\">NTU</h1>' +\r\n '<div id=\"bodyContent\">' +\r\n \"<p><b>NTU</b>, also referred to as <b>Pulau NTU</b>, is a place where people's \"+\r\n \"hopes and dreams go to die.</p>\" +\r\n '<p>Attribution: NTU, <a href=\"#\"</a> ' +\r\n \"(last visited June 22, 2021).</p>\" +\r\n \"</div>\" +\r\n \"</div>\";\r\n const infowindow = new google.maps.InfoWindow({\r\n content: contentString,\r\n });\r\n const marker = new google.maps.Marker({\r\n position: hall2,\r\n map\r\n });\r\n marker.addListener(\"mouseover\", () => {\r\n infowindow.open(map, marker);\r\n });\r\n marker.addListener('mouseout', ()=>{\r\n infowindow.close(map, marker);\r\n })\r\n marker.addListener('click', ()=>{\r\n var a = document.getElementById('newtable').insertRow(0);\r\n var b = a.insertCell(0);\r\n var c = a.insertCell(1);\r\n var d = a.insertCell(2);\r\n b.innerHTML = 'Id'\r\n c.innerHTML = \"row\";\r\n d.innerHTML = contentString;\r\n })\r\n }", "title": "" }, { "docid": "34c52df60aece350cd3b9f2b551bab84", "score": "0.5127558", "text": "function insertTable(newTable) {\n $scope.selectedRegion.Table.push(newTable);\n $scope.selectedRegion.isEdited = true;\n var newWidget = angular.copy(newTable.widget);\n newWidget.Code = null;\n $scope.selectedWidget = angular.copy(newWidget);\n }", "title": "" }, { "docid": "52b3ca910fe319775291109936c2b059", "score": "0.5126923", "text": "function PushButton_UpdateProperties(listProperties)\n{\n\t//basic processing properties?\n\tvar listBasicProperties = new Array();\n\t//marker for height\n\tvar bHeight = false;\n\t//loop through the properties\n\tfor (var i = 0, c = listProperties.length; i < c; i++)\n\t{\n\t\t//switch on property\n\t\tswitch (listProperties[i])\n\t\t{\n\t\t\tcase __NEMESIS_PROPERTY_CAPTION:\n\t\t\tcase __NEMESIS_PROPERTY_VIRTUAL_KEY:\n\t\t\t\t//update the shortcut\n\t\t\t\tPushButton_UpdateShortCut(this, this.InterpreterObject);\n\t\t\t\t//will also need basic processing\n\t\t\t\tlistBasicProperties.push(__NEMESIS_PROPERTY_CAPTION);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_HEIGHT:\n\t\t\tcase __NEMESIS_PROPERTY_MULTILINE:\n\t\t\t\t//height not yet done?\n\t\t\t\tif (!bHeight)\n\t\t\t\t{\n\t\t\t\t\t//Update word break\n\t\t\t\t\tLabel_CheckMultiline(this, this.InterpreterObject);\n\t\t\t\t\t//update offsets\n\t\t\t\t\tBasic_UpdateOffsets(this, this.InterpreterObject);\n\t\t\t\t\t//will also need basic processing\n\t\t\t\t\tlistBasicProperties.push(__NEMESIS_PROPERTY_HEIGHT);\n\t\t\t\t\t//set it\n\t\t\t\t\tbHeight = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_ENABLED:\n\t\t\t\t//update enabled\n\t\t\t\tPushButton_UpdateEnabled(this, this.InterpreterObject);\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_FLAT:\n\t\t\t\t//switch on interface look\n\t\t\t\tswitch (this.InterpreterObject.InterfaceLook)\n\t\t\t\t{\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//flat?\n\t\t\t\t\t\tif (Get_Bool(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_FLAT], false))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//set flat border\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER] = \"Solid,#000000,1px\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//reset border\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER] = this.InterpreterObject.DataObject.Properties[__NEMESIS_PROPERTY_BORDER];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//update the border property\n\t\t\t\t\t\tlistBasicProperties.push(__NEMESIS_PROPERTY_BORDER);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\t\t\t\t\t//flat?\n\t\t\t\t\t\tif (Get_Bool(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_FLAT], false))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_IMAGE_DEFAULT] = \"\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"#d8d6c7\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_IMAGE_HOVERED] = \"ais_theme_sapenjoy_buttonbg.png\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BACKIMAGE_HOVERED_POS] = \"0,0,0,0,R,3,3,2px,2px\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_IMAGE_DEFAULT] = \"ais_theme_sapenjoy_buttonbg.png\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BACKIMAGE_POS] = \"0,0,0,0,R,3,3,2px,2px\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//update the look\n\t\t\t\t\t\tlistBasicProperties.push(__NEMESIS_PROPERTY_BK_COLOR_DEFAULT);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\t\t\t\t//flat?\n\t\t\t\t\t\tif (Get_Bool(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_FLAT], false))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER] = \"solid,#73716b,1px\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER] = undefined;\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER_LEFT] = \"solid,#73716b,1px\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER_TOP] = \"solid,#73716b,1px\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER_RIGHT] = \"solid,#73716b,2px\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER_BOTTOM] = \"solid,#73716b,2px\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//update the border property\n\t\t\t\t\t\tlistBasicProperties.push(__NEMESIS_PROPERTY_BORDER);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\t\t\t\t\t//flat?\n\t\t\t\t\t\tif (Get_Bool(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_FLAT], false))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER] = \"none\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_IMAGE_DEFAULT] = \"\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_IMAGE_HOVERED] = \"ais_theme_signature_buttonbg_flat.png\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BACKIMAGE_HOVERED_POS] = \"0,0,0,0,R,3,3,0px,0px\";\n\t\t\t\t\t\t\t//activate mouse over listeners for flat buttons\n\t\t\t\t\t\t\tthis.State_OnMouseOut = PushButton_OnMouseOut;\n\t\t\t\t\t\t\tthis.State_OnMouseOver = PushButton_OnMouseOver;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BORDER] = \"solid,#73716b,1px\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_IMAGE_DEFAULT] = \"ais_theme_signature_buttonbg.png\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BACKIMAGE_POS] = \"0,0,0,0,R,3,3,0px,0px\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BK_IMAGE_PRESSED] = \"ais_theme_signature_buttonbg_pressed.png\";\n\t\t\t\t\t\t\tthis.InterpreterObject.Properties[__NEMESIS_PROPERTY_BACKIMAGE_PRESSED_POS] = \"0,0,0,0,R,3,3,2px,2px\";\n\t\t\t\t\t\t\t//deactivate mouse over listeners for flat buttons\n\t\t\t\t\t\t\tthis.State_OnMouseOut = null;\n\t\t\t\t\t\t\tthis.State_OnMouseOver = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//update the border property\n\t\t\t\t\t\tlistBasicProperties.push(__NEMESIS_PROPERTY_BORDER);\n\t\t\t\t\t\t//update the look\n\t\t\t\t\t\tlistBasicProperties.push(__NEMESIS_PROPERTY_BK_COLOR_DEFAULT);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_FOCUS_BORDER:\n\t\t\t\t//update this\n\t\t\t\tPushButton_UpdateOutline(this.InterpreterObject);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//will need basic\n\t\t\t\tlistBasicProperties.push(listProperties[i]);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t//needs basic processing?\n\tif (listBasicProperties.length > 0)\n\t{\n\t\t//call basic\n\t\tBasic_UpdateProperties(this.InterpreterObject, listBasicProperties);\n\t}\n}", "title": "" }, { "docid": "b2e122d58d3f491369a9adc069885c40", "score": "0.51263744", "text": "function addBtn(){\n\t//disable add button until screen is returned to focus. Issue #28\n\t$.addTransect.enabled = false;\n\t\n\tvar addTransect = Alloy.createController(\"addTransect\", {siteGUID: $.tbl.siteGUID}).getView();\n\tvar nav = Alloy.Globals.navMenu;\n\tnav.openWindow(addTransect);\n}", "title": "" }, { "docid": "ff99b9ac1e6710ccdf444b472bf479c2", "score": "0.5114786", "text": "addActiveProperty(name, mUnit, cap, value, addValue, color= \"\")\n {\n activeProperties.push(this.add.bitmapText( treePropertiesStartingWidth, \n treePropertiesStartingHeight += propertiesSpacing, \n \"retro\" + color, \n name + \": \" + value + \" / \" + cap + \" \" + mUnit,\n 17\n ));\n \n \n if(treeVariables[name].hasButton)\n {\n buttonCounter++;\n if(buttonCounter == 4)\n {\n buttonRows++\n buttonCounter = 0;\n treeButtonStartingWidth += 220;\n if(buttonRows % 2 == 0)\n {\n treeButtonStartingHeight = 525;\n }\n else\n {\n treeButtonStartingHeight = 565;\n }\n }\n if(buttonRows < 8)\n {\n let button = this.add.sprite( treeButtonStartingWidth, \n treeButtonStartingHeight += buttonSpacing, \n name + '_buttons', \n 0\n );\n button.setInteractive();\n button.on('pointerdown', () => {\n this.isActionAffordable(name, addValue); \n });\n button.on('pointerover', () => {\n button.setTexture( name + '_buttons', 1);\n });\n button.on('pointerout', () => {\n button.setTexture( name + '_buttons', 0);\n });\n \n buttons.push(button);\n }\n\n }\n }", "title": "" }, { "docid": "cb4a1fe3ff995a9a5a8d36ef6d8c7fab", "score": "0.5113157", "text": "function createRowforwatherInfoTable(tableBodyId,name,Description) {\n\n var row = tableBodyId.insertRow();\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n cell2.innerHTML = name;\n cell3.innerHTML = Description;\n createCheckBox(cell1);\n}", "title": "" }, { "docid": "772e3735c5be784d6945fb8829012b1a", "score": "0.51098335", "text": "function MUPS_CreateTblrowLvl(level_dict, depbase_pk, schoolbase_pk, allow_delete) { // PR2022-11-05\n //console.log(\"===== MUPS_CreateTblrowLvl ===== \");\n //console.log(\" level_dict\", level_dict);\n\n// --- get info from level_dict\n const lvlbase_pk = level_dict.base_id;\n const name = (level_dict.name) ? level_dict.name : \"\";\n const class_bg_color = \"c_columns_tr\";\n\n//--------- insert tblBody_select row at end\n const tblRow = el_MUPS_tbody_select.insertRow(-1);\n\n tblRow.setAttribute(\"data-table\", \"level\");\n tblRow.setAttribute(\"data-schoolbase_pk\", schoolbase_pk);\n tblRow.setAttribute(\"data-depbase_pk\", depbase_pk);\n tblRow.setAttribute(\"data-lvlbase_pk\", lvlbase_pk);\n\n// --- add first td to tblRow.\n let td = tblRow.insertCell(-1);\n td.classList.add(class_bg_color)\n\n let el_div = document.createElement(\"div\");\n el_div.classList.add(\"tw_075\")\n td.appendChild(el_div);\n\n// --- add second td to tblRow.\n td = tblRow.insertCell(-1);\n td.classList.add(class_bg_color)\n el_div = document.createElement(\"div\");\n el_div.classList.add(\"tw_480\")\n el_div.innerHTML = \"&emsp;&emsp;\" + name;\n\n td.appendChild(el_div);\n\n el_div.classList.add(\"awp_modselect_level\")\n\n // --- add addEventListener\n if (lvlbase_pk === -1){\n td.addEventListener(\"click\", function() {MUPS_SelectLevel(tblRow)}, false);\n } else {\n td.addEventListener(\"click\", function() {MUPS_ExpandTblrows(tblRow)}, false);\n };\n\n// --- add third td to tblRow.\n td = tblRow.insertCell(-1);\n td.classList.add(class_bg_color)\n // skip when add_new or not may_edit\n if (lvlbase_pk !== -1){\n // oly add delete btn when may_edit\n if (mod_MUPS_dict.may_edit) {\n el_div = document.createElement(\"div\");\n el_div.classList.add(\"tw_060\");\n el_div.classList.add(\"delete_0_0\");\n add_hover(el_div, \"delete_0_2\", \"delete_0_0\");\n\n // --- add addEventListener\n td.addEventListener(\"click\", function() {MUPS_DeleteTblrow(tblRow)}, false);\n td.appendChild(el_div);\n };\n };\n\n// --- add subject rows\n if (lvlbase_pk !== -1){\n let show_item = false;\n const expanded_schoolbase_dict = mod_MUPS_dict.expanded[schoolbase_pk.toString()];\n if (expanded_schoolbase_dict) {\n const expanded_depbase_dict = expanded_schoolbase_dict[depbase_pk.toString()];\n if (expanded_depbase_dict) {\n const expanded_lvlbase_dict = expanded_depbase_dict[lvlbase_pk.toString()];\n if (expanded_lvlbase_dict) {\n show_item = expanded_lvlbase_dict.expanded;\n }}};\n if (show_item){\n MUPS_CreateTableSubject(lvlbase_pk, depbase_pk, schoolbase_pk);\n };\n };\n }", "title": "" }, { "docid": "fc4e6d8deef5776a31f4832277b25a49", "score": "0.51083124", "text": "function createFieldMappingRow1() {\n var table = document.getElementById(\"userMapping\");\n// var tbody = document.getElementById(\"ProfileSync1\");\n var new_row = table.rows[4].cloneNode(true);\n // console.log(new_row);\n var len = table.rows.length;\n new_row.cells[0].innerHTML = len;\n\n var inp1 = new_row.cells[1].getElementsByTagName('select')[0];\n //new_row.id = \"row\" + len;\n //inp1.id += len;\n// inp1.value = '';\n// console.log(new_row.children[4]);\n new_row.children[4].style.display = \"block\";\n for (var i = 1; i < table.tBodies[0].children.length; i++) {\n table.tBodies[0].children[i].children[0].innerHTML = i + 1;\n }\n\n\n table.tBodies[0].appendChild(new_row);\n table.tBodies[0].children[len - 1].children[1].children[0].value = \"\";\n table.tBodies[0].children[len - 1].children[2].children[0].value = \"\";\n table.tBodies[0].children[len - 1].children[3].children[0].value = \"\";\n gadgets.window.adjustHeight();\n}", "title": "" }, { "docid": "691c751699e73fe3fe45f2be62906f1b", "score": "0.51068413", "text": "function toolbarAddIns(toolbarobj) {\n toolbarobj.add({id: \"insert\", hint: javaMessages.ins_line, icon: \"fa fa-plus\", caption: \"\", type: \"button\"});\n}", "title": "" }, { "docid": "3d8c047e0cdd5962541345873051c325", "score": "0.51001793", "text": "function openPagePropertiesDialog(){\r\n\t\t\r\n\t\tvar selectedItem = g_objItems.getSelectedItem();\r\n\t\tvar pageTitle = selectedItem.data(\"title\");\r\n\t\tvar layoutID = selectedItem.data(\"id\");\r\n\t\tvar dialogID = \"uc_dialog_addon_properties\";\r\n\t\t\t\t\r\n\t\tvar options = {\r\n\t\t\t\tminWidth: 900,\r\n\t\t\t\ttitle:\"Edit Page: \"+pageTitle\r\n\t\t};\r\n\t\t\r\n\t\tvar objDialog = jQuery(\"#\" + dialogID);\r\n\t\tg_ucAdmin.validateDomElement(objDialog, \"dialog properties\");\r\n\t\t\r\n\t\tvar objLoader = objDialog.find(\".uc-settings-loader\");\r\n\t\tg_ucAdmin.validateDomElement(objLoader, \"loader\");\r\n\t\t\r\n\t\t\r\n\t\tvar objContent = objDialog.find(\".uc-settings-content\");\r\n\t\tg_ucAdmin.validateDomElement(objContent, \"content\");\r\n\t\t\r\n\t\tobjContent.html(\"\").hide();\r\n\t\tobjLoader.show();\r\n\t\t\r\n\t\t\t\t\r\n\t\tg_ucAdmin.openCommonDialog(\"#uc_dialog_addon_properties\", function(){\r\n\t\t\t\r\n\t\t\tvar data = {\"id\":layoutID};\r\n\t \r\n\t\t\tdata = addCommonAjaxData(data);\t\r\n\t\t\t\r\n\t\t\tg_ucAdmin.ajaxRequest(\"get_layouts_params_settings_html\", data, function(response){\r\n\t\t\t\t\r\n\t\t\t\tobjLoader.hide();\r\n\t\t\t\tobjContent.show().html(response.html);\r\n\t\t\t\t\r\n\t\t\t\t//init settings\r\n\t\t\t\tvar objSettingsWrapper = objContent.find(\".unite_settings_wrapper\");\r\n\t\t\t\tg_ucAdmin.validateDomElement(objSettingsWrapper, \"page properties settings wrapper\");\r\n\t\t\t\t\r\n\t\t\t\tg_settingsPageProps = new UniteSettingsUC();\r\n\t\t\t\tg_settingsPageProps.init(objSettingsWrapper);\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t} ,options);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "c1f2ca9cd1d9fb4787d6fa81bd01dd97", "score": "0.50964516", "text": "function init_basicstepPage() {\n if (propertyid != \"-1\" && propertyid != \"0\") {\n $('#_propname2').val(HtmlDecoder(prop_info[\"Name2\"]));\n $('#_propname').val(HtmlDecoder(prop_info[\"Name\"]));\n $('#_virttour').val(HtmlDecoder(prop_info[\"VirtualTour\"]));\n $('#_propaddr').val(HtmlDecoder(prop_info[\"Address\"]));\n if (prop_info[\"IfShowAddress\"] != \"\" && prop_info[\"IfShowAddress\"] != null) $('#_propdisplay').val(prop_info[\"IfShowAddress\"]);\n $('#_propbedroom').val(prop_info[\"NumBedrooms\"]);\n $('#_propbathrooms').val(prop_info[\"NumBaths\"]);\n $('#_propsleep').val(prop_info[\"NumSleeps\"]);\n if (prop_info[\"MinimumNightlyRentalID\"] != \"\" && prop_info[\"MinimumNightlyRentalID\"] != null) $('#_propminrental').val(prop_info[\"MinimumNightlyRentalID\"]);\n $('#_proptv').val(prop_info[\"NumTVs\"]);\n $('#_propcd').val(prop_info[\"NumCDPlayers\"]);\n $('#additional_type').val(prop_info[\"PropertyName\"]);\n }\n\n $('#wzardstep0 .chosen-select').chosen();\n\n changePropertyType();\n}", "title": "" }, { "docid": "b992c5a92eccefa19d9ffb182362286b", "score": "0.50935936", "text": "function carePlanBuildTableRow(carePlan) {\n var ret =\n \"<tr>\" +\n \"<td>\" + carePlan.title + \"</td>\" +\n \"<td>\" + carePlan.patient_name + \"</td>\" +\n \"<td>\" + carePlan.user_name + \"</td>\" +\n \"<td>\" + carePlan.actual_start_date + \"</td>\" +\n \"<td>\" + carePlan.target_date + \"</td>\" +\n \"<td>\" + carePlan.reason + \"</td>\" +\n \"<td>\" + carePlan.action + \"</td>\" +\n \"<td>\" + carePlan.completed + \"</td>\";\n\n if (carePlan.end_date) {\n ret += \"<td>\" + carePlan.end_date + \"</td>\";\n }\n else {\n ret += \"<td></td>\";\n }\n\n if (carePlan.outcome) {\n ret += \"<td>\" + carePlan.outcome + \"</td>\";\n }\n else {\n ret += \"<td></td>\";\n }\n\n ret += \"<td>\" + \"<button type='button' title='Edit the care plan' \" + \"onclick='getCarePlanClick(this);' \" +\n \"class='btn btn-success btn-sm' \" + \"data-id='\" + carePlan.id + \"'>\" +\n \"<i class='bi bi-pencil' />\" + \"</button>\" + \"</td>\";\n\n ret += \"</tr>\";\n\n return ret;\n}", "title": "" }, { "docid": "2da47a0e3b5c3eaf227b2444ff31f96a", "score": "0.5091718", "text": "function addParam() {\r\n var addButtonRow = document.getElementById(\"add_button_row\"),\r\n paramRow = document.createElement(\"tr\"),\r\n paramSearchCell = document.createElement(\"td\"),\r\n paramAliasCell = document.createElement(\"td\"),\r\n paramSearchInput = document.createElement(\"input\"),\r\n paramAliasInput = document.createElement(\"input\"),\r\n paramDeleteCell = document.createElement(\"td\"),\r\n paramDeleteButton = document.createElement(\"span\");\r\n\r\n paramRow.setAttribute(\"name\",\"custom_param_row\");\r\n paramRow.style.verticalAlign = \"center\";\r\n paramSearchCell.setAttribute(\"name\", \"searchCell\");\r\n paramAliasCell.setAttribute(\"name\",\"aliasCell\");\r\n paramSearchInput.type = \"text\";\r\n paramSearchInput.setAttribute(\"name\",\"searchInput\");\r\n paramSearchInput.placeholder = \"Search For Parameters\";\r\n\r\n\r\n paramAliasInput.type = \"text\";\r\n paramAliasInput.setAttribute(\"name\",\"aliasInput\");\r\n paramAliasInput.placeholder=\"Enter Key\";\r\n paramDeleteButton.className = \"ion-close\";\r\n paramDeleteButton.style.fontSize = \"25px\";\r\n paramDeleteButton.onclick = function () {\r\n paramRow.parentElement.removeChild(paramRow);\r\n };\r\n\r\n //Assemble the row\r\n paramSearchCell.appendChild(paramSearchInput);\r\n paramAliasCell.appendChild(paramAliasInput);\r\n paramDeleteCell.appendChild(paramDeleteButton);\r\n paramRow.appendChild(paramSearchCell);\r\n paramRow.appendChild(paramAliasCell);\r\n paramRow.appendChild(paramDeleteCell);\r\n addButtonRow.parentElement.insertBefore(paramRow, addButtonRow);\r\n paramAliasCell.style.width = \"10px\";\r\n $(paramSearchInput).typeahead({\r\n hint: true,\r\n highlight: true,\r\n minLength: 1,\r\n maxLength: 5,\r\n },\r\n {\r\n name: 'states',\r\n source: substringMatcher(states)\r\n });\r\n}", "title": "" }, { "docid": "ab65f63b5f0654c4412f3bbd1b2661d8", "score": "0.5089695", "text": "function insertTableRow(list) {\n // Create row to append interested data\n let newRow = $(\"<tr>\");\n\n // Create interested elements to be appended\n //let teamIdElement = $(\"<td>\", {text: list.TeamId});\n let teamNameElement = $(\"<td>\", {text: list.TeamName});\n let managerNameElement = $(\"<td>\", {text: list.ManagerName});\n let managerEmailElement = $(\"<td>\", {text: list.ManagerEmail})\n let membersLenElement = $(\"<td>\", {text: list.Members.length + ` (max: ${list.MaxTeamMembers})`});\n \n // Create data specifically for view/delete team\n let newTd = $(\"<td>\");\n let detailElement = $(\"<button>\", {type: \"button\", \n class: \"btn btn-outline-success mx-1\",\n id: \"detailTeam\" + list.TeamId, \n text: \"Details\"});\n let deleteElement = $(\"<button>\", {type: \"button\", \n class: \"btn btn-outline-danger mx-1\",\n id: \"removeTeam\" + list.TeamId, \n text: \"Delete\"});\n\n // Append the row to the body\n $(\"#teamBody\").append(newRow);\n\n // Append interested elements\n newRow.append(teamNameElement)\n .append(managerNameElement)\n .append(managerEmailElement)\n .append(membersLenElement)\n .append(newTd);\n\n // Append edit/delete icons\n newTd.append(detailElement)\n .append(deleteElement);\n\n // Wire in click event for view details\n $(\"#detailTeam\" + list.TeamId).on(\"click\", () => {\n location.href = `details.html?teamId=${list.TeamId}`;\n });\n\n // Wire in click event for view details\n $(\"#removeTeam\" + list.TeamId).on(\"click\", () => {\n // Save team id for deletion\n sessionStorage.setItem(\"teamid\", list.TeamId);\n createDeleteModal(list);\n $(\"#deleteModal\").modal(focus);\n });\n}", "title": "" }, { "docid": "f8c628276a59240ea18ee44b8a5a9761", "score": "0.5088566", "text": "newPropertiesSheet() {\n this.properties_sheet = new OkeClusterProperties(this.artefact)\n }", "title": "" }, { "docid": "40458c8589f4277df29798019ff1ec5c", "score": "0.5082453", "text": "function update_property(row_id){\n create_property_list(row_id, from='update');\n}", "title": "" }, { "docid": "43a8f57b70e14f2d4b299665adc65798", "score": "0.50781035", "text": "function getHolonObjectTypesFromDatabase() {\nvar types=[\"Fridge\",\"Washing Machine\"];\nvar data=\"\";\nfor(var i=0;i<types.length;i++)\n\t{\n\t\tdata=data+\"<tr><td>\"+types[i]+\"</td><td><button id='editMasterHolonObjectType'>Edit</button></td><td><button id='deleteMasterHolonObjectType'>Delete</button></td></tr>\"\n\t}\ndata=\"<table border='1'><th>Data Type</th><th></th><th></th>\"+data+\"</table>\";\n$(\"#masterTableHolonObjectsTypes\").empty();\n$(\"#masterTableHolonObjectsTypes\").append(\"<a href='#' data-rel='back' data-role='button' data-theme='a' data-icon='delete' data-iconpos='notext' class='ui-btn-right'>X</a>\"+data);\n$(\"#masterTableHolonObjectsTypes\").append(\"<br><button id='addMasterHolonObjectType' onclick='addHolonObjectTypeInMaster()'>Add</button>\");\n$(\"#masterTableHolonObjectsTypes\").show();\n$(\"#masterTableHolonObjectsTypes\").popup();\n$(\"#masterTableHolonObjectsTypes\").popup(\"open\");\n\n}", "title": "" }, { "docid": "7a18e459f17796b25e7654ebd07c8b02", "score": "0.5069595", "text": "function populateTable(someJsonData) {\n for (let item of someJsonData) {\n let ispaid = \"\";\n let table_row = document.createElement(\"tr\");\n for (let prop in item) {\n if (item[prop] == \"unpaid\") {\n ispaid = \"true\";\n }\n let column = createColumn(\"\", item[prop]);\n table_row.appendChild(column);\n }\n if (ispaid) {\n // Create a action button \n table_row.appendChild(document.createTextNode(\"I'm a text\"));\n }\n afterThead.after(table_row);\n }\n}", "title": "" }, { "docid": "d97075b111206d0edd249cba38d57b35", "score": "0.50615513", "text": "add(properties) {\r\n return this.postCore({\r\n body: jsS(properties),\r\n });\r\n }", "title": "" }, { "docid": "d97075b111206d0edd249cba38d57b35", "score": "0.50615513", "text": "add(properties) {\r\n return this.postCore({\r\n body: jsS(properties),\r\n });\r\n }", "title": "" }, { "docid": "d97075b111206d0edd249cba38d57b35", "score": "0.50615513", "text": "add(properties) {\r\n return this.postCore({\r\n body: jsS(properties),\r\n });\r\n }", "title": "" }, { "docid": "0fff4639fe8fcd9f6e30cdbac56fa96e", "score": "0.5059564", "text": "function initPagePropsDialog(){\r\n\t\t\r\n\t\tvar objButton = jQuery(\"#uc_dialog_addon_properties_action\");\r\n\t\tif(objButton.length == 0)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tobjButton.on(\"click\",function(){\r\n\t\t\t\r\n\t\t\tvar selectedItemID = g_objItems.getSelectedItemID();\r\n\t\t\tvar selectedItem = g_objItems.getSelectedItem();\r\n\t\t\t\r\n\t\t\tvar data = {\"layoutid\":selectedItemID};\r\n\t\t\tdata.params = g_settingsPageProps.getSettingsValues();\r\n\t\t\tdata[\"from_manager\"] = true;\r\n\t\t\t\r\n\t\t\tdata = addCommonAjaxData(data);\r\n\t\t\t\r\n\t\t\tg_ucAdmin.dialogAjaxRequest(\"uc_dialog_addon_properties\", \"update_layout_params\", data, function(response){\r\n\t\t\t\t\r\n\t\t\t\tg_objItems.replaceItemHtml(selectedItem, response.html_item);\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "de1814f65d8e863e4a415669bd64fb10", "score": "0.50571084", "text": "function edit_property_row(data_table_id, row_no){\n $(\"#add_property\").parent().attr(\"style\", \"display:none\");\n $(\"#update_property\").parent().attr(\"style\", \"display:block\");\n $(\"#cancel_property\").parent().attr(\"style\", \"display:block\");\n row_no -= 1;\n load_property(property_list[row_no]);\n $('#update_property').attr(\"onclick\", \"update_property_row(\"+row_no+\");\");\n $(\"#stolenproperty\").prop('disabled', true);\n}", "title": "" }, { "docid": "d36c68fd0a6ab5a5fb03866004880a51", "score": "0.5056808", "text": "function quickinsertPROPINV(pFramedata)\r\n{\r\n if ( a.hasvar(\"$image.propinvrole\") && a.hasvar(\"$image.propertyid\") )\r\n {\r\n var fields = [\"PROPINVID\", \"PROPERTY_ID\", \"RELATION_ID\", \"ROLEINVOLVED\", \"USER_NEW\", \"DATE_NEW\"];\r\n var types = a.getColumnTypes(\"PROPINV\", fields);\r\n var values = [ a.getNewUUID(), a.valueof(\"$image.propertyid\"), pFramedata[\"ORGRELID\"], \r\n a.valueof(\"$image.propinvrole\"), a.valueof(\"$sys.user\"), a.valueof(\"$sys.date\") ];\r\n if ( isDuplicat(\"PROPINV\", fields, types, values) == 0 ) a.sqlInsert(\"PROPINV\", fields, types, values); \r\n }\r\n}", "title": "" }, { "docid": "cda2e7687326a36bd6b820424dde0c91", "score": "0.50510806", "text": "function RedcomDatabaseTableConfigAdd() {\n var val;\n for (var i = 0; i < RedcomDatabaseTableConfigArr.length; i++) {\n val += \"<tr>\";\n val += \"<td>\";\n val += RedcomDatabaseTableConfigArr[i][0];\n val += \"</td>\";\n val += \"<td>\";\n val += RedcomDatabaseTableConfigArr[i][1];\n val += \"</td>\";\n val += \"<td>\";\n val += RedcomDatabaseTableConfigArr[i][2];\n val += \"</td>\";\n val += \"<td>\";\n val += RedcomDatabaseTableConfigArr[i][3];\n val += \"</td>\";\n val += \"<td>\";\n val += RedcomDatabaseTableConfigArr[i][4];\n val += \"</td>\";\n val += \"<td>\";\n val += RedcomDatabaseTableConfigArr[i][5];\n val += \"</td>\";\n val += \"<td>\";\n val += RedcomDatabaseTableConfigArr[i][6];\n val += \"</td>\";\n val += \"</tr>\";\n }\n return val;\n}", "title": "" }, { "docid": "07e0bf2cced8a487844251f8d6b7ef77", "score": "0.50466096", "text": "function Form_UpdateProperties(listProperties)\n{\n\t//basic processing properties?\n\tvar listBasicProperties = new Array();\n\n\t//markers\n\tvar bWSCaptionDone = false;\n\tvar bWillDoWSCaption = false;\n\n\t//helpers\n\tvar i, c;\n\t//loop through the properties\n\tfor (i = 0, c = listProperties.length; i < c; i++)\n\t{\n\t\t//switch on property\n\t\tswitch (listProperties[i])\n\t\t{\n\t\t\tcase __NEMESIS_PROPERTY_WS_CAPTION:\n\t\t\tcase __NEMESIS_PROPERTY_WS_CHILD:\n\t\t\t\t//we will do this\n\t\t\t\tbWillDoWSCaption = true;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t//loop through the properties\n\tfor (i = 0, c = listProperties.length; i < c; i++)\n\t{\n\t\t//switch on property\n\t\tswitch (listProperties[i])\n\t\t{\n\t\t\tcase __NEMESIS_PROPERTY_WS_CHILD:\n\t\t\t\t//remove ourselves from our parent\n\t\t\t\tthis.parentNode.removeChild(this);\n\t\t\t\t//get its Child Status\n\t\t\t\tthis.WS_CHILD = Get_Bool(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_WS_CHILD], false);\n\t\t\t\t//child?\n\t\t\t\tif (this.WS_CHILD)\n\t\t\t\t{\n\t\t\t\t\t//this an sap object?\n\t\t\t\t\tswitch (this.InterpreterObject.InterfaceLook)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\t\t\t\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\t\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\t\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\t\t\t\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\t\t\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\t\t\t\t\t//load directly in the object\n\t\t\t\t\t\t\tthis.InterpreterObject.Parent.HTML.appendChild(this);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t//load in the parent\n\t\t\t\t\t\t\tthis.InterpreterObject.Parent.HTMLParent.appendChild(this);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//add it to the display\n\t\t\t\t\t__SIMULATOR.Interpreter.DisplayPanel.appendChild(this);\n\t\t\t\t}\n\t\t\t\t//ws caption not yet done?\n\t\t\t\tif (!bWSCaptionDone)\n\t\t\t\t{\n\t\t\t\t\t//force it\n\t\t\t\t\tlistProperties[i--] = __NEMESIS_PROPERTY_WS_CAPTION;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_HEIGHT:\n\t\t\tcase __NEMESIS_PROPERTY_WIDTH:\n\t\t\tcase __NEMESIS_PROPERTY_WS_CAPTION:\n\t\t\tcase __NEMESIS_PROPERTY_BORDER:\n\t\t\tcase __NEMESIS_PROPERTY_BORDER_LEFT:\n\t\t\tcase __NEMESIS_PROPERTY_BORDER_RIGHT:\n\t\t\tcase __NEMESIS_PROPERTY_BORDER_TOP:\n\t\t\tcase __NEMESIS_PROPERTY_BORDER_BOTTOM:\n\t\t\tcase __NEMESIS_PROPERTY_CLIENTEDGE:\n\t\t\tcase __NEMESIS_PROPERTY_BORDER_RADIUSES:\n\t\t\t\t//ws caption not yet done?\n\t\t\t\tif (!bWSCaptionDone)\n\t\t\t\t{\n\t\t\t\t\t//Update Border\n\t\t\t\t\tBasic_SetBorders(this, this.InterpreterObject);\n\t\t\t\t\t//update object position for borders \n\t\t\t\t\tBasic_UpdatePosition(this, this.InterpreterObject, this.InterpreterObject.DataObject.Class);\n\t\t\t\t\t//Update our WS Caption\n\t\t\t\t\tForm_UpdateWSCaption(this, this.InterpreterObject);\n\t\t\t\t\t//update the menu\n\t\t\t\t\tForm_UpdateMenu(this, this.InterpreterObject);\n\t\t\t\t\t//update the caption\n\t\t\t\t\tForm_UpdateCaption(this, this.InterpreterObject.Properties[__NEMESIS_PROPERTY_CAPTION]);\n\t\t\t\t\t//update the child area\n\t\t\t\t\tForm_UpdateChildArea(this, this.InterpreterObject);\n\t\t\t\t\t//get enabled state of the form\n\t\t\t\t\tthis.FORM_ENABLED = Get_Bool(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_ENABLED], true);\n\t\t\t\t\t//Updated enabled state to show disabled\n\t\t\t\t\tForm_UpdateEnabled(this, this.InterpreterObject, false);\n\t\t\t\t\t//set focus on it\n\t\t\t\t\tForm_SetFocus(this);\n\t\t\t\t\t//caption done\n\t\t\t\t\tbWSCaptionDone = true;\n\t\t\t\t\t//everytime we change this we update the clip rect\n\t\t\t\t\tthis.style.clip = \"rect(0px,\" + this.offsetWidth + \"px,\" + this.offsetHeight + \"px,0px)\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_MENU:\n\t\t\tcase __NEMESIS_PROPERTY_FONT:\n\t\t\t\t//will not do the full WS_CAPTION?\n\t\t\t\tif (!bWillDoWSCaption)\n\t\t\t\t{\n\t\t\t\t\t//update the menu\n\t\t\t\t\tForm_UpdateMenu(this, this.InterpreterObject);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_CAPTION:\n\t\t\t\t//will not do the full WS_CAPTION?\n\t\t\t\tif (!bWillDoWSCaption)\n\t\t\t\t{\n\t\t\t\t\t//update the caption\n\t\t\t\t\tForm_UpdateCaption(this, this.InterpreterObject.Properties[__NEMESIS_PROPERTY_CAPTION]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_CLIENT_RECT:\n\t\t\t\t//will not do the full WS_CAPTION?\n\t\t\t\tif (!bWillDoWSCaption)\n\t\t\t\t{\n\t\t\t\t\t//update the child area\n\t\t\t\t\tForm_UpdateChildArea(this, this.InterpreterObject);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_PROPERTY_ENABLED:\n\t\t\t\t//will not do the full WS_CAPTION?\n\t\t\t\tif (!bWillDoWSCaption)\n\t\t\t\t{\n\t\t\t\t\t//get enabled state of the form\n\t\t\t\t\tthis.FORM_ENABLED = Get_Bool(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_ENABLED], true);\n\t\t\t\t\t//Updated enabled state to show disabled\n\t\t\t\t\tForm_UpdateEnabled(this, this.InterpreterObject, false);\n\t\t\t\t\t//set focus on it\n\t\t\t\t\tForm_SetFocus(this);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//will need basic\n\t\t\t\tlistBasicProperties.push(listProperties[i]);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t//needs basic processing?\n\tif (listBasicProperties.length > 0)\n\t{\n\t\t//call basic\n\t\tBasic_UpdateProperties(this.InterpreterObject, listBasicProperties);\n\t}\n}", "title": "" }, { "docid": "d428fe06e9b13949a04adfcf3bc262d6", "score": "0.50459063", "text": "function showAddDictionaryButton() {\n let addDictionaryButton = `<a id=\"add-dictionary\" class=\"btn dark col-sm-auto\" href=\"./addDictionary.php\"><i class=\"fas fa-plus\"></i> Add Dictionary</a>`\n $('#table-header').append(` ${addDictionaryButton}\\n`) //extra spaces/tab for formatting purposes\n}//end of showAddDictionaryButton", "title": "" }, { "docid": "30123f860bb88b0f72a7e44abd9ce2a7", "score": "0.50422597", "text": "function outletAttrJSON(jData){\n\tpowerOutletTableObj = {};\n\tvar str = \"\";\n\tvar row = jData.data[0].row;\n\tvar tableHead = $(\"#tbOutlet\").find('th');\n\tfor(var a=0; a<row.length; a++){\n\t\tif(globalDeviceType != \"Mobile\"){\n\t\t\tvar host = jData.data[0].row[a]['HostName'];\n\t\t\tvar outname = jData.data[0].row[a]['OutletName'];\n\t\t\tvar outnum = jData.data[0].row[a]['Outlet'];\n\t\t\tvar outcom = host+\"^\"+outname+\"^\"+outnum;\n\t\t\tstr += \"<tr id='tr\"+row[a].DeviceId+\"' \";\n\t\t\tstr += \"onclick='$($(this).find(\\\"input\\\")[0]).trigger(\\\"click\\\")'><td>\";\n\t\t\tstr += \"<input type='checkbox' name='tbOutlet' class='trOutletDev' \";\n\t\t\tvar clickAct = \"$(this).trigger(\\\"click\\\");powerCheckbox(this.name)\";\n\t\t\tstr += \"outletid='\"+row[a].DeviceId+\"' onClick='\"+clickAct+\"'/></td>\";\n\t\t}else{\n\t\t\tstr += \"<tr class='trOutletDev' outletid='\"+row[a].DeviceId+\"'>\";\n\t\t}\n\t\tvar tableContentObj = {};\n\t\tpowerOutletTableObj[row[a].DeviceId] = tableContentObj;\n\t\tfor(var x=0; x<tableHead.length; x++){\n\t\t\tvar name = $(tableHead[x]).attr('name');\n\t\t\tvar className = $(tableHead[x]).attr('class');\n\t\t\tif(name==undefined){continue;}\n\t\t\tif(className!=undefined){\n\t\t\t\tstr += \"<td class='\"+className+\"'>\"+row[a][name]+\"</td>\";\n\t\t\t}else{\n\t\t\t\tstr += \"<td>\"+row[a][name]+\"</td>\";\n\t\t\t}\n\t\t\ttableContentObj[name] = row[a][name];\n\t\t}\n\t\tstr += \"</tr>\";\n\t}\n\t$('#tbOutlet > tbody').empty().append(str);\n\tsetBlank('tbOutlet');\n\tif(globalDeviceType != \"Mobile\"){\n\t}else{\n\t\t$(\"#tbOutlet\").table(\"refresh\");\n\t}\n\tif (!($('#PMExpandedView').is(':checked'))){\n\t\t$(\".PMOexpanded\").hide();\n\t}\n}", "title": "" }, { "docid": "38b7b729cd3cc37ac90206a0b8dd81c1", "score": "0.50418097", "text": "function fillUpTable() {\r\n\tgetInstantValues();\r\n}", "title": "" }, { "docid": "884b36d3293bffbee8ed41288cdcfea1", "score": "0.5038539", "text": "function generateTable() {\n let body = table.createTBody();\n var creatureIndex = 0;\n \n for (let creature of creatures) {\n\n if (creature.visible === true) {\n\n let row = body.insertRow();\n\n for (propertyKey in creature) {\n\n if (propertyKey !== 'visible') {\n\n let cell = row.insertCell();\n let text = document.createTextNode(creature[propertyKey]);\n let textHolder = document.createElement(\"DIV\");\n textHolder.setAttribute(\"class\", \"d-block textHolder text-capitalize\");\n let editInput = document.createElement(\"INPUT\");\n editInput.setAttribute(\"type\", \"text\");\n editInput.setAttribute(\"value\", creature[propertyKey]);\n editInput.setAttribute(\"class\", \"d-none editInput \" + propertyKey);\n editInput.dataset.title = propertyKey;\n textHolder.appendChild(text);\n cell.appendChild(textHolder);\n cell.appendChild(editInput);\n }\n }\n\n let cell = row.insertCell();\n for (action of actions) {\n let btn = document.createElement('input');\n btn.type = \"button\";\n btn.className = \"btn btn-secondary\";\n btn.value = action.name;\n btn.dataset.index = creatureIndex;\n btn.onclick = action.action;\n cell.appendChild(btn);\n }\n }\n creatureIndex++;\n }\n }", "title": "" }, { "docid": "279937fb9781560151710dce1340e823", "score": "0.50363183", "text": "function fillRow_change(tableName,c1,c2,c3,barcode){\n\t\t\t\t\tvar table=document.getElementById(tableName);\n\t\t\t\t\tvar numRows=table.rows.length;\n\t\t\t\t\tvar row=table.insertRow(numRows);\n\t\t\t\t\tvar cell1 = row.insertCell(0);\n\t\t\t \tvar cell2 = row.insertCell(1);\n\t\t\t \tvar cell3=\trow.insertCell(2);\n\t\t\t \tvar cell4=\trow.insertCell(3);\n\t\t\t \t\n\t\t\t \t\n\t\t\t \tcell1.innerHTML = c1;\n\t\t\t \tcell2.innerHTML = c2;\n\t\t\t \tcell3.innerHTML = c3;\n\n\t\t\t \tvar editButton = document.createElement('BUTTON');\n\t\t\t \teditButton.id=barcode.toString();\n\t\t\t \teditButton.className=\"glyphicon glyphicon-pencil\";\n\t\t\t \tcell4.appendChild(editButton);\n\t\t\t \teditButton.addEventListener(\"click\", edit);\n\t\t\t}", "title": "" }, { "docid": "ab5bc771646c8f1de795a17d6c3b56da", "score": "0.50351137", "text": "function insertProductRecordData(id,code,price,stock){\n\n var result = '<tr type=\"button\" onclick=\"productModifyModal('+id+')\" id=\"product-'+id+'\"><th scope=\"row\">' \n + id + '</th><td id=\"product-'+id+'-code\">' + code + '</td><td id=\"product-'+id+'-price\">'+price+'</td><td id=\"product-'+id+'-stock\">'+stock+'</td></tr>';\n\n\n $(\"#producttbody\").append(result);\n}", "title": "" }, { "docid": "027371cc54d33961360853b1edf14549", "score": "0.5027928", "text": "function InsertButtonsToToolBar()\n{\n//Strike-Out Button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png\",\n \"speedTip\": \"Strike\",\n \"tagOpen\": \"<s>\",\n \"tagClose\": \"</s>\",\n \"sampleText\": \"Strike-through text\"}\n//Line break button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png\",\n \"speedTip\": \"Line break\",\n \"tagOpen\": \"<br />\",\n \"tagClose\": \"\",\n \"sampleText\": \"\"}\n//Superscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png\",\n \"speedTip\": \"Superscript\",\n \"tagOpen\": \"<sup>\",\n \"tagClose\": \"</sup>\",\n \"sampleText\": \"Superscript text\"}\n//Subscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png\",\n \"speedTip\": \"Subscript\",\n \"tagOpen\": \"<sub>\",\n \"tagClose\": \"</sub>\",\n \"sampleText\": \"Subscript text\"}\n//Small Text\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png\",\n \"speedTip\": \"Small\",\n \"tagOpen\": \"<small>\",\n \"tagClose\": \"</small>\",\n \"sampleText\": \"Small Text\"}\n//Comment\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png\",\n \"speedTip\": \"Insert hidden Comment\",\n \"tagOpen\": \"<!-- \",\n \"tagClose\": \" -->\",\n \"sampleText\": \"Comment\"}\n//Gallery\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png\",\n \"speedTip\": \"Insert a picture gallery\",\n \"tagOpen\": \"\\n<gallery>\\n\",\n \"tagClose\": \"\\n</gallery>\",\n \"sampleText\": \"Image:Example.jpg|Caption1\\nImage:Example.jpg|Caption2\"}\n//Block Quote\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png\",\n \"speedTip\": \"Insert block of quoted text\",\n \"tagOpen\": \"<blockquote>\\n\",\n \"tagClose\": \"\\n</blockquote>\",\n \"sampleText\": \"Block quote\"}\n// Table\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/commons/0/04/Button_array.png\",\n \"speedTip\": \"Insert a table\",\n \"tagOpen\": '{| class=\"wikitable\"\\n|-\\n',\n \"tagClose\": \"\\n|}\",\n \"sampleText\": \"! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3\"}\n}", "title": "" }, { "docid": "2d79f20a4df3684e562d2cbf29752c1e", "score": "0.5026307", "text": "function customTableFromArray(tbl, map) {\r\n var rows = map.length;\r\n var rowCount = 0\r\n var columns = map[0].length;\r\n var cell;\r\n\r\n\r\n for(var r=rows - 1;r>=0;r--) { \r\n var x=document.getElementById(tbl).insertRow(rowCount);\r\n for(var c=0;c<parseInt(columns,10);c++) {\r\n cell = map[r][c];\r\n \r\n var y= x.insertCell(c); \r\n $(y).attr(\"data-row\", (rows - rowCount - 1));\r\n $(y).attr(\"data-col\", c);\r\n $(y).attr(\"data-djsteps\", cell.djSteps);\r\n //$(y).text(cell.djSteps);\r\n\r\n if(cell.onPath) {$(y).attr(\"class\", \"onpath\");}\r\n\r\n //\r\n if(cell.borderTop) {y.style.borderTop = \"1px solid black\";};\r\n if(cell.borderRight) {y.style.borderRight = \"1px solid black\";};\r\n if(cell.borderBottom) {y.style.borderBottom = \"1px solid black\";};\r\n if(cell.borderLeft) {y.style.borderLeft = \"1px solid black\";};\r\n\r\n if(cell.entrance) {\r\n $(y).attr(\"id\", \"entrance\");\r\n }else if(cell.exit) {\r\n $(y).attr(\"id\", \"exit\");\r\n };\r\n \r\n //debugger;\r\n };\r\n rowCount += 1;\r\n };\r\n}", "title": "" }, { "docid": "6fd1ba322927a4163cdaa116263426a5", "score": "0.50258917", "text": "function insertRow(data) {\n tbody.innerHTML = \"\";\n data.forEach(function (value) {\n var tr = document.createElement(\"tr\");\n tr.innerHTML = `\n <td>${value.employeeId}</td>\n <td>${value.firstName}</td>\n <td>${value.lastName}</td>\n <td>${value.address}</td>\n <td>${value.emailId}</td>\n <td><button type =\"button\" id=\"edit-btn\">Edit</button></td>\n <td><button type =\"button\" id=\"delete-btn\">Delete</button></td>\n `;\n tbody.appendChild(tr);\n });\n}", "title": "" }, { "docid": "79904756a4f45fba363ecf6ed51833cd", "score": "0.5025858", "text": "function popUpFormFieldPropertiesDialog(whichOne)\n{\n var commandFileName = \"ServerObject-\" + whichOne + \"Props.htm\";\n var rowObj = _ColumnNames.getRowValue();\n var fieldInfoObj = dwscripts.callCommand(commandFileName,rowObj.displayAs)\n\n // note: use the \"type\" property on the menuInfoObj to see which\n // type of object was returned\n \n if (fieldInfoObj)\n {\n rowObj.displayAs = fieldInfoObj;\n }\n}", "title": "" }, { "docid": "ac0df71719e4015ab2172565b1d81c31", "score": "0.5017341", "text": "function saveButton() { \n \n if ($(\"#selectWorksheet\").val() == null || $(\"#selectCampo1\").val() == null || $(\"#selectCampo2\").val() == null || $(\"#selectCampo3\").val() == null) {\n alert('Configuración inválida \\n\\Selecciona una hoja de trabajo y campos válidos.');\n return;\n }\n else {\n if ($(\"#selectCampo1\").val() == 'NA' && $(\"#selectCampo2\").val() == 'NA' && $(\"#selectCampo3\").val() == 'NA') {\n alert('Configuración inválida \\n\\nSelecciona al menos un campo.');\n return;\n }\n else {\n var l1 = $(\"#selectCampo1\").val();\n var l2 = $(\"#selectCampo2\").val();\n var l3 = $(\"#selectCampo3\").val();\n \n if ((l1 == 'NA' && (l2 != 'NA' || l3 != 'NA')) || (l2 == 'NA' && (l3 != 'NA') )) {\n alert('Configuración inválida \\n\\nCampos deben ser consecutivos.');\n return;\n }\n if (l1 == 'NA' || l2 == 'NA' || l3 == 'NA') {\n alert('Configuración inválida \\n\\nAl menos 3 campos obligatorios.');\n return;\n }\n if (l1 == l2 || l1 == l3 || l2 == l3) {\n alert('Configuración inválida \\n\\nNo se permiten campos duplicados.');\n return;\n }\n \n }\n } \n\n tableau.extensions.settings.set(\"selectWorksheet\", $(\"#selectWorksheet\").val()); \n tableau.extensions.settings.set(\"selectCampo1\", $(\"#selectCampo1\").val());\n tableau.extensions.settings.set(\"selectCampo2\", $(\"#selectCampo2\").val());\n tableau.extensions.settings.set(\"selectCampo3\", $(\"#selectCampo3\").val()); \n\n tableau.extensions.settings.saveAsync().then((currentSettings) => {\n tableau.extensions.ui.closeDialog(\"10\");\n });\n }", "title": "" }, { "docid": "15dacd5968472925169fecbc063d7b5b", "score": "0.50167686", "text": "function addAssetToTable(libAsset){\n\n // Create the row and data elements to add to the asset list table\n var newRow = document.createElement('tr');\n var editIcon = document.createElement('td');\n var assetId = document.createElement('td');\n var title = document.createElement('td');\n var author = document.createElement('td');\n var mediaType = document.createElement('td');\n var language = document.createElement('td');\n var collection = document.createElement('td');\n var location = document.createElement('td');\n var loanType = document.createElement('td');\n var interLibLoan = document.createElement('td');\n\n // This is the html for two clickable icons to put in the first column\n // Clicking the first (pencil) icon will bring up the manage-asset-modal in the 'update' state\n // Clicking the second (trash) icon will delete the row and its corresponding asset\n var pencilIcon = \n `<a href=\"#\" onclick=\"editIconClick(this)\" data-bs-toggle=\"modal\" data-bs-target=\"#manage-asset-modal\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-pencil-square\" viewBox=\"0 0 16 16\">\n <title>Edit Asset</title>\n <path d=\"M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z\"/>\n <path fill-rule=\"evenodd\" d=\"M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z\"/>\n </svg></a>\n <a href=\"#\" onclick=\"deleteIconClick(this)\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-trash\" viewBox=\"0 0 16 16\">\n <title>Delete Asset</title>\n <path d=\"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z\"/>\n <path fill-rule=\"evenodd\" d=\"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z\"/>\n </svg></a>\n `;\n\n // set the values for each data element\n editIcon.innerHTML = pencilIcon;\n assetId.innerText = libAsset.assetId;\n title.innerText = libAsset.title;\n author.innerText = libAsset.author;\n mediaType.innerText = libAsset.mediaType;\n language.innerText = libAsset.language;\n collection.innerText = libAsset.collection;\n location.innerText = libAsset.location;\n loanType.innerText = libAsset.loanType;\n if(libAsset.interLibLoan){\n interLibLoan.innerText = \"Yes\";\n }else{\n interLibLoan.innerText = \"No\";\n }\n\n // add the data elements to the row\n newRow.appendChild(editIcon);\n newRow.appendChild(assetId);\n newRow.appendChild(title);\n newRow.appendChild(author);\n newRow.appendChild(mediaType);\n newRow.appendChild(language);\n newRow.appendChild(collection);\n newRow.appendChild(location);\n newRow.appendChild(loanType);\n newRow.appendChild(interLibLoan);\n\n // add the row to the table body\n document.getElementById('asset-list-body').appendChild(newRow);\n}", "title": "" }, { "docid": "e3915c2dcdcdd8ea151c9c8e223c23dc", "score": "0.5005037", "text": "function populateTable(tableBody, data) {\n\n //Gathers info from Acesss key object\n if (!data) { return null; }\n let tableEntries = $(`#${tableBody}`);\n tableEntries.empty();\n\n //Fills table with new data \n Object.keys(data).forEach((key) => {\n let eventData = data[key];\n let row = document.createElement(\"table-entry\");\n\n let tempElement = document.createElement(\"td\");\n tempElement.innerHTML = eventData[\"name\"];\n row.append(tempElement);\n\n tempElement = document.createElement(\"td\");\n tempElement.innerHTML = eventData[\"region\"];\n row.append(tempElement);\n\n tempElement = document.createElement(\"td\");\n tempElement.innerHTML = new Date() - eventData[\"startDate\"] + \" seconds ago\";\n row.append(tempElement);\n\n tempElement = document.createElement(\"td\");\n let tempButton = document.createElement(\"button\");\n tempButton.innerHTML = \"Link here\";\n tempElement.append(tempButton);\n\n row.append(tempElement);\n tableEntries.append(row);\n })\n\n}", "title": "" }, { "docid": "c5187bc3e7a98ed2c6d17b59ae577ca9", "score": "0.50039876", "text": "function populatePassionTable(mappingListData, profileIdVal) {\r\n\tdocument.getElementById(\"existing_data_list\").innerHTML = \"Existing Passions\";\r\n\tvar attributeOrder = 0;\r\n\tvar tableDiv = document.getElementById(\"existingMappingListId\");\r\n\tif (null != mappingListData) {\r\n\t\tvar headingString = \"<table width='94%' id='mappingTablePASId' border=1 align='center' bordercolor='#78C0D3' class='tablesorter'><thead class='tab_header'><tr><th width='11%'><b>SL. No.</b></th><th width='15%'><b>Profile Name</b></th><th width='20%'><b>Attribute Name</b></th><th><b>Attribute Description</b></th><th width='12%'><b>Action</b></th></tr></thead><tbody>\";\r\n\t\tvar splitRec = mappingListData.split(\"$$$\");\r\n\t\tif(splitRec.length <= 2){\r\n\t\t\tdocument.getElementById(\"chgOrderBtnId\").disabled = true;\r\n\t\t}\r\n\t\tvar counter = 1;\r\n\t\tfor(var outerIndex = 0; outerIndex < splitRec.length-1; outerIndex++){\t\t\t\t\t\t\r\n\t\t\tvar objSplit = splitRec[outerIndex].split(\"~\");\r\n\t\t\tvar rowColor = \"\";\r\n\t\t\tif(objSplit[0] == 'PAS') {\t\r\n\t\t\t\tif(counter%2 == 0){\r\n\t\t\t\t\trowColor = \"#F1F1F1\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\trowColor = \"#D2EAF0\";\r\n\t\t\t\t}\r\n\t\t\t\theadingString = headingString + \"<tr align='center' bgcolor='\"+rowColor+\"' class='row_width'><td>&nbsp; \"+counter+\".</td>\";\r\n\t\t\t\theadingString = headingString + \"<td align='center'>\"+objSplit[4]+\"</td>\";\r\n\t\t\t\t//headingString = headingString + \"<td align='center'>\"+objSplit[6]+\"</td>\";\r\n\t\t\t\theadingString = headingString + \"<td align='center'>&nbsp;&nbsp; \"+objSplit[1]+\"</td>\";\r\n\t\t\t\theadingString = headingString + \"<td align='center'>&nbsp;&nbsp; \"+objSplit[5]+\"</td>\";\r\n\t\t\t\theadingString = headingString + \"<td class='table_col_txt_style' align='center'><a class='edit_style' href='#' onClick='editPassion(\\\"\"+objSplit[2]+\"\\\", \\\"\"+objSplit[1]+\"\\\", \\\"\"+objSplit[4]+\"\\\", \\\"\"+objSplit[5]+\"\\\", \\\"\"+objSplit[7]+\"\\\", \\\"\"+counter+\"\\\")'><img src = '../img/edit.png' /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class='delete_style' href='#' id='deleteVAL_\"+counter+\"' onClick='deletePassion(\\\"\"+objSplit[2]+\"\\\", \\\"\"+objSplit[1]+\"\\\", \\\"\"+objSplit[7]+\"\\\")'><img src = '../img/delete.png' /></a></td>\";\t\t\t\t\r\n\t\t\t\theadingString = headingString + \"</tr>\";\r\n\t\t\t\tcounter = counter + 1;\r\n\t\t\t}\r\n\t\t\tif(attributeOrder < objSplit[6]) {\r\n\t\t\t\tattributeOrder = objSplit[6];\r\n\t\t\t}\r\n\t\t}\r\n\t\t/*if(profileIdVal != 0){\r\n\t\t\tdocument.getElementById('attrOrderInptId').value = parseInt(attributeOrder)+1;\t\t\r\n\t\t}*/\r\n\t\theadingString = headingString + \"</tbody></table>\";\r\n\t\ttableDiv.innerHTML = headingString;\r\n\t\t//new SortableTable(document.getElementById('mappingTablePASId'), 1);\r\n\t\t$(\"table\").tablesorter(); \r\n\t} else {\r\n\t\t/*if(profileIdVal != 0){\r\n\t\t\tdocument.getElementById('attrOrderInptId').value = 1;\t\t\r\n\t\t}*/\r\n\t\tdocument.getElementById(\"chgOrderBtnId\").disabled = true;\r\n\t\ttableDiv.innerHTML = \"<div align='center'><img src='../img/no-record.png'><br />No Mapping Attribute To Display</div>\";\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "d79936903e6ced2328b29fe9c8af6033", "score": "0.4999443", "text": "function populateTable() {\n\n\n}", "title": "" }, { "docid": "8f9ed0ab6f6e53d5f7c9998cd8ef017f", "score": "0.49964342", "text": "function insert_Row() {\n const newRow = document.getElementById(\"sampleTable\").insertRow(0);\n const newCell = newRow.insertCell(0);\n const newCell2 = newRow.insertCell(1);\n newCell.innerHTML = \"New Cell1\";\n newCell2.innerHTML = \"New Cell2\";\n}", "title": "" }, { "docid": "ff80252ce3646e5d75aa7d9dab7d9357", "score": "0.49771935", "text": "function addProperty(propnumber) {\n let newProperty = document.querySelector(`.add-property-${propnumber}`);\n newBreak = document.createElement(\"br\");\n\n buttonRemoveProperty = document.createElement(\"button\");\n buttonRemoveProperty.classList.add(`add-small-property-${propCounter}`);\n buttonRemoveProperty.setAttribute(\"type\", \"button\");\n buttonRemoveProperty.innerHTML = \"Remove Property -\";\n\n smallProperty = document.createElement(\"div\");\n smallProperty.classList.add(`add-small-property-${propCounter}`);\n\n labelPropertyName = document.createElement(\"label\");\n labelPropertyName.setAttribute(\"for\", \"property-name\");\n labelPropertyName.classList.add(\"label-propname\");\n labelPropertyName.innerHTML = \"<br> Property name: <br>\";\n \n inputPropertyName = document.createElement(\"input\");\n inputPropertyName.setAttribute(\"type\", \"text\");\n inputPropertyName.setAttribute(\"id\", \"property-name\");\n inputPropertyName.setAttribute(\"name\", `property-name-${propCounter}`);\n inputPropertyName.classList.add(\"property-input\");\n\n labelPublicProp = document.createElement(\"label\");\n labelPublicProp.setAttribute(\"for\", \"public-prop\");\n labelPublicProp.innerHTML = \"Pub\"\n publicPropRadio = document.createElement(\"input\");\n publicPropRadio.setAttribute(\"type\", \"radio\");\n publicPropRadio.setAttribute(\"id\", \"public-prop\");\n publicPropRadio.setAttribute(\"name\", `property-name-${propCounter}`);\n publicPropRadio.setAttribute(\"value\", \"public-property\");\n publicPropRadio.setAttribute(\"checked\", \"true\");\n publicPropRadio.classList.add(\"create-checkbox\");\n \n labelPrivateProp = document.createElement(\"label\");\n labelPrivateProp.setAttribute(\"for\", \"private-prop\");\n labelPrivateProp.innerHTML = \"Priv\"\n privatePropRadio = document.createElement(\"input\");\n privatePropRadio.setAttribute(\"type\", \"radio\");\n privatePropRadio.setAttribute(\"id\", \"private-prop\");\n privatePropRadio.setAttribute(\"name\", `property-name-${propCounter}`);\n privatePropRadio.setAttribute(\"value\", \"private-property\");\n privatePropRadio.classList.add(\"create-checkbox\");\n\n labelProtProp = document.createElement(\"label\");\n labelProtProp.setAttribute(\"for\", \"prot-prop\");\n labelProtProp.innerHTML = \"Prot\"\n protPropRadio = document.createElement(\"input\");\n protPropRadio.setAttribute(\"type\", \"radio\");\n protPropRadio.setAttribute(\"id\", \"prot-prop\");\n protPropRadio.setAttribute(\"name\", `property-name-${propCounter}`);\n protPropRadio.setAttribute(\"value\", \"protected-property\");\n protPropRadio.classList.add(\"create-checkbox\");\n\n smallProperty.append(labelPropertyName);\n smallProperty.append(inputPropertyName);\n smallProperty.append(publicPropRadio);\n smallProperty.append(labelPublicProp);\n smallProperty.append(privatePropRadio);\n smallProperty.append(labelPrivateProp);\n smallProperty.append(protPropRadio);\n smallProperty.append(labelProtProp);\n smallProperty.append(buttonRemoveProperty);\n smallProperty.append(newBreak);\n newProperty.append(smallProperty);\n\n //propCounter = propCounter + 1;\n}", "title": "" }, { "docid": "67b00425413a5b146246b6e4416b062f", "score": "0.49763265", "text": "function addContectDetail(sender, eventArgs) {\n\n currentRowIndex = eventArgs.get_itemIndexHierarchical();\n\n\n var ary = [];\n\n ary[0] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"COUNTRY_NAME\").value;\n ary[1] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"ADDRESS_LINE1\").value;\n ary[2] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"ADDRESS_LINE2\").value;\n ary[3] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"STATE_NAME\").value;\n ary[4] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"CITY_NAME\").value;\n ary[5] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"ADDRESS_TYPE_NAME\").value;\n ary[6] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"PINCODE\").value;\n ary[7] = contectTableView.get_dataItems()[currentRowIndex].findElement(\"PHONE\").value;\n ary[8] = EMP_ID;\n ary[9] = eventArgs._tableView._element.parentNode.children[0].control._dataItems[currentRowIndex]._dataItem.EMP_CONTACT_SRNO;\n if (ary[9] == \"\" || ary[9] == 'null') ary[9] = 0;\n try {\n \n CRM.WebApp.webservice.EmployeeWebService.InsertUpdateEmployeeContectDetails(ary);\n CRM.WebApp.webservice.EmployeeWebService.GetDetailsByEMP_ID(EMP_ID, updateContectGrid);\n alert('Record Save Successfully');\n }\n catch (e) {\n masterTable.rebind();\n alert(\"Wrong Data Inserted\");\n\n }\n\n}", "title": "" } ]
8b8c39ae8b6626c64d7012adf0702565
function ///// / getClassNum
[ { "docid": "2f91af2359c060bf19ab1b9ca4da2224", "score": "0.79900885", "text": "function getClassNum ( aObj ) {\r\n\t\t\treturn parseInt ( aObj.attr( 'class' ).replace ( s.regExpFilterNum, '$1' ) );\r\n\t\t}", "title": "" } ]
[ { "docid": "b9e086d9e10014c60d8a0c86a09e54ed", "score": "0.65554196", "text": "function getClassFromIndex(index){\n\treturn \"m-\" + index;\n}", "title": "" }, { "docid": "9fba1a640554759e3bf61a9ab6c7d126", "score": "0.6354087", "text": "getClassname () {\n return (this.className);\n\t}", "title": "" }, { "docid": "f8dfb83cf4c673da9a71c929e2393245", "score": "0.63435745", "text": "function indexInClass(node) {\n var collection = document.getElementsByClassName(node.className);\n for (var i = 0; i < collection.length; i++) {\n if (collection[i] === node)\n return i;\n }\n return -1;\n}", "title": "" }, { "docid": "e723588a6e8c392caeb6dfba12c02e78", "score": "0.6335229", "text": "function getClass() { return selectedClass; }", "title": "" }, { "docid": "87b02feeda9d7727dfb835d725f794af", "score": "0.6177499", "text": "function getClassById(id){\n if(id == 1)\n return \"green-1\";\n else if(id == 2)\n return \"green-2\";\n else if(id == 3)\n return \"green-3\";\n else if(id == 4)\n return \"green-4\";\n else if(id == \"5\")\n return \"orange-1\";\n else if(id == \"6\")\n return \"orange-2\";\n else if(id == \"7\")\n return \"orange-3\";\n else if(id == \"8\")\n return \"orange-4\";\n else if(id == \"9\")\n return \"orange-5\";\n else if(id == \"10\")\n return \"blue-1\";\n else if(id == \"11\")\n return \"blue-2\";\n else if(id == \"12\")\n return \"blue-3\";\n else if(id == \"13\")\n return \"blue-4\";\n else if(id == \"14\")\n return \"blue-5\";\n else if(id == \"15\")\n return \"blue-6\";\n else if(id == \"16\")\n return \"red-1\";\n else if(id == \"17\")\n return \"red-2\";\n else if(id == \"18\")\n return \"red-3\";\n else if(id == \"19\")\n return \"pink-1\";\n else if(id == \"20\")\n return \"pink-2\";\n else if(id == \"21\")\n return \"pink-3\";\n else\n return \"red-4\";\n}", "title": "" }, { "docid": "6a803863a1a4c69382eada8fa6fe5a19", "score": "0.60693216", "text": "function getClassName(id) {\n return data[id.slice(0,9)].name;\n}", "title": "" }, { "docid": "4d0c734fccc5bcdf1e0efde12f4f6f02", "score": "0.606551", "text": "function getClassName() {\n className = $getClass.split(/\\s+/);\n\n if ($body.hasClass('archive')) {\n className = className[3].split('-');\n } else {\n className = className[2].split('-');\n }\n\n return className;\n }", "title": "" }, { "docid": "698ff911f3dcd4ede6e7c83a3f2d1ff1", "score": "0.60435736", "text": "function getClass(obj) {\n return {}.toString.call(obj).slice(8, -1);\n}", "title": "" }, { "docid": "41e8c499f51b233dcad4cb06467b14a7", "score": "0.6017195", "text": "function _class_labeler(ce){\n\tvar ret = ce.class_label();\n\t// Optional ID.\n\tvar cid = ce.class_id();\n\tif( cid && cid !== ret ){\n\t ret = '[' + cid + '] ' + ret;\n\t}\n\treturn ret;\n }", "title": "" }, { "docid": "02c71d7075fa4a1bb738f122e7dfa759", "score": "0.5990161", "text": "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "title": "" }, { "docid": "02c71d7075fa4a1bb738f122e7dfa759", "score": "0.5990161", "text": "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "title": "" }, { "docid": "43f8743709242aadc646d39f56627e4b", "score": "0.598472", "text": "function getCardClass(cardNumber) {\r\n var rand4 = Math.floor((Math.random() * 4) + 1); //for picking a random suite\r\n var className=\"\";\r\n switch(cardNumber){\r\n case 1:\r\n className = \"ace\"; \r\n break;\r\n case 2:\r\n className = \"two\";\r\n break;\r\n case 3:\r\n className = \"three\";\r\n break;\r\n case 4:\r\n className = \"four\";\r\n break;\r\n case 5:\r\n className = \"five\";\r\n break;\r\n case 6:\r\n className = \"six\";\r\n break;\r\n case 7:\r\n className = \"seven\";\r\n break;\r\n case 8:\r\n className = \"eight\";\r\n break;\r\n case 9:\r\n className = \"nine\";\r\n break;\r\n case 10:\r\n className = \"ten\";\r\n break;\r\n case 11:\r\n className = \"jack\";\r\n break;\r\n case 12:\r\n className = \"queen\";\r\n break;\r\n case 13:\r\n className = \"king\";\r\n break; \r\n }\r\n className += rand4.toString();\r\n return className; //return the class name\r\n}", "title": "" }, { "docid": "4fac218b9a86b7ba8ef35ec780f201b2", "score": "0.5923706", "text": "function getClassName(location) {\r\n var cellClass = 'cell-' + location.i + '-' + location.j;\r\n return cellClass;\r\n}", "title": "" }, { "docid": "169f7400610ac73ae6bf0924c2a26657", "score": "0.59101254", "text": "function getClassifier() {\n return d3.select(\"#classSelect\").property(\"value\");\n}", "title": "" }, { "docid": "4a0a4d2e15b97e1015b821193ff2bb53", "score": "0.5907692", "text": "function getClassName(location) {\r\n var cellClass = 'cell-' + location.i + '-' + location.j;\r\n return cellClass;\r\n}", "title": "" }, { "docid": "bb6e17546c16c3398e530e7d08ec836b", "score": "0.58543587", "text": "function generateClassCode() {\n var length = 8;\n var code = Math.random().toString(16).substr(2, length);\n return code;\n}", "title": "" }, { "docid": "4a19df9f11d1890d1a6f5b05089be48d", "score": "0.58330226", "text": "function getClassName(location) {\n var cellClass = \"cell-\" + location.i + \"-\" + location.j;\n return cellClass;\n}", "title": "" }, { "docid": "ae05727e491d8b71f4871d21ad9467b0", "score": "0.5828594", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n }", "title": "" }, { "docid": "3fa56bf7c64019c544475275e44e1edb", "score": "0.58091444", "text": "function getClass(classType){\n if (classType == 1) {\n return Mammal;\n } else {\n return Marsupial;\n }\n}", "title": "" }, { "docid": "3e087d6ff14d9550d7be32719e715772", "score": "0.5805678", "text": "getIndex(cls) {\n var ind = false;\n var self = this;\n var classNames = (typeof cls === 'string') ? [cls] : cls;\n if (!Array.isArray(classNames)) return ind;\n classNames.filter(function(i) {\n if (self.cssClasses.indexOf(i) >= 0) return ind = true;\n });\n return ind;\n }", "title": "" }, { "docid": "acaf902188684fea55aff1d661c1b885", "score": "0.5795509", "text": "getClassWeight(e) {\n var weight = 0;\n\n /* Look for a special classname */\n if (e.className != \"\") {\n if (e.className.search(this.regexps.negativeRe) !== -1)\n weight -= 25;\n\n if (e.className.search(this.regexps.positiveRe) !== -1)\n weight += 25;\n }\n\n /* Look for a special ID */\n if (typeof (e.id) == 'string' && e.id != \"\") {\n if (e.id.search(this.regexps.negativeRe) !== -1)\n weight -= 25;\n\n if (e.id.search(this.regexps.positiveRe) !== -1)\n weight += 25;\n }\n\n return weight;\n }", "title": "" }, { "docid": "ddcb6ebe0dc364adeaec813009c7e773", "score": "0.57710975", "text": "function getclass($myvar, i){\r\n theclass = $myvar.attr(\"class\");\r\n theclassarray = theclass.split(\" \");\r\n myclass = theclassarray[i];\r\n return myclass;\r\n }", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.577066", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.577066", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.577066", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "2e5d00b0e65a487a5ac658d0ed9f1cb3", "score": "0.577066", "text": "function codeClass(status) {\n return Number(String(status).charAt(0) + '00');\n}", "title": "" }, { "docid": "a10b399c926a023e24e2db9c88346caf", "score": "0.57704276", "text": "function getColorName(obj) {\n var classes = obj.attr(\"class\");\n if(classes){\n var start_index = classes.indexOf(\"color\")+5;\n var color_code = classes.substring(start_index, start_index+2);\n return color_code;\n }\n return null;\n}", "title": "" }, { "docid": "0fbbe998ab03a933db494ae401a3d86d", "score": "0.5747765", "text": "function getClass(idname){ \n return document.querySelector(\".box\" + idname ).id// returnong id name\n}", "title": "" }, { "docid": "63b4d6e12803bd096f8dcc1a97540936", "score": "0.5736115", "text": "function assignClassByNumber(elem, num, classRangeArray) {\n\n // start by removing any classes previously assigned by this function\n for (var c = 0; c < classRangeArray.length; c++) {\n elem.removeClass(classRangeArray[c][0]);\n }\n\n // check each key\n for (var i = 0; i < classRangeArray.length; i++) {\n\n // check number is in range for this key\n if ((num >= classRangeArray[i][1]) && (num <= classRangeArray[i][2])) {\n\n // assign the given value as a CSS class and quit\n elem.addClass(classRangeArray[i][0]);\n break;\n\n }\n }\n }", "title": "" }, { "docid": "e484fd9646e3357fedaf0ef2e8cd6be3", "score": "0.57277644", "text": "function getHeroId(classname){\n switch(classname){\n case \"DRUID\": \n return 274;\n case \"HUNTER\": \n return 31;\n case \"MAGE\": \n return 637;\n case \"PALADIN\": \n return 671;\n case \"PRIEST\": \n return 813;\n case \"ROGUE\": \n return 930;\n case \"SHAMAN\": \n return 1066;\n case \"WARLOCK\": \n return 893;\n case \"WARRIOR\": \n return 7;\n default:\n // For now we'll just assume hunter\n // Should build some sort of safety net here in the future\n return 31;\n }\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "6560c6626fe02af6f7b4800549829777", "score": "0.57062376", "text": "function codeClass (status) {\n return Number(String(status).charAt(0) + '00')\n}", "title": "" }, { "docid": "684684f63822fc1062d2e85133e4d4ba", "score": "0.56775725", "text": "getClassName(className, i){\n let liClassName = className + \"-\" + this.state.navState.styles[i];\n\n // if step ui based navigation is disabled, then dont highlight step\n if (!this.props.stepsNavigation)\n liClassName += \" no-hl\";\n\n return liClassName;\n }", "title": "" }, { "docid": "06e5d0c200123b0289b373dd7e6a0b08", "score": "0.5669687", "text": "get tileClass() {\n if (this.selectedBoatId == this.boat.Id) {\n return TILE_WRAPPER_SELECTED_CLASS;\n }\n return TILE_WRAPPER_UNSELECTED_CLASS;\n }", "title": "" }, { "docid": "395bc297efdd201a0a5b1a35108c54da", "score": "0.56613326", "text": "function _getDigits() {\n\t\t\n\t\t\treturn obj.children('.' + _getOption('digitClass'));\n\t\t\t\n\t\t}", "title": "" }, { "docid": "af42d06d5d3fd1ef386db72a5893c947", "score": "0.56521004", "text": "function manageinstanceSubclassNumber(thisobj)\n{\n if ($(thisobj).closest('ol.ins-subcls').siblings('ol.ins-subcls').length == 0)\n {\n bootbox.alert(\"You can't delete this instance.\");\n event.stopPropagation();\n\n } else {\n var counter = 1;\n $(thisobj).closest('ol.ins-subcls').siblings().each(function () {\n\n if ($(this).find('a.count-class').length > 1)\n {\n $(this).children('li.sub-class-list').each(function () {\n\n if ($.trim($(this).find('a.count-class').text()) != '')\n {\n $(this).find('a.count-class').text(counter++);\n }\n });\n\n } else {\n var clone_class = $.trim($(this).find('span.number_print1.clone').attr('class'));\n if (typeof clone_class != undefined && clone_class != '')\n {\n var new_clone_class = clone_class.slice(0, -1);\n $(this).find('span.number_print1.clone').removeClass(clone_class).addClass(new_clone_class + counter);\n\n\n $(this).find('span.number_print1.prop').each(function () {\n var prop_class = $.trim($(this).attr('class'));\n var prop_clone_class = prop_class.slice(0, -1);\n $(this).removeClass(prop_class).addClass(prop_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.input').each(function () {\n var input_class = $.trim($(this).attr('class'));\n var input_clone_class = input_class.slice(0, -1);\n $(this).removeClass(input_class).addClass(input_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.radio').each(function () {\n var radio_class = $.trim($(this).attr('class'));\n var radio_clone_class = radio_class.slice(0, -1);\n $(this).removeClass(radio_class).addClass(radio_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.checkbox').each(function () {\n var checkbox_class = $.trim($(this).attr('class'));\n var checkbox_clone_class = checkbox_class.slice(0, -1);\n $(this).removeClass(checkbox_class).addClass(checkbox_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.dropdown').each(function () {\n var dropdown_class = $.trim($(this).attr('class'));\n var dropdown_clone_class = dropdown_class.slice(0, -1);\n $(this).removeClass(dropdown_class).addClass(dropdown_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.file').each(function () {\n var file_class = $.trim($(this).attr('class'));\n var file_clone_class = file_class.slice(0, -1);\n $(this).removeClass(file_class).addClass(file_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.textarea').each(function () {\n var textarea_class = $.trim($(this).attr('class'));\n var textarea_clone_class = textarea_class.slice(0, -1);\n $(this).removeClass(textarea_class).addClass(textarea_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.calendar').each(function () {\n var calendar_class = $.trim($(this).attr('class'));\n var calendar_clone_class = calendar_class.slice(0, -1);\n $(this).removeClass(calendar_class).addClass(calendar_clone_class + counter);\n });\n\n\n $(this).find('span.number_print1.else').each(function () {\n var else_class = $.trim($(this).attr('class'));\n var else_clone_class = else_class.slice(0, -1);\n $(this).removeClass(else_class).addClass(else_clone_class + counter);\n });\n }\n\n if ($.trim($(this).find('a.count-class').text()) != '')\n {\n $(this).find('a.count-class').text(counter++);\n }\n }\n });\n\n /*var deleted_number = $(thisobj).closest('ol.ins-subcls').find('span.number_print1').length;*/\n var currentNum = $(thisobj).closest('ol').find('div.node-content:first').find('span.number_print1').text();\n\n var nextNum = $(thisobj).closest('ol').nextAll(\"ol.ins-subcls:first\").find('div.node-content:first').find('span.number_print1').text();\n if ($.trim(nextNum) == '')\n {\n var prevNum = $(thisobj).closest('ol').prevAll(\"ol.ins-subcls:first\").find('div.node-content:first').find('span.number_print1').text();\n var deleted_number = parseInt(currentNum) - parseInt(prevNum);\n } else {\n var deleted_number = parseInt(nextNum) - parseInt(currentNum);\n }\n\n\n if ($.trim($(thisobj).closest('ol.ins-subcls').siblings('div.node-content').find('span.action-plus').attr('onclick')) != \"\") {\n var param = $(thisobj).closest('ol.ins-subcls').siblings('div.node-content').find('span.action-plus').attr('onclick').split(\",\");\n var param_length = param.length;\n var tempParam = [];\n var tempcount = parseInt(param[parseInt(param_length) - 1]) - parseInt(deleted_number);\n\n for (i = 0; i < parseInt(param_length) - 1; i++)\n {\n tempParam[i] = param[parseInt(i)];\n }\n tempParam[parseInt(param_length) - 1] = tempcount + ')';\n $(thisobj).closest('ol.ins-subcls').siblings('div.node-content').find('span.action-plus').attr('onclick', tempParam);\n }\n\n\n /*change number value after the selected node*/\n $('.action-plus').each(function () {\n var currentActionInd = $('.act-mov-sub').index($(thisobj).siblings('.act-mov-sub')); /*$('.act-mov-sub').index($('.node-selected .act-mov-sub'));*/\n var lengthAction = $('.act-mov-sub').length;\n\n for (i = currentActionInd; i < lengthAction; i++) {\n //console.log('index',i);\n\n if ($('.act-mov-sub').parent().eq(i).find('.action-plus').attr(\"onclick\"))\n {\n //$('.act-mov-sub').parent().eq(i).find('.action-plus').css({'background': 'orange'});\n\n var paramB = $('.act-mov-sub').parent().eq(i).find('.action-plus').attr(\"onclick\").split(\",\");\n var param_lengthB = paramB.length;\n var tempParamB = [];\n var newdiff = parseInt(paramB[parseInt(param_lengthB) - 1]) - parseInt(deleted_number);\n for (iB = 0; iB < parseInt(param_lengthB) - 1; iB++) {\n tempParamB[iB] = paramB[parseInt(iB)];\n }\n tempParamB[parseInt(param_lengthB) - 1] = newdiff + ')';\n $('.act-mov-sub').parent().eq(i).find('.action-plus').attr(\"onclick\", tempParamB);\n }\n }\n });\n /*End Here*/\n\n $(thisobj).closest('ol.ins-subcls').nextAll('ol.ins-subcls').each(function () {\n $(this).find('span.number_print1').each(function () {\n $(this).html(parseInt($(this).text()) - deleted_number);\n });\n });\n\n /*Sub Class Structure not for clone part*/\n $('div.node-content').each(function () {\n var currentActionInd = $('.act-mov-sub').index($('.node-selected .act-mov-sub'));\n var lengthAction = $('.act-mov-sub').length;\n\n for (i = currentActionInd; i < lengthAction; i++) {\n\n if ($('.act-mov-sub').parent().parent('div.node-content').eq(i).hasClass('showhide') || $(this).eq(i).hasClass('hideshow'))\n {\n\n } else\n {\n if ($(this).eq(i).attr(\"onclick\"))\n {\n //$('.act-mov-sub').parent().parent('div.node-content').eq(i).css({'background': 'green'});\n\n var paramB = $('.act-mov-sub').parent().parent('div.node-content').eq(i).attr(\"onclick\").split(\",\");\n var param_lengthB = paramB.length;\n var tempParamB = [];\n var newdiff = parseInt(paramB[parseInt(param_lengthB) - 1]) - parseInt(deleted_number);\n for (iB = 0; iB < parseInt(param_lengthB) - 1; iB++) {\n tempParamB[iB] = paramB[parseInt(iB)];\n }\n tempParamB[parseInt(param_lengthB) - 1] = newdiff + ')';\n $('.act-mov-sub').parent().parent('div.node-content').eq(i).attr(\"onclick\", tempParamB);\n\n $('.act-mov-sub').parent().parent('div.node-content').not(\":hidden\").find('span.number_print1').each(function () {\n $(this).html(parseInt($(this).text()) - deleted_number);\n });\n }\n }\n }\n });\n /*End Here*/\n\n /*$(thisobj).closest('ol.ins-subcls').parent('li').nextAll('li').each(function(){\n\n $(this).not(\":hidden\").find('span.number_print1').each(function(){\n $(this).html(parseInt($(this).text()) - deleted_number);\n if($(this).find('div.node-content:first').hasClass('showhide') || $(this).find('div.node-content:first').hasClass('hideshow'))\n {\n }\n else\n {\n if($(this).closest('div.node-content:first').attr('onclick')){\n var tempcount \t\t= $(this).text();\n var param \t\t\t= $(this).closest('div.node-content:first').attr('onclick').split(\",\");\n var param_length \t= param.length;\n var tempParam \t\t= [];\n\n for(i=0; i<parseInt(param_length)-1; i++){\n tempParam[i] \t= param[parseInt(i)];\n }\n tempParam[parseInt(param_length)-1] = tempcount+')';\n $(this).closest('div.node-content:first').attr(\"onclick\",tempParam);\n }\n }\n });\n });*/\n\n var parent_li = $(thisobj).closest('.parent-sub-class-list');\n $(thisobj).closest('ol.ins-subcls').remove();\n\n /*if(!parent_li.find('ol.ins-subcls').length){\n parent_li.find('.fa-angle-down:first').removeClass('fa-angle-down').addClass('fa-angle-up')\n }*/\n }\n}", "title": "" }, { "docid": "2be4486945e6b0f57073acad76be1a21", "score": "0.5624084", "text": "function instance$getClass() {\n return _;\n }", "title": "" }, { "docid": "089dca4b88f123a31d95ac3a1220b067", "score": "0.5622222", "text": "callDetermineClass(unit) {\n return this.refs.hashfunctions.determineClass(unit);\n }", "title": "" }, { "docid": "dbbbb23c39b0e89f89c1f8bb644e5fae", "score": "0.5621232", "text": "function getNumbersByClass(target, num) {\n let arr = [];\n for (let i = 0; i < num; i++) {\n arr.push(parseInt(document.getElementsByClassName(target)[i].value));\n }\n return arr;\n}", "title": "" }, { "docid": "3409d4e4ec70387f8d592260193de476", "score": "0.5618439", "text": "function countByNbClass() {\n\t\t\tvar data = new Array(0,0,0,0,0,0);\n\t\t\t$(\"*[id^=resultC]\").each(function(){\n\t\t\t\tvar n = 0;\n\t\t\t\tfor (var i=6; i<$(this).attr(\"id\").length; i++) {\n\t\t\t\t\tn += $(this).attr(\"id\").substring(i+1,i+2) == \"1\";\n\t\t\t\t}\n\t\t\t\tvar val = $(this).text();\n\t\t\t\tif(val == '?') {\n\t\t\t\t\tval = $(this).children(\"span\").attr('title');\n\t\t\t\t}\n\t\t\t\tdata[n-1] += parseInt(val);\n\t\t\t});\n\t\t\treturn data;\n\t\t}", "title": "" }, { "docid": "3409d4e4ec70387f8d592260193de476", "score": "0.5618439", "text": "function countByNbClass() {\n\t\t\tvar data = new Array(0,0,0,0,0,0);\n\t\t\t$(\"*[id^=resultC]\").each(function(){\n\t\t\t\tvar n = 0;\n\t\t\t\tfor (var i=6; i<$(this).attr(\"id\").length; i++) {\n\t\t\t\t\tn += $(this).attr(\"id\").substring(i+1,i+2) == \"1\";\n\t\t\t\t}\n\t\t\t\tvar val = $(this).text();\n\t\t\t\tif(val == '?') {\n\t\t\t\t\tval = $(this).children(\"span\").attr('title');\n\t\t\t\t}\n\t\t\t\tdata[n-1] += parseInt(val);\n\t\t\t});\n\t\t\treturn data;\n\t\t}", "title": "" }, { "docid": "d2848f848ee1ad0c7838ce9cd2784496", "score": "0.5614996", "text": "function classToggleLayerCounting(tagContainer,strClassName,strTAGName)\n{\n\tvar arrTAG = tagContainer.getElementsByTagName(strTAGName);//holds all strTAGName in tagContainer\n\tvar intTag = 0;//holds the number of tags that is using the same class name in the tagContainer\n\t\n\t//goes around the for each tag that getElementsByTagName found in tagContainter\n\tfor(var intIndex = arrTAG.length - 1; intIndex > -1; intIndex--) \n\t{\n\t\t//checks if the class name is the same as strClassName and if so then count it to the number of tags with the same class name\n\t\tif(arrTAG[intIndex].className === strClassName)\n\t\t\tintTag++;\n\t}//end of for loop\n\t\n\treturn intTag;\n}//end of classToggleLayerCounting()", "title": "" }, { "docid": "24702e367b7bbf4ae95b67489c9e28a7", "score": "0.5610443", "text": "function unit_class(d){\n var n = 0\n var str = unit_id(d)\n for(var i=0; i < str.length; i++){\n n += str.charCodeAt(i)\n }\n return \" b\" + (n % 5)\n}", "title": "" }, { "docid": "d2c34a0506055c7cf82d0a81553a5f97", "score": "0.5604451", "text": "function classNameToLocationIndex(classNameString)\n{\n var arrayOfWords = classNameString.split(\" \");\n var locationIndex = arrayOfWords[1];\n return Number(locationIndex);\n}", "title": "" }, { "docid": "6dba84f3251b9cb64bdb4f6ef7ebc8d5", "score": "0.55847263", "text": "function getClassName(){\n \n var stack = new Error(\"Dummy\").stack;\n if (stack != undefined){\n var functionName = stack.split(\"\\n\")[3];\n functionName = functionName.split(\"/\")[functionName.split(\"/\").length-1];\n functionName = functionName.split(\":\")[0];\n functionName = functionName.split(\".\")[0];\n return functionName;\n }\n return \"IE. No ClasName\";\n \n }", "title": "" }, { "docid": "067674d8b382cb92723aa6aff9f9f66d", "score": "0.55805093", "text": "function rollClass() {\n\t\tvar numClasses = baseClasses.length;\n\t\tvar randClass = baseClasses[Math.floor(Math.random() * numClasses)];\n\t\treturn randClass;\n\t}", "title": "" }, { "docid": "4c060563856d433e10acf1d85f827c5e", "score": "0.5562764", "text": "function getUI_ID() {\n let ID = document.getElementById(\"AKNOWTATE-POPUP-REFERENCE\").classList[1];\n console.log(ID);\n\n /** Removes any other classes after the ID (which should be 14 characters long... for a very long time. There might be the \"show\" class after the ID */\n ID = ID.substring(0, 13);\n console.log(ID);\n return parseInt(ID);\n}", "title": "" }, { "docid": "0c42c6e5fcfba3c4b715a3914c79db3d", "score": "0.55596495", "text": "determineClassName(){\n\t\treturn `square ${this.props.model.getState()}`;\n\t}", "title": "" }, { "docid": "c68a58f79dcca053561691f82f99abdc", "score": "0.5552983", "text": "function getType(x,y){\n return get(x,y).getAttribute(\"class\");\n}", "title": "" }, { "docid": "491c916c5044df1acc66dbde5808d81b", "score": "0.55487394", "text": "getClass() {\n const { isViewerApplyClass, isViewerClosed, isViewerApplyMaxClass, isViewerMaxed } = this.props;\n let cls = 'viewer';\n if ( isViewerApplyClass ) cls += ' scale0';\n if ( isViewerApplyMaxClass ) cls += ' maxClass';\n if ( isViewerClosed ) cls += ' closed';\n if ( isViewerMaxed ) cls += ' maxed';\n\n return cls;\n }", "title": "" }, { "docid": "f33211d0e245a161cfac41a3f0dfd1b1", "score": "0.5541179", "text": "classNameToColor(name, classes) {\n var index = -1;\n for (var i = 0; i < classes.length; i++) {\n if (classes[i] == name || (typeof(classes[i])!=\"String\" && classes[i].title == name)) {\n index = i;\n break;\n }\n }\n return index == -1 ? \"#777777\" : service.classIndexToColor(index);\n }", "title": "" }, { "docid": "1a02498db3a6daf785e43bb2d92faadf", "score": "0.5533708", "text": "getNextTetriminoClass() {\n const classes = ['next-tetrimino'];\n\n // We use this extra class to position tetriminos differently from CSS\n // based on their type\n if (this.props.nextTetrimino) {\n classes.push(`next-tetrimino-${this.props.nextTetrimino}`);\n }\n\n return classes.join(' ');\n }", "title": "" }, { "docid": "74a23d5c8fd84a787913c0513ad2efff", "score": "0.55328786", "text": "_computeClasses() {\n let result = [this.color];\n if (this.active) {\n result.push(\"active\");\n }\n if (this.highlighted) {\n result.push(\"highlighted\");\n }\n result.push(this.type);\n result.push(super._computeClasses());\n return result.join(\" \");\n }", "title": "" }, { "docid": "03e9080ab819e925f2c84ea34ad99b8a", "score": "0.5506758", "text": "get class () {\n\t\treturn this._class;\n\t}", "title": "" }, { "docid": "9f2024a47572780437df77cf1b3c5113", "score": "0.5501703", "text": "function getCellClass(i, j) {\n return `.cell-${i}-${j}`;\n}", "title": "" }, { "docid": "ded61fc658320e509edeff2365b031c2", "score": "0.5498455", "text": "function manageNumbers(){\n if(num1 == null){\n num1 = Number(number);\n number = '';\n }\n\n operator = this.classList[1];\n}", "title": "" }, { "docid": "ba0b9f1699f04dbb31eb27bc6461e120", "score": "0.5480244", "text": "function calculateTagClass(count, params){\n const normalizedCount = count - params.min;\n const normalizedMax = params.max - params.min;\n const percentage = normalizedCount / normalizedMax;\n const classNumber = Math.floor( percentage * (opt.cloudClassCount - 1) + 1 );\n return classNumber;\n }", "title": "" }, { "docid": "74987b7095b341221512ce5fdecc75f3", "score": "0.5475808", "text": "getClassName() {\n switch (this.titleStyle) {\n case 'dxp-title-xl': {\n return 'dxp-title-1';\n }\n case 'dxp-title-lg': {\n return 'dxp-title-2';\n }\n case 'dxp-title-md': {\n return 'dxp-title-3';\n }\n case 'dxp-title-sm': {\n return 'dxp-title-4';\n }\n default: {\n return 'dxp-title-1';\n }\n }\n }", "title": "" }, { "docid": "5210825b265157d7fc98cf2f7da44dfc", "score": "0.54718494", "text": "function addClass(_class, classNumOnPage) {\n\n\tlet classAbbr = _class.children[0].innerHTML;\n\tclassAbbr = classAbbr.replace(/:/g, \"\");\n\tlet classDesc = _class.children[1].innerHTML;\n\tlet specificClass = document.getElementById(\"cartDiv\").getElementsByClassName(\"classTable\")[\n\t\tclassNumOnPage];\n\tlet sectionsList = specificClass.getElementsByClassName(\"classSection\");\n\tlet profsList = specificClass.getElementsByClassName(\"classInstructor\");\n\tlet typeList = specificClass.getElementsByClassName(\"classType\");\n\tlet hoursList = specificClass.getElementsByClassName(\"classHours\");\n\tlet daysList = specificClass.getElementsByClassName(\"classMeetingDays\");\n\tlet timesList = specificClass.getElementsByClassName(\"classMeetingTimes\");\n\tlet classBuildingList = specificClass.getElementsByClassName(\"classBuilding\");\n\tlet sections = [];\n\tlet profs = [];\n\tlet types = [];\n\tlet hours = [];\n\tlet days = [];\n\tlet times = [];\n\tlet location = [];\n\n\t// Refines content\n\tfor (let num = 0; num < sectionsList.length; ++num) {\n\t\tsections[num] = sectionsList[num].innerText.trim();\n\t\tprofs[num] = profsList[num].innerText.trim();\n\t\ttypes[num] = typeList[num].innerText.trim();\n\t\thours[num] = hoursList[num].innerText.replace(/\\s+/g, \"\");\n\t\tdays[num] = daysList[num].innerText.trim();\n\t\ttimes[num] = timesList[num].innerText.trim().replace(/ - /g, \"-\");\n\t\tlocation[num] = classBuildingList[num].innerText.trim();\n\n\t}\n\n\tlet bigArr = [sections, types, profs, hours, days, times, location];\n\tlet distinctTypes = new Set(types);\n\tdistinctTypes.forEach((type) => {\n\t\tlet typeIndices = types.map((t, i) => t === type ? i : -1).filter((index) => index !== -1);\n\t\tlet bigArr2 = bigArr.map((littleArr) => littleArr.filter((_, index) => typeIndices.includes(index)));\n\t\tlet newClass = new Class_(classAbbr, classDesc, ...bigArr2)\n\t\tclassArr.push(newClass);\n\t})\n}", "title": "" }, { "docid": "c1b6704c7fbe1029018c694215ccc0eb", "score": "0.54596466", "text": "function getClassFromCard(card){\n return card[0].firstChild.className;\n}", "title": "" }, { "docid": "7ffc49bd9da8ec1a908946af2eae9d42", "score": "0.5457475", "text": "getNumId() {\r\n return this.numId;\r\n }", "title": "" }, { "docid": "b7e2ad2fdb0aac612c07cb49c365ce8a", "score": "0.5448534", "text": "GetRawClass() {}", "title": "" }, { "docid": "8a18f8dad4b0398279247a452b393334", "score": "0.54332876", "text": "function class_of(obj) {\n return cls.call(obj).slice(8, -1)\n }", "title": "" }, { "docid": "4b338d31f5eea7758b429d9aaef5987e", "score": "0.5428736", "text": "getClass(className) {\n const classMap = this.getClassMap();\n return classMap.get(className);\n }", "title": "" }, { "docid": "7a76dad1a71e34c8219c0269cd848e62", "score": "0.5415718", "text": "function getClazz(classID){\n\t\t\n\t\tvar clz = [];\n\t\tvar tempID;\n\t\tfor( var i = 0; i < clazzes.length; i++){\n\t\t\tif(clazzes[i].id === 'ID_Log4JLogChute_NI'){\n\t\t\t\tconsole.log(\"clazzes[i].id \" + clazzes[i].id ); \n\t\t\t}\n\t\t\ttempID =clazzes[i].id;\n\t\t\tif(clazzes[i].id.lastIndexOf('_') > 3){\n\t\t\t\tvar idSuffix = clazzes[i].id.substring(clazzes[i].id.lastIndexOf('_')+1,clazzes[i].id.length);\n\t\t\t\tif(idSuffix === 'DI' || idSuffix === 'FI' || idSuffix === 'NI' || idSuffix === 'IF'){\n\t\t\t\t\ttempID = clazzes[i].id.substring(0,clazzes[i].id.length-3); \n\t\t\t\t}\n\t\t\t}\t\n\t\t\tif(classID === tempID ) { \n\t\t\t\tclz = clazzes[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn clz;\n\t}", "title": "" }, { "docid": "615fddbf3c9ead7337ee399bde37213d", "score": "0.541088", "text": "function getabClassName(){\n\t\treturn $.get('./abClassName.txt', function(data){\n\t\t\tvar lines = data.split('\\n');\n\t\t\n\n\t\t\tfor(var i = 0; i < lines.length; i++)\n\t\t\t{\n\t\t\t\tabClassName.push(lines[i].toString());\n\t\t\t}\n\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "c0222d36b955c7a515bd9deb6a87d8d4", "score": "0.54055095", "text": "function _getClassName(el) {\n return typeof el.className.baseVal === \"undefined\" ? el.className : el.className.baseVal;\n }", "title": "" }, { "docid": "a8728364f4c182245917f08e64f17ce5", "score": "0.5396167", "text": "function getTileNumber (tile) {\n\t\treturn String($(tile).find(\".tile_number\").data(\"number\"))\n\t}", "title": "" } ]
c5ea377311fdb872f0d3539d0584ae89
function translates the cards of users to HTML content
[ { "docid": "3bd9ac5294678e1451ce0e629610f5ea", "score": "0.70849663", "text": "function getUserContent(user)\n{\n return \"\" +\n `<div class=\"card\">\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=${user.picture.large} alt=\"profile picture\">\n </div>\n\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${user.name.first} ${user.name.last}</h3>\n <p class=\"card-text\">${user.email}</p>\n <p class=\"card-text cap\">${user.location.city}, ${user.location.state}</p>\n </div>\n </div>`;\n \n}", "title": "" } ]
[ { "docid": "5c44ab24d3f2f9e01af59794977685be", "score": "0.7507639", "text": "function displayUsersCards(user){\n let cardHTML = `\n <div class=\"top-space\">\n <div class=\"image\">\n <img src=\"${user.avatar_url}\" alt=\"${user.name}\">\n </div>\n \n <h3 class=\"username\">${user.name}</h3>\n </div>\n \n <div class=\"body-info\">\n <p class=\"bio\">\n ${user.bio}\n </p>\n \n <ul>\n <li>${user.followers} <strong>followers</strong></li>\n <li>${user.following} <strong>following</strong></li>\n <li>${user.public_repos} <strong>repos</strong></li>\n </ul>\n \n <div class=\"repos\">\n </div>\n </div>\n `;\n\n main.innerHTML = cardHTML;\n}", "title": "" }, { "docid": "7855d64f3556c5174084ae4919521762", "score": "0.6411069", "text": "function generateHTML(data) {\n\tconst users = data.map((user, index) => {\n\t\tconst section = document.createElement('section');\n\t\tgallery.appendChild(section);\n\t\tconsole.log(index);\n\t\tlistenForClick(user, data, index);\n\t\tsection.innerHTML = `\n <div class=\"card\" id=\"${user.name.first}\" >\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=${user.picture.medium}>\n </div>\n \n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${user.name.title+\" \"+user.name.first+\" \"+user.name.last}</h2>\n <p class=\"card-text\">${user.email}</p>\n <p class=\"card-text cap\">${user.location.city+\" \"+user.location.country}</p>\n </div>\n </div> `;\n\t}).join('');\n}", "title": "" }, { "docid": "d9508df376cf54c6bd9085318abc9b61", "score": "0.6373186", "text": "makeCards(cards) {\n let htmlElements = ``\n cards.forEach(element => {\n htmlElements += `<div id=\"${element.id}\" class=\"col\">\n <div class=\"card mb-2\">\n <div class=\"card-body\">\n <div>\n <h3 class=\"card-title mb-3\">${this.truncateTitle(element.Title)}</h3>\n <p class=\"card-text mb-2\"> ${this.truncateText(element.Text)}</p>\n </div>\n <div>\n <p class=\"date mb-1\"><b>Fecha: </b>${element.Date}</p>\n <p class=\"source-url\"><b>Fuente:</b> ${this.truncateUrl(element.Url)}/</p>\n <a href=\"${element.Url}\" target=\"_blank\" class=\"btn btn-primary\">Visitar</a>\n <a data-id=\"${element.id}\" href=\"#\" class=\"modify-button btn btn-primary\">Visualizar</a>\n <img id=\"${element.id}\" class=\"trash-icon\" src=\"./icons/times-circle-regular.svg\" alt=\"trash\">\n </div>\n </div>\n </div>\n </div>`\n });\n return htmlElements\n }", "title": "" }, { "docid": "0bfbb85f08d8d38f07e77bc0e34cda31", "score": "0.634687", "text": "function create_html_card(user, online = true, img = '\"/client/resources/fondo.jpeg\"'){\n\n let state_html = '\"online_icon\"';\n let state_txt_html = 'online';\n\n let user_arr = user.split('_');\n let username = user_arr[0];\n let sens = user_arr[1];\n\n if(sens == 'analogico'){\n img = '\"/client/resources/ntc.jpg\"'\n } else if(sens == 'digital'){\n img = '\"/client/resources/digital.jpg\"'\n } else if(sens == 'luz'){\n img = '\"/client/resources/ldr.jpg\"'\n }\n\n if(online == false){\n state_html = '\"online_icon offline\"';\n state_txt_html = 'offline'\n }\n\n let html1 = '<li>' + '<div class=\"d-flex bd-highlight\">' + '<div class=\"img_cont\">'\n + '<img src=' + img + 'class=\"rounded-circle user_img\">'\n + '<span class=' + state_html +'></span>' + '</div>'\n + '<div class=\"user_info\">' + '<span>';\n let html2 = '</span>' + '<p>';\n let html3 = ' is ' + state_txt_html + '</p>' + '</div> ' + '</div>' + '</li>' \n return html1 + username + html2 + username + html3;\n}", "title": "" }, { "docid": "f2186797ddd4a27dfb7753645f47cdbd", "score": "0.63288033", "text": "renderTemplate(user, posts){\n\t\tconst { name, username } = user;\n\t\tconst userHeader = `Nombre: <strong>${name}</strong> Alias: <strong>${username}</strong>`;\n\t\tconst postsTitles = posts.map(post => `<li>${post.title}</li>`).join('');\n\t\tDataRetriever.USER_CNT.innerHTML = userHeader;\n\t\tDataRetriever.USER_POST_CNT.innerHTML = postsTitles;\n\t}", "title": "" }, { "docid": "27dc38c2e9ece90918aa11543f189046", "score": "0.6305087", "text": "function getCardHtml(data) {\n const template =\n ` \n <div class=\"ui centered fluid card\">\n <div class=\"content\">\n <img class=\"right floated tiny ui image\" src=\"{{ img_url }}}\">\n <div class=\"header\">{{ title }}}</div>\n <div class=\"meta\">{{ author }}</div>\n <div class=\"description\">{{{ reason }}}</div>\n </div>\n <a class=\"ui bottom attached button\" href=\"{{ url }}\" target=\"_blank\">\n <p> <i class=\"external icon\"></i> View Work </p>\n </a> \n </div>\n `;\n\n const entry = formatString(template, data.imgURL, data.title, data.author, data.reason, data.url);\n return entry;\n}", "title": "" }, { "docid": "c0fc13bdcae046ae762f62dcbb2f8c45", "score": "0.6184956", "text": "function showUser(user){\n console.log(user);\n $('.card-img-top').attr('src', user.picture.large);\n $('.card-title').text(user.name.first + ' ' + user.name.last);\n $('.card-text').html(`Age: ${user.dob.age} <br> \n City: ${user.location.city} `);\n $('#contact').attr('href', 'mailto:' + user.email);\n \n $('.card-body').css('text-transform', 'capitalize');\n $('.card').fadeIn(1000);\n}", "title": "" }, { "docid": "8de6607e0d6491519c490699f5715429", "score": "0.6183161", "text": "function displayUsers (users) {\n let html = '';\n gallery.innerHTML = '';\n\n users.forEach(element => {\n //console.log(`${element.picture.thumbnail} - ${element.name.first} ${element.name.last}: ${element.location.city}, ${element.location.state} - ${element.email}`);\n html += `<div class=\"card\"><div class=\"card-img-container\">`;\n html += `<img class=\"card-img\" src=${element.picture.large} alt=\"profile picture\">`\n html += `</div><div class=\"card-info-container\">`;\n html += `<h3 id=\"name\" class=\"card-name cap\">${element.name.first} ${element.name.last}</h3>\n <p class=\"card-text\">${element.email}</p>\n <p class=\"card-text cap\">${element.location.city}, ${element.location.state}</p>`\n html += `</div></div>`;\n });\n\n if (users.length === 0) {\n html = \"<h2>No users match that name.</h2>\"\n }\n\n gallery.insertAdjacentHTML('beforeend', html);\n}", "title": "" }, { "docid": "a1b7594f229d1f78174adcf38806975f", "score": "0.61774594", "text": "function InternCard(data){\n return`\n <div class=\"col-4\">\n <div class=\"card mb-5 border-dark\">\n <div class=\"card-body bg-secondary\">\n <h5 class=\"card-title\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-file-person\" viewBox=\"0 0 16 16\">\n <path d=\"M12 1a1 1 0 0 1 1 1v10.755S12 11 8 11s-5 1.755-5 1.755V2a1 1 0 0 1 1-1h8zM4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4z\"/>\n <path d=\"M8 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6z\"/>\n </svg>${data.getName()}</h5>\n <p class=\"card-text\">${data.getRole()}</p>\n </div>\n <div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item card-link\">ID: ${data.getId()}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${data.getEmail()}\">${data.getEmail()}</a></li>\n <li class=\"list-group-item\">University: ${data.getSchool()}</li>\n </ul>\n </div>\n </div>\n </div>\n `\n}", "title": "" }, { "docid": "b83f85dc63d48b020e1e0f670c62405d", "score": "0.61518174", "text": "function EngineerCard(data){\n return`\n <div class=\"col-4\">\n <div class=\"card mb-5 border-dark\">\n <div class=\"card-body bg-secondary\">\n <h5 class=\"card-title\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-file-person\" viewBox=\"0 0 16 16\">\n <path d=\"M12 1a1 1 0 0 1 1 1v10.755S12 11 8 11s-5 1.755-5 1.755V2a1 1 0 0 1 1-1h8zM4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4z\"/>\n <path d=\"M8 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6z\"/>\n </svg>${data.getName()}</h5>\n <p class=\"card-text\">${data.getRole()}</p>\n </div>\n <div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item card-link\">ID: ${data.getId()}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${data.getEmail()}\">${data.getEmail()}</a></li>\n <li class=\"list-group-item\">Github: <a href = \"https://www.github.com/${data.getGithub()}/\" target = \"_blank\">${data.getGithub()}</a></li>\n </ul>\n </div>\n </div>\n </div>\n `\n}", "title": "" }, { "docid": "b2330da0b24accbc902d9db84d42189d", "score": "0.61209005", "text": "function display(cards) {\n shuffle(cards);\n const deck = $('.deck');\n deck.empty();\n cards.forEach(function(card, index) {\n const cardHtml = getHtmlForCard(card);\n deck.append(cardHtml);\n });\n }", "title": "" }, { "docid": "ce54403b05a240be190b9bb3eac4bc73", "score": "0.6106149", "text": "function generateMarkup(data){\n users = [];\n data.results.map((user) =>{\n let userPhone = phoneRegEx(user.phone);\n console.log(userPhone)\n let userData = new Object();\n userData.card =\n `<div class=\"card\" id=${data.results.indexOf(user)}>\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${user.name.first} ${user.name.last}</h3>\n <p class=\"card-text\">${user.email}</p>\n <p class=\"card-text cap\">${user.location.city}, ${user.location.state}</p>\n </div>\n </div>`;\n userData.modal =\n `<div class=\"modal-container\" id=\"${data.results.indexOf(user)}\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${user.name.first} ${user.name.last}</h3>\n <p class=\"modal-text\">${user.email}</p>\n <p class=\"modal-text cap\">${user.location.city}</p>\n <hr>\n <p class=\"modal-text\"> (${userPhone.slice(0,3)}) ${userPhone.slice(3,6)}-${userPhone.slice(6,10)}</p>\n <p class=\"modal-text\">${user.location.street.number} ${user.location.street.name}, ${user.location.city}, ${user.location.state} ${user.location.postcode}</p>\n <p class=\"modal-text\">Birthday: ${user.dob.date.slice(5,7)}/${user.dob.date.slice(8,10)}/${user.dob.date.slice(0,4)}</p>\n </div>\n </div>\n <div class=\"modal-btn-container\">\n <button type=\"button\" id=\"modal-prev\" class=\"modal-prev btn\">Prev</button>\n <button type=\"button\" id=\"modal-next\" class=\"modal-next btn\">Next</button>\n </div>`;\n users.push(userData);\n let card = userData.card;\n addToGallery(userData.card);\n });\n generateSearch(data);\n searchCards(data);\n resetButton();\n cardClick();\n}", "title": "" }, { "docid": "830eb51b378deaa447205d4e07891cdf", "score": "0.6097854", "text": "function addCardsHtml(member){\n return new Promise(function(resolve, reject){\n const name = member.getName();\n const role = member.getRole();\n const email = member.getEmail();\n const id = member.getId();\n let data = \"\";\n if (role === \"Engineer\"){\n const github = member.getGithub();\n data = ` <div id=\"cards-align\">\n \n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n \n <h5 class=\"card-title\">${name}</h5>\n <p class=\"card-text\">Engineer</p>\n <span>\n <i class=\"fas fa-glasses\"></i>\n </span>\n \n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${email}\">${email}</a></li>\n <li class=\"list-group-item\">Github: <a href=\"https://www.github.com/${github}\" target=\"_blank\">${github}</a></li>\n </ul>\n </div>\n </div>`\n } else if (role === \"Intern\"){\n const school = member.getSchool();\n data = ` <div id=\"cards-align\">\n \n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${name}</h5>\n <p class=\"card-text\">Intern</p>\n <span>\n <i class=\"fas fa-graduation-cap\"></i>\n </span>\n </div>\n <ul class=\"list-group list-group-flush\">\n \n <li class=\"list-group-item\">ID: ${id}</li> \n <li class=\"list-group-item\">Email: <a href=\"mailto:${email}\">${email}</a></li>\n <li class=\"list-group-item\">School: ${school}</li>\n </ul>\n </div>\n </div>`\n }else {\n const officeNumber = member.getOfficeNumber();\n data = ` <div id=\"cards-align\">\n \n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${name}</h5>\n <p class=\"card-text\">Manager</p>\n <span>\n <i class=\"fas fa-coffee\"></i>\n </span>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${email}\">${email}</a></li>\n <li class=\"list-group-item\">Office Phone #: ${officeNumber}</li>\n </ul>\n </div>\n </div>`\n }\n console.log(\"adding team member\");\n fs.appendFile(\"./dist/team.html\" , data, function (err) {\n if (err) {\n return reject(err);\n };\n return resolve();\n });\n });\n}", "title": "" }, { "docid": "1ea748f8ddfb19e88b6fb30f755bb080", "score": "0.60941845", "text": "function showUserContent(user) {\n if(user.emailVerified === true) {\n userEmailVerified.innerHTML = 'E-mail verificado'\n hideItem(sendEmailVerificationDiv)\n } else {\n userEmailVerified.innerHTML = 'E-mail não verificado!'\n showItem(sendEmailVerificationDiv)\n }\n\n userImg.src = user.photoURL ? user.photoURL : 'img/unknownUser.png'\n userName.innerHTML = user.displayName;\n\n userEmail.innerHTML = user.email;\n hideItem(auth);\n showItem(userContent);\n}", "title": "" }, { "docid": "59951e569bfc1f4cc5d52d1f36dc8dab", "score": "0.6081626", "text": "function showCards(cards) {\n \n $result.empty();\n \n for (var i = 0; i < cards.length; i++) {\n var card = cards[i];\n \n $result.append($('<div class=\"golive golive' + card.golive + '\">' + card.name + \n '<br>' + 'Go Live ' + card.golive + '<br><br>' + \n '<a href=\"https://jira.berkeley.edu/browse/SISRP-' + \n card.jiraNumber + '\">' + card.jiraNumber + '</a>' + \n '</div>'));\n }\n }", "title": "" }, { "docid": "2d4e100d9b5fa5c77a9ecf8bffa00cec", "score": "0.60621077", "text": "function generateUsersHTML(users) {\n gallery.innerHTML = \"\";\n users.forEach( (user, index) => {\n gallery.insertAdjacentHTML('beforeend', \n `<div class=\"card\" data-index=${index}>\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${user.name.first} ${user.name.last}</h3>\n <p class=\"card-text\">${user.email}</p>\n <p class=\"card-text cap\">${user.location.city}, ${user.location.state}</p>\n </div>\n </div>` );\n })\n}", "title": "" }, { "docid": "97b4c91e71efca698041929df8c7db3a", "score": "0.6051214", "text": "function displayCards(cards) {\n // Shuffle the deck of cards.\n var shuffledIcons = shuffle(cards);\n createHtml(shuffledIcons);\n }", "title": "" }, { "docid": "8bbccf0e2ced9f7b51a8f7a6464eaf4c", "score": "0.605098", "text": "rederTemplate(user,post){\n const {name=\"N/A\", username=\"N/A\"}=user; \n const posts=post; \n const NameHTML=`<p><b>Name:</b> ${name}.</p>`;\n const UsernameHTML=`<p><b>Username:</b> ${username}</p>`;\n DataRetriever.UserNameArea.innerHTML= `${NameHTML}${UsernameHTML}`;\n DataRetriever.PostsArea.innerHTML=posts.map(data=> `<li>${data.title}.</li>`).join(\"\");\n }", "title": "" }, { "docid": "91a74eead7794e67027879929be5a99d", "score": "0.60475767", "text": "function generateTeamCards(ans) {\n let role;\n if (ans.title === \"Manager\") {\n role = `Office Number: ${ans.officeNumber}`;\n } else if (ans.title === \"Engineer\") {\n role = `Github Username: ${ans.github}`;\n } else if (ans.title === \"Intern\") {\n role = `School: ${ans.school}`;\n }\n return `\n <div class=\"card\">\n<div class=\"card-header\">\n <h2>${ans.name}</h2> \n <h2><i class=\"far fa-user\"></i> ${ans.title}</h2>\n <hr>\n</div>\n<div class=\"card-body\">\n <ul>\n <li>ID: ${ans.id}</li>\n <li>Email: ${ans.email}</li>\n <li>${role} </li>\n </ul>\n</div>\n</div>`;\n}", "title": "" }, { "docid": "f40df472b911694d09e19dec336a4af1", "score": "0.6047046", "text": "function create_user_card (array) {\n const employees = array.map(employee =>\n `\n <div class=\"card\"> \n <img src=\"${employee.foto}\">\n <div class=\"info_wrapper\">\n <h3>${employee.firstName} ${employee.secondName}</h3>\n <p>${employee.email}</p>\n <p>${employee.city}</p>\n </div>\n <div class=\"card_overlay\">\n </div>\n </div>\n `\n ).join(\"\");\n\n directory.innerHTML = employees;\n }", "title": "" }, { "docid": "346af34140f7b03767ae08a4e516757a", "score": "0.6044614", "text": "function generateHTML() {\n var cards = [];\n employees.forEach(function(employee){\n cards.push(employee.generateHTML())\n })\n return `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>My Team</title>\n <link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.8.1/css/all.css\"/>\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\" integrity=\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T\" crossorigin=\"anonymous\">\n <script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\" integrity=\"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM\" crossorigin=\"anonymous\"></script>\n </head>\n <style>\n .card-body{\n padding: 10px;\n }\n .wrapper{\n padding: 5px;\n display: inline-block;\n }\n h5.card-title, i, p, h1{\n color: white;\n }\n </style>\n\n <body>\n <div class=\"jumbotron\" style=\"background-color: red; text-align: center;\">\n <h1 class=\"display-4\">My Team</h1>\n </div>\n <div class=\"container\">\n <br>\n ${cards.join(\" \")}\n </div>\n \n </body>\n </html>`\n}", "title": "" }, { "docid": "2e372992d01618146c0fe12d928a9bdb", "score": "0.60404134", "text": "function displayAll()\n{\n const containAll = document.querySelectorAll(\".card-contain\");\n let flag = 0;\n containAll.forEach((cle) => {\n\n let player = cards.filter((card) => card.holder === flag);\n\n player.forEach((personCard)=> {\n \n var newDiv = document.createElement('div');\n newDiv.className=`card user${personCard.holder}`;\n newDiv.id=personCard.id;\n var text = document.createTextNode(personCard.id);\n newDiv.appendChild(text);\n cle.appendChild(newDiv);\n \n });\n\n flag++;\n })\n}", "title": "" }, { "docid": "7256a0e729511ac59b13c8601c8a56f9", "score": "0.6034128", "text": "function displayUsers(users){\n\n\n let usersHTML= \"\";\n users.forEach((user) => usersHTML += getUserContent(user));\n galleryDiv.innerHTML=usersHTML;\n\n cards = document.querySelectorAll('.card');\n\n\n //Dynamically addding a seacrh bar\n searchForm = document.createElement('form');\n searchForm.innerHTML = getFormInnerHTML();\n searchForm.setAttribute('action' , \"#\");\n searchForm.setAttribute('method', \"get\");\n const searchContainer = document.querySelector('.search-container');\n searchContainer.appendChild(searchForm);\n\n //Event listeners\n addCardListeners(users);\n addSearchListener();\n}", "title": "" }, { "docid": "4b6ccb229e80160f32f84947bd9ab582", "score": "0.6032477", "text": "function generateHTML(data) {\n return `\n <!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n \n <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.15.4/css/all.css\" integrity=\"sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm\" crossorigin=\"anonymous\">\n <title>Team Profile</title>\n</head>\n<body style=\"background-color: #e3f2fd;\">\n <div class='container-fluid'>\n <div class='row'>\n <div class='col-12 jumbotron mb-4 bg-primary'>\n <h1 class='text-center fw-bold text-lg-centered' style=\"color: #e3f2fd;\">My Team</h1>\n </div>\n </div>\n </div>\n\n <div class=\"container text-center\">\n ${generateCards(data)}\n </div>\n \n</body>\n</html>`\n \n }", "title": "" }, { "docid": "d26e795a7f05a8ebe90d6b654f481154", "score": "0.60220075", "text": "function myUsers() {\n fetch('https://jsonplaceholder.typicode.com/users')\n .then(response => response.json())\n .then(output => {\n console.log(output)\n let users = '';\n output.forEach(element => {\n users += `<div class='card'><ul> \n <li>${element.name}</li>\n <li>${element.phone}</li>\n <li>${element.website}</li>\n <li>${element.username}</li>\n <li>${element.email}</li>\n <li>${element.address.street}</li>\n <li>${element.company.name}</li>\n \n </ul>\n </div>`\n document.getElementById('six').innerHTML = JSON.stringify(users);\n });\n\n });\n}", "title": "" }, { "docid": "02c6c67479a296241452eb0fa54030df", "score": "0.60144436", "text": "function load_profile_html(user) {\r\n $(\"#chat-profile\").html(`\r\n <div class=\"right-header-img\">\r\n <img src=\"${user.profile_pic}\" alt=\"${user.profile_pic}\" >\r\n </div>\r\n <div class=\"right-header-detail\">\r\n <div>\r\n <p>${user.fullname}</p>\r\n <span>${user.is_parent === 0 ? \"Teacher\" : \"Parent\"}</span>\r\n </div>\r\n </div>\r\n`);\r\n}", "title": "" }, { "docid": "4c99b31ecf1f371513346ad8acf37e2c", "score": "0.6008741", "text": "function displayGameCards() {\n let deckHtml = '';\n\n for (const card of cards) {\n deckHtml += `\n <li class=\"card\">\n <i class=\"fa fa-${card}\"></i>\n </li>\n `;\n }\n // Create new card-elements\n deck.innerHTML = deckHtml;\n}", "title": "" }, { "docid": "8c808cb041068cac37664559b1faf4c0", "score": "0.6004266", "text": "function createHTMLPage(){\n // console.log(team);\n let finishedCard = [];\n team.forEach(team => { \n // console.log(\"This is the role: \" + team.role);\n // This checks to see if the object is an engineer or intern. It will then modify the card slightly to display the pertinent information.\n if (team.role == \"👓 Engineer\"){\n const card = ` \n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-header \">\n <p>${team.name}</p>\n <p>${team.role}</p>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${team.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${team.email}\">${team.email}</a></li>\n <li class=\"list-group-item\">Github: <a href=\"https://github.com/${team.github}\" target=\"_blank\">${team.github}</a></li>\n </ul>\n </div>`\n // This pushes the card object in the array to later be called and displayed in the html file.\n finishedCard.push(card);\n }else if (team.role == \"🎓 Intern\"){\n const card = ` \n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-header \">\n <p>${team.name}</p>\n <p>${team.role}</p>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${team.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${team.email}\">${team.email}</a></li>\n <li class=\"list-group-item\">School: ${team.school}</li>\n </ul>\n </div>`\n finishedCard.push(card);\n }\n });\n // console.log(\"This is for finished cards \\n\" + finishedCard);\n // This is the html document file inside template literals. It uses bootstrap for some styling and scripting.\n // It comes with manager already coded due to manager always being the 1st employee. The rest of the team is filled in with cards created on demand.\n const html = `\n <!doctype html>\n<html lang=\"en\">\n\n<head>\n <!-- Required meta tags -->\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <!-- Bootstrap CSS -->\n <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\"\n integrity=\"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">\n\n <title>Team Profile</title>\n</head>\n\n<body>\n <nav class=\"navbar navbar-dark bg-dark\">\n <div class=\"container-fluid\">\n <h1 class=text-light>My Team</h1>\n </div>\n </nav>\n <div class=\"row row-cols-1 row-cols-md-2 g-4\">\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-header primary\">\n <p>${boss.name}</p>\n <p> ${boss.role}</p>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${boss.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${boss.email}\">${boss.email}</a></li>\n <li class=\"list-group-item\">Office number: ${boss.officeNumber}</li>\n </ul>\n </div>\n\n ${finishedCard}\n\n\n <script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js\"\n integrity=\"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM\"\n crossorigin=\"anonymous\"></script>\n</body>\n\n</html> \n \n `;\n // Placed finished html file in dist folder. Reports success if it was successful.\n fs.writeFile(\"./dist/index.html\", html, (err) => \n err ? console.log(err) : console.log('Web page has been created successfully!!'));\n }", "title": "" }, { "docid": "3d35820b763ce3b422ec1d94e0ef4473", "score": "0.596933", "text": "function cardHtml() {\n let cards = shuffle(cards_list);\n cards.forEach(function(card) {\n $(\".deck\").append('<li><i class=\"card fa fa-' + card + '\"></i></li>');\n })\n }", "title": "" }, { "docid": "39371e833113e8473150d5273d2c022d", "score": "0.5963627", "text": "function displayTranslation(object) {\n let trans = object.Russian;\n let card = document.getElementById('translation-card');\n card.value = trans;\n}", "title": "" }, { "docid": "02b1fb02681a2ab39d7b89b69f923cc6", "score": "0.594484", "text": "function display(user){\n\t\tif(!firstInput.value) return;\n\t\tplayerone=user;\n // console.log(user)\n var playerOneDetail =document.querySelector(\".player-one-detail\");\n playerOneDetail.innerHTML=\n\t ` <li class=\"user-detail\">\n\t\t<h1>${user.name}</h1>\n\t\t<img src=\"${user.avatar_url}\"/>\n\t\t<p>public_repos:${user.public_repos}</p>\n\t\t<p> public_gists:${user.public_gists}</p>\n\t\t<p>followers:${user.followers}</p>\n\t\t<p>following:${user.following}</p>\n\t\t</li>`\n }", "title": "" }, { "docid": "3783e5cc19e97e7a38ae8efa504db106", "score": "0.59403", "text": "function render(data){\n //se inicia el manejo de strings que viene en ES6 se usan las comillas ``\n //la variable se colocan con el signo $ y entre {}\n\n //se restructura para manejar el array con map\nvar html = data.map(function(elem, index){\n return( `<div>\n <strong>${elem.autor}</strong>:\n <em>${elem.texto}</em>\n </div>`);\n }).join(\" \");\n\n document.getElementById('messages').innerHTML = html;\n}", "title": "" }, { "docid": "407d5951a020ebacea23b7766024cf0c", "score": "0.59322506", "text": "renderUserContent() {\n // If user is logged in, auth will not be null\n if (this.props.auth) {\n // Render first name\n // FIXME this looks gross\n return <div className='card blue accent-4 white-text'>\n <div className='card-content'>\n <div className='chip blue lighten-2 white-text right'><Greeting name={ this.props.auth.firstName } /></div>\n <p className='flow-text center-align'><h4>Survey Dashboard</h4></p>\n </div>\n </div>\n }\n }", "title": "" }, { "docid": "85d763574938f90941d824edf0e9c2d9", "score": "0.59306735", "text": "showProfile(user) {\n this.profile.innerHTML = `\n <div class=\"card card-body\">\n <div class=\"card-content\">\n <div class=\"card-img\">\n <img class=\"img-fluid\" src=\"${user.avatar_url}\">\n <br>\n <div class=\"btn-center\">\n <a href=\"${user.html_url}\" target=\"_blank\" class=\"btn\">View Profile</a>\n </div>\n </div>\n <div class=\"colum-2\">\n <div class=\"selt-m\">\n <span class=\"badge-first\">Public Repos: ${user.public_repos}</span>\n <span class=\"badge-second\">Public Gists: ${user.public_gists}</span>\n <span class=\"badge-three\">Followers: ${user.followers}</span>\n <span class=\"badge-four\">Following: ${user.following}</span>\n </div>\n <ul class=\"list-group\">\n <li class=\"list-group-item\">Company: ${user.company}</li>\n <li class=\"list-group-item\">Website/Blog: ${user.blog}</li>\n <li class=\"list-group-item\">Location: ${user.location}</li>\n <li class=\"list-group-item\">Member Since: ${user.created_at}</li>\n <li class=\"list-group-item\">Twitter Use Name: ${user.twitter_username}</li>\n </ul>\n </div>\n </div>\n </div>\n <h3 class=\"page-heading\">Latest Repos</h3>\n <div id=\"repos\"></div>\n `;\n }", "title": "" }, { "docid": "ced2ef3c9ff959a2e44fdd88e2b5fc1f", "score": "0.5892866", "text": "function renderUsersList(data) {\n let rawHTML = \"\";\n //Insert HTML tags into template\n data.forEach((item) => {\n rawHTML += `<div class=\"col-sm-3 \">\n <div class=\"mb-5 \">\n <div class=\"card text-center shadow p-3 mb-5 bg-body rounded\">\n <img src=\"${item.avatar}\" class=\"card-img-top rounded-circle w-75 mx-auto mt-4\" alt=\"People's face\">\n <div class=\"card-body description\">\n <h3 class=\"card-title\">${item.name} ${item.surname}</h3>\n <p class=\"card-title\">${item.region}</p>\n <p class=\"card-title\">${item.age} yr</p>\n </div>\n <button class=\"btn btn-primary btn-show-user rounded-pill\" data-toggle=\"modal\" data-target=\"#user-modal\" data-id=\"${item.id}\">More</button>\n <button class=\"mt-2 btn btn-info btn-add-favorite rounded-pill\" data-id=\"${item.id}\">+</button>\n \n </div>\n </div>\n </div>`;\n });\n dataPanel.innerHTML = rawHTML;\n}", "title": "" }, { "docid": "8aa7f1974c4e7c39061aab377a4a0ca9", "score": "0.58890754", "text": "function render(data){\n\tvar html = data.map(function(item, index){\n\t\treturn(`<div>\n\t\t\t\t\t<strong>${item.author}</strong>:\n\t\t\t\t\t<em>${item.text}</em>\n\t\t\t\t</div>`);\n\t}).join(\" \");\n\n\tdocument.getElementById(\"messages\").innerHTML = html;\n}", "title": "" }, { "docid": "4bdae082d568dd55ca44e910199d3647", "score": "0.5879641", "text": "function userInformationHTML(user) {\n return `\n <h2>${user.name}\n <span class=\"small-name\">\n (@<a href=\"${user.html_url}\" target=\"_blank\">${user.login}</a>)\n </span>\n </h2>\n <div class=\"gh-content\">\n <div class=\"gh-avatar\">\n <a href=\"${user.html_url}\" target=\"_blank\">\n <img src=\"${user.avatar_url}\" width=\"80\" height=\"80\" alt=\"${user.login}\" />\n </a>\n </div>\n <p>Followers: ${user.followers} - Following ${user.following} <br> Repos: ${user.public_repos}</p>\n </div>`;\n}", "title": "" }, { "docid": "ff29cae65bf7a4669e42bae0bcf017f4", "score": "0.58753914", "text": "render() {\n const { user } = this.props;\n const { name, likes, birthday, memberSince, contact } = user;\n const { first, last } = name;\n return (\n <div className=\"card-wrap\">\n <div className=\"card\">\n <img src={ImageUrl[user.gender]} className=\"card-img\" alt=\"user profile\"/>\n <div className=\"detailsCont\">\n <h4>{`${first} ${last}`}</h4>\n <p>Age: {getDateDifference(birthday)}</p>\n <p>Expierence: {getDateDifference(memberSince)} years</p>\n <span>Likes: {this.getEmoji(likes)}</span>\n </div>\n <button className=\"contact\" onClick={() => {\n this.props.contactButtonClicked(contact);\n }}>Contact</button>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "a4ab043e3f8cd49867d19d17b97c1137", "score": "0.5870727", "text": "function allCards(makeCard) {\n return `<li class=\"card\"><i class=\"fa ${makeCard}\"></i></li>`;\n}", "title": "" }, { "docid": "3c8de11069bd684ef8d3dd869f984f36", "score": "0.58429986", "text": "function getHtmlForCard(card) {\n return '<li class=\"card\"><i class=\"fa ' + card + '\"></i></li>'\n }", "title": "" }, { "docid": "cd1e47c20e9b32b4c1715e7bd7461f00", "score": "0.581976", "text": "function makeEmployeeCard(data) {\n for (i = 0; i < data.length; i++) {\n let html =\n `\n <div class=\"card\" id=\"${i}\">\n <img class=\"profile-image\" src=\"${data[i].picture.large}\" alt=\"${data[i].name.first} ${data[i].name.last}\" />\n <div class=\"profile-text\">\n <h3>${data[i].name.first} ${data[i].name.last}</h3>\n <p class=\"email\">${data[i].email}</p>\n <p class=\"location\">${data[i].location.city}, ${data[i].location.state}</p>\n </div>\n </div>\n `;\n container.innerHTML += html;\n }\n}", "title": "" }, { "docid": "05d769831168c97dc0c76594d8d80092", "score": "0.58181804", "text": "function generateCards(data) {\n employees = data.results;\n\n profileCards = employees.map(employee => {\n employeeProfile = '';\n employeeProfile += '<li class=\"employeeCard\">';\n employeeProfile += `<a href=\"#${employee.name.last}\">`;\n employeeProfile += '<div class=\"card\">';\n employeeProfile += `<img src=${employee.picture.large} class=\"cardPhoto\" alt=\"Employee Photo\" title=\"${employee.name.first} ${employee.name.last}\">`;\n employeeProfile += '<div class=\"cardText\">';\n employeeProfile += `<p class=\"employee\">${employee.name.first} ${employee.name.last}</p>`;\n employeeProfile += `<p class=\"email\">${employee.email}</p>`;\n employeeProfile += `<p class=\"city\">${employee.location.city}</p>`;\n employeeProfile += '</div>';\n employeeProfile += '</div>';\n employeeProfile += '</a>';\n employeeProfile += '</li>';\n return employeeProfile;\n });\n\n profileCards.map(card => ul.append(card));\n //----Declaring Card Elements-----//\n card = $('.card');\n cardText = $('.cardText');\n profileCards = $('li.employeeCard');\n\n}", "title": "" }, { "docid": "a69b82cac8a5fe2ffad76d66dcbf1b3d", "score": "0.58159524", "text": "function displayUserData(data) {\n\n let temp = `<a href=\"#\">\n <img src=\"${data.img}\" class=\"img-fluid\" alt=\"\">\n ${data.name}<i class=\"fa fa-angle-down\" aria-hidden=\"true\"></i>\n </a>`\n \n login_btn.style.display = 'none';\n userCard.innerHTML = temp;\n\n \n \n}", "title": "" }, { "docid": "c2b692748a0114fdd3e1658d3869e144", "score": "0.58116513", "text": "function showAll (container) {\n const cards = data.map((roommate, index) => templates.card(roommate, index)).join('')\n container.innerHTML = cards\n}", "title": "" }, { "docid": "7427b2aa8393e873ded2c31349e07190", "score": "0.57948446", "text": "function renderUserInfoTemplate(user) {\n\n let userInfo = document.getElementById(\"userInfo\");\n\n userInfo.setAttribute(\"class\", \"row user-info\");\n userInfo.innerHTML = `\n <div class=\"col-lg-4\">\n <img src=\"${user.avatar_url}\" alt=\"avatar\">\n <h4>${user.login}</h4>\n </div>\n\n <div class=\"col-lg-8\">\n ${user.name? `\n <h2>${user.name}</h2>\n <p>\n <a href=\"${user.html_url}?tab=followers\">\n Followers: ${user.followers}\n </a>\n /\n <a href=\"${user.html_url}?tab=following\">\n Following: ${user.following}\n </a>\n </p>\n\n ${user.location? `<p class=\"location\">Location: ${user.location}</p>` : ''}\n ` : ''}\n <p>\n <a class=\"btn btn-default btn-outline-secondary\" href=\"${user.html_url}\" role=\"button\">View details</a>\n </p>\n </div>\n `;\n}", "title": "" }, { "docid": "fbaf3aa88057d70c37e9e599ec30223b", "score": "0.5794665", "text": "function updateCards(){\n if (site_language == 'en'){\n $('#running_task_name').html(lastUsedBehaviors[1].translation[1]);\n $('#behavior_last').html(lastUsedBehaviors[0].translation[1]);\n $('#behavior_current').html(lastUsedBehaviors[1].translation[1]);\n $('#behavior_next').html(lastUsedBehaviors[2].translation[1]);\n } else {\n $('#running_task_name').html(lastUsedBehaviors[1].translation[0]);\n $('#behavior_last').html(lastUsedBehaviors[0].translation[0]);\n $('#behavior_current').html(lastUsedBehaviors[1].translation[0]);\n $('#behavior_next').html(lastUsedBehaviors[2].translation[0]);\n }\n}", "title": "" }, { "docid": "c9be58d69c37327e07d54fb02c296fca", "score": "0.5791125", "text": "function render(whatToRender) {\n const where = document.getElementById(\"cards\");\n let cards = whatToRender\n .map((item) => {\n return `\n <div class=\"card\" style=\"width: 18rem\">\n <div class=\"card-header\">Category ${categoryLetterToName(item.category)}</div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">${item.title}</h5>\n \n <a href=\"#\">Price ${item.price}</a><br />\n <a class=\"btn btn-small btn-info\" href=\"#\">Quantity ${item.quantity}</a>\n </div>\n </div>\n `;\n })\n .join(\"\");\n // console.log(\"cards\", cards);\n where.innerHTML = cards;\n}", "title": "" }, { "docid": "97b00a4f152adddf0efd18d9f961b453", "score": "0.57887787", "text": "function renderUsers(data){\n var html = data.map(function(elem,index){\n return (`\n\t\t<li class=\"list-group-item\">${elem}</li>\n `);\n }).join(\"\");\n\n\tdocument.getElementById('user').innerHTML = html;\n}", "title": "" }, { "docid": "f965503c2c58a847fc00c734de799a52", "score": "0.578561", "text": "function userInformationHTML(user) {\n /*\n If we want to display all the properties that GitHub User has:\n let's use console.log():\n */\n console.log(user); // this will output the JSON content of \"user\" JSON object\n\n // we don't output anything here, just return the result:\n // simple output for testing:\n // return \"login: \" + user.login + \". Username: \" + user.name + \" \" + \". Public Repos: \" + user.public_repos;\n\n /*\n We're returning a template literal using the \"back quote\" notation.\n return\n\n - user public name\n \"name\": \"monalisa octocat\"\n\n - span with class \"small-name\": Check github-styles.css CSS file\n\n - put a bracket and an @ sign so that will appear before the user's login name.\n like \"The Octocat (@octocat)\"\n\n \"html_url\": example => \"https://github.com/octocat\"\n\n - the text inside the anchor tag is the user login name:\n \"login\": \"octocat\"\n\n Then display the user's content:\n - create a new div with class gh-content to display all user's content\n - inside it, creating a div with class of \"gh-avatar\" href and image for the user avatar \n - img inside it\n\n display in italic: (@octocat)\n\n template literal: `Simple text ${variable} simple text`\n\n We are going to return a full HTML code + embedded JS variables using literal template with \"`\":\n\n \"name\", \"html_url\", \"login\"\n\n In HTML format (Just the few):\n\n <h2> USER_NAME <span class=\"small-name\"> HTML_URL LOGIN </span>\n </h2>\n <div class=\"gh-content\">\n <a href=\"HTML_URL\" target=\"_blank\">\n <img src=\"USER_IMAGE\" alt=\"LOGIN_NAME\">\n </a>\n </div>\n */\n return `\n <h2>${user.name}\n <span class=\"small-name\">\n <a href=\"${user.html_url}\" target=\"_blank\">${user.login}</a>\n </span>\n </h2>\n\n <div class=\"gh-content\">\n <div class=\"gh-avatar\">\n <a href=\"${user.html_url}\" target=\"_blank\">\n <img src=\"${user.avatar_url}\" width=\"80\" height=\"80\" alt=\"${user.login}\" />\n </a>\n </div>\n <p>Followers: ${user.followers} - Following ${user.following} <br> Repos: ${user.public_repos}</p>\n </div>`;\n} // end userInformationHTML()", "title": "" }, { "docid": "c69b7b8c5df32691eb76a71d71dbce59", "score": "0.578167", "text": "mostraUserInfo(dados) {\n \n //cria variavel para armazenar o nome do usuario, vindo do localStorage\n let nomeUsuario = localStorage.getItem(\"nome-usuario\")\n \n let card = `\n <h3 class=\"profile-fullname\"><a>${nomeUsuario}<a></h3>\n <h2 class=\"profile-element\"><a>@${dados[0].usuario}</a></h2>\n <a class=\"profile-element profile-website\" hrerf=\"\"><i\n class=\"octicon octicon-link\"></i>&nbsp;${dados[0].usuario}.com</a>\n <a class=\"profile-element profile-website\" hrerf=\"\"><i\n class=\"octicon octicon-location\"></i>&nbsp;${dados[0].local}</a>\n <h2 class=\"profile-element\"><i class=\"octicon octicon-calendar\"></i>Joined ${dados[0].cadastro}</h2>\n <button class=\"btn btn-search-bar tweet-to-btn\">Tweet to ${dados[0].nome}</button>\n `\n \n this.userInfo.innerHTML = card\n console.log(\"usuario\", dados)\n }", "title": "" }, { "docid": "858362d5422d23111cc0b3ca4c3515e5", "score": "0.57781786", "text": "function createCards(array) {\n array.forEach((data, index) => {\n if(data.getRole() === 'Manager'){\n\n let cardManager = `<div class=\"card\">\n <h2 class=\"member-name\">${data.getName()}</h2>\n <div class=\"card-info\">\n <p class=\"id\">ID: ${data.getId()}</p>\n <hr>\n <p class=\"email\">Email: ${data.getEmail()}</p>\n <hr>\n <p class=\"employee-info\">Office Number: ${data.getOfficeNumber()}</p>\n </div>\n </div>`\n cardsArray.push(cardManager);\n }else if(data.getRole() === 'Engineer'){\n\n let cardEngineer = `<div class=\"card\">\n <h2 class=\"member-name\">${data.getName()}</h2>\n <div class=\"card-info\">\n <p class=\"id\">ID: ${data.getId()}</p>\n <hr>\n <p class=\"email\">Email: ${data.getEmail()}</p>\n <hr>\n <p class=\"employee-info\">Github: ${data.getGithub()}</p>\n </div>\n </div>`\n cardsArray.push(cardEngineer);\n }else{\n\n let cardIntern = `<div class=\"card\">\n <h2 class=\"member-name\">${data.getName()}</h2>\n <div class=\"card-info\">\n <p class=\"id\">ID: ${data.getId()}</p>\n <hr>\n <p class=\"email\">Email: ${data.getEmail()}</p>\n <hr>\n <p class=\"employee-info\">School: ${data.getSchool()}</p>\n </div>\n </div>`\n cardsArray.push(cardIntern);\n }\n })\n writeHTML(cardsArray);\n}", "title": "" }, { "docid": "792d6fdb5d2ef8ee29825b287a4fe472", "score": "0.5774586", "text": "function setCard(){\ncardHolder.innerHTML = ''\ncardData.forEach((cardItem) => {\n cardHolder.innerHTML += '<li card-list=' + cardItem + '>' + cardItem + '</li>'\n })\n}", "title": "" }, { "docid": "601ac8d19bd598492788e2bc6e5b32d2", "score": "0.5773966", "text": "showProfile(user) {\n this.profile.innerHTML = `\n <div class=\"card card-body mb-3\">\n <div class=\"row\" >\n <div class=\"col-md-3\">\n <img class=\"img-fluid mb-2\" src=\"${user.avatar_url}\">\n <a href=\"${user.html_url}\" target=\"_blank\" class=\"btn btn-primary btn-block mb-3\">View Profile</a>\n </div>\n <div class=\"col-md-9\">\n <span class=\"badge badge-primary mt-3\">Public Repos: ${user.public_repos}</span>\n <span class=\"badge badge-secondary mt-3\">Public Gists: ${user.public_gists}</span>\n <span class=\"badge badge-success mt-3\">Followers Repos: ${user.followers}</span>\n <span class=\"badge badge-info mt-3\">Following: ${user.following}</span>\n <br><br>\n <ul class=\"list-group\">\n <li class=\"list-group-item\">Company:${user.company}</li>\n <li class=\"list-group-item\">Website/Blog: ${user.blog}</li>\n <li class=\"list-group-item\">Location: ${user.location}</li>\n <li class=\"list-group-item\">Member Since: ${user.created_at}</li>\n </ul>\n </div>\n </div>\n </div>\n <h3 class=\"page-heading mb-3\">Latest Repos</h3>\n <div id=\"repos\"></div>\n `\n }", "title": "" }, { "docid": "57058a53dae23a2e315517f2ac7a874b", "score": "0.5769368", "text": "showProfile(user) {\n this.profile.innerHTML = `\n <div class='card card-body mb-3>\n <div class='row'>\n <div class='col-md-3'>\n <img class='img-fluid mb-2' src='${user.avatar_url}'>\n <a href='${user.html_url}' target = '_blank' class='btn btn-primary btn-block mb-4'>View Profile</a>\n </div>\n <div class='col-md-9'>\n <span class='badge badge-primary mr-1'>Public Repos: ${user.public_repos}</span>\n <span class='badge badge-secondary mr-1'>Public Gist(s): ${user.public_gists}</span>\n <span class='badge badge-success mr-1'>Followers: ${user.followers}</span>\n <span class='badge badge-info'>Following: ${user.following}</span>\n <br><br>\n <ul class='list-group'>\n <li class='list-group-item>Company: ${user.organizations_url}</li>\n <li class='list-group-item>Website/Blog: ${user.blog}</li>\n <li class='list-group-item>Location: ${user.location}</li>\n <li class='list-group-item>Member Since: ${user.created_at}</li>\n </ul>\n </div>\n </div>\n </div>\n <h3 class='page-heading mb-3'>Latest Repos</h3>\n <div id='repos'></div>\n `;\n }", "title": "" }, { "docid": "68a1e5a268b092b7d390bd84c6848d7f", "score": "0.57671976", "text": "function createGameBoard() {\n let cardHtml = \"\";\n for (let cardItem of shuffledCards) {\n let theCard = `<li class=\"card\" data-symbol=\"${cardItem}\"><i class=\"fa ${cardItem}\"></i></li>`;\n cardHtml += theCard;\n }\n gameDeck.innerHTML = cardHtml;\n}", "title": "" }, { "docid": "0166deff887fef8c39c251aa2c323116", "score": "0.5766236", "text": "function generateHTML(data) {\n data.forEach( data => {\n\n// Create variable elements for profile display\n const gallery = document.getElementById('gallery');\n const card = document.createElement('div');\n const imageContainer = document.createElement('div');\n const infoContainer = document.createElement('div');\n const image = document.createElement('IMG');\n const name = document.createElement('h3');\n const cardText = document.createElement('p');\n const cardTextCap = document.createElement('p');\n\n// Create variable attributes for profile display\n card.classList = 'card';\n imageContainer.classList = 'card-img-container';\n infoContainer.classList = 'card-info-container';\n image.classList = 'card-img';\n image.src = 'https://placehold.it/90x90';\n name.classList = 'card-name cap';\n cardText.classList = 'card-text';\n cardTextCap.classList = 'card-text cap';\n\n// Append elements to arrange display of profiles\n gallery.appendChild(card);\n card.appendChild(imageContainer);\n card.appendChild(infoContainer);\n imageContainer.appendChild(image);\n infoContainer.appendChild(name);\n infoContainer.appendChild(cardText);\n infoContainer.appendChild(cardTextCap);\n\n// Assign API attributes to display elements\n if (typeof(data.picture.medium) != 'undefined') {\n name.textContent = data.name.first + ' ' + data.name.last;\n cardText.textContent = data.email;\n cardTextCap.textContent = data.location.city + ', ' + data.location.state;\n }\n image.src = data.picture.medium;\n name.textContent = data.name.first + ' ' + data.name.last;\n cardText.textContent = data.email;\n cardTextCap.textContent = data.location.city + ', ' + data.location.state;\n });\n}", "title": "" }, { "docid": "a319617d714e964c703ef9f225aeb0c0", "score": "0.5753737", "text": "function getProfileCard(player, user) {\n\treturn {\"embed\": embed = {\n\t\tcolor: 6447003,\n\t\tauthor: {\n\t\t\tname: user.username,\n\t\t\ticon_url: user.avatarURL\n\t\t},\n\t\ttitle: \"Personaje de \" + user.username,\n\t\tdescription: player.description,\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: \"Nivel\",\n\t\t\t\tvalue: player.level\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"Dinero\",\n\t\t\t\tvalue: player.coins + \"€\"\n\t\t\t}\n\t\t]\n\t} }; // This double \"}\" is on purpose\n}", "title": "" }, { "docid": "33a084e23963eafddbcdbd48fa865bba", "score": "0.57485396", "text": "function parseContent() {\n $('.oer-squirrel-select-all-button').text($.i18n('button-select-all'));\n $('.oer-squirrel-deselect-all-button').text($.i18n('button-deselect-all'));\n\n //translate card box header by given\n $('.col-12').each(function () {\n $(this).find('.card-header').text($.i18n($(this).attr('id')));\n });\n //translate license options individually by label and input value\n $('#license-filter-box').find('label input').each(function () {\n var licenseVal = 'license-filter-' + ($(this).attr('value'));\n $(this).parent().find('span').text($.i18n(licenseVal));\n });\n }", "title": "" }, { "docid": "3b24635c549fbaebc04bb6c82b88c063", "score": "0.57474226", "text": "static renderHtml(data) {\n const div = document.createElement(\"div\");\n const container = document.querySelector(\"#result\");\n div.classList = \"user-details mt-4\";\n container.innerHTML = '';\n div.innerHTML = `\n \n <div class=\"card col-12\">\n <div class=\"card-body\">\n <div class=\"row\">\n <div class=\"col-sm-6 col-md-4\">\n <img src=\"${data.github.avatar_url}\" alt=\"\" width=\"350\" height=\"350\" class=\"img-rounded img-responsive\" />\n <a href=\"${data.github.html_url}\" target=\"_blank\" class=\"mt-3 btn btn-block btn-danger\">Visit profile</a>\n </div>\n <div class=\"col-sm-6 col-md-8\">\n\n <h4>${data.github.name}</h4>\n \n <p>${data.github.bio}</p>\n \n <p>\n Company: ${data.github.company}<br>\n Email: ${data.github.email}<br>\n Location: ${data.github.location}<br>\n Member Since: ${data.github.created_at}\n </p>\n <p>\n <span class=\"label label-default\">Public Repos: ${data.github.public_repos}</span>\n <span class=\"label label-danger\">Public Gists: ${data.github.public_gists}</span>\n <span class=\"label label-success\">Followers: ${data.github.followers}</span>\n <span class=\"label label-info\">Following: ${data.github.following}</span>\n </p>\n </div>\n </div>\n </div>\n \n </div>\n `;\n container.appendChild(div);\n }", "title": "" }, { "docid": "051df4781ce49918cffdc7df15ffd138", "score": "0.574225", "text": "function displayCountry(countries) {\n for (let country of countries) {\n const name = country.name;\n const domain = country.topLevelDomain;\n const capital = country.capital;\n const currency = country.currencies[0].name + \" \" + country.currencies[0].symbol + \" \" + country.currencies[0].code;\n const flag = country.flag;\n const countryCard = `\n <div class=\"col-lg-3 col-sm-4\">\n <div class=\"card mb-3\" style=\"max-width: 18rem;>\n <div class=\"row no-gutters\">\n <img src=\"${flag}\" class=\"card-img\" alt=\"country flag\">\n <div class=\"card-header\"><h3>${name}</h3></div>\n <div class=\"card-body\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\"><span><b>Top level domain:</b> <span class=\"answer\">${domain}</span></li>\n <li class=\"list-group-item\"><span><b>Capital:</b> <span class=\"answer\">${capital}</span> </li>\n <li class=\"list-group-item\"><span><b>Currencies:</b> <span class=\"answer\">${currency}</span> </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n \n `\n $(\"#allCards\").append(countryCard);\n }\n }", "title": "" }, { "docid": "c594ff38a7044980612c63195b5e872b", "score": "0.5738157", "text": "function generateCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\" ></i></li>`\n}", "title": "" }, { "docid": "03543619860820c76c43636743b56b84", "score": "0.57330245", "text": "function cardDeck(allcard) {\n return `<li class=\"card\"><i class=\"fa ${allcard}\"></i></li>`;\n }", "title": "" }, { "docid": "8d9e5d3023a068fede56b97cb4fbab6d", "score": "0.57324684", "text": "function render_html(pokemon_card) {\n const node = document.createElement('LI')\n node.classList.add('poke-card')\n node.innerHTML = pokemon_card\n pokedex.appendChild(node)\n}", "title": "" }, { "docid": "da54a1a6ac05985ef64eb34a16a40e29", "score": "0.5732425", "text": "function generateCard(card){\n return `<li class= \"card\" data-card= \"${card}\"><i class= \"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "8c83d003965e74702a56efabe2021f78", "score": "0.5731185", "text": "function userHtmlList() {\r\n var output = '';\r\n var prepend = '';\r\n for (x in g_user_client) {\r\n if (g_user_admin[x] == 1) prepend += '@';\r\n if (g_user_voice[x] == 1) prepend += '+';\r\n output += '<a href=\"#\" onclick=\"userHtmlUser('+g_user_client[x]+\");mboxView('user_div');\\\">\"+prepend+g_user_name[x]+'</a><br />';\r\n prepend = '';\r\n }\r\n print(\"ulist_div\", output);\r\n\r\n return;\r\n}", "title": "" }, { "docid": "3bc093e414de4ff525a57ece73369341", "score": "0.57298726", "text": "function displayCards() {\n let cards = shuffle(cardsList);\n cards.forEach(function(card) {\n $(deck).append(`<li class=\"card\"><i class=\"fa fa-${card}\"></i></li>`)\n });\n}", "title": "" }, { "docid": "cc428304e7d1ae8839881d475010fcfe", "score": "0.5722952", "text": "function render() {\n //select the container class\n let container = document.querySelector('.container');\n\n //creates a new array and calls MakeCard function on each element\n //joins each of the cards together\n let html = families.map(makeCard).join(\"\");\n container.innerHTML = html;\n}", "title": "" }, { "docid": "741b6ccde80cc16379835290f3011013", "score": "0.57216877", "text": "function cardMaker(obj) {\n const card = document.createElement(\"div\"),\n myImg = document.createElement(\"img\"),\n cardInfo = document.createElement(\"div\"),\n name = document.createElement(\"name\"),\n userN = document.createElement(\"p\"),\n gpsLoc = document.createElement(\"p\"),\n profile = document.createElement(\"p\"),\n profileLink = document.createElement(\"a\"),\n followers = document.createElement(\"p\"),\n following = document.createElement(\"p\"),\n bio = document.createElement(\"p\");\n\n card.classList.add(\"card\");\n cardInfo.classList.add(\"card-info\");\n name.classList.add(\"name\");\n userN.classList.add(\"username\");\n\n card.append(myImg, cardInfo);\n profile.append(\"Profile: \", profileLink);\n cardInfo.append(name, userN, gpsLoc, profile, followers, following, bio);\n\n myImg.src = obj.avatar_url;\n name.textContent = obj.name;\n userN.textContent = obj.login;\n gpsLoc.textContent = \"Location: \" + obj.location;\n profileLink.textContent = obj.html_url;\n profileLink.href = obj.html_url;\n followers.textContent = \"Followers: \" + obj.followers;\n following.textContent = \"Following: \" + obj.following;\n bio.textContent = obj.bio;\n\n console.log(card);\n return card;\n}", "title": "" }, { "docid": "b67669cb7212374ff4587e21ff81f7d2", "score": "0.5718667", "text": "function renderEachCard(object) {\n let container = document.querySelector('.filtered_container');\n let divElem = document.createElement('div');\n divElem.classList.add('card');\n let pElem = document.createElement('p');\n let linkElem = document.createElement('a');\n let img = document.createElement('img');\n pElem.textContent = object.INSTNM;\n let link = object.INSTURL.substring(0,5);\n if(link != 'https') {\n linkElem.href = 'https://' + object.INSTURL;\n } else {\n linkElem.href = object.INSTURL;\n }\n linkElem.target = '_blank';\n img.src = 'img/college.png';\n divElem.appendChild(img);\n divElem.appendChild(pElem);\n linkElem.appendChild(divElem);\n container.appendChild(linkElem);\n }", "title": "" }, { "docid": "2fde8c3445de15edfa90121bc75f6476", "score": "0.5717609", "text": "function renderizarUsuarios(personas) {\r\n $(\".box-title small\").text(sala);\r\n\r\n let html = \"\";\r\n\r\n html += `\r\n\t\t<li>\r\n\t\t\t<a href=\"javascript:void(0)\" class=\"active\">\r\n\t\t\t\tChat de <span>${sala}</span>\r\n\t\t\t</a>\r\n\t \t</li>\r\n\t`;\r\n\r\n personas.map(({ id, nombre }) => {\r\n html += `\r\n\t\t\t<li>\r\n\t\t\t\t<a data-id=\"${id}\" href=\"javascript:void(0)\">\r\n\t\t\t\t\t<img src=\"assets/images/users/1.jpg\" alt=\"user-img\" class=\"img-circle\">\r\n\t\t\t\t\t<span>${nombre} <small class=\"text-success\">online</small></span>\r\n\t\t\t\t</a>\r\n\t\t\t</li>\r\n\t\t`;\r\n });\r\n\r\n divUsuarios.html(html);\r\n}", "title": "" }, { "docid": "5986597fa7a641bc7623af3d325f90b0", "score": "0.57166237", "text": "function internationalMarketHTML(responseDataObj) {\n switch (sessionStorage.getItem('duStateLanguage')) {\n default:\n let outputHtmlString = \"\";\n let insideLoopHTML = \"\";\n responseDataObj.forEach(data => {\n insideLoopHTML += `<div class=\"du-row\"><div class=\"du-col-md-4\"><a href=\"#\" onClick=\"viewDuNewsPage('summaryPage', event);\">\n <img class=\"du-img-fluid width-100\" src=` + data.image.primary + `></div>\n <div class=\"du-col-md-8 du-mt-4\"><small class=\"title-under-img\">Markets - <span>10 minutes ago</span></small>\n <h5 class=\"title-img-description\">` + data.title + `</h5><p>` + data.teaser + `</p></a></div></div><hr>`\n });\n outputHtmlString = `<h4 class=\"exclusive-heading\">International Market</h4><a href=\"#\" class=\"view-all-text\" onClick=\"duListingNewsPage('summaryPage', event);\">See all<img class=\"pl-1\" src=\"https://du-widget.herokuapp.com/assets/images/path-487.svg\" alt=\"\"></a>` + insideLoopHTML;\n return outputHtmlString;\n break;\n case 'AR':\n let outputHtmlStringAr = \"\";\n let insideLoopHTMLAr = \"\";\n responseDataObj.forEach(data => {\n insideLoopHTMLAr += `<div class=\"du-row\"><div class=\"du-col-md-4\"><a href=\"#\" onClick=\"viewDuNewsPage('summaryPage', event);\">\n <img class=\"du-img-fluid width-100\" src=\"https://du-widget.herokuapp.com/assets/images/111.png\">\n </div><div class=\"du-col-md-8\"><small class=\"title-under-img\">محتوی الشریک - <span>قبل 3 ساعات</span></small>\n <h5 class=\"title-img-description\">متعامل يتابع أس الأسهم سوق الأسهم السعودية يرتفع بالختام بسيولة 4.4 مليار ريال بدعم القياديات</h5>\n <p>لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم نشأت بالفعل،\n وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء</p></a></div></div><hr>`\n });\n outputHtmlStringAr = `<h4 class=\"exclusive-heading\">الأسواق العالمية</h4><a href=\"#\" onClick=\"duListingNewsPage('summaryPage', event);\" \n class=\"view-all-text\">اظهار الكل <img class=\"pr-1 rotate180\" src=\"https://du-widget.herokuapp.com/assets/images/path-487.svg\" alt=\"\"></a>` + insideLoopHTMLAr;\n return outputHtmlStringAr;\n break;\n }\n}", "title": "" }, { "docid": "232c7fa5779a0b94c48303afba213529", "score": "0.57165265", "text": "function renderUsers(){\r\n inputSearch();\r\n\r\n // Filter users\r\n const filteredUser = allUsers.filter(user => {\r\n const lowName = user.name.toLowerCase();\r\n const lowInputName = inputUser.value.toLowerCase();\r\n return lowName.includes(lowInputName);\r\n })\r\n\r\n // Order by ascending letters\r\n filteredUser.sort((a,b) => {\r\n return a.name.localeCompare(b.name)\r\n })\r\n\r\n // Show information on HTML\r\n let UsersHTML = '<div>';\r\n filteredUser.forEach(user => {\r\n const { name, picture, dob, gender } = user;\r\n const UserHTML = `\r\n <div class='info'>\r\n <img class='pic' src=\"${picture}\" alt=\"${name}\">\r\n <span class = 'content'>${name}, ${dob}, ${gender}</span>\r\n </div> \r\n </div> \r\n `;\r\n\r\n UsersHTML += UserHTML;\r\n });\r\n UsersHTML += '</div>';\r\n tabUsers.innerHTML = UsersHTML;\r\n countUsers.innerHTML = filteredUser.length;\r\n \r\n renderStatistics(filteredUser);\r\n}", "title": "" }, { "docid": "8adb3ad1d81209826e0f51d6fc021d47", "score": "0.5710179", "text": "function GetUsersList() {\n let users = JSON.parse( localStorage.getItem('usersList') )\n\n const wrapper = document.getElementById(\"card-wrapper\")\n /* Vacia de contenido para evitar mostrar usuarios repetidos*/\n wrapper.innerHTML=\"\"\n\n /* Ciclo que muestra cada uno de los usuarios. */\n for(let i = 0 ; i < users.length; i++){\n wrapper.innerHTML += `\n <div class=\"card\">\n <h4>${users[i].name} ${users[i].lastName}</h4>\n <h5>${users[i].email}</h5>\n <button onclick=\"DeleteUser(${i})\" class=\"danger\">Eliminar</button>\n <button onclick=\"ChangeToEditUser(${i})\">Editar</button>\n </div>\n `\n }\n\n}", "title": "" }, { "docid": "e6f81b2787621bc4f47c76e2a8e3e647", "score": "0.5699401", "text": "function makeEmployeeCard(data) {\n const employeeCard = data.map(employee => `\n <div class=\"employee-card\" id=\"${employee.email}\">\n <img src=\"${employee.picture.large}\" alt=\"profile-pic\">\n <div class=\"employee-info\">\n <h2>${employee.name.first} ${employee.name.last}</h2>\n <p class=\"email\">${employee.email}</p>\n <p>${employee.location.city}</p>\n </div>\n </div>\n `).join(\"\")\n directory.innerHTML = employeeCard;\n}", "title": "" }, { "docid": "181af6f6cb92f00e0846b44eb0f87e64", "score": "0.5698603", "text": "card() {\n return(\n `<div class=\"card m-auto\" style=\"width: 18rem;\">\n <div class=\"card-header\">\n <h1>${this.name}</h1>\n <h2>Engineer 🖥️</h2>\n </div>\n <div class=\"card-body\">\n <ul class=\"list-group\">\n <li class=\"list-group-item\">ID: ${this.id}</li>\n <li class=\"list-group-item\">Email: <a href = \"mailto: ${this.email}\">${this.email}</a></li>\n <li class=\"list-group-item\">Github: <a href = \"https://github.com/${this.github}\" target=\"_blank\">${this.github}</a></li>\n </ul>\n </div>\n </div>\n `);\n }", "title": "" }, { "docid": "b89c9e5c6488ff1c17c812657ad8285a", "score": "0.56923616", "text": "function profileHTML(userData, githubData, githubStarsData) {\n return `\n <!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <title>${githubData.data.name}'s Profile</title>\n <!--Bootstrap-->\n <link\n rel=\"stylesheet\"\n href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css\"\n integrity=\"sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh\"\n crossorigin=\"anonymous\"\n />\n <!--CSS-->\n <style>\n .user-color {\n background-color: ${userData.color};\n }\n body {\n background-color: #ddd;\n color: #fff;\n }\n\n h3 {\n color: #333;\n }\n\n .header-position {\n position: relative;\n top: 60px;\n border-radius: 3px;\n padding: 20px;\n padding-top: 0;\n }\n\n .header-position img {\n position: relative;\n top: -40px;\n border-radius: 50%;\n border: 9px solid #fff;\n }\n\n .header-links a,\n .header-links a:hover,\n .header-links a:active,\n .header-links a:visited {\n color: white;\n text-decoration: none;\n margin: 10px 25px;\n font-weight: 700;\n }\n\n section {\n background-color: #fff;\n padding: 85px 0 20px;\n }\n\n .data-card {\n margin: 30px;\n padding: 20px;\n border-radius: 3px;\n }\n </style>\n </head>\n <body>\n ${generateHeader(githubData)}\n <section>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col text-center\">\n <h3>${githubData.data.bio}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-6\">\n <div class=\"data-card user-color text-center\">\n <h5>Public Repositories:</h5>\n <p>${githubData.data.public_repos}</p>\n </div>\n </div>\n <div class=\"col-sm-6\">\n <div class=\"data-card user-color text-center\">\n <h5>Followers:</h5>\n <p>${githubData.data.followers}</p>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-6\">\n <div class=\"data-card user-color text-center\">\n <h5>GitHub Stars:</h5>\n <p>${githubStarsData.data.length}</p>\n </div>\n </div>\n <div class=\"col-sm-6\">\n <div class=\"data-card user-color text-center\">\n <h5>Following:</h5>\n <p>${githubData.data.following}</p>\n </div>\n </div>\n </div>\n </div>\n </section>\n </body>\n</html>\n `;\n}", "title": "" }, { "docid": "1f8ac14d0aedf16c05e7be9a2081e284", "score": "0.5679834", "text": "function showUser(user) {\n //2. set the contents of the h2 and the two div elements in the div '#profile' with the user content\n $(\"#profile\").find(\"h2\").text(user.name);\n $(\".avatar\").prepend('<img src=\"'+user.avatar_url+'\" width=\"100px\" height=\"100px\"/>')\n $(\".information\").prepend('<a href=\"'+user.html_url+'\">Github Url</a></br><a href=\"'+user.repos_url+'\">Repo Url</a>');\n}", "title": "" }, { "docid": "0e7c7e3a649a3022008f40626768bdd1", "score": "0.56791973", "text": "render() {\n let page = (\n <div>\n <Container>\n <Card className=\"card border-primary mb-3\">\n <CardBody>\n <CardTitle>Home</CardTitle>\n <CardSubtitle>Welcome, {this.state.users[1].name}.</CardSubtitle>\n <CardText>\n Enjoy!\n </CardText>\n </CardBody>\n </Card>\n </Container>\n </div>);\n return page;\n }", "title": "" }, { "docid": "26a915db654bfdff1ef13d23a9283e9a", "score": "0.56751424", "text": "function Character({data}) {\n return (\n\n \n <div class=\"card\">\n <div class=\"card-body\">\n <ul>\n <h5 class=\"card-title text-center\">name: {data.name}</h5>\n <li class=\"card-text\">born: {data.born}</li>\n <li class=\"card=text\">died: {data.died}</li>\n <li class=\"card=text\">culture: {data.culture}</li>\n </ul>\n </div>\n </div>\n \n )\n\n\n\n}", "title": "" }, { "docid": "1706131928db5fef13924f5aa4c66227", "score": "0.5671012", "text": "function userDisplay(myUser)\n{\n document.getElementById('name').innerHTML = userAry[myUser].firstName + \" \" + userAry[myUser].lastName;\n document.getElementById('num').innerHTML = userAry[myUser].phoneNum\n document.getElementById('email').innerHTML = userAry[myUser].emailAdd\n document.getElementById('link').href = \"https://\" + userAry[myUser].theLink\n document.getElementById('img').src = userAry[myUser].theImg\n \n}", "title": "" }, { "docid": "a14586b3ab00399a0ea0b7430b706e58", "score": "0.56697255", "text": "function montarComentario(user, texto) {\n\n return `<article>\n\n <img class=\"img-user\" src=\"img/user.jpg\" alt=\"Foto de Usuario Anonimo\">\n <h4 class=\"user\">Anonymous</h4>\n\n <p class=\"comment-text\"><a class=\"user-text\">${user}</a> ${texto}</p>\n\n <div class=\"response\">\n\n <a class=\"reply\">Reply</a>\n <i class=\"fa fa-thumbs-up\" aria-hidden=\"true\"></i><span class=\"likeCount\">0</span>\n <i class=\"fa fa-thumbs-down\" aria-hidden=\"true\"></i><span class=\"dislikeCount\">0</span>\n\n <div class=\"reply-a-comment hidden\">\n <textarea class=\"reply-comment\" rows=\"8\" cols=\"80\" placeholder=\"Reply this comment\"></textarea>\n <a class=\"sendReply\">Send</a>\n </div>\n\n </div>\n </article>`;\n\n}", "title": "" }, { "docid": "0b6b1dea3a3b212187c6144d6cbcb71a", "score": "0.5668671", "text": "getCard(){\n return`\n <div class=\"column is-one-fifth\">\n <div class=\"card\">\n <header class=\"card-header \">\n <p class=\"card-header-title\">\n ${this.name}\n </p>\n </header>\n <div class=\"card-content\">\n <ul>\n <li>Job Title: Engineer</li>\n <li>ID: ${this.id}</li>\n <li>Email: ${this.email}</li>\n <li>GitHub: ${this.github}</li>\n </ul> \n </div>\n </div>\n </div>\n \n `\n\n }", "title": "" }, { "docid": "ce9dfc82e33d9c61092a4fccd9a5781d", "score": "0.5660956", "text": "function display(data){ \n\n for(let i = 0; i < showCard.length; i ++){\n let name = employees[i].name;\n let email = employees[i].email;\n let city = employees[i].location.city;\n let picture = employees[i].picture;\n\n if(showCard.display !== \"none\"){\n employeeHTML += `\n <div class=\"card show\" data-index=\"${i}\">\n `;\n }else{\n employeeHTML += `\n <div class=\"card\" data-index=\"#\">\n `;\n }\n // setup HTML code and store it in variable\n employeeHTML += `\n <img class=\"avatar\" src=\"${picture.large}\" alt=\"profile pic\">\n <div class=\"text-container\">\n <h2 class=\"name\">${name.first} ${name.last}</h2>\n <p class=\"email\">${email}</p>\n <p class=\"address\">${city}</p>\n </div>\n </div>\n `;\n }\n // add HTML code to card container in HTML\n listContainer.innerHTML = employeeHTML;\n}", "title": "" }, { "docid": "fc7d30ae2d611624fc00b7224e1233d4", "score": "0.5655564", "text": "function outputUsers(users) {\r\n userList.innerHTML = `\r\n ${users.map(user => `<li>${user.username}</li>`).join('')}`;\r\n // userList.innerHTML = '';\r\n // users.forEach((user) => {\r\n // const li = document.createElement('li');\r\n // li.innerText = user.username;\r\n // userList.appendChild(li);\r\n // });\r\n }", "title": "" }, { "docid": "56669944608f60c60aacc560e504ef1d", "score": "0.5653001", "text": "function generateHtml(cardArray) {\n let output = \"\";\n for(const card of cardArray) {\n output = `${output}\n<div class=\"card-outer\">\n <i class=\"${card} card-front\"><img src=\"img/${card}.jpg\"></i><i class=\"card-back card-open\"><img src=\"img/seed.jpg\"></i>\n</div>`;\n }\n return output;\n}", "title": "" }, { "docid": "38fe1cf0850669baf1dec3a9f6e0a25b", "score": "0.5652087", "text": "function generateCard(card) {\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "3c406670c5c3f61d87c9a31a510fc1da", "score": "0.56512564", "text": "function generateCard(card){\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "title": "" }, { "docid": "f312591ae71b00c06941b7fcac9a16c4", "score": "0.56462866", "text": "function initGame(){\n shuffle(cards);\n const cardHtml = cards.map(function getCardTemplate(card){\n return `<li class=\"card\"><i class=\"fa ${card}\"></i></li>`;\n });\n gameDeck.innerHTML = cardHtml.join(' ');\n}", "title": "" }, { "docid": "06dfd7ebace85e7bf1569c30266a531a", "score": "0.56461287", "text": "function createHTMLCard(cardName){\n $(\"ul.deck\").append(`<li class=\"card\"><i class=\"fa ${cardName}\"></i></li>`);\n}", "title": "" }, { "docid": "52a64b2fbb0d36ebc4222c331f48c786", "score": "0.5645817", "text": "displayProfile(profile) {\n this.profile.innerHTML = \n `\n <div class=\"card\">\n <div class=\"card-body\">\n <div class=\"row align-items-center\">\n <div class=\"col-12 col-sm-12 col-md-4 col-lg-3 col\">\n <figure>\n <img style=\"width:100%\" src=\"${profile.avatar_url}\" alt=\"Avatar\">\n </figure>\n <form action=\"${profile.html_url}\" target=\"_blank\">\n <button type=\"submit\" class=\"mt-3 mb-3 btn btn-primary btn-block\">View Profile</button>\n </form>\n </div>\n <div class=\"col\">\n <span class=\"badge badge-primary\">Public Repos: ${profile.public_repos}</span>\n <span class=\"badge badge-success\">Public Gists: ${profile.public_gists}</span>\n <span class=\"badge badge-info\">Followers: ${profile.followers}</span>\n <span class=\"badge badge-warning\">Following: ${profile.following}</span>\n <div class=\"profile-info mt-2\">\n <ul class=\"list-group text-primary\">\n <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n <h3 class=\"m-0\">${profile.name}</h3> aka ${profile.login}\n </li>\n <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n Bio: ${profile.bio}\n </li>\n <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n Company: ${profile.company} - ${profile.location}\n </li>\n <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n Website: ${profile.blog}\n </li>\n <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n Member since: ${profile.created_at}\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n `\n }", "title": "" }, { "docid": "a329974bad56bc11e850a67a2d617bc0", "score": "0.5643607", "text": "function populateCards() {\n let cardsContainer = document.getElementById('cards')\n let output = ''\n blogData.forEach(card => {\n output += ` \n <div>\n <img src=${card.imgUrl} alt=\"card-image\" />\n <div class='catAndUsername'>\n <div>${card.category}</div>\n <div> by ${card.username}</div>\n </div>\n <div>${card.title}</div>\n <button onclick=\"deleteCard(${card.id})\">Delete</button>\n </div>\n `\n })\n\n cardsContainer.innerHTML = output\n}", "title": "" }, { "docid": "6d93507897bfccda314a25e101eda3a4", "score": "0.56422937", "text": "loadUser(user) {\n localStorage.setItem(this.tokenStorageKey, user.id);\n const userUrl = `${this.userUrl.replace(':user:', user.login)}?${this.accessToken}`;\n fetch(userUrl)\n .then(response => response.json())\n .then(user => this.transformUser(user))\n .then(user => {\n const source = document.querySelector('#vcard').innerHTML;\n const template = Handlebars.compile(source);\n document.querySelector(this.vcard).insertAdjacentHTML('beforeend', template(user))\n })\n .catch(error => this.handleError(error));\n return user;\n }", "title": "" }, { "docid": "4e92ec6d55e525278963bbcdee69fedc", "score": "0.5632065", "text": "function contentCard(responseData) {\n let stars = createStar(responseData);\n let score = responseData[\"sub-title\"];\n let itemCard = `\n <div class=\"card mb-2 border border-0\">\n <div class=\"card-img-top img-fluid d-flex justify-content-center align-items-center\">\n <img\n class=\"img-top\"\n src=${responseData.thumb_url}\n alt=\"Diagonal Smile\"\n />\n <img class=\"img-play\" src=\"images/play.png\" alt=\"play\" />\n </div>\n <div class=\"card-body-tutorial align-self-center\">\n <h4 class=\"card-title-tutorial text-left font-weight-bold mt-3\">\n ${responseData.title}\n </h4>\n <p class=\"card-text-tutorial text-left\">\n ${score}\n </p>\n <div class=\"author d-flex flex-row justify-content-start\">\n <img\n class=\"img-author\"\n src=${responseData.author_pic_url}\n alt=\"Phillip Massey\"\n />\n <p class=\"name-author ml-3 align-self-center mb-0\">\n ${responseData.author}\n </p>\n </div>\n <div class=\"score-time mt-2 d-flex flex-row justify-content-between\">\n ${stars}\n <p class=\"time\">${responseData.duration}</p>\n </div>\n </div>\n </div>\n `;\n return itemCard;\n }", "title": "" }, { "docid": "6f130e771657d1bac4da61beaa8307d3", "score": "0.5628046", "text": "function displayUser(userSnapshot) {\n \n // Extract our JSON style user data from Firebase's data snapshot using the Firebase .val() method\n let user = userSnapshot.val();\n \n // CREATE NEW HTML ELEMENTS:\n // <section> \n // <h2 class=\"displayname\">...</h2>\n // <img class=\"profilephoto\" src=\"...\">\n // <p class=\"favlanguage\">...</p>\n // </section>\n\n let userSectionElement = document.createElement(\"section\");\n let userNameElement = document.createElement(\"h2\");\n let userEmailElement = document.createElement(\"p\");\n let userImageElement = document.createElement(\"img\");\n let userLangElement = document.createElement(\"p\");\n \n // Set class names on the HTML elements (we use these to apply CSS rules from styles.css file based on class names)\n userSectionElement.className = \"profile-section\";\n userNameElement.className = \"displayname\";\n userEmailElement.className = \"email\";\n userImageElement.className = \"profilephoto\";\n userLangElement.className = \"favlanguage\";\n\n // Put user data inside the elements accordingly\n userNameElement.textContent = user.displayName;\n userEmailElement.textContent = user.email;\n userLangElement.textContent = \"Favorite language: \" + user.favLanguage; \n userImageElement.src = user.photoURL;\n\n // Put these HTML elements all inside the <section> element\n userSectionElement.appendChild(userNameElement);\n userSectionElement.appendChild(userEmailElement);\n userSectionElement.appendChild(userImageElement);\n userSectionElement.appendChild(userLangElement);\n \n // Put the <section> element inside usersListElement (<div id=\"userslist> ... </div>)\n usersListElement.appendChild(userSectionElement);\n}", "title": "" }, { "docid": "bf6aacd8c615abe521dcd4e295542685", "score": "0.56255984", "text": "function outputUsers(users) {\n usersList.innerHTML = `\n ${users.map(user => `<li>${user.name} ${(username === user.name) ? '(You)' : ''}</li>`).join('')}\n `;\n}", "title": "" }, { "docid": "573a6408da3c159c49c4a79ecdb7277e", "score": "0.5621719", "text": "function UserCard(props) {\n const { allUsers, Match } = props;\n const userId = parseInt(Match.params.id, 10);\n\n const user = allUsers.filter(myUser => myUser.id === userId);\n\n if (user.length < 1) {\n return (\n <div>\n <p>User not found</p>\n <Link to=\"/\">Go back</Link>\n </div>\n );\n } else {\n return (\n <ul className=\"card-container\">\n {user.map(user => {\n return (\n <div className=\"row\" key={user.id}>\n <div className=\"col s12 m7\">\n <span className=\"name-card\">{user.name}</span>\n <div className=\"card\">\n <div>\n <div className=\"image-container\" />\n <img\n className=\"image-user\"\n src={profileImage}\n alt=\"user profile\"\n />\n </div>\n <div className=\"card-content\">\n <span className=\"content-space\">\n <strong>Email:</strong>\n </span>\n <p>{user.email}</p>\n <span className=\"content-space\">\n <strong>Website:</strong>\n </span>\n <p>{user.website}</p>\n <span className=\"content-space\">\n <strong>Company:</strong>\n </span>\n <p>{user.company.name}</p>\n <span className=\"content-space\">\n <strong>Phone:</strong>\n </span>\n <p>{user.phone}</p>\n <div className=\"back\">\n <Link to={\"/\"}>\n <button className=\"btn waves-effect waves-light\">\n Go back\n </button>\n </Link>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n })}\n </ul>\n );\n }\n}", "title": "" }, { "docid": "5c64cefaa98f43826e1edb546aec6aa9", "score": "0.5619501", "text": "function recommended_cards(response,cardhtml){\n array = JSON.parse(response)['newforuser'];\n console.log(array);\n\n $(\"#recommended-cards\").hide();\n $(\"#recommended-cards\").text(\"\");\n $(\"#recommended-cards\").append('<div class=\"row\">');\n counter = 1;\n array.forEach(function(element,index) {\n $(\"#recommended-cards\").append('<div id=\"recommended-card-'+index+'\">'+cardhtml+'</div>');\n $(\"#recommended-card-\" +index+\" .card-title\").text(element[6]);\n var now = new Date();\n dateFormat(now, \"dddd, mmmm dS, yyyy, h:MM:ss TT\");\n $(\"#recommended-card-\" +index+\" .card-text\").html($.trim(element[2])+\", \"+$.trim(element[1])+'<br>'+$.trim(dateFormat(now, \"dddd, mmmm dS, yyyy, h:MM:ss TT\")));\n $(\"#recommended-card-\" +index+\" .img-fluid\").attr(\"src\",element[8]);\n\n if (counter == 4){\n counter = 0;\n $(\"#recommended-cards\").append('</div><div class=\"row\">');\n }\n counter++;\n });\n $(\"#recommended-cards\").append('</div>');\n $(\"#recommended-cards\").fadeIn(1000);\n \n}", "title": "" }, { "docid": "be309842d501a8108f8e19b2ac019270", "score": "0.5618862", "text": "showProfile(user){\n this.profile.innerHTML = `\n <div class=\"card card-body mb-3\">\n <div class=\"row\">\n <div class=\"col-md-3\">\n <img class=\"img-fluid mb-2 w-100 d-flex justify-content-center\" src=\"${user.avatar_url}\">\n <a href=\"${user.html_url} target=\"_blank\" class=\"btn btn-primary btn-block mb-4\">View Profile</a>\n </div> \n <div class=\"col-md-9\">\n <span class=\"badge badge-dark\">Public Repos: ${user.public_repos}</span>\n <span class=\"badge badge-success\">Public Gists: ${user.public_gists}</span>\n <span class=\"badge badge-warning\">Followers: ${user.followers}</span>\n <span class=\"badge badge-info\">Following: ${user.following}</span>\n\n <br><br>\n <ul class=\"list-group\">\n <li class=\"list-group-item\">Company: <span class=\"font-weight-bold\">${user.company}</span></li>\n <li class=\"list-group-item\">Website/Blog: <span class=\"font-weight-bold\"><a href=\"${user.blog}\" target=\"_blank\">${user.blog}</a></span></li>\n <li class=\"list-group-item\">Location: <span class=\"font-weight-bold\">${user.location}</span></li>\n <li class=\"list-group-item\">Member since: <span class=\"font-weight-bold\">${user.created_at}</span></li>\n </ul>\n </div> \n </div>\n </div>\n <h3 class=\"page-heading mb-3\">10 Latest Repos</h3>\n <div id=\"repos\">\n \n </div>\n `;\n }", "title": "" }, { "docid": "0425c6bec5c48caa1c86276915dd18c5", "score": "0.56174964", "text": "function uProfileDivDisplay(currentUser, u_hand) {\n \n const uProfileDiv = document.querySelector('.u-profile')\n uProfileDiv.innerText = ''\n\n // let h1 = document.createElement('h1')\n // h1.innerText = currentUser.attributes.name\n\n // let m = document.createElement('p')\n // m.innerText = 'TOKENS: ' + currentUser.attributes.tokens\n\n // let p = document.createElement('p')\n // p.innerText = 'BET: ' + u_hand.bet\n\n // uProfileDiv.append(h1, m, p)\n\n const imageDiv = document.createElement('div')\n imageDiv.className = 'game-profile-picture-container'\n const playerImage = document.createElement('img')\n playerImage.className = 'game-player-image'\n playerImage.src = currentUser.attributes.picture\n imageDiv.append(playerImage)\n\n const h1Div = document.createElement('div')\n h1Div.className = 'game-player-name-container'\n const h1 = document.createElement('h1')\n h1.className = 'game-player-name'\n h1.innerText = currentUser.attributes.name\n h1Div.append(h1)\n \n const tokenDiv = document.createElement('div')\n tokenDiv.className = 'game-token-container'\n const money = document.createElement('p')\n money.className = 'game-player-tokens'\n money.innerText = 'TOKENS: ' + currentUser.attributes.tokens\n tokenDiv.append(money)\n\n const betDiv = document.createElement('div')\n betDiv.className = 'game-bet-container' \n const p = document.createElement('p')\n p.className = 'game-player-bet'\n p.innerText = 'BET: ' + u_hand.bet\n betDiv.append(p)\n uProfileDiv.append(imageDiv, h1Div, tokenDiv, betDiv)\n\n}", "title": "" }, { "docid": "0315022247cbcd652a4f4a25d5d37915", "score": "0.56149894", "text": "function createCards() {\n let shuffledItems = shuffleCards(cardsArr);\n let output = '';\n\n shuffledItems.forEach(item => {\n output += `\n <li class=\"card animated\" type=\"${item}\">\n <i class=\"fas fa-${item}\"></i>\n </li>\n `;\n });\n document.querySelector('.game-screen-wrapper').innerHTML = output;\n}", "title": "" } ]
974723776b9dd1f05cb97ffea04bc1fe
Calls readFileContent and displayNudges
[ { "docid": "736ac57f67ade86340dafd6bf90c5eec", "score": "0.68301195", "text": "function display(data) {\n readFileContent(data).then(content => {\n var obj = JSON.parse(content)\n console.log(obj)\n displayNudges(obj)\n }).catch(error => console.log(error))\n}", "title": "" } ]
[ { "docid": "58ddaca558863d7e706b387181636bfa", "score": "0.54583234", "text": "analyze() {\n this.getSpeeches(this.data);\n this.countLines(this.speeches, this.dict);\n this.deleteAll(this.dict);\n this.sortLines(this.dict);\n this.printSortedDict(this.sortedDict);\n }", "title": "" }, { "docid": "6875b76534d6de937d0f0b54ffc04277", "score": "0.5437926", "text": "readFileData(fileName) {\r\n Neutralino.filesystem.readFile(fileName,\r\n function (data) {\r\n console.log('Read file :', data);\r\n var contentElem = document.querySelector('.content');\r\n if (data && data.content) {\r\n console.log('Parse file data :', JSON.parse(data.content));\r\n if (JSON.parse(data.content).content) {\r\n contentElem.innerHTML = JSON.parse(data.content).content;\r\n }\r\n }\r\n\r\n },\r\n function (error) {\r\n console.error('Error in readFile : ', error);\r\n }\r\n );\r\n }", "title": "" }, { "docid": "fdd5375ffebfcca23c7f5ec2a118bfd2", "score": "0.527227", "text": "function readFile(fileEntry)\n{\n\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n var xml = StringtoXML(this.result);\n if(xml == null)\n {\n return;\n }\n\n noFileForInport = false;\n // ---- read code drop-down list\n\n\n /*\n var options = xml.getElementsByTagName(\"option\");\n if(options.length>2)\n {\n $( \"#code\" ).empty();\n for (var i = 0; i < options.length; i++) {\n var option = options[i].firstChild.nodeValue;\n $( \"#code\" ).append($(\"<option></option>\").attr(\"value\", option).text(option));\n }\n }\n */\n\n // ---- end read category drop-down list\n db.importCode(xml);\n db.importSheets(xml);\n db.importHowPaid(xml);\n //db.FSsummaryImport(xml);\n db.importLastSyncDate(xml);\n\n\n };\n reader.readAsText(file);\n workOn(dir,\"metaSave\");\n db.setLastSync();\n });\n}", "title": "" }, { "docid": "5b2ac76936a3fbd73269f1b6fd2fcf28", "score": "0.5262368", "text": "async function renderFile(directory, file) {\n\n // // getting this set up for permalinks\n // const extension = window.location.pathname\n // + '/?directory=' + encodeURIComponent(directory)\n // + '&file=' + encodeURIComponent(file);\n // history.pushState({}, null, extension);\n\n if (views[directory + '/' + file]) {\n return views[directory + '/' + file];\n }\n\n\n const header = document.createElement('h2');\n header.innerHTML = directory + '/' + file;\n\n\n const gitHubButton = document.createElement('button');\n gitHubButton.innerHTML = 'read file on GitHub';\n\n const gitHubA = document.createElement('a');\n gitHubA.href = 'https://github.com/' + userName + '/' + repoName + '/tree/master/' + directory + '/' + file;\n gitHubA.target = '_blank';\n gitHubA.appendChild(gitHubButton);\n gitHubButton.style.height = '30px';\n\n\n const backButton = document.createElement('button');\n backButton.innerHTML = 'table of contents';\n backButton.onclick = () => {\n console.clear();\n console.log(views.tableOfContents.console);\n\n document.getElementById('root').innerHTML = '';\n document.getElementById('root').appendChild(views.tableOfContents.dom);\n };\n backButton.style.height = '30px';\n\n\n const code = await fetch('./' + directory + '/' + file)\n .then(resp => resp.text())\n .then(fileText => fileText);\n\n const codeEl = document.createElement('code');\n codeEl.innerHTML = code;\n codeEl.className = \"language-js line-numbers\";\n\n const pre = document.createElement('pre');\n pre.appendChild(codeEl);\n pre.style.fontSize = '80%';\n Prism.highlightAllUnder(pre);\n\n const container = document.createElement('div');\n container.appendChild(header);\n container.appendChild(gitHubA);\n container.appendChild(backButton);\n container.appendChild(pre);\n\n views[directory + '/' + file] = { dom: container, console: code };\n\n return Promise.resolve({ dom: container, console: code });\n}", "title": "" }, { "docid": "373c00e934d858a4abb6a72ba5a7fe67", "score": "0.52446723", "text": "readFile() {\r\n try {\r\n const response = fs.readFileSync(this.fileName, 'utf8');\r\n this.raw.push(response);\r\n this.data = this.raw[0].split('\\r\\n');\r\n } catch(err) {\r\n return('Error: ', err.stack);\r\n }\r\n }", "title": "" }, { "docid": "be5ea14b33180edfba456b389edd1bc6", "score": "0.5233915", "text": "function loadTableFromGithub() {\n\n repo.getContents(\"master\",\"AuthorizedUsers.txt\",true,\n function(err,stuff) {\n console.log(stuff);\n table.setData(stuff);\n }\n );\n}", "title": "" }, { "docid": "d0448852d08729b90aef1fcc14e19d65", "score": "0.5196852", "text": "function readFile() {\n\tipcRenderer.send(\"load_dialog\", {\n\t\tdo: \"load_dialog\",\n\t});\n}", "title": "" }, { "docid": "4a1ef5fdf7019bad12cc9f55eea58a42", "score": "0.51897854", "text": "function displayContent(filename, done){\n //readfile takes in two parameters--- filename and callback\n fs.readFile(filename, (err, data) => {\n if (err) throw err;\n let output = data;\n done(output);\n });\n}", "title": "" }, { "docid": "93242eccc7296f3f1a28bda08bb70c82", "score": "0.51509196", "text": "async function ViewRepositoryFiles(repofullName) {\r\n console.log(repofullName);\r\n content.innerHTML = \"\";\r\n var repofilesApi = \"https://api.github.com/repos/\" + repofullName + \"/contents\";\r\n var repofilesRequest = await (await fetch(repofilesApi)).json();\r\n if (repofilesRequest.length > 0) {\r\n return handleRepofiles(repofilesRequest);\r\n }\r\n else {\r\n error_me.innerHTML = \"Oooops..No Records Found!!!\";\r\n document.getElementById(\"content\").innerHTML = error_me.outerHTML;\r\n }\r\n}", "title": "" }, { "docid": "dfa0f3cbfda929cd83198f43cde5efce", "score": "0.5144278", "text": "function readFile(evt) {\n let file = evt.target.files[0];\n if (file) {\n let reader = new FileReader();\n\n reader.onload = function (loadEvent) {\n let stringData = loadEvent.target.result;\n\n //Formatting string data into an array of numbers. Removes n spaces, replacing with 1, then splits by this space into a number array.\n let data = stringData\n .replace(/[^0-9\\-\\.]/g, \" \")\n .replace(/\\s\\s+/g, \" \")\n .split(\" \")\n .map(Number);\n\n //Ensures that data is of sufficient length\n if (data.length <= 1) {\n document.getElementById(\"btnAttachment\").innerHTML =\n \"Data is too short\";\n return;\n }\n //Call the update script\n computeAndUpdatePage(data);\n };\n reader.readAsText(file);\n } else {\n //Reading file failed. Button is updated to display this error.\n document.getElementById(\"btnAttachment\").innerHTML =\n \"Cannot Read From This File\";\n }\n}", "title": "" }, { "docid": "b5e53a5c56af16060cab38006352101a", "score": "0.51337045", "text": "function readFile() {\n // window.alert(\"readfile called\");\n\n // Get the file from the file entry\n fileEntryGlobal.file(function (file) {\n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n \n reader.onloadend = function() {\n\n // window.alert(\"Successful file read: \" + this.result);\n \n\n // console.log(\"Successful file read: \" + this.result);\n // window.alert(\"file path: \" + fileEntryGlobal.fullPath);\n\n // console.log(\"file path: \" + fileEntryGlobal.fullPath);\n contentGlobal = this.result;\n \n\n };\n }, onError);\n}", "title": "" }, { "docid": "ddc1573150a866b7bf3f5e24aa2b4315", "score": "0.51132447", "text": "function display(description, data) {\n //console.log(description + data);\n appendFile(description + data + \"\\n\");\n}", "title": "" }, { "docid": "bc5e6873fbf86417a69ea8aae022c724", "score": "0.5108649", "text": "function readFile() {\n\n // Get the file from the file entry\n fileEntryGlobal.file(function (file) {\n\n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n\n reader.onloadend = function () {\n\n console.log(\"Successful file read: \" + this.result);\n console.log(\"file path: \" + fileEntryGlobal.fullPath);\n contentGlobal = this.result;\n };\n\n }, onError);\n}", "title": "" }, { "docid": "d7dca84ac9b0e7b40804f213bd7dc5ac", "score": "0.51057726", "text": "async function main(){\n\ttry {\n\t\tconst files = ['chapter1.txt', 'chapter2.txt', 'chapter3.txt'];\n\t\tfor (x in files) {\n\t\t\tconst chapters = files[x];\n\t\t\tconst jsonFile = chapters.replace('.txt', '.result.json');\n\t\t\tfsp.exists(jsonFile, async function(exists){\n\t\t\t\tconst debugFile = chapters.replace('.txt', '.debug.txt');\n\t\t\t\t//If no result file is found, get the contents of the file using getFileAsString\n\t\t\t\t//Simplify the text, and store that text in a file named fileName.debug.txt\n\t\t\t\tconst sim = await textMetrics.simplify(await fileData.getFileAsString(chapters));\n\t\t\t\tawait fileData.saveStringToFile(debugFile, sim);\n\t\t\t\t//Run the text metrics, and store those metrics in fileName.result.json\n\t\t\t\tawait fileData.saveJSONToFile(jsonFile, textMetrics.createMetrics(sim));\n\t\t\t\t/*\n\t\t\t\tCheck if a corresponding result file already exists for this file, \n\t\t\t\tif so query and print the result already stored.\n\t\t\t\tprint the resulting metrics\n\t\t\t\t*/\n\t\t\t\tconsole.log(exists ? jsonFile + \" already stored\" : await fileData.getFileAsString(jsonFile));\n\t\t\t});\n\t\t}\n\t} catch (err) {\n\t\tthrow err;\n\t}\n}", "title": "" }, { "docid": "46233a3035c7c86208f4d0d91161a852", "score": "0.5024541", "text": "async function readAndInsertStudys () {\n try {\n // Clear previous ES index\n await esConnection.resetIndex()\n\n let files = fs.readdirSync('./BIBTertiarystudies').filter(file => file.slice(-4) === '.txt')\n console.log(`Found ${files.length} Files`)\n\n // Read each Study file, and index each paragraph in elasticsearch\n for (let file of files) {\n console.log(`Reading File - ${file}`)\n const filePath = path.join('./BIBTertiarystudies', file)\n const { title, author, keywords, abstract } = parseStudyFile(filePath, file)\n await insertStudyData(title, author, keywords, abstract)\n }\n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "3640a3bdd3235aea1aaf395a30451c60", "score": "0.49896976", "text": "function _display_material_file() {\n\t\t\ttry {\n\t\t\t\tvar db = Titanium.Database.open(self.get_db_name());\n\t\t\t\tvar i = 0;\n\t\t\t\tvar b = self.data.length;\n\t\t\t\tvar asset_row = db.execute('SELECT * FROM my_' + _type + '_asset_type_code WHERE code=?', self.materials_type_code);\n\t\t\t\tvar rows = db.execute('SELECT * FROM my_' + _type + '_asset WHERE status_code=1 and ' + _type + '_asset_type_code=? and ' + _type + '_id=? ORDER BY id desc', self.materials_type_code, _selected_job_id);\n\t\t\t\tif (rows.getRowCount() > 0) {\n\t\t\t\t\twhile (rows.isValidRow()) {\n\t\t\t\t\t\tvar temp_upload_flag = -1;\n\t\t\t\t\t\tvar temp_uploading_record_id = null;\n\t\t\t\t\t\tvar new_text = '';\n\t\t\t\t\t\tnew_text += 'Name : ' + rows.fieldByName('name') + '\\n';\n\t\t\t\t\t\tvar temp_row = db.execute('SELECT * FROM my_updating_records where type=? and updating_id=?', _type, rows.fieldByName('local_id'));\n\t\t\t\t\t\tif (temp_row.isValidRow()) {\n\t\t\t\t\t\t\ttemp_upload_flag = temp_row.fieldByName('upload_status');\n\t\t\t\t\t\t\ttemp_uploading_record_id = temp_row.fieldByName('id');\n\t\t\t\t\t\t\tswitch (temp_row.fieldByName('upload_status')){\n\t\t\t\t\t\t\t\tcase 0://\n\t\t\t\t\t\t\t\t\tnew_text += 'Not Uploaded';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1://\n\t\t\t\t\t\t\t\t\tnew_text += 'Uploading';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 2://\n\t\t\t\t\t\t\t\t\tnew_text += 'Completed';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 3://\n\t\t\t\t\t\t\t\t\tnew_text += 'Failed';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnew_text += 'From Server';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (rows.fieldByName('id') > 1000000000) {\n\t\t\t\t\t\t\t\tnew_text += 'Not Uploaded';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar temp_row2 = db.execute('SELECT * FROM my_updating_records_for_data where type=? and updating_id=?', _type, rows.fieldByName('local_id'));\n\t\t\t\t\t\t\t\tif (temp_row2.isValidRow()) {\n\t\t\t\t\t\t\t\t\tnew_text += 'Not Uploaded';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnew_text += 'From Server';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttemp_row2.close();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnew_text += '\\n';\n\t\t\t\t\t\tnew_text += 'Description : ' + ((rows.fieldByName('description') === null) ? '' : rows.fieldByName('description')) + '\\n';\n\t\t\t\t\t\tvar new_row = Ti.UI.createTableViewRow({\n\t\t\t\t\t\t\tclassName : 'data_row_' + b,\n\t\t\t\t\t\t\tfilter_class : 'job_material_file',\n\t\t\t\t\t\t\thasChild : true,\n\t\t\t\t\t\t\theight : (temp_upload_flag === 3) ? 160 : 120,\n\t\t\t\t\t\t\tuploading_record_id : temp_uploading_record_id,\n\t\t\t\t\t\t\tjob_id : rows.fieldByName(_type + '_id'),\n\t\t\t\t\t\t\tasset_id : rows.fieldByName('id'),\n\t\t\t\t\t\t\tasset_type_name : asset_row.fieldByName('name'),\n\t\t\t\t\t\t\tasset_type_path : asset_row.fieldByName('path'),\n\t\t\t\t\t\t\tasset_type_code : asset_row.fieldByName('code'),\n\t\t\t\t\t\t\tasset_mime_type : rows.fieldByName('mime_type'),\n\t\t\t\t\t\t\tpath_original : rows.fieldByName('path_original')\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (i == 0) {\n\t\t\t\t\t\t\tnew_row.header = 'Material Files';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar asset_file_obj = null;\n\t\t\t\t\t\tvar asset_mime_type = rows.fieldByName('mime_type');\n\t\t\t\t\t\tvar asset_mime_type_array = asset_mime_type.split('/');\n\t\t\t\t\t\tvar temp_asset_mime_type_name = (asset_mime_type_array.length > 0) ? asset_mime_type_array[0] : '';\n\t\t\t\t\t\tvar asset_thumb_width = self.default_thumb_image_width;\n\t\t\t\t\t\tvar asset_thumb_height = self.default_thumb_image_width;\n\t\t\t\t\t\tswitch (temp_asset_mime_type_name){\n\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tvar file_name_array = rows.fieldByName('path_original').split('/');\n\t\t\t\t\t\t\t\tasset_file_obj = Ti.Filesystem.getFile(_file_folder, 'thumb_' + file_name_array[file_name_array.length - 1]);\n\t\t\t\t\t\t\t\tif (asset_file_obj.exists()) {\n\t\t\t\t\t\t\t\t\tvar blob = asset_file_obj.toBlob();\n\t\t\t\t\t\t\t\t\tasset_thumb_width = blob.width;\n\t\t\t\t\t\t\t\t\tasset_thumb_height = blob.height;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tasset_file_obj = self.get_file_path('image', 'media_type/photo.png');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'audio':\n\t\t\t\t\t\t\t\tasset_file_obj = self.get_file_path('image', 'media_type/audio.jpg');// '../../../images/flag/audio.png';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'video':\n\t\t\t\t\t\t\t\tasset_file_obj = self.get_file_path('image', 'media_type/video.png');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tasset_file_obj = self.get_file_path('image', 'media_type/pdf.png');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar thumb = Ti.UI.createImageView({\n\t\t\t\t\t\t\timage : asset_file_obj,\n\t\t\t\t\t\t\twidth : asset_thumb_width,\n\t\t\t\t\t\t\theight : asset_thumb_height,\n\t\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\t\ttop : (120 - asset_thumb_height) / 2,\n\t\t\t\t\t\t\tbottom : (temp_upload_flag === 3) ? 40 : (120 - asset_thumb_height) / 2\n\t\t\t\t\t\t});\n\t\t\t\t\t\tnew_row.add(thumb);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (temp_upload_flag === 3) {\n\t\t\t\t\t\t\t_upload_btn = Ti.UI.createButton({\n\t\t\t\t\t\t\t\tname : 'upload_btn',\n\t\t\t\t\t\t\t\tbackgroundImage : self.get_file_path('image', 'BUTT_grn_off.png'),\n\t\t\t\t\t\t\t\tcolor : '#fff',\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tfontSize : 12,\n\t\t\t\t\t\t\t\t\tfontWeight : 'bold'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttitle : 'Upload',\n\t\t\t\t\t\t\t\ttextAlign : 'center',\n\t\t\t\t\t\t\t\tstyle : Titanium.UI.iPhone.SystemButtonStyle.BORDERED,\n\t\t\t\t\t\t\t\tbottom : 5,\n\t\t\t\t\t\t\t\tleft : 10,\n\t\t\t\t\t\t\t\theight : 30,\n\t\t\t\t\t\t\t\twidth : asset_thumb_width\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tnew_row.add(_upload_btn);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tnew_row.add(Ti.UI.createLabel({\n\t\t\t\t\t\t\ttext : new_text,\n\t\t\t\t\t\t\ttextAlign : 'left',\n\t\t\t\t\t\t\theight : 'auto',\n\t\t\t\t\t\t\twidth : 'auto',\n\t\t\t\t\t\t\tleft : self.default_thumb_image_width + 15,\n\t\t\t\t\t\t\ttop : 10,\n\t\t\t\t\t\t\tbottom : 10\n\t\t\t\t\t\t}));\n\t\t\t\t\t\tself.data.push(new_row);\n\t\t\t\t\t\trows.next();\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trows.close();\n\t\t\t\tdb.close();\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _display_material_file');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "395f8b28d403ed52e125252767054f8b", "score": "0.49735588", "text": "function postprocessData(filename){\n\n var lineReader = require('readline').createInterface({\n input: fs.createReadStream(filename)\n });\n\n lineReader.on('line', function (line) {\n let idx = line.indexOf(\",,,\")\n if(line.indexOf(\",placeholdertext\") > 0){\n idx = line.indexOf(\",placeholdertext\");\n } else {\n idx = line.indexOf(\",,,\")\n }\n let msg = line.substring(0, idx);\n\n saveMessage(msg, true);\n\n }).on('close', function () {\n\n markov.setup(fixedData);\n\n saveToJson(nounFilename, nounTable);\n saveToJson(verbFilename, verbTable);\n saveToJson(adverbFilename, adverbTable);\n saveToJson(adjectiveFilename, adjectiveTable);\n saveToJson(emoteFilename, emoteTable);\n\n console.log(\"postprocessing done. here are some high frequency words.\")\n for(var i = 0; i < 10; i++){\n console.log(getNextHighFreqNoun());\n console.log(getNextHighFreqVerb());\n console.log(getNextHighFreqAdverb());\n console.log(getNextHighFreqAdjective());\n console.log(getEmote());\n console.log(\"---------\")\n\n }\n });\n}", "title": "" }, { "docid": "13e963efcf3a61c18e034e8da1ff4338", "score": "0.49634206", "text": "function ReadFile(){}", "title": "" }, { "docid": "8169654973c2f4ff8dae8dff91fb8b0a", "score": "0.49548495", "text": "function showSum()\n{\n var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", \"testing.txt\", true);\n rawFile.onreadystatechange = function ()\n {\n if(rawFile.readyState === 4)\n {\n var allText = rawFile.responseText;\n document.getElementById(\"textSection\").innerHTML = allText;\n }\n }\n\n rawFile.send();\n}", "title": "" }, { "docid": "39c151960184bd62741607c964f71ade", "score": "0.49268177", "text": "function moreWork() {\n console.log(fs.readFileSync('file.md'));\n}", "title": "" }, { "docid": "044ec8c86dc8efb9333f14c3169fe096", "score": "0.4881315", "text": "function readFromFile() {\r\n file_entry.file(fileReaderSuccess,failed);\r\n}", "title": "" }, { "docid": "323695a64c8b93244c9434a058624c33", "score": "0.48556432", "text": "function loadPages(filePath) {\n fetch(filePath)\n .then((filedata) => filedata.text())\n .then((finalData) => (load.innerHTML = finalData))\n counter = counter + 1\n }", "title": "" }, { "docid": "5f6c6b73672c7286fec2ad3261f49bd1", "score": "0.48524508", "text": "function loadDoc3(str) {\n alert(\"No hate or judgement. You are only allowed to love and respect one another.\");\n var uic = document.getElementById(\"table\").innerHTML = \"\";\n loadDoc7();\n var file = document.getElementById(\"userfile\").files[0].name;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n loadDoc2();\n\n }\n };\n xmlhttp.open(\"GET\", \"message4.php?q=\" + str + \"&q2=\" + file , true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "f223ed8435949b6ea7390818e22d5f89", "score": "0.4835877", "text": "onFileLoaded(contents) {\n this.editor.loadFile(contents);\n this.forceUpdate();\n }", "title": "" }, { "docid": "6010ace3ab09d96622ece2d1f05e5026", "score": "0.48293325", "text": "async function loadFiles() {\r\n let data = await fs.readFileSync(\"verifiedMembers.json\");\r\n verifiedMembers = JSON.parse(data)\r\n data = await fs.readFileSync(\"nonMembers.json\");\r\n newUserArray = JSON.parse(data);\r\n data = await fs.readFileSync(\"newUsers.json\");\r\n newUsers = JSON.parse(data);\r\n}", "title": "" }, { "docid": "079d9780112c5783c961cdbde75af45b", "score": "0.48285463", "text": "readFileBlock() {\n const keyDiv = $('#file-upload-progress ' + '#' + this.key);\n const progressStatusDiv = keyDiv.find('.file-upload-progress-status');\n\n if (this.offset >= this.file.size) {\n this.offset = this.file.size;\n this.isComplete = true;\n\n console.log(this.results);\n\n // nuBox.getBobKeys()\n // .then((bob) => nuBox.grant(this.path, bob.bek, bob.bvk, '2019-05-01 00:00:00'))\n // .catch((err) => {\n // console.log(err);\n // });\n\n progressStatusDiv.css('color', '#28a745').html('Completed');\n keyDiv.find('.file-upload-progress-btn').html('');\n\n return;\n }\n\n const blob = this.file.slice(this.offset, this.blockSize + this.offset);\n const blobURL = URL.createObjectURL(blob);\n\n nuBox\n .readBlock(blobURL, this.path, true /* upload to ipfs */)\n .then((ipfsHash) => {\n if (this.paused) {\n return;\n }\n\n if (this.results === null) {\n this.results = []\n }\n this.results.push(ipfsHash);\n this.offset += this.blockSize;\n\n this.readFileBlock();\n }).catch((err) => {\n progressStatusDiv.css('color', '#dc3545').html(err.message);\n\n this.isComplete = true;\n this.results = null;\n\n const html = '<i class=\"fas fa-trash-alt file-upload-progress-cancel\" style=\"cursor:pointer;\"></i>';\n keyDiv.find('.file-upload-progress-btn').html(html);\n });\n }", "title": "" }, { "docid": "363c1ba6c47319e7c141bd7121f12707", "score": "0.48283046", "text": "jsonRead(input) {\r\n jsonReadSuccessful = false;\r\n const file = input.target.files[0];\r\n const fileName = file.name;\r\n const setDescriptions = this.setDescriptions;\r\n $('#JSONFileDiv').next('.custom-file-label').html(fileName);\r\n if (file === undefined) {\r\n alert('Please select a file.');\r\n return;\r\n } else if (/\\.(json|txt)$/i.test(fileName) === false) {\r\n alert(\"Please select a json formatted file (.json or .txt)!\");\r\n return;\r\n } else {\r\n try {\r\n const reader = new FileReader();\r\n var data = [];\r\n reader.onload = (event) => {\r\n data = event.target.result;\r\n //wait until render button clicked before creating objects\r\n document.getElementById('renderButton').addEventListener('click', function() {\r\n if (data !== null) {\r\n //create block objects\r\n blockService.setBlocks(data);\r\n //create link objects\r\n linkService.createLinks();\r\n //set locations of blocks using parameters (distance between blocks (pixels),x,y)\r\n blockService.calcLocation(150, 0, 0);\r\n\r\n jsonReadSuccessful = true;\r\n //this.setDescriptions(fileBlocks);\r\n if (jsonReadSuccessful && excelReadSuccessful) {\r\n blockService.setBlockMetaData(fileBlocks);\r\n }\r\n\r\n //render diagram\r\n render();\r\n\r\n }\r\n });\r\n }\r\n reader.onerror = (event) => {\r\n alert(event.target.error.name);\r\n };\r\n reader.readAsText(file);\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n\r\n }\r\n }", "title": "" }, { "docid": "89e636b04686d05d936f01fa58af70f5", "score": "0.48185897", "text": "async function listAuthor() {\r\n const files = await readDirData('author');\r\n files.forEach(async (file) => {\r\n let author = await readFile(file, 'author');\r\n author = JSON.parse(author);\r\n // const listauthor = console.log(author);\r\n });\r\n return author.name;\r\n}", "title": "" }, { "docid": "0e7c0631967755da6694c1c5c77e4c6b", "score": "0.4816467", "text": "function read (singleFile) {\n // Go through each file asynchronously.\n Async.doInParallel(singleFile || files, readFile).always(function () {\n // Remove all files that do not have todos.\n files = files.filter(function (file) {\n return file.todos && file.todos.length > 0;\n });\n\n // Sort file by path.\n files = files.sort(function (a, b) {\n var nameA = a.name.toLowerCase();\n var nameB = b.name.toLowerCase();\n\n if (nameA < nameB) {\n return -1;\n }\n\n if (nameA > nameB) {\n return 1;\n }\n\n return 0;\n });\n\n // Count used tags.\n count();\n\n // Parsing is done. Publish event.\n Events.publish('todos:updated');\n });\n }", "title": "" }, { "docid": "8e215249e8454aae0f55cac1ee44f0e9", "score": "0.48161092", "text": "function fetchText() { //fungsi untuk menampilkan file text\n // TODO\n fetch('examples/words.txt') //lokasi fetch\n .then(validateResponse)\n .then(readResponseAsText)//membaca data sesuai fungsi readResponseAsText\n .then(showText)//menampilkan text sesuai variabel showText\n .catch(logError);\n}", "title": "" }, { "docid": "d1ce452490e4afac2cca8228cdcc60e0", "score": "0.48132366", "text": "function loadVIZ() {\n $('div#uploadDB').find('div.warn').css('display', 'none');\n $.ajax({\n url: 'data/vizDB.txt',\n type: 'get',\n dataType: 'json',\n async: true,\n success: function(db) {\n if (validDB(db)) {\n if (validData(db)) {\n allData = db;\n assignDataLabels();\n buildUI();\n $('div#loading').fadeOut(200);\n $('div#uploadDB').fadeOut(300);\n removeElement('uploadDB', zStack);\n unfreeze();\n }\n }\n },\n error: function() {\n $('div#uploadWarn2').css('display', 'block');\n $('div#loading').fadeOut(200);\n }\n });\n }", "title": "" }, { "docid": "9a1d8f3141123b27103872c00f364478", "score": "0.4807637", "text": "function inListAll(){\n // this variables are used for string numbering for authors/ for books we're using 'BookId' variable\n let authorOrder = 1; \n \n let author;\n let book;\n let listAuthors = readFile('authors.json');\n let listBooks = readFile('books.json');\n if(listAuthors){\n allAuthors = listAuthors;\n }\n if(listBooks){\n allBooks = listBooks;\n }\n console.log('\\nAuthors:');\n for(let i = 0; i < allAuthors.length; i++){\n author = authorOrder++ + '. ' + allAuthors[i].name + '(' + allAuthors[i].language + '). ' + allAuthors[i].genre;\n console.log('\\t' + author); \n }\n console.log('\\nBooks:');\n for(let i = 0; i < allBooks.length; i++){\n book = allBooks[i].id + '. ' + allBooks[i].title + '(' + allBooks[i].author + '). Rating: ' + allBooks[i].rate;\n console.log('\\t' + book); \n }\n mainMenu();\n}", "title": "" }, { "docid": "669d72ba528ab5f2ae34169333c2dad4", "score": "0.4800119", "text": "function checkFile() {\n readFromFile('recipes.json');\n\t}", "title": "" }, { "docid": "83ce578a4a270ec9ddeea85cb0f2d00e", "score": "0.47962165", "text": "async indexFile() {\n try {\n\t\t\tvar status=0; // 0 = default, 1 = question, 2 = answer\n\t\t\tvar lineLen=0;\n\t\t\tvar questionNumber=0;\n\t\t\tvar gotCorrect = false;\n\t\t\tlet allLines;\n\t\t\t\n\t\t\tif (this.qFile===null&&this.uid===null&&this.qfid===null){\n\t\t\t\tthrow (new Error(\"No Questionfile Specified\"));\n\t\t\t} else if (this.qFile!==null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tthis.rawQuestions = await this.readUploadedFileAsText(this.qFile);\t\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow(error);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\tallLines = this.rawQuestions.split(/\\r\\n|\\n/);\t\t\n\n\t//\t\t\t\tallLines.forEach( (line) =>{\n\t\t\t\tfor (let x=0;x<allLines.length;x++){\n\t\t\t\t\tif (!(allLines[x].slice(0,1) === process.env.REACT_APP_COMMENT) && allLines[x].trim().length !== 0) {\n\t\t\t\t\t\tif (status === 0) {\n\t\t\t\t\t\t\t// expecting a question\n\t\t\t\t\t\t\tif (allLines[x].slice(0,2)===process.env.REACT_APP_Q_START) {\n\t\t\t\t\t\t\t\t// question start\n\t\t\t\t\t\t\t\tstatus = 1;\n\t\t\t\t\t\t\t\tlineLen = allLines[x].replace(\"\\\\W\", \"\").length; // replace all non word characters\n\t\t\t\t\t\t\t\tif (lineLen <= process.env.REACT_APP_MAX_CHARS_PER_LINE) {\n\t\t\t\t\t\t\t\t\tquestionNumber++;\n\t\t\t\t\t\t\t\t\tthis.questions.push(new Question(''));\n\t\t\t\t\t\t\t\t} else {\n\t//\t\t\t\t\t\t\t\t\t\tstatus=0;\n\t\t\t\t\t\t\t\t\tthrow (new Error(`Question ${questionNumber+1}: Line ${allLines[x]} Length (${lineLen}) is greater than Maximum Question Length: ${process.env.REACT_APP_MAX_CHARS_PER_LINE}`));\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\tconsole.error(\"IndexFile: unexpected input: \" + allLines[x]);\n\t\t\t\t\t\t\t\tthrow (new Error(\"IndexFile: unexpected input: \" + allLines[x]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (status === 1) {\n\n\t\t\t\t\t\t\t// reading question, checking for answer start\n\t\t\t\t\t\t\tlineLen = allLines[x].replace(\"\\\\W\", \"\").length;\n\t\t\t\t\t\t\tif (lineLen <= process.env.REACT_APP_MAX_CHARS_PER_LINE) {\n\t\t\t\t\t\t\t\tif (allLines[x].slice(0,2) === process.env.REACT_APP_A_START) {\n\t\t\t\t\t\t\t\t\t// question end, answer start\n\t\t\t\t\t\t\t\t\tstatus = 2;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// keep track of end of last part of question\n\t\t\t\t\t\t\t\t\tlet curQuestion = this.questions[questionNumber-1].getQuestion();\n\t\t\t\t\t\t\t\t\tthis.questions[questionNumber-1].setQuestion(curQuestion + allLines[x]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tthrow (new Error(`Question Line: ${allLines[x]}, Length ${lineLen} is greater than Maximum Question Length: ${process.env.REACT_APP_MAX_CHARS_PER_LINE}`));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// reading answer, checking for answer end\n\t\t\t\t\t\t\tif (allLines[x].slice(0,2) === process.env.REACT_APP_A_END) {\n\t\t\t\t\t\t\t\t// answer end\n\t\t\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t\t\t\tgotCorrect=false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// add answer offset\n\t\t\t\t\t\t\t\tif (gotCorrect){\n\t\t\t\t\t\t\t\t\tthis.questions[questionNumber-1].addAnswer(allLines[x]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tgotCorrect = true;\n\t\t\t\t\t\t\t\t\tthis.questions[questionNumber-1].setCorrect(parseInt(allLines[x].trim()));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif ( this.questions.length < 1 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n } catch (e)\n {\n\t\t\tthrow e;\n }\n\t}", "title": "" }, { "docid": "ecd8c06f4ecb3755cece1ec1d102ca9e", "score": "0.47882771", "text": "function rvLoadBreakdown() {\n $('#readsViewer-analyticsBirdCountTable').empty();\n\n let stringToAppend = \"\";\n var readers = \"\";\n var total = 0;\n let sex = '';\n\n // Load bird data\n for(var c in rfidCounts) {\n total = 0;\n readers = \"\";\n\n // Calculate the total number of reads for this rfid and the readers string\n //let counter = 0;\n for(var d in rfidCounts[c]) {\n readers += '<a href=\"/boxes.html?reader='+d+'\">'+d+'</a>, ';\n /*\n if(counter == 2 && rfidCounts[c][Object.keys(rfidCounts[c]).length] != d) {\n readers += '<br />';\n counter = 0;\n }\n counter++;\n */\n total += rfidCounts[c][d];\n }\n\n sex = \"\";\n switch(RFIDSexMap[RFIDBandMap[c]]) {\n case 'Male':\n sex = '<span style=\"color:blue;\">&#9794;</span>';\n break;\n case 'Female':\n sex = '<span style=\"color:pink;\">&#9792</span>';\n break;\n default:\n sex = '<span style=\"color:black;\">?</span>';\n break;\n }\n\n stringToAppend = '<tr><td><a href=\"/birds.html?id='+c+'\">'+c+'</a></td><td><a href=\"/birds.html?id='+c+'\">'+RFIDBandMap[c]+'</a>'+sex+'</td><td>'+total+'</td><td>'+((total/numberOfEntries)*100).toFixed(2)+'</td><td>';\n // Add links to readers webpages\n stringToAppend += readers;\n stringToAppend = stringToAppend.substr(0, stringToAppend.length-2);\n stringToAppend += \"</td></tr>\";\n $('#readsViewer-analyticsBirdCountTable').append(stringToAppend);\n }\n\n $('#readsViewer-analyticsReaderCountTable').empty();\n\n // Load reader data\n for(var c in readerCounts) {\n total = 0;\n readers = \"\";\n\n // Calculate the total number of reads for this reader and the readers string\n //counter = 0;\n for(var d in readerCounts[c]) {\n readers += '<a href=\"/birds.html?id='+d+'\">'+d+'</a>, ';\n /*\n if(counter == 2 && rfidCounts[c][Object.keys(rfidCounts[c]).length] != d) {\n readers += '<br />';\n counter = 0;\n }\n counter++;\n */\n total += readerCounts[c][d];\n }\n\n stringToAppend = '<tr><td><a href=\"/boxes.html?reader='+c+'\">'+c+'</a></td><td><a href=\"/boxes.html?reader='+c+'\">'+readersBoxMap[c]+'</a></td><td>'+total+'</td><td>'+((total/numberOfEntries)*100).toFixed(2)+'</td><td>';\n // Add links to readers webpages\n stringToAppend += readers;\n stringToAppend = stringToAppend.substr(0, stringToAppend.length-2);\n stringToAppend += \"</td></tr>\";\n $('#readsViewer-analyticsReaderCountTable').append(stringToAppend);\n }\n}", "title": "" }, { "docid": "e2cb46d5d9b9f0f881191fd7d0a1a442", "score": "0.4786573", "text": "function readInputFiles() {\n fs.readFile('credentials.json', (err, content) => {\n if (err) return console.log('Error loading client secret file:', err);\n // Authorize a client with credentials, then call the Google Sheets API.\n console.log(\"About to read file\");\n //authorize(JSON.parse(content), getVelocityData);\n authorize(JSON.parse(content), getDefectsData);\n // Commenting this code to get real-time data from JIRA for defects\n // authorize(JSON.parse(content), getDefectsData);\n\n // Commenting createGraphs: It is an expensive call\n // createGraphs.createVelocityCharts();\n\n // Get Real-time defects data from JIRA\n // readJIRADefects.getDefectsData();\n\n console.log(\"Read file\");\n });\n}", "title": "" }, { "docid": "b526845d30544672ee42685a6809432a", "score": "0.47819802", "text": "function readContent() {\n var authorId = $('#authorId').val();\n if (authorId != '') authorId = parseInt($('#authorId').val());\n else authorId = -1;\n\n content.authorId = authorId;\n content.authorName = $('#authorName').val().replace(new RegExp('\\n', 'g'), '');\n}", "title": "" }, { "docid": "f6aef555ea2b913e8b7bdc54cef7b683", "score": "0.47790858", "text": "function dataDump(req, res) {\n //create a user data object template\n let userData = {\n images: {\n \"mouths\": [],\n \"leftEyes\": [],\n \"rightEyes\": [],\n \"noses\": [],\n \"rightEyebrows\": [],\n \"leftEyebrows\": [],\n },\n \"demographics\": []\n };\n //read the userIndex file, passing the content into a \"data\" variable\n fs.readFile('userIndex.json', function(err, data) {\n if (err) throw err;\n //once again, parse 'n' store in a descriptive variable\n let uIndex = JSON.parse(data);\n //run a for loop for as many times as there are stored users\n for (let i = 0; i < uIndex.users.length; i++) {\n //run the image urls stored in the uIndex object through a base64 encoder,\n //and push the data into the userData object.\n userData.images.mouths.push(base64Encode(uIndex.users[i].images.mouth));\n userData.images.leftEyes.push(base64Encode(uIndex.users[i].images.leftEye));\n userData.images.rightEyes.push(base64Encode(uIndex.users[i].images.rightEye));\n userData.images.noses.push(base64Encode(uIndex.users[i].images.nose));\n userData.images.rightEyebrows.push(base64Encode(uIndex.users[i].images.rightEyebrow));\n userData.images.leftEyebrows.push(base64Encode(uIndex.users[i].images.leftEyebrow));\n //push an empty dictionary into object so it is ready to recieve info later on\n userData.demographics.push({});\n }\n //run th epackage demographics function, passing it the\n //post response, userData, and uIndex objects\n packageDemographics(res, userData, uIndex)\n })\n}", "title": "" }, { "docid": "9df02b1a7595456bbad10c31fb26b303", "score": "0.47760123", "text": "async function grabFile() {\n console.log(\"ON THE RIGHT FILE\");\n var x = document.getElementById(\"inputBibFile\");\n \n // Don't allow another file upload while processing the current one\n x.disabled = true;\n \n var reader = new FileReader();\n\n // error handling if they click upload without selecting a file\n if (x.files[0] == null) {\n alert(\"Please input a BibTeX file\")\n }\n else {\n // error handling if file uploaded is too big (number below in bytes)\n if (x.files[0].size > 2000000) {\n alert(\"Please input a BibTeX file\")\n } \n // else if the file is a reasonable size\n else {\n // run the FileReader instance to convert the file to plaintext\n reader.readAsText(x.files[0])\n reader.onload = async function () {\n // get the result of the file read and send it to the parser\n var input = reader.result;\n runParser(input);\n };\n }\n }\n\n x.disabled = false;\n\n}", "title": "" }, { "docid": "78f167f669fe91c81449a591d90a3dc9", "score": "0.47757426", "text": "function renderMd2(url){\r\n loadDataMd(url);\r\n function loadDataMd(url) {\r\n let xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onreadystatechange = function () {\r\n if (xmlHttp.readyState===4 && xmlHttp.status===200)\r\n {\r\n let data=xmlHttp.responseText;\r\n document.getElementsByClassName(\"markdown-container\")[0].innerHTML = marked(data);\r\n }\r\n };\r\n xmlHttp.open(\"GET\",url+\"?uid=\"+uid,true);\r\n xmlHttp.send();\r\n }\r\n console.log(\"md file rendered\");\r\n}", "title": "" }, { "docid": "c7a535b9d6af964c7b5fa93edbd09291", "score": "0.47734502", "text": "function propertiesFS(){\nconsole.log(\"welcome to propertiesFS line 32 in auth.js\");\nfs.readFile('db/'+ userName +'/properites.json', 'utf8' ,function(err, data){\n\tif(err){\n\t\tconsole.log('error reading file 29: ' + err);\n\t\treturn;\n\t}\n\tproperitess = data;//JSON.parse(data);\n\tconsole.log('auth line 40: ' + ++i );\n\t});\n}", "title": "" }, { "docid": "ea2d2bc1230daf6bae0768c5cf434df2", "score": "0.47675952", "text": "readFile(fileName, callBack) { //readFile takes two params: fileName and callBack, ref'd in index.js\n fs.readFile(fileName, (error, contents) => {\n if (error) {\n callBack(error); //error handling if bad request\n } else {\n console.log(contents.toString());\n //TODO: refactor with own string instead of relying on toString (stretch)\n callBack(undefined, contents.toString());\n }\n });\n\n }", "title": "" }, { "docid": "71eb8a7b02774b468559e4437f47bfe3", "score": "0.4760981", "text": "function read( file )\n{\n\t\n}", "title": "" }, { "docid": "9de92b7763685e0a8ad1a23f99ccd1bc", "score": "0.47570536", "text": "function readHostFile(){\n\n document.getElementById('viewsHost').innerHTML=\"\";\n\n lineNumber =0;\n var rd = readline.createInterface({\n input: fs.createReadStream(filename),\n output: process.stdout,\n terminal: false\n });\n\n rd.on('line', function(line) {\n hostFile.push(line);\n console.log('Read host file');\n\n }).on('close', function() {\n for(line in hostFile){\n showHostLine(hostFile[line]);\n }\n });\n\n\n }", "title": "" }, { "docid": "534be44bc6ad624e425ce2abbfc00efc", "score": "0.4755678", "text": "function fileLoaded(data) {\n var txt = data.join('\\n');\n process(txt);\n}", "title": "" }, { "docid": "b2c4e8a63274f02787475ee4ee5bfdef", "score": "0.47364584", "text": "function openFile() {\n $('div#uploadDB').find('div.warn').css('display', 'none');\n var success = false;\n var parsed = false;\n uploadInput = document.querySelector('input#DBInput');\n if (uploadInput.files[0]) {\n var reader = new FileReader();\n reader.onload = function() {\n try {\n theData = $.parseJSON(reader.result);\n parsed = true;\n if (validDB(theData)) {\n if (validData(theData)) {\n allData = theData;\n assignDataLabels();\n buildUI();\n $('div#uploadDB').fadeOut(300);\n removeElement('uploadDB', zStack);\n unfreeze();\n success = true;\n }\n }\n }\n catch(e) {\n $('div#uploadWarn2').css('display', 'block'); \n }\n finally {\n $('div#loading').fadeOut(200);\n }\n };\n reader.readAsText(uploadInput.files[0]);\n } else {\n $('div#loading').css('display', 'none');\n $('div#uploadWarn1').css('display', 'block');\n }\n }", "title": "" }, { "docid": "36bb506229509233661b2e70028d2d31", "score": "0.47359", "text": "function readData() {\n if ((xhrMyData.readyState === 4) && (xhrMyData.status === 200)) {\n\n var MyData = JSON.parse(xhrMyData.responseText);\n var paragraphs = MyData.paragraphs;\n paragraphs.forEach(function (paragraph) {\n var paragraphElement = document.getElementById(paragraph.id);\n //looks for the element id and aligns it with the paragraphs in the html\n if(paragraphElement) {\n paragraphElement.innerHTML = paragraph.content;\n }\n \n }, this);\n }\n }", "title": "" }, { "docid": "417c93f42df00a6307efb1e974d052b5", "score": "0.47341177", "text": "function handleREADMEs() { // {{{\n\tvar readmeBoxen = getElementsByClassName(\"dsrv.readme\", \"div\");\n\tif(readmeBoxen.length > 0) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\tvar repository = getRepository(), branch = getBranch(), path = getPath();\n\t\tvar request = repository + \"/\" + branch + \"/\" + path + \"/README\";\n\t\tif(path.length == 0)\n\t\t\trequest = repository + \"/\" + branch + \"/README\";\n\n\t\txhr.open('POST', apiURL + \"cat/\" + request, true);\n\t\txhr.onreadystatechange = function(xhrEvent) {\n\t\t\tif(xhr.readyState != 4)\n\t\t\t\treturn;\n\t\t\tif(xhr.status != 200)\n\t\t\t\treturn;\n\n\t\t\tvar readme = JSON.parse(xhr.responseText, false);\n\t\t\tfor(var i = 0; i < readmeBoxen.length; ++i)\n\t\t\t\tfillReadme(readmeBoxen[i], readme, (path.length != 0));\n\t\t};\n\t\txhr.send(null);\n\t}\n} // }}}", "title": "" }, { "docid": "d8b1f3479ebada2d0c08c4070989d4d9", "score": "0.4727921", "text": "read() {\n try {\n this._toggleEditThrobber();\n var expId = parseInt(document.getElementById('edit_id').value);\n var outputEl = this._clearOutput();\n \n // read data from db\n var jsonObj = this.dao.read(expId);\n if (!jsonObj) throw `Error reading animal data for audiogram ${expId}`; \n this._showOutput(expId, jsonObj);\n\n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleEditThrobber();\n }", "title": "" }, { "docid": "1acb7389c91375fa47d2e781e8da5aa7", "score": "0.47201183", "text": "function displayAFile(filename,findme){\nvar test1=0;\n\n\n\t\t\tfetch(filename)\n .then(function(response){\n return response.text();\n }).then(function (data) {\n\n\n\t\tconst nameOnly= filename.split('/media/');\n\t\tconst removeEnd = nameOnly[1].split(\".txt\");\n\t\tconst finalfix = removeEnd[0].split(\".\");\n\n\t\tconst onlythis = occurrences(data,findme,finalfix[0])\n\t\thowmany= howmany+ onlythis\n\t\tif(onlythis >=1){\n\n\n\t\tlet examples= <span> {finalfix[0]} <i><b>{onlythis}</b></i></span>\n\t\tconst currentFiles = <div>{examples}</div>\n\n\t\toutPut =[...outPut, currentFiles];\n\t\t}\n\n\n })\n\n\n\n\n}", "title": "" }, { "docid": "6830a9d9194971de000591b2e11a1343", "score": "0.47098947", "text": "function finishRead() {\r\n return Os.File.stat(fileName).then(function(x) {\r\n var file_info = /** @type {!Os.File.Info} */(x);\r\n file.close();\r\n var decoder = detector.decoders[0];\r\n if (!decoder)\r\n return Promise.reject(new Error('Bad encoding'));\r\n\r\n // Inserts file contents into document with replacing CRLF to LF.\r\n var range = new Range(document);\r\n range.end = document.length;\r\n var newline = Newline.UNKNOWN;\r\n decoder.strings.forEach(function(string) {\r\n if (newline == Newline.UNKNOWN) {\r\n if (string.indexOf('\\r\\n') >= 0)\r\n newline = Newline.CRLF;\r\n else if (string.indexOf('\\n') >= 0)\r\n newline = Newline.LF;\r\n }\r\n document.readonly = false;\r\n if (newline == Newline.CRLF)\r\n string = string.replace(RE_CR, '');\r\n range.text = string;\r\n document.readonly = true;\r\n range.collapseTo(range.end);\r\n });\r\n\r\n // Update document properties based on file.\r\n document.encoding = decoder.encoding;\r\n document.lastWriteTime = file_info.lastModificationDate;\r\n document.modified = false;\r\n document.newline = newline;\r\n document.readonly = file_info.readonly || readonly;\r\n document.clearUndo();\r\n return Promise.resolve(document.length);\r\n }).catch(logErrorInPromise('load/open/stat'));\r\n }", "title": "" }, { "docid": "8570f7a7c673a7a5d8d79bf0db78b47b", "score": "0.47066608", "text": "function readFile(fileEntry) {\n//alert(\"read\");\n // Get the file from the file entry\n fileEntry.file(function (file) {\n // alert(\"reading\");\n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n\n reader.onloadend = function() {\n\n console.log(\"Successful file read: \" + this.result);\n console.log(\"file path: \" + fileEntry.fullPath);\n\n };\n\n reader.readAsText(file);\n\n }, function (error) {\n console.log(error);\n\n });\n}", "title": "" }, { "docid": "cc19ec0142e2f1a9292fb3aaa3282961", "score": "0.47048405", "text": "function gcb_course_json(){\n\tvar fs = require(\"fs\");\n\tvar y = document.getElementById(\"fileImportDialog\");\n\tvar file1 = y.files[0];\n\tvar elo_course_path = file1.path;\n\tvar new_file_name = file1.name.replace(/ELO/, \"\");\n\tvar gcb_path = file1.path.replace(file1.name, \"\") + \"GCB\" + new_file_name.replace(/ /g, \"_\");\n\tvar buf2 = new Buffer(1000000);\n\tvar buf3 = new Buffer(1000000);\n\tvar unit_id = 1;\n\n\tfs.open(gcb_path + \"/files/data/course.json\", \"w\", function(err,fd){\n\t\tif(err) throw err;\n\n\t\telse{\n\t\t\tvar buf = new Buffer(\"{\\n \\\"lessons\\\": [\");\n\n\t\t\tfs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer){\n\t\t\t\tif(err) throw err;\n \t\t\tconsole.log(err, written, buffer);\n\t\t\t})\n\n\t\t\tfs.open(elo_course_path + \"/elo_aggregation.xml\", \"r\", function(err, fd){\n\t\t\t\tif(err) throw err;\n\t\t\t\tconsole.log(\"elo_aggregation.xml opened successfully !\");\n\n\t\t\t\tfs.read(fd, buf2, 0, buf2.length, 0, function(err, bytes){\n\t\t\t\t\tif(err) throw err;\n\n\t\t\t\t\telse if(bytes > 0){\n\n\t\t\t\t\t\tvar content = buf2.slice(0, bytes).toString();\n\t\t\t\t\t\tparser = new DOMParser();\n\t\t\t\t\t\txmlDoc = parser.parseFromString(content,\"text/xml\");\n\t\t\t\t\t\tconsole.log(xmlDoc);\n\n\t\t\t\t\t\tx = xmlDoc.getElementsByTagName(\"container\");\n\t\t\t\t\t\ty = xmlDoc.getElementsByTagName(\"content\");\n\n\t\t\t\t\t\tfor(var i = 1; i < y.length; i++){\n\n\t\t\t\t\t\t\tvar unit_name = x[unit_id-1].getAttribute(\"display_name\");\n\t\t\t\t\t\t\tvar lesson_id = i + y.length;\n\t\t\t\t\t\t\tvar html_file_name = y[i-1].getAttribute(\"url_name\");\n\n\t\t\t\t\t\t\tif(y[i-1].getAttribute(\"tid\") == y[i].getAttribute(\"tid\")){\n\t\t\t\t\t\t\t\twrite_lesson_course_json(unit_name, lesson_id, unit_id, html_file_name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\twrite_lesson_course_json(unit_name, lesson_id, unit_id, html_file_name);\n\t\t\t\t\t\t\t\tunit_id += 1;\n\t\t\t\t\t\t\t\tconsole.log(unit_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar unit_name = x[x.length-1].getAttribute(\"display_name\");\n\t\t\t\t\t\tvar html_file_name = y[y.length-1].getAttribute(\"url_name\");\n\t\t\t\t\t\tvar lesson_id = 2 * y.length;\n\t\t\t\t\t\tconsole.log(html_file_name);\n\n\n\t\t\t\t\t\tfs.appendFile(gcb_path + \"/files/data/course.json\", \n\t\t\t\t\t\t\"\\n\\t{\\n\\t \\\"activity_listed\\\": true,\\n\\t \\\"activity_title\\\": \\\"\\\",\\n\\t \\\"auto_index\\\": true,\" + \n\t\t\t\t\t\t\"\\n\\t \\\"duration\\\": \\\"\\\",\\n\\t \\\"has_activity\\\": false,\\n\\t \\\"lesson_id\\\": \" + lesson_id + \n\t\t\t\t\t\t\",\\n\\t \\\"manual_progress\\\": false,\\n\\t \\\"notes\\\": \\\"assets/html/\" + html_file_name + \".html\\\",\" + \n\t\t\t\t\t\t\"\\n\\t \\\"now_available\\\": false,\\n\\t \\\"objectives\\\": \\\"\\\",\\n\\t \\\"properties\\\": {\\n\\t \\\"\" + \n\t\t\t\t\t\t\"modules.skill_map.skill_list\\\": []\\n\\t },\\n\\t \\\"scored\\\": false,\\n\\t \\\"title\\\": \\\"\" + unit_name + \n\t\t\t\t\t\t\"\\\",\\n\\t \\\"unit_id\\\": \" + unit_id + \",\\n\\t \\\"video\\\": \\\"\\\"\\n\\t}\\n ],\\n \\\"next_id\\\": \" + \n\t\t\t\t\t\t(lesson_id + 1) + \",\\n \\\"units\\\": [\", function(err){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(err) throw err;\n\t\t\t\t\t \t\tconsole.log(' course.json about lesson was complete!');\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tfor(var j = 0; j < x.length; j++){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar unit_id2 = j + 1;\n\t\t\t\t\t\t\t\tvar unit_name2 = x[j].getAttribute(\"display_name\");\n\t\t\t\t\t\t\t\tconsole.log(unit_id2);\n\t\t\t\t\t\t\t\tconsole.log(unit_name2);\n\n\t\t\t\t\t\t\t\tif(j == x.length - 1){\n\t\t\t\t\t\t\t\t\tfs.appendFile(gcb_path + \"/files/data/course.json\",\n\t\t\t\t\t\t\t\t\t\"\\n\\t{\\n\\t \\\"custom_unit_type\\\": null,\\n\\t \\\"description\\\": \\\"\\\",\\n\\t \\\"href\\\": null,\" + \n\t\t\t\t\t\t\t\t\t\"\\n\\t \\\"html_check_answers\\\": false,\\n\\t \\\"html_content\\\": null,\\n\\t \\\"html_review_form\\\": null,\" + \n\t\t\t\t\t\t\t\t\t\"\\n\\t \\\"labels\\\": \\\"\\\",\\n\\t \\\"manual_progress\\\": false,\\n\\t \\\"now_available\\\": false,\" + \n\t\t\t\t\t\t\t\t\t\"\\n\\t \\\"post_assessment\\\": null,\\n\\t \\\"pre_assessment\\\": null,\\n\\t \\\"properties\\\": {},\" + \n\t\t\t\t\t\t\t\t\t\"\\n\\t \\\"release_date\\\": \\\"\\\",\\n\\t \\\"show_contents_on_one_page\\\": false,\\n\\t \\\"shown_when_unavailable\\\":\" + \n\t\t\t\t\t\t\t\t\t\" false,\\n\\t \\\"title\\\": \\\"\" + unit_name2 + \"\\\",\\n\\t \\\"type\\\": \\\"U\\\",\\n\\t \\\"unit_footer\\\": \\\"\\\",\" + \n\t\t\t\t\t\t\t\t\t\"\\n\\t \\\"unit_header\\\": \\\"\\\",\\n\\t \\\"unit_id\\\": \" + unit_id2 + \",\\n\\t \\\"weight\\\": 1,\\n\\t \\\"workflow_yaml\\\": \" + \n\t\t\t\t\t\t\t\t\t\"\\\"grader: auto\\\\n\\\"\\n\\t}\\n ],\\n \\\"version\\\": \\\"1.3\\\"\\n}\", function(err){\n\t\t\t\t\t\t\t\t\t\tif(err) throw err;\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\twrite_unit_course_json(unit_name2, unit_id2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 30)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t})\n}", "title": "" }, { "docid": "b5c287527600fdf495f6f1d8b5175909", "score": "0.46907273", "text": "function readFile1(filename1) {\n fs.readFile(filename1, (err, data) => {\n if (err) {\n console.log(err);\n } else {\n console.log(\"\\n\\nThe content of the file is \\n\\n\"+data);\n console.log(\"Completed reading file1\");\n }\n });\n}", "title": "" }, { "docid": "8d85408831797fd51023b7081a9c465e", "score": "0.46872336", "text": "function doWork(i){\r\n\tif (fs.existsSync(\"./chapter\"+ i + \".result.json\")){\r\n\t\t//console.log(\"Found it!\");\r\n\t\tfileData.getFileAsJSON(\"./chapter\" + i + \".result.json\").then((fileContent) => {\r\n\t\t\tconsole.log(fileContent);\r\n\t\t}, (fileReadError) => {\r\n\t\t\tconsole.log(fileReadError);\r\n\t\t});\r\n\t}\r\n\telse {\r\n\t\tfileData.getFileAsString(\"chapter\"+ i + \".txt\").then((fileContent)=>{\r\n\t\t\tfileData.saveStringToFile(\"./chapter\" + i + \".debug.txt\", textMetrics.simplify(fileContent));\r\n\t\t\tvar results = textMetrics.textMetrics(fileContent);\r\n\t\t\tfileData.saveJSONToFile(\"./chapter\" + i + \".result.json\", results);\r\n\t\t\tconsole.log(results);\r\n\t\t}, (error) => {\r\n\t\t\tconsole.log(error);\r\n\t\t});\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "35f59c485a03abf26ca80e7bfa21419e", "score": "0.46862233", "text": "function readDataFromDatabase() {\n\t\n\tdocument.getElementById('message_container').style.display = \"none\";\n\tdocument.getElementById('collection_content_container').style.display = \"none\";\n\t\n\tshowPleaseWait();\n\n\tvar totaldocCount = 0;\n\tdb.collection(basePath+coll_lang+'/'+coll_name).get().then((querySnapshot) => {\n\t console.log(\"SIZE : \" + querySnapshot.size);\n\n if(querySnapshot.size == 0) {\n hidePleaseWait();\t\t \n\t\t showNoRecordMessage(); \n\n } else {\n\t\t\t\n\t\t\t// ------- Details Found ------------\n\t\t\tdocument.getElementById('collection_content_container').style.display = \"block\";\n\n totaldocCount = querySnapshot.size\n\n var list_html = '';\n var nav_html = '';\n var coll_admin_html = '';\n\n var docCount = 0;\n\n // Read Each Documents\n querySnapshot.forEach((doc) => {\n //console.log(`${doc.id} =>`, doc.data());\n allDocData[doc.id] = doc.data();\n\n if(doc.id == 'MAIN') {\n // --------- Update Main Section ----------\n // Create NAV HTML Tags.\n coll_admin_html += getCollectionAdminHTMLContent(doc.data())\n\t\t\t\t\t\t \n\t\t\t\t\t\t // Collect global MAIN details\n\t\t\t\t\t\t doc_display_id_info_details = allDocData[doc.id]['INFO11']['VALUE'];\n doc_publish_info_details = allDocData[doc.id]['INFO12']['VALUE'];\n doc_listData_info_details = allDocData[doc.id]['INFO13']['VALUE'];\n\t\t\t\t\t\t \n\n } else {\n\n // Create List group HTML tags\n list_html += '<a class=\"list-group-item list-group-item-action \" data-toggle=\"list\" href=\"#' + doc.id + '_TAB' + '\" role=\"tab\">' + doc.id + '</a>\\n';\n\n // Create NAV HTML Tags.\n nav_html += getTabPanelHTMLFormat(doc.id + '_TAB',doc.id + '_NAV',doc.data(),doc.id)\n\n }\n\n // Check Document count\n docCount++;\n if(totaldocCount == docCount) {\n hidePleaseWait();\n }\n\n\n\n });\n\n // Update HTML Page\n // console.log(coll_admin_html);\n $(\"#collectionAdminContent\").html(coll_admin_html);\n\n // Update HTML Page\n //console.log(list_html);\n $(\"#collectionDocumentsList\").html(list_html);\n\n // Update HTML page\n //console.log(nav_html);\n $(\"#collectionDocumentsTab\").html(nav_html);\n\n\n // Process disable operation handling\n disableHandling()\n\n\t\t}\n\t\t\n\t});\n\t\n} // EOF", "title": "" }, { "docid": "3153ebd2fe3946e1a6802570c74d7e56", "score": "0.4684687", "text": "handleFileRead(){\n let archivo = fileReader.result;\n archivo = archivo.replace(/\\n/g, \",\").split(\",\");\n for(let i = 0; i < archivo.length; i++) {\n archivo[i] = archivo[i].replace(\" \", \"\");\n }\n this.llenarProcesos(archivo);\n }", "title": "" }, { "docid": "f4241c5ee2b94725c18a57610eb41bee", "score": "0.4681006", "text": "load(adress) {\n \n //fs.readFile(adress, 'utf8', (err, jsonString) => {} )\n }", "title": "" }, { "docid": "7cefa8ab4ee5f0f709ea936562cbad25", "score": "0.46791738", "text": "function load_content(id) {\r\n $.ajax({\r\n type: \"POST\",\r\n dataType: \"json\",\r\n async: true,\r\n url: urlaction, //Relative or absolute path to response.php file\r\n data: { fileid: id, action: 'loadcontent' },\r\n success: function(data) {\r\n $('#code').removeClass(\"prettyprinted\");\r\n $(\"#code\").empty();\r\n\r\n $('#output').html(data['output']);\r\n if (data['lock'] == 'true') {\r\n $('#code').html(data['firstline']);\r\n $('#code').append(data['content']);\r\n $(\"#code\").attr('contenteditable', 'false');\r\n $(\"#output\").attr('contenteditable', 'false');\r\n }\r\n else {\r\n $('#code').append(data['content']);\r\n $(\"#code\").attr('contenteditable', 'true');\r\n $(\"#output\").attr('contenteditable', 'true');\r\n }\r\n }\r\n });\r\n }", "title": "" }, { "docid": "93747b5d4f4d6c26e7e28eccc6b8543d", "score": "0.46760842", "text": "function readTXTData(){\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n retrieveTXTDoc(this);\n }\n };\n request.open(\"GET\", filepath, true);\n request.send();\n }", "title": "" }, { "docid": "8287241f7271f31cf79ce567d2b90873", "score": "0.4670986", "text": "function gameLanguageScreenLanguageFileRead()\n\t{\n\t\tupdateUI();\n\t\treadAllCategories(allCategoriesRead, categoriesReadingFailed);\n\t}", "title": "" }, { "docid": "0a69bb00ebb54b395809f044d0883516", "score": "0.46706903", "text": "function fileLoaded(data) {\n var txt = data.join('\\n');\n input.html(txt);\n}", "title": "" }, { "docid": "23d1286097238922aabe6ee8417f31dc", "score": "0.46639514", "text": "function loadFile() {\n var reader = new FileReader();\n reader.onload = fileLoaded;\n reader.readAsText(treeFile);\n\n function fileLoaded(evt) {\n treeData = evt.target.result;\n reloadTreeData();\n }\n\n}", "title": "" }, { "docid": "51ab71e9f7c9f1f3cb17e8e97ec00e7e", "score": "0.46585795", "text": "function fetchContentForReference(sha256AndLength, callback) {\n var fileDirectory = calculateStoragePath(resourcesDirectory, sha256AndLength, resourceDirectoryLevels, resourceDirectorySegmentLength);\n var fileName = sha256AndLength + resourceFileSuffix;\n fs.readFile(fileDirectory + fileName, \"utf8\", callback);\n}", "title": "" }, { "docid": "f3b5c27c9a4d8dd863c9eb38a6c9c6c8", "score": "0.46467683", "text": "async function example () {\n try {\n // Read file content.\n // /////////////////\n const content = await readFile(filePath)\n\n console.log(content)\n } catch (error) {\n // In case you do not have permissions,\n // you may want to handle it here.\n console.error(error)\n }\n}", "title": "" }, { "docid": "c5791697e041fe2c6f53460ffd95e22c", "score": "0.46457753", "text": "function readTextFile(data) {\n\tdata = data.toString();\n\torganizeData(data.split(\"\\r\\n\"));\n\tconsole.log(\"Itemlist succesfully imported: \" + itemList.length + \" entry items.\");\n}", "title": "" }, { "docid": "540f06dd7440affc3d03a67143bb7248", "score": "0.46422315", "text": "function readFile(filepath) {\n fs.readFile(filepath, 'utf-8', function (err, data) {\n if(err){\n alert(\"An error ocurred reading the file :\" + err.message);\n return;\n }\n\n document.getElementById(\"content-editor\").value = data;\n });\n }", "title": "" }, { "docid": "69519d0be98a2601cde0cd47e67af0e8", "score": "0.4640111", "text": "function loadData () {\n _writeCollectibleCards();\n _writeExp();\n}", "title": "" }, { "docid": "1012b6e8dc63c2fa51ed76d81c28faf2", "score": "0.4637296", "text": "function renderUsers(){\n //create httpRequest Object\n const httpRequest = new XMLHttpRequest();\n //open httpRequest\n httpRequest.open('GET', 'users.json', true);\n //use onload function\n httpRequest.onload = function(){\n if(this.status === 200){\n const users = JSON.parse(this.responseText);\n let output = '';\n\n for(var i in users){\n //loop through the users.json array\n output += '<ul type=\"square\"> '+\n '<li>ID: '+ users[i].id + '</li>'+\n '<li>Name: '+ users[i].name + '</li>'+\n '<li>Email '+ users[i].email + '</li>'+\n '</ul>';\n }\n\n document.querySelector('#users').innerHTML = output;\n }\n else if(this.status === 404){\n document.querySelector('#users').innerHTML = 'Not found';\n }\n }\n httpRequest.send();\n}", "title": "" }, { "docid": "7aabaef05c719514ab61020202d576cd", "score": "0.46372187", "text": "async function ReadChapters(chapters, chapterData) {\n for (var idx in chapters) {\n var chapter = chapters[idx];\n chapter.orderBook = Number(idx);\n\n /*if no children in chapter*/\n if (chapter.url) {\n var url, dst, dstFilename, pathDirName;\n\n // FIXME: for now don't support any lang\n chapter.url = chapter.url.replace(\"%lang%/\", \"\");\n dstFilename = path.basename(chapter.url);\n\n // Build source url and dst file\n if(isPdf(chapter.url)) {\n pathDirName = \"\";\n dst = chapterData.dstDir;\n } else {\n pathDirName = path.dirname(chapter.url);\n dst = path.join(chapterData.dstDir, pathDirName);\n }\n\n // dst_prefix : common destination prefix directory\n if (chapterData.bookConfig.dst_prefix && chapterData.bookConfig.dst_prefix != \"\") {\n dst = path.join(chapterData.dstDir, chapterData.bookConfig.dst_prefix, pathDirName);\n }\n\n // src_prefix : common source prefix directory for all url of a chapter\n if (chapterData.src_prefix && chapterData.src_prefix != \"\") {\n chapter.url = path.join(chapterData.src_prefix, chapter.url)\n }\n\n // destination : allow to rename markdown filename in website\n var orgDst = path.join(dst, dstFilename);\n if (chapter.destination && chapter.destination != \"\") {\n dstFilename = chapter.destination;\n }\n dst = path.join(dst, dstFilename);\n\n if(isPdf(chapter.url)) {\n url = chapter.url;\n } else {\n url = chapterData.bookConfig.url.replace(path.basename(chapterData.bookConfig.path), chapter.url);\n }\n\n if (fse.existsSync(dst)) {\n console.error(\"ERROR destination file already exists :\");\n console.error(\" fetch url :\", url);\n console.error(\" destination file :\", dst);\n process.exit(-2);\n }\n /* TODO: cleanup if ok to have unique files\n var subId = 0;\n while (fse.existsSync(dst)) { //if file already exists rename it\n var newName = idx.toString() + \".\" + subId.toString() + \"__\" + path.basename(chapter.url);\n dst = path.join(chapterData.dstDir, path.join(path.dirname(chapter.url), newName));\n if (VERBOSE) console.log(\" WARNING: %s already exists renamed into %s\", dst, newName);\n subId = parseInt(subId) + 1;\n }\n */\n\n if (!fse.existsSync(dst)) fse.mkdirsSync(path.dirname(dst));\n\n var editURI = \"\"\n if (chapterData.url_edit) {\n editURI = chapterData.url_edit.replace (\"%source%\", path.join (chapterData.src_prefix, chapter.url));\n }\n\n var newFrontMatter = {\n edit_link: editURI || \"\",\n title: chapter.name,\n origin_url: url,\n };\n\n // Handle case of overloaded repos by local repos using __fetched_files_local.yml\n if (!url.startsWith('http')) {\n newFrontMatter.origin_url = 'file://' + newFrontMatter.origin_url;\n }\n\n var newUrl;\n if(url.endsWith(\".pdf\")) {\n downloadFile(url, dst, orgDst, false, \"\");\n newUrl = path.join(\"reference\", path.relative(chapterData.dstDir, dst));\n }else {\n downloadFile(url, dst, orgDst, true, setFrontMatter(chapterData.bookConfig.localPath, newFrontMatter));\n newUrl = path.join(\"reference\", path.relative(chapterData.dstDir, dst)).replace(\".md\", \".html\");\n }\n\n var order = Number(chapter.order ? chapter.order : DEFAULT_ORDER);\n var orderBook = Number(chapter.orderBook);\n if (chapterData.bookConfig.brother) {\n if (chapterData.bookConfig.brother != chapterData.bookConfig.id) {\n order = chapterData.bookConfig.order ? chapterData.bookConfig.order : order;\n orderBook = chapterData.bookConfig.idNb ? chapterData.bookConfig.idNb : orderBook;\n }\n }\n var chapterToc = {\n name: chapter.name,\n order: order,\n orderBook: orderBook,\n url: newUrl,\n }\n\n //push new chapterToc for generated yml file\n chapterData.toc.children.push(chapterToc);\n\n var section = chapterData.section;\n var nbDownload = chapterData.section.mapNbMarkdownDownloaded.get(chapterData.language);\n nbDownload += 1;\n chapterData.section.mapNbMarkdownDownloaded.set(chapterData.language, nbDownload);\n\n } else if (chapter.children) { //if children call recursively ReadChapters\n var subChapterData = Object.assign({}, chapterData);\n\n var subToc = {\n name: chapter.name,\n order: chapter.order ? chapter.order : DEFAULT_ORDER,\n orderBook: 0,\n children: [],\n };\n subChapterData.toc = subToc;\n ReadChapters(chapter.children, subChapterData);\n chapterData.toc.children.push(subToc);\n }\n }\n}", "title": "" }, { "docid": "3b2408f9271f3ecf5bf763fed6ca5084", "score": "0.46356383", "text": "function readDocument(inputDoc, linesToSkip) { // __________________________________________________________\n var curDoc = new File(inputDoc); //Een nieuwe bestand aanmaken gebaseerd op de geselecteerde input file\n if (curDoc.exists){ // we controleren of deze bestaat (gebeurt allemaal achter de schermen in de memory)\n var contentAry = new Array(); // we maken een content array\n curDoc.open(\"r\"); // we openen het document om deze in te lezen (in read mode \"R\"), schrijven is \"W\" mode.\n while(!curDoc.eof) { // terwijl we NIEt aan het einde van de document zijn (eof is end of file)\n contentAry[contentAry.length] = curDoc.readln(); // lezen we elke regel van het document en slaan deze op in de zojuist aangemaakte array.\n }\n curDoc.close(); // we sluiten vervolgens het document\n }\n contentAry.splice(0, linesToSkip); // document processing (bijg evalueren of we regels willen overslaan zoals de header etc., in dat geval worden die gestript uit de array\n var contentList = contentAry.join(\"_dpt_\").toString().replace(new RegExp(\"_dpt_\",\"g\" ), \" \\r\" ); // we maken vervolgens een nieuwe variabel aan , deze is gelij aan onze array, maar we gaan deze joinen (comma separated array wordt ander character) in dit geval \"_dpt_\". Dit voorkomt dat de script error maakt als er een komma in de tekst file zit.\n contentAry = contentAry;\n return{ // we krijgen de data terug of als een content array, of als een content list (voor als we later bijv de lijst willen printen, in leesbare vorm)\n 'contentAry': contentAry,\n 'contentList': contentList\n }\n } // Einde van de readDocument functie __________________________________________________________________", "title": "" }, { "docid": "ff6d0870fb75dc7c67b99cd97062a002", "score": "0.46341613", "text": "readFile({ commit }) {\n const files = event.target.files;\n commit('setFiles', files)\n const fileReader = new FileReader();\n let file = files[0]\n if (file['size'] < 20000) {\n fileReader.readAsDataURL(file)\n fileReader.addEventListener('load', () => {\n var imageURL = fileReader.result;\n commit('setImageURL', imageURL)\n });\n } else if (file['size'] > 20000) {\n alert(\"Imagen Demasiado Grande\");\n } else if (this.file == null) {\n alert(\"Se Omite Foto De Perfil\");\n } else {\n commit('setAlertMessage', 'the image size is greater than 200 KB');\n }\n }", "title": "" }, { "docid": "87aedf3297e33d1a08f224bd56f61822", "score": "0.46314478", "text": "async loadNotarizedDocuments() {\n const { contractInst, account } = this.state;\n //calling blockchain method\n const _result = await contractInst.methods.getAllDocumentProofs().call();\n this.setState({ listOfNotarizedDocuments: _result });\n }", "title": "" }, { "docid": "b3a9cf5be41a8ea29bebfbb765202dc7", "score": "0.4629768", "text": "function packageDemographics(res, userData, uIndex) {\n //set up a data counter to keep track of how many things have been stored (this is becuase of the\n //async nature of fs.read/write)\n let dataCount = 0;\n //once again, for loop for as many users\n for (let i = 0; i < uIndex.users.length; i++) {\n //read in the corresponding clarifai json file (url is stored in the userIndex, file in seperate directory)\n //spits out json as var=>data\n fs.readFile(uIndex.users[i].claData, function(err, data) {\n if (err) throw err;\n //parse'n'store\n let claData = JSON.parse(data);\n //decode the ridiculously long path to the data we want from the clarifai .json\n let raceInfo = claData.outputs[0].data.regions[0].data.face.multicultural_appearance.concepts;\n //loop for as many objects there are in the cla data\n for (let e = 0; e < raceInfo.length; e++) {\n //create a key value pair for each one in our userData object\n userData.demographics[i][raceInfo[e].name] = raceInfo[e].value;\n }\n //increase the data count\n dataCount++\n //if as many datas as users\n if (dataCount >= uIndex.users.length) {\n //send that data on t'wards the client\n res.send(userData);\n }\n })\n }\n}", "title": "" }, { "docid": "4b2277707654d6500201c300ada4c088", "score": "0.46296114", "text": "function readText(filePath) {\n var output = \"\"; //placeholder for text output\n if(filePath.files && filePath.files[0]) { \n reader.onload = function (e) {\n output = e.target.result;\n \n //Parse the csv file by new line\n var lines = this.result.split('\\n');\n //Creating a new array on the data on the line \n for(var line = 0; line <lines.length; line++){\n var currStudent = lines[line];\n //create an array of current student's attributes\n var student = currStudent.split(\",\");\n //creates student object\n createStudentObject(student);\n }\n //console.log(arrayOfObjects);\n findStudentGroups();\n displayFullHTML();\n\n\n \n };//end onload()\n reader.readAsText(filePath.files[0]);\n }//end if html5 filelist support\n else if(ActiveXObject && filePath) { //fallback to IE 6-8 support via ActiveX\n try {\n reader = new ActiveXObject(\"Scripting.FileSystemObject\");\n var file = reader.OpenTextFile(filePath, 1); //ActiveX File Object\n output = file.ReadAll(); //text contents of file\n file.Close(); //close file \"input stream\"\n displayContents(output);\n } catch (e) {\n if (e.number == -2146827859) {\n alert('Unable to access local files due to browser security settings. ' + \n 'To overcome this, go to Tools->Internet Options->Security->Custom Level. ' + \n 'Find the setting for \"Initialize and script ActiveX controls not marked as safe\" and change it to \"Enable\" or \"Prompt\"'); \n }\n } \n }\n else { //this is where you could fallback to Java Applet, Flash or similar\n return false;\n } \n return true;\n}", "title": "" }, { "docid": "d385f1dc5178b95357beb4c0032fbaa7", "score": "0.46289966", "text": "function process_files(users) {\n\t\tcount(number_obj.current, users, save);\n\t}", "title": "" }, { "docid": "13c741282be352c6ef9ce58bae4917ef", "score": "0.46281812", "text": "function readMe(){\n //obj = JSON.parse(fs.readFileSync('public/quakes.json', 'utf8')); //read file from quakes.json\n obj = JSON.parse(fs.readFileSync('public/combined.json', 'utf8')); //read file from combines.json\n console.log(\"Data sets in the following JSON file: \" + obj.length);\n setTimeout(generate, 2000)\n}", "title": "" }, { "docid": "6727904370ee8c0b2200d05c7c92ac25", "score": "0.46264336", "text": "async linguist(_, {commit, cache: {languages}}) {\n const cache = {files: {}, languages}\n const result = {total: 0, files: 0, missed: {lines: 0, bytes: 0}, lines: {}, stats: {}, languages: {}}\n const edited = new Set()\n for (const edition of commit.editions) {\n edited.add(edition.path)\n\n //Guess file language with linguist\n const {files: {results: files}, languages: {results: languages}, unknown} = await linguist(edition.path, {fileContent: edition.patch})\n Object.assign(cache.files, files)\n Object.assign(cache.languages, languages)\n if (!(edition.path in cache.files))\n cache.files[edition.path] = \"<unknown>\"\n\n //Aggregate statistics\n const language = cache.files[edition.path]\n edition.language = language\n const numbers = edition.patch\n .split(\"\\n\")\n .filter(line => this.markers.line.test(line))\n .map(line => Buffer.byteLength(line.substring(1).trimStart(), \"utf-8\"))\n const added = numbers.reduce((a, b) => a + b, 0)\n result.total += added\n if (language === \"<unknown>\") {\n result.missed.lines += numbers.length\n result.missed.bytes += unknown.bytes\n }\n else {\n result.lines[language] = (result.lines[language] ?? 0) + numbers.length\n result.stats[language] = (result.stats[language] ?? 0) + added\n }\n }\n result.files = edited.size\n result.languages = cache.languages\n return result\n }", "title": "" }, { "docid": "99d6e723d98645c59e900d2c67fa74c2", "score": "0.46239844", "text": "function verifyUser(){\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // When successfully loaded, store people as an array split by new line\n let people = this.responseText.split('\\n');\n let found = false;\n for(let person in people){\n if(user === people[person]){\n // If the user is found in important.txt, let found = true\n found = true;\n }\n }\n if(!found){\n // If the user was not found in important.txt, no greeting\n let noGreeting = document.createElement(\"p\");\n noGreeting.innerHTML = \"No greeting for you\";\n content.appendChild(noGreeting);\n }else{\n // User was found, so call loadDoc() function\n loadDoc();\n }\n }\n };\n xhttp.open(\"GET\", \"important.txt\", true);\n xhttp.send();\n}", "title": "" }, { "docid": "bab2ac83d002bbf8f3e8b23b19c56c08", "score": "0.4619746", "text": "function _loadContent(err, stats) {\n\n if (err !== null) {\n // File does not exist, so fetch from dspace.\n if (err.code === 'ENOENT') {\n _getFileFromDspace();\n }\n else {\n console.log(err);\n }\n }\n else if (stats.isFile()) {\n // File exists, so use it.\n var size = stats.size;\n _sendCachedFile(filePath, size);\n }\n\n }", "title": "" }, { "docid": "c552554e8e7d2b1846558a387133bb47", "score": "0.46152246", "text": "function loadSample(path) {\n fetch(path)\n .then(function(response) { \n return response.text() \n })\n .then(function(text) { \n updateUI(FileInput.parseFileContents(text));\n $('#upload').prop('checked', false)\n $('#paste').prop('checked', true)\n });\n }", "title": "" }, { "docid": "7f199aa8cbc0a4e1a162edae0080293a", "score": "0.46142012", "text": "function statisticsPost() {\n\t\tvar url;\n\t\tvar propList = ['coveredNumLine', 'executedNumLine', 'totalNumLine', \n\t\t'coveredNumOp', 'executedNumOp', 'totalNumOp', 'totalNumDlintWarning'];\n\t\tconsole.log(JSON.stringify(resultDB, 0, 2));\n\t\tfs.writeFileSync(summaryFile, 'url,' + propList.join(',') + '\\r\\n');\n\t\tfor (url in resultDB) {\n\t\t\tif (!(resultDB.hasOwnProperty(url))) continue;\n\t\t\tvar line = url;\n\t\t\tfor(var i=0;i<propList.length;i++) {\n\t\t\t\tline = line + ',' + resultDB[url][propList[i]];\n\t\t\t}\n\t\t\tfs.appendFileSync(summaryFile, line + '\\r\\n');\n\t\t}\n\t\tconsole.log('Result written into:\\r\\n\\t' + summaryFile);\n\t}", "title": "" }, { "docid": "320ade0f1a5ada99786f518227aff007", "score": "0.46125823", "text": "function LoadFromFile() {\n readLists(function (data) {\n MergeList(data);\n Lists.Sync();\n })\n }", "title": "" }, { "docid": "9c66996d1e29c37b3220eb5535a7a468", "score": "0.46070364", "text": "function loadFile() {\n console.log('loadFile');\n var result = null;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n console.log('Status: ' + this.status);\n if (this.readyState == '4' && this.status == '200') {\n result = xmlhttp.responseText;\n console.log('File read: ' + result);\n buildReport(result);\n }\n };\n xmlhttp.open('GET', 'savedQueries.json', true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "163b8ec3c7468186274b4f7e4f6caa1b", "score": "0.46051693", "text": "readFile(e) {\n\t\tconst content = this.fileReader.result;\n\t\t\n\t\tthis.fileUpload(content).then((response)=>{\n\t\t this.setState({\n\t\t\t\t...this.state,\n\t\t\t\tresponseDetail: response.data\n\t\t\t});\n\t\t})\n\t}", "title": "" }, { "docid": "7c7ebe35754a3ec79cc6104bdcbc2cfc", "score": "0.45970657", "text": "onDoctorView(patientUsername, patientFilename) {\n if (!this.state.username || !patientFilename || !patientUsername) {\n console.error(\"Needed fields not provided!\");\n return;\n }\n\n this.setState({ filePreviewDialogOpen: true, isLoading: true });\n\n // generate private key to decrypt\n let passphrase = loadUserData().appPrivateKey;\n let privatekey = cryptico.generateRSAKey(passphrase, 1024);\n\n // get file from patient's gaia hub\n getFile(\n `SHARED_${this.state.username.split(\".\")[0]}_END_${patientFilename}`,\n {\n username: `${patientUsername}.id.blockstack`,\n decrypt: false\n }\n )\n .then(filecontent => {\n // decrypts encrypted file content\n let decrypted = cryptico.decrypt(filecontent, privatekey);\n\n this.setState({ fileContent: decrypted.plaintext, isLoading: false });\n })\n .catch(err => {\n console.error(err);\n this.setState({ isLoading: false, fileContent: \"Error Occured!\" });\n });\n }", "title": "" }, { "docid": "fe6f63e2c155ae8b0f435f12941a0f9e", "score": "0.45924166", "text": "async function processData() {\n // array of all the input files (crime reports)\n const inputFiles = fs.readdirSync(INPUT_DIR);\n\n // go through all the input files and produce an output JSON file\n for (const filename of inputFiles)\n {\n // get the file name from the file path\n const filepath = `${INPUT_DIR}/${filename}`;\n \n // pull the data from the PDF\n const data = await getDataFromPDF(filepath);\n \n // write the data from the PDF to a JSON file\n fs.writeFileSync(`output/${filename.replace(\"pdf\", \"json\")}`, JSON.stringify(data, null, 4));\n fs.writeFileSync(`../data/${filename.replace(\"pdf\", \"json\")}`, JSON.stringify(data, null, 4));\n }\n}", "title": "" }, { "docid": "13a1affd8fbad8c2edbc8549ba61edb3", "score": "0.45900005", "text": "async function bulkLoadNaicsData () {\n try {\n // Clear previous ES index\n await esConnection.resetIndex()\n\n const filePath = path.join('./naics', \"es-bulkload-naics-2017.txt\")\n const naicsBulkLoadPayload = fs.readFileSync(filePath, 'utf8')\n await esConnection.client.bulk({body: naicsBulkLoadPayload})\n\n } catch (err) {\n console.error(err)\n }\n}", "title": "" }, { "docid": "c7e0ae58743d998d0a7d9fdef84c9f65", "score": "0.45828217", "text": "importEditorContent ({ commit, dispatch, state }, fileList) {\n if (state.game.loaded) {\n let file = fileList[0]\n let fileExtension = file.name.split('.').pop()\n // Check file extension\n if (ProcessorProxyFactory.processorProxies.map(e => e.name).includes(Object.keys(languagesExtensions).find(key => languagesExtensions[key] === fileExtension))) {\n dispatch('console/info', 'Fichier supporté')\n // Get file\n let fr = new FileReader()\n // Declare onload callback\n fr.onload = (e) => {\n console.log(e.target.result)\n commit('UPDATE_EDITOR_CONTENT', e.target.result)\n // Reset the editor value directly on the editor instance\n // Nesesary because the editor component can not watch the editor content state\n window.scriptEditor.getModel().setValue(e.target.result)\n }\n fr.readAsText(fileList[0])\n commit('UPDATE_EDITOR_LANGUAGE', Object.keys(languagesExtensions).find(key => languagesExtensions[key] === fileExtension))\n } else {\n Snackbar.open({\n message: 'Language non supporté.',\n type: 'is-warning',\n position: 'is-top',\n actionText: 'OK',\n duration: 4500\n })\n dispatch('console/warning', 'Language non supporté.')\n }\n } else {\n Snackbar.open({\n message: \"Vous ne pouvez pas importer de fichier si aucun jeux n'est chargé.\",\n type: 'is-warning',\n position: 'is-top',\n actionText: 'OK',\n duration: 4500\n })\n dispatch('console/warning', \"Vous ne pouvez pas importer de fichier si aucun jeux n'est chargé.\")\n }\n }", "title": "" }, { "docid": "ecd785ea109f556df2a2ed65e3169cbd", "score": "0.45819283", "text": "function readParagraphs() {\n // data loaded everything is ok\n if ((xhrParagraphsContents.readyState === 4) && (xhrParagraphsContents.status === 200)) {\n\n var paragraphsContents = JSON.parse(xhrParagraphsContents.responseText);\n var contents = paragraphsContents.paragraphs;\n\n contents.forEach(function (pContents) {\n var index = pContents[\"id\"];\n var contents = pContents[\"content\"];\n console.log(index + \" ==> \" + pContents);\n if (paragraphElements [index]) {\n paragraphElements [index].innerHTML = contents;\n }\n }, this);\n\n }\n }", "title": "" }, { "docid": "619db77b3986dfa6243d6002cf7177a9", "score": "0.45804545", "text": "function processContents(fileContents) {\n \n // place the contents into the file contents area (will improve later)\n // document.getElementById('pointbox').innerHTML = \"<pre>\" + fileContents + \"</pre>\";\n // document.getElementById('selected').innerHTML = \"<pre>\" + fileContents + \"</pre>\";\n \n var pointboxContents = \"\";\n \n // parse the file and process as appropriate\n // TODO: check that this is always still here when we ask, might be\n // better to store the filename in a variable for safe keeping\n var fileName = document.getElementById('filename').innerHTML;\n if (fileName.indexOf(\".wpt\") >= 0) {\n document.getElementById('filename').innerHTML = fileName + \" (Waypoint File)\";\n document.getElementById('startUp').innerHTML=\"\";\n pointboxContents = parseWPTContents(fileContents);\n showTopControlPanel();\n }\n else if (fileName.indexOf(\".pth\") >= 0) {\n document.getElementById('filename').innerHTML = fileName + \" (Waypoint Path File)\";\n document.getElementById('startUp').innerHTML=\"\";\n pointboxContents = parsePTHContents(fileContents);\n showTopControlPanel();\n }\n else if (fileName.indexOf(\".nmp\") >= 0) {\n document.getElementById('filename').innerHTML = fileName + \" (Near-Miss Point File)\";\n document.getElementById('startUp').innerHTML=\"\";\n pointboxContents = parseNMPContents(fileContents);\n showTopControlPanel();\n }\n else if (fileName.indexOf(\".wpl\") >= 0) {\n document.getElementById('filename').innerHTML = fileName + \" (Waypoint List File)\";\n document.getElementById('startUp').innerHTML=\"\";\n pointboxContents = parseWPLContents(fileContents);\n showTopControlPanel();\n }\n else if (fileName.indexOf(\".gra\") >= 0) {\n document.getElementById('filename').innerHTML = fileName + \" (Highway Graph File)\";\n document.getElementById('startUp').innerHTML=\"\";\n pointboxContents = parseGRAContents(fileContents);\n }\n else if (fileName.indexOf(\".tmg\") >= 0) {\n document.getElementById('filename').innerHTML = fileName + \" (Highway Graph File)\";\n document.getElementById('startUp').innerHTML=\"\";\n pointboxContents = parseTMGContents(fileContents);\n showAlgorithmSelectionPanel();\n }\n \n document.getElementById('datatable').innerHTML = pointboxContents;\n hideLoadDataPanel();\n updateMap();\n}", "title": "" }, { "docid": "3b6224d3e55c173fd228a1780d2a3e67", "score": "0.45738417", "text": "function collectlogfileitems(readfile) {\n\n\tconst readInterface = readline.createInterface ({\n\t\tinput: fs.createReadStream(readfile),\n //output: process.stdout,\n //console: false\n });\n\n readInterface.on('line', function(line) {\n\n\t\tif ( line.indexOf(forgedblockstext) != -1 ) {\n\n\t\t\tblocks += parseInt(line.slice(line.indexOf(':')+1))\n\n }\n\t\tif ( line.indexOf(distributiontext) != -1 ) {\n\t\t\t\n\t\t\tdist = line.slice(line.indexOf(':')+1)\n\t\t\tnumber += parseInt(dist.substring(0, dist.length - 1))\n\t\t}\n });\n}", "title": "" }, { "docid": "f9075b682925cf7aea6c04a656937f29", "score": "0.45714596", "text": "function fileLoaded(event) {\n // file done loading, read the contents\n processContents(event.target.result);\n}", "title": "" }, { "docid": "ef09a4262f6c007b6ae8b55625735bfb", "score": "0.45700496", "text": "function cloud_load(get_loadDocid, get_loadTemplateId, get_loadTemplateOwnerId, get_loadOwnerId) {\n\twaitbox_start(); // Removed to keep load clean\n\t//message_start(\"Loading\");\n\tloadMessageDisplayed = true;\n\tloadDocid = get_loadDocid;\n\tloadTemplateId = get_loadTemplateId;\n\tloadTemplateOwnerId = get_loadTemplateOwnerId;\n\tloadOwnerId = typeof get_loadOwnerId == \"undefined\" ? \"\" : get_loadOwnerId;\n\t\n\tif(typeof(loadDocid) == \"undefined\") {\n\t\tloadDocid = lastActiveDocid;\n\t} else {\n\t\tlastActiveDocid = loadDocid;\n\t}\n\tlastImportFromOwner = loadTemplateOwnerId;\n\n\tserverComBusy = true;\n\t\n\t\n\t//board_description\n\t\n\t\n\t\n\tvar http = new XMLHttpRequest();\n\thttp.onprogress = function(e) {\n/*\t\tif(!loadMessageDisplayed) {\n\t\t\twaitbox_start(); // Removed to keep load clean\n\t\t\tmessage_start(\"Loading\");\n\t\t\tloadMessageDisplayed = true;\n\t\t} */\n\t\t//message_progress(e.loaded, e.total);\n\t}\n\n\thttp.onreadystatechange = function() {\n\t\tswitch(http.readyState) {\n\t\t\tcase 4:\n\t\t\t\tif(http.status == 200) {\n\t\t\t\t\tvar dataSaveData = http.responseText;\n\t\t\t\t\tif(dataSaveData !== \"\") { // A copy already saved?\n\t\t\t\t\t\tdocumentSavedOnce = true;\n\t\t\t\t\t\tmessage_end();\n\t\t\t\t\t\tfinalizeLoad(dataSaveData);\n\t\t\t\t\t} else { // No, we can load the template\n\t\t\t\t\t\tdocumentSavedOnce = false;\n\t\t\t\t\t\tif(lastImportFromOwner != \"\") {\n\t\t\t\t\t\t\tcloud_load_fromTemplate();\n\t\t\t\t\t\t} else { // No template - New empty document\n\t\t\t\t\t\t\twaitbox_end();\t\n\t\t\t\t\t\t\tif(editor && dot_init_requested) {\n\t\t\t\t\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\t\t\t\t\tdot_init();\n\t\t\t\t\t\t\t\t}, 250);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocChecksum = getDocumentChecksum();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage_update(\"Failed\");\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t//message_end();\n\t\t\t\t\t\twaitbox_end();\n\t\t\t\t\t\tif(editor && dot_init_requested) {\n\t\t\t\t\t\t\tdot_init();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 3000);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tserverComBusy = false;\n\t\t\t\tdocServerStamp = 0;\n\t\t\t\tsession_initialize();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\thttp.open(\"GET\", QUERY_URL + \"?load=\" + loadDocid + \"&userid=\"+(loadOwnerId == \"\" ? userid : loadOwnerId)+\"&nocache=\" + Date.now(), true);\n\thttp.send();\n}", "title": "" }, { "docid": "6f88910ef6433ca8649327736b80dc21", "score": "0.45684", "text": "async read(text) {\n try {\n const data = [];\n\n let message = '';\n let line = '';\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n if (char === '\\n') {\n if (line.match(this.multilineStartPattern) !== null) {\n data.push({ message });\n message = '';\n } else {\n message += char;\n }\n message += line;\n line = '';\n } else {\n line += char;\n }\n }\n\n // add the last line of the file to the list\n if (message !== '') {\n data.push({ message });\n }\n\n // remove first line if it is blank\n if (data[0] && data[0].message === '') {\n data.shift();\n }\n\n this.data = data;\n this.docArray = this.data;\n\n return {\n success: true,\n };\n } catch (error) {\n console.error(error);\n return {\n success: false,\n error,\n };\n }\n }", "title": "" }, { "docid": "89efc00d104d16449715af1a628481cf", "score": "0.45671082", "text": "function load_new_textfile (bar) {\n\n\t// shuffle textfiles array? maybe upon rest of text_i? or use random text_i values?\n\ttextfiles_i = (textfiles_i+1) % textfiles.length;\n\n \tconsole.log('loading: '+textfiles[textfiles_i].filename);\n\tfs.readFile('./texts/'+textfiles[textfiles_i].filename, 'utf8', function (err,data) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t\tprocess.exit(-1);\n\t\t}\n\n\t\ttext_body = data;\n\t\ttext_body_split = text_body.split(/[\\s*]/g); // along all whitespace\n\t\ttext_body_length = text_body_split.length;\n\n\t\ttext_body_i = 0;\n\n\t\tio.to('active').emit('textinfo',JSON.stringify(textfiles[textfiles_i]));\n \t\tconsole.log('load successful');\n\n\t\tbar();\n\t});\n\n}", "title": "" }, { "docid": "01a767a80b940de39b62e79859073e52", "score": "0.4564046", "text": "loadData(files, fetchParam = {}) {\n this.status = 'Loading view data.';\n this._viewData = {};\n files.forEach((file, i) => {\n\n let fp = fetchParam.hasOwnProperty(file)\n ? fetchParam[file]\n : this._fetchParam.hasOwnProperty(file)\n ? this._fetchParam[file]\n : fetchParam;\n\n this.appendData(file,fp)\n .then(() => {\n if (i === files.length-1) {\n this.status = 'View data loaded';\n this.setDirty(true);\n }\n })\n .catch(e => {\n this.setStatus(\"error loading data\");\n console.error(e);\n });\n });\n }", "title": "" }, { "docid": "9eb79557d4ceb98105020ebd8284720f", "score": "0.45617387", "text": "function mainBody(){\n fs.readFile('data.txt', (err, data) => {\n if (err) throw err;\n // file openning\n data = data.toString()\n let res = data.split('\\r\\n')\n let pk = res[0]\n let user = res[1]\n let did = res[2]\n let date = res[3]\n let time = res[4]\n let claimam = res[5]\n let delph = res[6]\n pk = pk.split(\" :\")\n user = user.split(\" :\")\n did = did.split(\" :\")\n date = date.split(\" :\")\n time = time.split(\" :\")\n claimam = claimam.split(\" :\")\n delph = delph.split(\" :\")\n userPrivateKey = pk[1]\n userClaimAccount = user[1]\n userClaimDropId = parseInt(did[1])\n date = date[1].split('/')\n let year = parseInt(date[2])\n let month = parseInt(date[1]) - 1\n let day = parseInt(date[0])\n time = time[1].split(\":\")\n let hour = parseInt(time[0])\n let minute = parseInt(time[1])\n userClaimAmount = parseInt(claimam[1])\n respond = delph[1]\n\n // Api\n const privateKeys = [userPrivateKey];\n const signatureProvider = new JsSignatureProvider(privateKeys);\n const rpc = new JsonRpc('https://chain.wax.io', { fetch }); //required to read blockchain state\n const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() }); //required to submit transactions\n \n //Get Intended dewlphi Median\n const getIntMedian = () => rpc.get_table_rows({\n json: true, // Get the response as json\n code: 'delphioracle', // Contract that we target\n scope: 'waxpusd', // Account that owns the data\n table: 'datapoints', // Table name\n limit: 1, // Maximum number of rows that we want to get\n reverse: false, // Optional: Get reversed data\n show_payer: false // Optional: Show ram payer\n })\n\n // Reccurtion Claim Ith no Intended Delphi Median\n let Claim = () => {\n api.transact({\n actions: [{\n account: userReferAccount,\n name: userAction,\n authorization: [{\n actor: userClaimAccount,\n permission: 'active',\n }],\n data: {\n claim_amount: userClaimAmount,\n claimer: userClaimAccount,\n country: userCountry,\n drop_id: userClaimDropId,\n intended_delphi_median: userIntendedDelphiMedian,\n referrer:userReferrer,\n },\n }]\n }, {\n blocksBehind: 3,\n expireSeconds: 30,\n }).then((res) =>{\n console.log(res)\n console.log('-----------------Sucess----------------------')\n }).catch((err) =>{ \n console.log(err)\n console.log('-----------------Fail----------------------')\n Claim()\n })\n }\n\n // Reccurtion Claim With Intended Delphi Median\n let ClaimWithInt = () =>{\n getIntMedian().then((data) =>{\n userIntendedDelphiMedian = data['rows'][0]['median']\n api.transact({\n actions: [{\n account: userReferAccount,\n name: userAction,\n authorization: [{\n actor: userClaimAccount,\n permission: 'active',\n }],\n data: {\n claim_amount: userClaimAmount,\n claimer: userClaimAccount,\n country: userCountry,\n drop_id: userClaimDropId,\n intended_delphi_median: userIntendedDelphiMedian,\n referrer:userReferrer,\n },\n }]\n }, {\n blocksBehind: 3,\n expireSeconds: 30,\n }).then((res) =>{\n console.log(res)\n console.log('-----------------Sucess----------------------')\n }).catch((err) =>{ \n console.log(err)\n console.log('-----------------Fail----------------------')\n ClaimWithInt()\n })\n })\n }\n \n //Timer\n // 13 second delay if Intended delphi median is needed\n var buy_time = new Date(year,month,day,hour,minute,0,0);\n if(respond=='Y'){\n // 8.1 second delay\n buy_time = buy_time - 8100\n buy_time = new Date(buy_time)\n }\n else if(respond=='N'){\n // 6 second delay \n userIntendedDelphiMedian = 0\n buy_time = buy_time - 6000\n buy_time = new Date(buy_time)\n }\n\n console.log('Pending for Claim Drop ID: ' + userClaimDropId)\n\n while (true){\n var time_now = new Date();\n //exit()\n if (time_now.getTime() >= buy_time.getTime()){\n break\n }\n }\n\n if(respond=='Y'){\n ClaimWithInt()\n }\n else if(respond=='N'){\n // claimdrop\n Claim()\n }\n })\n}", "title": "" }, { "docid": "c4f7d2286250f34478a9e5729fb48e16", "score": "0.45506412", "text": "function renderUser(){\n //create httpRequest Object\n const httpRequest = new XMLHttpRequest();\n //open httpRequest\n httpRequest.open('GET', 'user.json', true);\n //use onload function\n httpRequest.onload = function(){\n if(this.status === 200){\n const user = JSON.parse(this.responseText);\n let output = '';\n\n output += '<ol type=\"a\"> '+\n '<li>ID: '+ user.id + '</li>'+\n '<li>Name: '+ user.name + '</li>'+\n '<li>Email '+ user.email + '</li>'+\n '</ol>';\n document.querySelector('#user').innerHTML = output;\n }\n else if(this.status === 404){\n document.querySelector('#user').innerHTML = 'Not found';\n }\n }\n httpRequest.send();\n}", "title": "" }, { "docid": "b69a2668fd9ea749c076e591d7713f83", "score": "0.4550184", "text": "function infoFile(){ // metodo que convierte la cadena obtenida del archivo en json y permite leerlo\n if(tipoDato == 'number'){\n burbuja();\n } else {\n listaValores = lonWord();\n burbuja();\n }\n}", "title": "" } ]
227d3a62c1a5431205abd46f149bea12
Whether we have modified any state that should trigger a snapshot.
[ { "docid": "21f0e47bd170be392f1f62fc46f0fc4c", "score": "0.0", "text": "get Qs() {\n return this.Us;\n }", "title": "" } ]
[ { "docid": "dc5fb89417fb3212b4a033196529d8f9", "score": "0.715389", "text": "function hasChanged() {\n return changed;\n}", "title": "" }, { "docid": "39d7b541b637837250f0ba0c9bd573b8", "score": "0.70909166", "text": "hasStateUpdates() {\n return this.stateQueue.length > 0;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.7040281", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.7040281", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.7040281", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.7040281", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.7040281", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "f4c0d73915b3164c95c634bb7ba408e8", "score": "0.6938886", "text": "isDirty() {\n return Object.keys(this._prev_attributes).length > 0;\n }", "title": "" }, { "docid": "f2843ffd98754fdb35677d030fc02a53", "score": "0.6788756", "text": "hasChanges() {\n return this.__updatedAttributes.length > 0 || this.__deletedAttributes.length > 0;\n }", "title": "" }, { "docid": "482fce42cd724cab8165ffbf82a7a873", "score": "0.6593982", "text": "isDirty() {\n return (this.state.value || null) !== (this.props.value || null);\n }", "title": "" }, { "docid": "b5faa957ce88b800a89953d4c193eaa1", "score": "0.6464771", "text": "pe () {\n if (edgeUid[this.euid].lastState === false && this.state === true) {\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "38b7681ce50144482b9525548d4af1db", "score": "0.64108634", "text": "isCurrentStateOutdated() {\n\t\treturn Object.entries(this._stateStorage).some(([propName, propValue]) => this[propName] !== propValue);\n\t}", "title": "" }, { "docid": "81ae2038d9b309b321104c636894bec1", "score": "0.64027643", "text": "get shouldTakeSnapshot() {\n return false\n }", "title": "" }, { "docid": "e1f5ce614930cb86638ffabeb7013a5b", "score": "0.63726366", "text": "get hasPersistableChanges() {\n return this.isPersistable && !ObjectHelper.isEmpty(this.rawModificationData);\n }", "title": "" }, { "docid": "2a555c8425d5c915a11c4d989863d619", "score": "0.6244933", "text": "hasChanged(attr) {\n\t\tif (attr == null) return !_.isEmpty(this.changed)\n\t\treturn _.has(this.changed, attr)\n\t}", "title": "" }, { "docid": "684047f570bb2821b8d6a4ad7ca10361", "score": "0.62448084", "text": "#shouldBuildPartialSnapshot(dataNode) {\n return (\n // ref access\n !!dataNode.varAccess?.objectNodeId &&\n // ignore trace owning nodes (since that causes some trouble)\n !this.dp.util.isTraceOwnDataNode(dataNode.nodeId) &&\n // don't create partial snapshots for watched nodes.\n // (→ since this would lead to duplicated nodes)\n // → create full/deep snapshots instead\n !this.pdg.watchSet.isWatchedDataNode(dataNode.nodeId)\n );\n }", "title": "" }, { "docid": "12ef2e89d4f637a2faabbbee11aef5dd", "score": "0.623483", "text": "shouldComponentUpdate() {\n return (\n Object.assign(\n {},\n mapStateToProps(this.state.storeState, this.props)\n ) === this.previousProps\n );\n }", "title": "" }, { "docid": "050fd120e7c0a5474182703da6b67b65", "score": "0.62323064", "text": "hasChanged(attr) {\n if (_.isNull(attr)) return !_.isEmpty(this.changed);\n return !_.isUndefined(_.get(this.changed, attr));\n }", "title": "" }, { "docid": "9e8604afcba178c593836fba260c6a27", "score": "0.6215307", "text": "function isDirty() {\n return true;\n}", "title": "" }, { "docid": "868b09f8e777389cd65121efe69a20ad", "score": "0.6213355", "text": "_isValid() {\n return this.stateHistories && this.stateHistories.length > 0;\n }", "title": "" }, { "docid": "be853521d2ac27d9f98f56660915b09b", "score": "0.6206112", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "b374dfcb24f239dba59790cc577d21e6", "score": "0.6203291", "text": "function hasChanges(base) {\n const proxy = proxies.get(base)\n if (!proxy) return false // nobody did read this object\n if (copies.has(base)) return true // a copy was created, so there are changes\n // look deeper\n const keys = Object.keys(base)\n for (let i = 0; i < keys.length; i++) {\n if (hasChanges(base[keys[i]])) return true\n }\n return false\n }", "title": "" }, { "docid": "ee5b291ced2488e98ecc82e25a6fb550", "score": "0.6198775", "text": "function isSnapshotEvent(event) {\n return event.type === 'snapshot';\n}", "title": "" }, { "docid": "6237f9818d48e611b418c7a42ab1e98d", "score": "0.619321", "text": "function confirmChanges() {\r\n return isChanged;\r\n}", "title": "" }, { "docid": "1ee27f68d762bcdeb09e23be001c6044", "score": "0.61826444", "text": "function OrderedVm_isUpdated() {\r\n if (this.intVmOldPriority == this.intVmPriority &&\r\n\tthis.boolOldAutoStartStop == this.boolAutoStartStop) {\r\n return false; \r\n } else {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "0e8d12cb224d416d49c11b6879f5b0fd", "score": "0.61805695", "text": "shouldUpdate(props, state) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.61796045", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.61796045", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.61796045", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "9765228ebee5e644557651c675be3474", "score": "0.61796045", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "685668f07124f0be14a4f6e1373a9342", "score": "0.6170604", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "e8e359269fd511d67c896130b8e01c74", "score": "0.61551714", "text": "get isDirty() {\n return this._stringify(this._value) !== this._stringify(this.value);\n }", "title": "" }, { "docid": "15159fc81886977b57b17568ac42ea82", "score": "0.61397815", "text": "get geometryChanged() {\n return this.docChanged || (this.flags & (8 | 2)) > 0;\n }", "title": "" }, { "docid": "6f354c02ea4963cc0b49cf3b76c2b9f4", "score": "0.61343366", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "ab559b0c81625641c724066bce5ad6c3", "score": "0.61258525", "text": "isValid() {\n return (\n !this.state.alreadyExists &&\n !this.state.duplicates.environmentVariables.hasRefs &&\n !this.state.duplicates.persistedFolders.hasRefs &&\n !this.state.duplicates.configMapPaths.hasRefs &&\n !this.state.duplicates.secretPaths.hasRefs &&\n !this.state.duplicates.existingVolumes.hasRefs\n );\n }", "title": "" }, { "docid": "d6e6d8977ba78f7fe16dbb18a613a776", "score": "0.6087432", "text": "isModified(){\n //return !!sync.modifiedRequestsMap[this.props.record.optKey];\n let optKey = this.props.record.optKey,\n modifiedRequests = this.props.modifiedRequests,\n modRec = modifiedRequests[optKey]||{requestAction:'proxy'};\n return modRec.requestAction !=='proxy';\n }", "title": "" }, { "docid": "8303be0a94a3a4b1a46840c0b57ea201", "score": "0.6065295", "text": "shouldUpdate(_changedProperties) {\n return __hook__(_changedProperties => {\n return true;\n }, null, arguments, __da140e61ecdb563be368893121319116701c615bcefe29ebb808fe09cc48f2a6__[102]);\n }", "title": "" }, { "docid": "914bbf6a9a0c6c99a8a01f01cfe8f2f0", "score": "0.6064873", "text": "get dirty() {\n return this.content != this.getDocumentContent();\n }", "title": "" }, { "docid": "5a2be4a936fc34fdeedd1476026c73bb", "score": "0.60633457", "text": "isDirty () {\n const { dirty } = this.props // only by this dirty property for now\n return dirty\n }", "title": "" }, { "docid": "379c52bd5e63c1c80091c1299835f47d", "score": "0.6062638", "text": "function canReuseOldState(newReferencedMap,oldState){return oldState&&!oldState.referencedMap===!newReferencedMap;}", "title": "" }, { "docid": "b0d54279d04bc2baab5d182f97674f19", "score": "0.6045672", "text": "shouldUpdate(_changedProperties) {\n return true;\n }", "title": "" }, { "docid": "4fe38c08a033ca79de1b1a60b273229e", "score": "0.6031428", "text": "warnIfUnsaved() {\n return this.project.isDirty();\n }", "title": "" }, { "docid": "560613acc1b6e10b7f874f93590dc5d4", "score": "0.6024735", "text": "get docChanged() { return !this.changes.empty; }", "title": "" }, { "docid": "560613acc1b6e10b7f874f93590dc5d4", "score": "0.6024735", "text": "get docChanged() { return !this.changes.empty; }", "title": "" }, { "docid": "6cb973bc6d9da7fa9a8549645d15c51d", "score": "0.6011053", "text": "function haveNewChanges(changes, events){\n var auxHaveNewChanges = false;\n if (events.changes != undefined){\n if (changes != undefined){\n if (events.changes.length != changes.length) {\n console.log(' New Events -> Changes');\n auxHaveNewChanges = true;\n }\n } else {\n console.log(' New Events -> Changes');\n auxHaveNewChanges = true;\n }\n }\n return auxHaveNewChanges;\n}", "title": "" }, { "docid": "b51d60875d8427aa7cb0f39e56659d06", "score": "0.5988896", "text": "isPropertyUpdated(...properties) {\n\t\treturn properties.some(prop => this.getStoredPropertyState(prop) !== this[prop]);\n\t}", "title": "" }, { "docid": "3ea9271baf1863f6db81fa8d4c203706", "score": "0.5984076", "text": "get geometryChanged() {\n return this.docChanged || (this.flags & (8 /* UpdateFlag.Geometry */ | 2 /* UpdateFlag.Height */)) > 0;\n }", "title": "" }, { "docid": "ef61ed30406f5948def1683bad94a42b", "score": "0.5975459", "text": "function hasLocalChanges(object) {\n if (!object.updatedAt) {\n return false;\n }\n if (!object._syncedAt) {\n return true;\n }\n return object._syncedAt < object.updatedAt;\n }", "title": "" }, { "docid": "0fdd41d22162fae02bf9db86537c2430", "score": "0.5973807", "text": "valid() {\n return !this._logger.dirty()\n }", "title": "" }, { "docid": "374a0998390d0ec3a561c55f1603491d", "score": "0.597149", "text": "isAssessed() {\n return !!this.original && this.original.value !== DEFAULT_VALUE;\n }", "title": "" }, { "docid": "d1651aca3f39563646590545c1499c8d", "score": "0.59664214", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "d1651aca3f39563646590545c1499c8d", "score": "0.59664214", "text": "get docChanged() {\n return !this.changes.empty;\n }", "title": "" }, { "docid": "5acbf0361d45c8adc277dd32c0afdac0", "score": "0.5951278", "text": "mutated(caller) {\n let changed = false;\n const mutationList = this._dataChildren()\n if (mutationList.length > 0) {\n this._dataValue(mutationList);\n changed = true;\n }\n if (this._dataText()) {\n changed = true;\n }\n this._dataVisible();\n // console.log('mutated', caller, changed);\n return changed;\n }", "title": "" }, { "docid": "9ad4481958a30e981b18b6ff10605a60", "score": "0.59405565", "text": "function hasUnappliedChanges() {\n if (_controls.CropPane && _controls.CropPane.style.display === \"block\") {\n return _controls.InputCropHeight.value != 0 && _controls.InputCropWidth.value != 0;\n } else if (_controls.ResizePane && _controls.ResizePane.style.display === \"block\") {\n return actualWidth != _controls.InputResizeWidth.value || actualHeight != _controls.InputResizeHeight.value;\n }\n return false;\n}", "title": "" }, { "docid": "7257d370759168c5de30a784536c8ac3", "score": "0.5930502", "text": "getSnapshotBeforeUpdate(prevProps, prevState) {\n // DO: Last-minute DOM ops\n // DON'T: Cause Side-Effects\n console.log('[ People.js | Component-__-U4 ] shouldComponentUpdate');\n return null;\n }", "title": "" }, { "docid": "d6dda3aef41ecfd2fb175539d33ac4e5", "score": "0.5929728", "text": "checkCache() {\n return this.getChangeNumber() > -1;\n }", "title": "" }, { "docid": "9cc5b970b5e7d1cd3b95513f959315e9", "score": "0.592766", "text": "function areCustomAttributesDirty( material ) {\n\t\tfor ( var a in material.attributes )\n\t\t\tif ( material.attributes[ a ].needsUpdate ) \n\t\t\t\treturn true;\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "5005a5b7590ace6e3f3b5a9cec04e45f", "score": "0.59199005", "text": "get geometryChanged() {\n return this.docChanged || (this.flags & (8 /* UpdateFlag.Geometry */ | 2 /* UpdateFlag.Height */)) > 0;\n }", "title": "" }, { "docid": "4c4943a9b5ade4790a03db775b168284", "score": "0.5918064", "text": "_allPlayerMovesMade() {\n for (let state of this.playerMap.values()) {\n if (!state.hasMadeMove()) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "e4a5bf4d1b195caea501df73651533d4", "score": "0.58982855", "text": "shouldComponentUpdate() {\n if ((this.props.remainingFields.length === 0) || this.props.remainingFields.includes(this.props.item) || this.props.visitedFields.includes(this.props.item) || this.props.activeFields.includes(this.props.item)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "94d72b4a6d8675e60ce386aabcdc947b", "score": "0.58940184", "text": "function isModified() {\n for (var i=0; i<EthWanCfg.members.length; i++) {\n var name=EthWanCfg.members[i].memberName;\n if (isDefined(EthWanCfg.obj[name])) {\n if (EthWanCfg.members[i].getVal() != EthWanCfg.obj[name]) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "425fa7e886e2ffc2320220d281203426", "score": "0.58552057", "text": "function isModified(sess) {\n\t return originalId !== sess.id || originalHash !== hash(sess);\n\t }", "title": "" }, { "docid": "34870a1b1d0b358062c5ba934a5c7647", "score": "0.58539224", "text": "shouldUpdate(data) {\n\t\treturn true\n\t}", "title": "" }, { "docid": "d8c3c9e937d3b967ff7e76782bf7c8d7", "score": "0.58533204", "text": "dirty() {\n return !(this._msgs.length === 0 && this._children.every(child => !child.dirty()))\n }", "title": "" }, { "docid": "6307ac992a706ecaaecce3161d0a40b9", "score": "0.58401006", "text": "isReady() {\n return this.loudnessHistory.length > 180\n }", "title": "" }, { "docid": "172be899b08d828fb20bcda9209020c8", "score": "0.5829246", "text": "_hasChangedSet() {\n if (!this._team)\n return false;\n\n const board = this._board;\n const degree = board.getDegree('N', board.rotation);\n const oName = this.data.set.name;\n const oUnits = this.data.set.units.map(unitData => ({ ...unitData, direction:'S' }));\n const nName = this._name.value;\n const nUnits = this._team.units;\n\n return oName !== nName || oUnits.length !== nUnits.length || oUnits.findIndex(unit => {\n const unit2 = board.getTileRotation(unit.assignment, degree).assigned;\n\n return !(unit2 && unit2.type === unit.type);\n }) > -1;\n }", "title": "" }, { "docid": "a239457adaebd3ae4f940af7421b2bb7", "score": "0.58221203", "text": "function isModified(sess) {\r\n return originalId !== sess.id || originalHash !== hash(sess);\r\n }", "title": "" }, { "docid": "3f082be1272d2baea2fc2f6acd7f7c17", "score": "0.58210003", "text": "function hasSrcChanged(player, snapshot) {\n if (player.src()) {\n return player.src() !== snapshot.src;\n }\n // the player was configured through source element children\n return player.currentSrc() !== snapshot.src;\n }", "title": "" }, { "docid": "698a39bca8a1cfe7e68351c5845e1500", "score": "0.5817361", "text": "shouldUpdate() {\n return this.active;\n }", "title": "" }, { "docid": "698a39bca8a1cfe7e68351c5845e1500", "score": "0.5817361", "text": "shouldUpdate() {\n return this.active;\n }", "title": "" }, { "docid": "c878b4507b7f073420d58fd39f871ca7", "score": "0.58149886", "text": "get unchanged() {\r\n let unchanged = this.source.unchanged;\r\n unchanged = unchanged &&\r\n (this.metadata ? this.metadata.unchanged : true);\r\n if (this.outputs) {\r\n for (let o of this.outputs) {\r\n unchanged = unchanged && o.unchanged;\r\n }\r\n }\r\n if (this.executionCount) {\r\n // TODO: Ignore if option 'ignore minor' set?\r\n unchanged = unchanged && this.executionCount.unchanged;\r\n }\r\n return unchanged;\r\n }", "title": "" }, { "docid": "11e490d8e31e678d6d007ea9cce97810", "score": "0.58105856", "text": "checkNoChange(){\n this.noChange=this.scene.layerNoChange.getTileAtWorldXY(this.x, this.y) != null;\n }", "title": "" }, { "docid": "2cf7e8d3488d81c47a9036939f1430b0", "score": "0.5808466", "text": "isReplaced() {\n return !!this._isReplaced;\n }", "title": "" }, { "docid": "8e5e95f4ac79c83603bcbf0b96c40655", "score": "0.5804787", "text": "get patchIsStaged() {\n var readState = readStatusFile(getUpdatesDir());\n // Note that if we decide to download and apply new updates after another\n // update has been successfully applied in the background, we need to stop\n // checking for the APPLIED state here.\n return readState == STATE_PENDING || readState == STATE_PENDING_SVC ||\n readState == STATE_APPLIED || readState == STATE_APPLIED_SVC;\n }", "title": "" }, { "docid": "b7a9be67b9c1052b1cd5b648ba71308c", "score": "0.58030385", "text": "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var a in material.attributes ) {\n\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "5d11e86ad75ee6d88f14b858badbe609", "score": "0.5801921", "text": "isDirty(propertyName) {\n let iv = this.i.aw(propertyName);\n return (iv);\n }", "title": "" }, { "docid": "33afd0d1dbe8263f435337ca50765c37", "score": "0.5789828", "text": "async hasUncommittedChanges() {\n const result = await this._executeGitCommand('status');\n return typeof result === 'string' && (result.includes('not staged') || result.includes('untracked'));\n\n }", "title": "" }, { "docid": "b7fc3197b0193ce1c6268fa66ac7beb2", "score": "0.57863533", "text": "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "b7fc3197b0193ce1c6268fa66ac7beb2", "score": "0.57863533", "text": "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "d8f6d535a30acca7bc726cddb7231d67", "score": "0.57859504", "text": "function areCustomAttributesDirty ( material ) {\n\n\t\tfor ( var a in material.attributes ) {\n\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "5182f13add4fea4bdf8250e0bd10376c", "score": "0.578441", "text": "function shouldRunNewQuery() {\n if (\n // if year1 / year 2 (sliders) were changed\n currYear1 != lastValidYear1 ||\n currYear2 != lastValidYear2 ||\n // if division / inst type (dropdowns, checkboxes) were changed\n currDivision != lastDivision ||\n currOwnership != lastOwnership ||\n currLength != lastLength ||\n currIsR1 != lastIsR1 ||\n currJobType != lastJobType ||\n // if checkboxes changed state\n !sameChecked() ||\n !sameBEAZonesChecked()\n ) {\n // if something was changed, update \"last\" versions of the attributes\n lastValidYear1 = currYear1;\n lastValidYear2 = currYear2;\n lastDivision = currDivision;\n lastOwnership = currOwnership;\n lastLength = currLength;\n lastIsR1 = currIsR1;\n lastJobType = currJobType;\n // we cannot simply set lastSubjs = currSubjs here because then they point\n // to the same set\n lastCareerAreas.clear();\n currCareerAreas.forEach((careerarea) => lastCareerAreas.add(careerarea));\n lastBEAZones.clear();\n currBEAZones.forEach((beazone) => lastBEAZones.add(beazone));\n return true;\n }\n // no change, no need to update \"last\" versions\n return false;\n}", "title": "" }, { "docid": "85ef6f2dcb32be88cc3fc060e206379b", "score": "0.57813126", "text": "shouldComponentUpdate(nextState, props) {\n return (\n this.state.addAmount !== nextState.addAmount ||\n this.state.balance !== nextState.balance\n );\n }", "title": "" }, { "docid": "4d25c1216f44938eaf5b92472c1b6b1f", "score": "0.57723725", "text": "hasChanged(newValue) {\n console.debug(`SynchedPropertyNesedObject[${this.id()}, '${this.info() || \"unknown\"}']: contained ObservedObject hasChanged'.`);\n this.notifyHasChanged(this.obsObject_);\n }", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.5768071", "text": "storeChanged() {}", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.5768071", "text": "storeChanged() {}", "title": "" }, { "docid": "f4a658797a8d2e2c90170495e3ecf1f0", "score": "0.5767305", "text": "get isReallyDirty() {\n return !(this.isDestroyed && this.isDestroying) && this._valueIsDirty && this._valueIsNotBlank;\n }", "title": "" }, { "docid": "3a098bb35f3aa6e92aa591cdb03325ab", "score": "0.5760668", "text": "get isNone() {\n return void 0 === this.updateTime && void 0 === this.exists;\n }", "title": "" }, { "docid": "3a098bb35f3aa6e92aa591cdb03325ab", "score": "0.5760668", "text": "get isNone() {\n return void 0 === this.updateTime && void 0 === this.exists;\n }", "title": "" }, { "docid": "568f9c033c99878488841e8c2fffc285", "score": "0.57570124", "text": "shouldComponentUpdate(props, state) {\n return props.primitive !== null;\n }", "title": "" }, { "docid": "712679d94f76d6d1b2006aa6c40d27dc", "score": "0.57521105", "text": "isEdited() {\n\t\treturn !this.original ||\n\t\t\tthis.original.english !== this.english ||\n\t\t\tthis.original.characters !== this.characters ||\n\t\t\tthis.original.confidence !== this.confidence ||\n\t\t\tthis.original.pinyin !== this.pinyin;\n\t}", "title": "" }, { "docid": "54e498c49877c1e65083a79414fcd211", "score": "0.5751473", "text": "isConsistent() {\n return !this.inconsistentAt;\n }", "title": "" }, { "docid": "9b70b3aacc769dffbe611022a6693ce1", "score": "0.57380015", "text": "shouldComponentUpdate(props, state) {\n return this.state.count !== state.count;\n }", "title": "" }, { "docid": "a018e9650a51332f70abdeeec116b6c0", "score": "0.5728442", "text": "isUpdating(set) {\n if (arguments.length) {\n this._state = set ? GoblEntityState.UPDATING : GoblEntityState.UNKNOWN;\n }\n return this._state === GoblEntityState.UPDATING;\n }", "title": "" }, { "docid": "b03636ae3295dc4983d081025a1b531e", "score": "0.5721565", "text": "get reconfigured() { return this.startState.config != this.state.config; }", "title": "" }, { "docid": "b03636ae3295dc4983d081025a1b531e", "score": "0.5721565", "text": "get reconfigured() { return this.startState.config != this.state.config; }", "title": "" }, { "docid": "a6ef754159c9f268d561ed3640080f8f", "score": "0.57138735", "text": "_check() {\n try {\n if (!this._evtx.refresh()) return false;\n let size = this._evtx.size();\n for(let i = 0; i < size; i++) {\n if (this._chunks.hasOwnProperty(i)) {\n // chunk already exists\n let evtId = this._evtx.chunk(i).lastEventId;\n if (evtId != this._chunks[i]) {\n this._evtx.chunk(i).forEach((evt) => {\n if (evt.id > this._chunks[i]) {\n // trigger only new events\n this._trigger(evt);\n }\n });\n }\n } else {\n // try to trigger every event\n this._evtx.chunk(i).forEach((evt) => {\n this._trigger(evt);\n });\n }\n }\n return true;\n } catch(e) {\n console.error(e);\n }\n }", "title": "" }, { "docid": "03ddfd484804283e48130faffd4bf0a3", "score": "0.5685858", "text": "get dirty() {\n return this.value !== this.defaultValue;\n }", "title": "" }, { "docid": "b1556d2cc2d892b96fc83cec76d4e5c3", "score": "0.56857103", "text": "anyUnresolvedMutations() {\n return this.submitted.length > 0 || this.pending.length > 0;\n }", "title": "" }, { "docid": "7541eb0b6a4638166af7c97036f62f83", "score": "0.56752926", "text": "shouldComponentUpdate(newProps, newState) {\n console.log('i am inside shouldComponentUpdate method');\n //console.log('new props are ', newProps);\n //console.log('new state are ', newState);\n \n return true;\n }", "title": "" }, { "docid": "c8bc160f67b626394d98bcbb2b094ba3", "score": "0.5665406", "text": "getSnapshotBeforeUpdate(prevProps, prevState) {\n console.log('getSnapshotBeforeUpdate', prevProps, prevState);\n return 1; //returning this just to check if componentDidUpdate received it\n }", "title": "" }, { "docid": "be6d7dc0fd893da6431ec20e1a1b0dbe", "score": "0.5656651", "text": "shouldComponentUpdate(nextProps) {\n return this.props.state !== nextProps.state;\n }", "title": "" } ]
2ff0d4e2300fe7be0272a0da1430248b
monitorChildVisibility() calls this when a thumbnail comes onscreen
[ { "docid": "b2b23e9552af244c34f7ec47de36d1bd", "score": "0.5874817", "text": "function thumbnailOnscreen(thumbnail) {\n if (thumbnail.dataset.backgroundImage)\n thumbnail.style.backgroundImage = thumbnail.dataset.backgroundImage;\n}", "title": "" } ]
[ { "docid": "3584a5ccd76de848e29454049a435b04", "score": "0.5983247", "text": "function seven_thumb_hide()\n\t\t{\n\t\t\t//thumbnail flag switch to newly hover\n\t\t\tt_flag=0;\n\t\t\thandle.find(\".seven_bt_preview\").hide();\n\t\t}", "title": "" }, { "docid": "534235197e7c8d5726cc00b2cd5d4fba", "score": "0.59745204", "text": "function visibilityCheck() {\n\t var renderableImages = [];\n\t var keys = Object.keys(App.vars.invisibleImages);\n\t var el;\n\n\t keys.forEach(function (key) {\n\t el = App.vars.invisibleImages[key];\n\t if (dimensionCheck(el) && el.nodeName.toLowerCase() == 'img') {\n\t renderableImages.push(el);\n\t delete App.vars.invisibleImages[key];\n\t }\n\t });\n\n\t if (renderableImages.length) {\n\t Holder.run({\n\t images: renderableImages\n\t });\n\t }\n\n\t // Done to prevent 100% CPU usage via aggressive calling of requestAnimationFrame\n\t setTimeout(function () {\n\t global.requestAnimationFrame(visibilityCheck);\n\t }, 10);\n\t}", "title": "" }, { "docid": "b5bed05f8285a405f0cc28dc84fb2807", "score": "0.59583426", "text": "function handleVisibilityChange() {\n if (!document.webkitHidden) {\n checkUpdate();\n }\n }", "title": "" }, { "docid": "14a6ee85941048e7f42fe88dfc26f182", "score": "0.5907448", "text": "handleVisibilityChange() {\n switch (document.visibilityState) {\n case 'visible':\n this.update();\n this.continue();\n break;\n\n case 'hidden':\n this.pause();\n break;\n\n default:\n }\n }", "title": "" }, { "docid": "00be64c3ee12d5383995653f1759ea44", "score": "0.5887738", "text": "onFocus_() {\n // Ignore focus triggered by mouse to allow the focus to go straight to the\n // thumbnail being clicked.\n const focusOutlineManager = FocusOutlineManager.forDocument(document);\n if (!focusOutlineManager.visible) {\n return;\n }\n\n // Change focus to the thumbnail of the active page.\n const activeThumbnail =\n this.shadowRoot.querySelector('viewer-thumbnail[is-active]');\n if (activeThumbnail) {\n activeThumbnail.focus();\n return;\n }\n\n // Otherwise change to the first thumbnail, if there is one.\n const firstThumbnail = this.shadowRoot.querySelector('viewer-thumbnail');\n if (!firstThumbnail) {\n return;\n }\n firstThumbnail.focus();\n }", "title": "" }, { "docid": "c1c6aa911956b9ee07c83bc3069782e9", "score": "0.58309567", "text": "function _updateThumbnailNavigation() {\n\t\tvar\n\t\t\tdiff = _safeWidth(thumbs.parent()) - _safeWidth(thumbs),\n\t\t\tpos = _getRTLPosition(thumbs);\n\t\tbtnScrollBack.toggleClass(CLASS_HIDDEN, pos >= 0);\n\t\tbtnScrollForward.toggleClass(CLASS_HIDDEN, diff > 0 || pos <= diff);\n\t}", "title": "" }, { "docid": "2fc05f8958e205fd2e0ff7044ff7e84c", "score": "0.5820883", "text": "function computeVisibility(){var computedVisibility=(_audioOnly&&_displayMode==='auto'||_displayMode==='on')&&_displayAroundLoading;if(_lastComputedVisibility!==computedVisibility){_lastComputedVisibility=computedVisibility;_eventEmitter.emit('visibilityChanged',computedVisibility);}}", "title": "" }, { "docid": "8893c9db9de077995fae42377e09b814", "score": "0.58121324", "text": "function handleResizeWhenVisible () {\n // if there is already a watcher waiting for resize, do nothing\n if (handleResizeWhenVisible.watcher) return;\n // otherwise, we will abuse the $watch function to check for visible\n handleResizeWhenVisible.watcher = $scope.$watch(function () {\n // since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates\n $mdUtil.nextTick(function () {\n // if the watcher has already run (ie. multiple digests in one cycle), do nothing\n if (!handleResizeWhenVisible.watcher) return;\n\n if ($element.prop('offsetParent')) {\n handleResizeWhenVisible.watcher();\n handleResizeWhenVisible.watcher = null;\n\n handleWindowResize();\n }\n }, false);\n });\n }", "title": "" }, { "docid": "8893c9db9de077995fae42377e09b814", "score": "0.58121324", "text": "function handleResizeWhenVisible () {\n // if there is already a watcher waiting for resize, do nothing\n if (handleResizeWhenVisible.watcher) return;\n // otherwise, we will abuse the $watch function to check for visible\n handleResizeWhenVisible.watcher = $scope.$watch(function () {\n // since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates\n $mdUtil.nextTick(function () {\n // if the watcher has already run (ie. multiple digests in one cycle), do nothing\n if (!handleResizeWhenVisible.watcher) return;\n\n if ($element.prop('offsetParent')) {\n handleResizeWhenVisible.watcher();\n handleResizeWhenVisible.watcher = null;\n\n handleWindowResize();\n }\n }, false);\n });\n }", "title": "" }, { "docid": "8893c9db9de077995fae42377e09b814", "score": "0.58121324", "text": "function handleResizeWhenVisible () {\n // if there is already a watcher waiting for resize, do nothing\n if (handleResizeWhenVisible.watcher) return;\n // otherwise, we will abuse the $watch function to check for visible\n handleResizeWhenVisible.watcher = $scope.$watch(function () {\n // since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates\n $mdUtil.nextTick(function () {\n // if the watcher has already run (ie. multiple digests in one cycle), do nothing\n if (!handleResizeWhenVisible.watcher) return;\n\n if ($element.prop('offsetParent')) {\n handleResizeWhenVisible.watcher();\n handleResizeWhenVisible.watcher = null;\n\n handleWindowResize();\n }\n }, false);\n });\n }", "title": "" }, { "docid": "8893c9db9de077995fae42377e09b814", "score": "0.58121324", "text": "function handleResizeWhenVisible () {\n // if there is already a watcher waiting for resize, do nothing\n if (handleResizeWhenVisible.watcher) return;\n // otherwise, we will abuse the $watch function to check for visible\n handleResizeWhenVisible.watcher = $scope.$watch(function () {\n // since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates\n $mdUtil.nextTick(function () {\n // if the watcher has already run (ie. multiple digests in one cycle), do nothing\n if (!handleResizeWhenVisible.watcher) return;\n\n if ($element.prop('offsetParent')) {\n handleResizeWhenVisible.watcher();\n handleResizeWhenVisible.watcher = null;\n\n handleWindowResize();\n }\n }, false);\n });\n }", "title": "" }, { "docid": "a2fe1863e671df2f9cce906fbd318074", "score": "0.5811071", "text": "function handleVisibilityChange() {\n if (tabIsInBackground && document.hidden) {\n tabIsInBackground = document.hidden;\n window.requestAnimationFrame(drawAnimated);\n }\n\n tabIsInBackground = document.hidden;\n}", "title": "" }, { "docid": "a2fe1863e671df2f9cce906fbd318074", "score": "0.5811071", "text": "function handleVisibilityChange() {\n if (tabIsInBackground && document.hidden) {\n tabIsInBackground = document.hidden;\n window.requestAnimationFrame(drawAnimated);\n }\n\n tabIsInBackground = document.hidden;\n}", "title": "" }, { "docid": "acb087227b9237b8e2705341a5b3a3f5", "score": "0.57483435", "text": "function handleResizeWhenVisible(){// if there is already a watcher waiting for resize, do nothing\n\tif(handleResizeWhenVisible.watcher)return;// otherwise, we will abuse the $watch function to check for visible\n\thandleResizeWhenVisible.watcher=$scope.$watch(function(){// since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates\n\t$mdUtil.nextTick(function(){// if the watcher has already run (ie. multiple digests in one cycle), do nothing\n\tif(!handleResizeWhenVisible.watcher)return;if($element.prop('offsetParent')){handleResizeWhenVisible.watcher();handleResizeWhenVisible.watcher=null;handleWindowResize();}},false);});}// Event handlers / actions", "title": "" }, { "docid": "6b38c07c09cec18777497e94e86d02b9", "score": "0.5695036", "text": "function thumbNowPlaying() {\n var offset = $(curTarget).offset();\n if (thumbTimeout) {\n clearInterval(thumbTimeout);\n }\n $(video_thumb).css(offset);\n //console.log(\"Moving video to \" + offset);\n $(video_thumb).show();\n thumbTimeout = setInterval(thumbShotTrigger, (extractTime(segment_list[cur_segment].end) - extractTime(segment_list[cur_segment].begin)) * 1000);\n video_thumb.removeEventListener(\"playing\", thumbNowPlaying);\n }", "title": "" }, { "docid": "8afe40c3854b3cb2053d23dc25ca6153", "score": "0.5641314", "text": "function displayThumbnails() {\n // thumbnails.js started created thumbanils offscreen.\n // We're ready now to deal with them\n\n // Copy stuff to global variables\n // jshint ignore:start\n thumbnails = Thumbnails.container; // The element that holds the thumbnail\n thumbnailList = Thumbnails.list; // The object that represents them\n // jshint ignore:end\n\n // Now insert the thumbnails into the document.\n var placeholder = $('thumbnails-placeholder');\n placeholder.parentElement.replaceChild(thumbnails, placeholder);\n\n // Handle clicks on the thumbnails\n thumbnails.addEventListener('click', thumbnailClickHandler);\n\n // When the first page of thumbnails is diplayed, we can emit\n // our 'visually complete' mark for startup time comparison\n Thumbnails.firstpage.then(function() {\n // Tell performance monitors that \"above the fold\" content is displayed\n // and is ready to interact with.\n window.performance.mark('visuallyLoaded');\n window.performance.mark('contentInteractive');\n });\n\n // When all the thumbnails have been created, we can start a scan\n Thumbnails.complete.then(function() {\n if (files.length === 0) { // If we didn't find anything\n Overlay.show('scanning');\n }\n\n // Send a custom mark to performance monitors to note that we're done\n // enumerating the database at this point. We won't send the final\n // fullyLoaded marker until we're completely stable and have\n // finished scanning.\n window.performance.mark('mediaEnumerated');\n\n // Now that we've enumerated all the photos and videos we already know\n // about it is time to go and scan the filesystem for new ones. If the\n // MediaDB is fully ready, we can scan now. Either way, we always want\n // to scan every time we get a new 'ready' event.\n photodb.addEventListener('ready', function() { photodb.scan(); });\n if (photodb.state === MediaDB.READY) { // if already ready then scan now\n photodb.scan();\n }\n });\n }", "title": "" }, { "docid": "40825abb88067b041f497bc7ad9973fb", "score": "0.56278247", "text": "function animOnVisibility() {\n checkVisible(demos, dist);\n}", "title": "" }, { "docid": "6b733b572d5a8d65f66d5ec6dc598436", "score": "0.5621148", "text": "_resizeHandler() {\n const that = this;\n\n if (!that._isVisible()) {\n that._renderingSuspended = true;\n return;\n }\n else if (that._renderingSuspended) {\n that._createElement();\n return;\n }\n\n if (that._renderingSuspended) {\n return;\n }\n\n if (that._orientationChanged !== true) {\n that._setTicksAndInterval();\n that._moveThumbBasedOnValue(that._drawValue);\n }\n\n //Needed for getOptimalSize method\n if (that._trackChanged) {\n that._measurements.trackLength = that.$.track[this._settings.clientSize];\n that._setTicksAndInterval();\n that._moveThumbBasedOnValue(that._drawValue);\n }\n\n that._setTrackSize();\n delete that._orientationChanged;\n delete that._trackChanged;\n }", "title": "" }, { "docid": "fcf74a2062d2f86a82010b4d00a5dabd", "score": "0.562037", "text": "function onResize() {\n var clientHeight = document.documentElement.clientHeight;\n topMarginElement.style.marginTop =\n Math.max(0, (clientHeight - MOST_VISITED_HEIGHT) / 2) + 'px';\n\n var clientWidth = document.documentElement.clientWidth;\n var numTilesToShow = Math.floor(\n (clientWidth - MIN_TOTAL_HORIZONTAL_PADDING) / TILE_WIDTH);\n numTilesToShow = Math.max(MIN_NUM_TILES_TO_SHOW, numTilesToShow);\n if (numTilesToShow != numTilesShown) {\n updateTileVisibility(numTilesToShow);\n numTilesShown = numTilesToShow;\n }\n}", "title": "" }, { "docid": "e87c67b83c9b59e23a1c1d8c6d9ae5d8", "score": "0.5601638", "text": "function handleResize(){\n\t$('.lightbox').each(function(index, item){\n\t\tif($(item).css('display') == \"block\"){\n\t\t\tpositionLightbox($(item));\n\t\t}\n\t});\n}", "title": "" }, { "docid": "97fe23718c0e0d8ec86ce71c6d37c4c5", "score": "0.55799496", "text": "check() {\n const el = this.refs.myview,\n rect = el.measure((ox, oy, width, height, pageX, pageY) => {\n this.setState({\n rectTop: pageY,\n rectBottom: pageY + height,\n rectWidth: pageX + width,\n })\n });\n\n const isVisible = (\n this.state.rectBottom != 0 && this.state.rectTop >= 0 && this.state.rectBottom <= window.height &&\n this.state.rectWidth > 0 && this.state.rectWidth <= window.width\n );\n\n // notify the parent when the value changes\n if (this.lastValue !== isVisible) {\n this.lastValue = isVisible;\n this.props.onChange(isVisible);\n }\n }", "title": "" }, { "docid": "0dda9a856d77022d1610b818e94cd20d", "score": "0.5558086", "text": "function startVisibilityCheck() {\n\t if (!App.vars.visibilityCheckStarted) {\n\t global.requestAnimationFrame(visibilityCheck);\n\t App.vars.visibilityCheckStarted = true;\n\t }\n\t}", "title": "" }, { "docid": "2bbbbaab791fb83c04eb0cf13fbf381f", "score": "0.55502903", "text": "function thumbnailOffscreen(thumbnail) {\n if (thumbnail.dataset.backgroundImage)\n thumbnail.style.backgroundImage = null;\n}", "title": "" }, { "docid": "5e4556ff6d4a20b1b79cee48ae8289d1", "score": "0.55447334", "text": "function handleResizeIE() {\n var wrapers = document.getElementsByClassName(\"title-wrap\");\n for (var i = 0; i < wrapers.length; i++) {\n var title = wrapers[i].getElementsByClassName(\"title-thumbnail\");\n if (title[0].scrollHeight > wrapers[i].clientHeight) {\n wrapers[i].getElementsByClassName(\"clamp\")[0].style.visibility =\n \"visible\";\n } else {\n if (\n wrapers[i].getElementsByClassName(\"clamp\")[0].style.visibility ===\n \"visible\"\n ) {\n wrapers[i].getElementsByClassName(\"clamp\")[0].style.visibility =\n \"hidden\";\n }\n }\n }\n}", "title": "" }, { "docid": "e161637bf4efe6087ea72ea842cac6fd", "score": "0.5541201", "text": "function handleVisibilityChange() {\n if (document[hidden]) {\n clearInterval(watchInterval);\n } else {\n watchInterval = window.setInterval(function() {\n fileWatch(url);\n }, 1000);\n }\n }", "title": "" }, { "docid": "a344fd4927d55650240cdaa4b1995219", "score": "0.55305177", "text": "show() {\n this.isVisible = true\n this.clip._root.children.forEach(elt => elt.visible = true)\n this._updateVisibilityImg()\n }", "title": "" }, { "docid": "f78ada07cd97d725023491bd56521822", "score": "0.55289745", "text": "function run() { \n\t\t\t\tme._trigger_thumbnail_loads();\n\t\t\t\tme.scroll_timeout=null;\n\t\t\t}", "title": "" }, { "docid": "6544720ca07cc921bf39601842b38a06", "score": "0.55262333", "text": "onShowThumbnails(callback) {\n this.transport.on(Protocol.SHOW_THUMBNAILS, () => callback());\n }", "title": "" }, { "docid": "81a44243d644c99874eefe40cdf7ca22", "score": "0.55105877", "text": "function clickOnThumbnail() {\n\tgetPhotoUrl($(this));\n\t$container.append($photoviewer.append($photoBox).append($caption));\n\t$photoBox.after($leftClick);\n\t$photoBox.before($rightClick);\n\t$(\"html\").css(\"background\",\"gray\");\n\t//All other images are not visible\n\t$(\".thumbnail\").addClass(\"greyed-out\");\n\t$(\".small-img\").hide();\n\t$leftClick.on(\"click\",leftClick);\n\t$rightClick.on(\"click\",rightClick);\n}", "title": "" }, { "docid": "609370e632b1578c4a334a04ccf0daf5", "score": "0.54971504", "text": "function overbox(){\n\tvar node=this.parentNode.children;\n\tvar reqnode=node[0];\n\tconsole.log(reqnode.style.visibility);\n\n\t//IT HAD AN ISSUE WITH TWO CLICKS TRIGGERING\n\n\tif((!(reqnode.style.visibility) || reqnode.style.visibility==\"hidden\")&& reqnode.style.opacity==0){\n\t\treqnode.style.visibility=\"visible\";\n\t\tanimateopacity(reqnode);\n\t\tconsole.log(reqnode.style.visibility);\n\t}\n\telse if(reqnode.style.opacity==1){\n\t\t//reqnode.style.visibility=\"hidden\";\n\t\tdeanimateopacity(reqnode);\n\t\t//setTimeout(function(){reqnode.style.visibility= \"hidden\";\n\t\t\t\t\t\t\t//this.children[0].style.opacity=0;\n\t\t\t\t\t\t//},1000);\n\t\tconsole.log(reqnode.style.visibility);\n\t}\n}", "title": "" }, { "docid": "0e6a5a9c063e6b5566952a18418e3ce1", "score": "0.5488699", "text": "function start_expanding() {\r\n setTimeout(change_cagle_thumbs, wait);\r\n}", "title": "" }, { "docid": "5475b0908b440be944c69fd471f6278a", "score": "0.54747236", "text": "scrollSearchToThumbnail()\n {\n if(this.isAnimating || !this.parent.active || this.dragger.position < 1)\n return;\n\n ppixiv.app.scrollSearchToMediaId(this.parent.dataSource, this.parent._wantedMediaId);\n }", "title": "" }, { "docid": "972a5a65f5b1bace50d9eab2b9c0aaca", "score": "0.54666245", "text": "set hasVisibleChildren(value) {}", "title": "" }, { "docid": "fa73db35f7a537823bee7c86f3877118", "score": "0.5455523", "text": "activePageChanged_() {\n if (this.shadowRoot.activeElement) {\n this.getThumbnailForPage(this.activePage).focusAndScroll();\n }\n }", "title": "" }, { "docid": "e3305275a813f42f4fc0859b1b808e99", "score": "0.54474336", "text": "_registerDisplayListeners () {\n this.display = caller('display', {postMessage: window.parent.postMessage.bind(window.parent)})\n this.hide = caller('hide', {postMessage: window.parent.postMessage.bind(window.parent)})\n }", "title": "" }, { "docid": "fd6c0d6479ebee85b6757c3eafeca42b", "score": "0.5410925", "text": "_styleChangedHandler() {\n const that = this;\n\n if (!that._isVisible()) {\n that._renderingSuspended = true;\n return;\n }\n else if (that._renderingSuspended) {\n that._createElement();\n return;\n }\n\n if (that._renderingSuspended) {\n return;\n }\n\n that._setTicksAndInterval();\n that._moveThumbBasedOnValue(that._drawValue);\n }", "title": "" }, { "docid": "1f7d2a9725ddd7c8c9910be5f4f1da8f", "score": "0.54061383", "text": "function onVisibilityChanged() {\n\tif (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)\n\t\tcr_setSuspended(true);\n\telse\n\t\tcr_setSuspended(false);\n}", "title": "" }, { "docid": "6b8658e5b4734c42a489365fc3519322", "score": "0.5403252", "text": "function whenVisible(elem, callback) {\n elem.__visCheck = debounce(function visCheck() {\n callIfVisible(elem, callback);\n }, 100);\n window.addEventListener('resize', elem.__visCheck, false);\n window.addEventListener('scroll', elem.__visCheck, false);\n elem.__visCheck();\n }", "title": "" }, { "docid": "1bdd6f7ad4f9b2aba7ceb643158f26e3", "score": "0.5394299", "text": "visibilityListeners() {\n\t\tdocument.addEventListener(\"visibilitychange\", () => {\n\t\t\tif (document.visibilityState === \"visible\" && this.active === false) {\n\t\t\t\tthis.active = true;\n\t\t\t\tthis.resizeListeners();\n\t\t\t} else {\n\t\t\t\tthis.active = false;\n\t\t\t\tclearTimeout(this.expanding);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "8ba8f9823f2d8828fe32f8cc73377a5e", "score": "0.5385807", "text": "function watchSize() {\n\t\t\t\t\t\tif(window.width > 436) $('#tab-content-container').css({'pointer-events':'all'});\n\t\t\t\t\t\telse $('#tab-content-container').css({'pointer-events':'none'});\n\t\t\t\t\t\t// var canvas = $('#give-image-canvas')[0];\n\t\t\t\t\t\t// canvas.width = $('#give-image-canvas').width();\n\t\t\t\t\t\t// canvas.height = $('#give-image-canvas').height();\n\t\t\t\t\t}", "title": "" }, { "docid": "e715ec663f941a92138a0e0592e095df", "score": "0.5383685", "text": "handleMouseLeave() {\n this.props.hideThumbnail();\n }", "title": "" }, { "docid": "4bb3ca8eb41d839325f4aa27e71a50bf", "score": "0.5375819", "text": "function checkVisible() {\n $('.img').each(function() {\n if ($(this).visible(false, true)) {\n $(this).waitForImages(function() {\n $(this).children('img').fadeIn(1500);\n })\n }\n })\n }", "title": "" }, { "docid": "4c36e4d278ca0317e5f809303c8ce7fc", "score": "0.5368875", "text": "function thumbnailFocus(e) {\n const thumbFront = document.querySelector('.thumb-front');\n thumbFront.focus();\n}", "title": "" }, { "docid": "6e1e05cf9c0a0c99c8d01b6fa51a3e58", "score": "0.5366572", "text": "function update() {\n const me = container.getBoundingClientRect();\n const par = parent.getBoundingClientRect();\n const visible = me.height > 0 && par.height >= me.height &&\n par.width >= me.width && me.top <= par.bottom &&\n me.bottom >= par.top && !getFoldedParent(parent);\n if (visible || parent == document.body) {\n if (url) {\n icon.src = url;\n } else {\n iconError.call(icon);\n }\n\n parent.removeEventListener('scroll', update);\n parent.removeEventListener('resize', update);\n }\n }", "title": "" }, { "docid": "824610dc59d0f312b0bd1c42825006f2", "score": "0.5366466", "text": "onShown() {\r\n // Stub\r\n }", "title": "" }, { "docid": "fe91ff4a692249d5520f92289b0d460a", "score": "0.53661644", "text": "__init13() {this._handleVisibilityChange = () => {\n if (WINDOW$1.document.visibilityState === 'visible') {\n this._doChangeToForegroundTasks();\n } else {\n this._doChangeToBackgroundTasks();\n }\n };}", "title": "" }, { "docid": "55fd606d85a60c62b54055e758dd71c6", "score": "0.53638595", "text": "notifyResize(){super.notifyResize()}", "title": "" }, { "docid": "0b469d430c17f1241f0eac2ce6efcebe", "score": "0.53479546", "text": "function showImg(imgId) {\r\n if (isScrolledIntoView(imgId) && $(imgId).css(\"visibility\") === \"hidden\") {\r\n $(imgId).css(\"visibility\", \"visible\");\r\n }\r\n}", "title": "" }, { "docid": "d47bc36e0ca35c3b90ef488643f74153", "score": "0.5337401", "text": "function onThumbsChange(event){\n\t\t\n\t\t//preload visible images \n\t\tif(g_options.gallery_images_preload_type == \"visible\" && g_temp.isAllItemsPreloaded == false){\n\t\t\tpreloadBigImages();\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "6771bf2f9a7f423ecbe1a130752aef23", "score": "0.53326535", "text": "checkIfVisibleFallback_() {\n const elTop = this.element_./*OK*/ getBoundingClientRect().top;\n const winInnerHeight = this.win_./*OK*/ innerHeight;\n\n if (winInnerHeight > elTop) {\n this.cb_();\n this.win_.removeEventListener('scroll', this.scrollHandler_);\n }\n }", "title": "" }, { "docid": "02194ad2e86d0f74220065d2da2f52c7", "score": "0.5315659", "text": "_listenVisibilityChange () {\n if (typeof document.hidden !== \"undefined\") {\n this._visibilityHidden = \"hidden\";\n this._visibilityChange = \"visibilitychange\";\n } else if (typeof document.mozHidden !== \"undefined\") {\n this._visibilityHidden = \"mozHidden\";\n this._visibilityChange = \"mozvisibilitychange\";\n } else if (typeof document.msHidden !== \"undefined\") {\n this._visibilityHidden = \"msHidden\";\n this._visibilityChange = \"msvisibilitychange\";\n } else if (typeof document.webkitHidden !== \"undefined\") {\n this._visibilityHidden = \"webkitHidden\";\n this._visibilityChange = \"webkitvisibilitychange\";\n }\n\n document.addEventListener(this._visibilityChange,\n this._onVisibilityChange, false);\n }", "title": "" }, { "docid": "5bd86080c1a3dca2611d13e529b24626", "score": "0.5312273", "text": "function handleVisibilityChange() {\n if (document[hidden]) {\n visivilityFlag = false;\n console.log('document is hidden');\n } else {\n visivilityFlag = true;\n console.log('document is visible');\n }\n }", "title": "" }, { "docid": "b9b477e3e3ef37f2bcb6c46e2c4dcfc8", "score": "0.5307438", "text": "function fullscreenExitHandler() {\n // If we exited fullscreen, display the thumbnails\n if (currentView === fullscreenView &&\n document.mozFullScreenElement !== fullscreenView)\n setView(thumbnailListView);\n }", "title": "" }, { "docid": "0bd32ef6fa3a0e2d9d73a33a9fdb10e2", "score": "0.5285989", "text": "function checkVisible() {\n var divs = document.getElementsByTagName('DIV');\n var bound;\n for (var d in divs) {\n if (divs[d].className == 'image') {\n bound = divs[d].getBoundingClientRect();\n //console.log('id: ' + pid + ', top: ' + bound.top + ', right: ' + bound.right + ', bottom: ' + bound.bottom + ', left: ' + bound.left + ', height: ' + bound.height + ', width: ' + bound.width);\n if ((bound.top > 0 && bound.top < innerHeight) || (bound.bottom > 0 && bound.bottom < innerHeight)) {\n if (!divs[d].alreadyloading && (!divs[d].firstChild || divs[d].firstChild.tagName == 'CANVAS') ) {\n divs[d].alreadyloading = true;\n\n var img = document.createElement('IMG');\n img.src = '/i/lenta_img,' + divs[d].id.substr(1);\n\n img.onload = (function (parent) {\n return function () {\n if (parent.firstChild && parent.firstChild.tagName == 'CANVAS') {\n parent.removeChild(parent.firstChild);\n }\n\n parent.appendChild(img);\n }\n })(divs[d]);\n\n\n }\n\n }\n\n }\n }\n } // checkVisible", "title": "" }, { "docid": "a1295d7a89a27660d11632d5d382fa90", "score": "0.5279088", "text": "function displayImage(domAAroundImgThumb)\n{\n if (domAAroundImgThumb.attr('href'))\n {\n var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');\n if ($('#bigpic').attr('src') != newSrc)\n\t\t{ \n $('#bigpic').fadeIn('fast', function(){\n $(this).attr('src', newSrc).show();\n if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)\n\t $(this).attr('alt', domAAroundImgThumb.attr('href'));\n });\n }\n $('#views_block li a').removeClass('shown');\n $(domAAroundImgThumb).addClass('shown');\n }\n}", "title": "" }, { "docid": "4cb1ce71f1bd2d446fb829ea6d9d6186", "score": "0.52781963", "text": "function waitForImagesAndResize() {\n var grid = document.querySelector(\"main.content\");\n\n if (window.innerWidth < 1024 && grid) {\n imagesLoaded(grid, function() {\n resizeAllMasonryItems();\n });\n } else if (grid) {\n var allItems = grid.querySelectorAll(\".status\");\n enterFromBottom(allItems);\n }\n}", "title": "" }, { "docid": "bba32d0fd924099953bde3a8ab1c3c43", "score": "0.52646077", "text": "_ensureVisible(item) {\n const that = this;\n\n that._ensureVisibleTreeMode(item, item.getBoundingClientRect(), that.$.scrollViewer,\n that.$.scrollViewer.getBoundingClientRect(), that._scrollViewerPadding);\n\n //Used in GanttChart to ensure the TaskBar inside the Timeline is also visible\n if (that._ensureVisibleCallback) {\n that._ensureVisibleCallback(item);\n }\n }", "title": "" }, { "docid": "d0ccf4ecf7df28824d30fa029f2135f5", "score": "0.5253041", "text": "function scaleDownPreviewBntClick(event) {\n gImageInfoListViewer.setScale(gImageInfoListViewer.scale / 2);\n}", "title": "" }, { "docid": "2ca5f503c10778c5db345fd1a511bcd1", "score": "0.52495515", "text": "function eventInWidget(display, e) {\r\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\r\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\r\n }\r\n }", "title": "" }, { "docid": "1f1ec5dd5e544fcf7ea8e359e102d835", "score": "0.5239506", "text": "onBeforeChildShow({\n source: showingChild\n }) {\n // Some outside code is showing a child.\n // We must control this, so veto it and activate it in the standard way.\n if (!this.owner.isConfiguring && !showingChild.$isActivating) {\n this.activeItem = showingChild;\n return false;\n }\n }", "title": "" }, { "docid": "5e1ddef3346640578565d3a3bd74ddef", "score": "0.52226454", "text": "_refreshVisibility() {\n this._sideBar.setHidden(this._sideBar.titles.length === 0);\n this._stackedPanel.setHidden(this._sideBar.currentTitle === null);\n }", "title": "" }, { "docid": "89d6cc234e1818fdb3f971542463e2a2", "score": "0.5221", "text": "function checkSize(){\n if ($(\".progressBar\").css(\"top\") !== \"-65px\" ){\n $('#video-controls').hide();\n video.prop(\"controls\",true);\n } else {\n $('#video-controls').show();\n video.prop(\"controls\",false);\n }\n}", "title": "" }, { "docid": "56f2f4304df07df86c53d24e53dc78d5", "score": "0.52195174", "text": "handleMouseMove(event) {\n let bckRect = this.background.current.getBoundingClientRect(),\n rect = this.slider.current.getBoundingClientRect(),\n position = (event.clientX - rect.left) / rect.width,\n ratio = getTimeRatio(this.props.mediaTime, this.props.mediaLength);\n if (ratio >= 0) {\n if (this.dragging && this.slider.current) this.slider.current.value = ratio;\n this.props.showThumbnail(position, event.clientX - bckRect.left, rect.top - THUMBNAIL_SEEKBAR_OFFSET);\n } else {\n this.props.hideThumbnail();\n }\n }", "title": "" }, { "docid": "5a4c36bcc751104062fd21e46fe0cbd9", "score": "0.52120256", "text": "visibilityChange() {\n switch (document.visibilityState) {\n case \"visible\":\n this.resume();\n break;\n case \"hidden\":\n this.pause();\n break;\n default:\n }\n }", "title": "" }, { "docid": "34fafa4be0df43189fe9d4daf508e757", "score": "0.52056986", "text": "function handleVisibilityChange() {\n if (document.hidden) {\n clearInterval(gameLoop);\n gameLoop = false;\n } else {\n gameLoop = startGameLoop();\n requestRender();\n }\n}", "title": "" }, { "docid": "5517783b6d5797f6ed11e21a15368f61", "score": "0.520069", "text": "_hide_workspaces_thumbnails() {\n\t\tMain.overview._overview._controls._thumbnailsBox.hide();\n\t}", "title": "" }, { "docid": "07629a5c590d5d02b072bfd11a0053ec", "score": "0.51982194", "text": "function prepareToShow() {}", "title": "" }, { "docid": "f5f428dcaa99caaaf2564bb5874fcae3", "score": "0.51905173", "text": "function showIfVisible(img, index) {\n var invis = img.getBoundingClientRect().top == 0 && img.getBoundingClientRect().bottom == 0 \n if (!invis && img.getBoundingClientRect().top < winH + offset) {\n loadImg(img, index);\n return true; // img shown\n } else {\n return false; // img to be shown\n }\n }", "title": "" }, { "docid": "007a11d209b909cad01fde13a32a1aaf", "score": "0.5184446", "text": "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "title": "" }, { "docid": "007a11d209b909cad01fde13a32a1aaf", "score": "0.5184446", "text": "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "title": "" }, { "docid": "007a11d209b909cad01fde13a32a1aaf", "score": "0.5184446", "text": "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "title": "" }, { "docid": "007a11d209b909cad01fde13a32a1aaf", "score": "0.5184446", "text": "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "title": "" }, { "docid": "d1a6de5722394ba89ca9251607d41169", "score": "0.51816094", "text": "onBeforeChildHide({\n source: hidingChild\n }) {\n // Some outside code is hiding a child.\n // We must control this, so veto it and activate a sibling in the standard way.\n if (!this.owner.isConfiguring && !hidingChild.$isDeactivating) {\n this.activateSiblingOf(hidingChild);\n return false;\n }\n }", "title": "" }, { "docid": "8efb3c169f8f2fa08db8313fe248ac69", "score": "0.5181493", "text": "function showSub() {\n\tif(this.children.length>1) {\n\t\tthis.children[1].style.height = \"auto\";\n\t\tthis.children[1].style.opacity = \"1\";\n\t\tthis.children[1].style.display = \"flex\";\n\t} else {\n\t\treturn false; \n\t}\n}", "title": "" }, { "docid": "4e7de93b4dde2bd6d544a33b88a96d5a", "score": "0.518056", "text": "function _showItem() {\n\t\t_selector('m', dialog).removeClass(CLASS_HIDDEN);\n\t\tvar pos = _getRTLPosition(thumbs.children().eq(current)); // left offset of active thumbnail on thumbs ribbon w.r.t. left edge of viewer\n\t\tif (thumbindex < 0) {\n\t\t\tvar\n\t\t\t\tvw = _safeWidth(thumbsBar), // width of viewport\n\t\t\t\ttw = _safeWidth(thumbs); // total width of thumbnail ribbon\n\t\t\t\t // tw - vw = maximum value permitted as left offset w.r.t. left edge of viewer\n\t\t\tthumbs.css(rtlpos, -(tw < vw ? _getRTLPosition(thumbs.children().eq(0)) : Math.min(pos, tw - vw)));\n\t\t} else {\n\t\t\tthumbindex = current;\n\t\t\tthumbs.css(rtlpos, -pos);\n\t\t}\n\t\t_updateThumbnailNavigation();\n\n\t\t// show image viewer\n\t\tviewer.removeClass(CLASS_HIDDEN);\n\n\t\t// show navigation controls as appropriate\n\t\tvar loop = settings.loop;\n\t\tbtnPrev.toggleClass(CLASS_UNAVAILABLE, !loop && current == 0);\n\t\tbtnNext.toggleClass(CLASS_UNAVAILABLE, !loop && current >= anchors.length-1);\n\n\t\t// reset metadata view state\n\t\tviewer.children().removeClass(CLASS_HIDDEN);\n\n\t\t// show action controls as appropriate\n\t\tvar hasimage = preloader && preloader.src;\n\t\tvar hascontent = !viewercontent.is(':empty');\n\t\tbtnDownload.toggleClass(CLASS_UNAVAILABLE, !settings.download(anchors.eq(current)));\n\t\tbtnMetadata.toggleClass(CLASS_UNAVAILABLE, !hasimage || !hascontent);\n\t\tviewercontent.addClass(CLASS_HIDDEN);\n\t\thasimage || !hascontent || metadataItem(); // show metadata if there is no image\n\n\t\t// remove wait indicators\n\t\t_toggleProgress(dialog, false);\n\n\t\t// add (or hide) caption text\n\t\t_setCaption(dialog, false);\n\n\t\t// resize dialog to show caption text\n\t\tvar target = {\n\t\t\twidth: _safeWidth(dialog) + _selector('sideways', dialog).trueWidth(),\n\t\t\theight: _safeHeight(dialog) + _heightExtension(dialog)\n\t\t};\n\t\tdialog.animate(target, settings.duration, settings.easing, function () {\n\t\t\tpanels.removeClass(CLASS_HIDDEN); // displays the image caption text\n\t\t\tif (!settings.loop && current >= anchors.length-1) { // automatically stop slideshow at last image\n\t\t\t\tstopSlideshow();\n\t\t\t}\n\t\t\tif (_isSlideshowActive()) {\n\t\t\t\t_startSlideshowTimer();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "cd0a1ce7997c776f0e89da2df4376da1", "score": "0.518043", "text": "function eventInWidget(display, e) {\n\t\t for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n\t\t if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n\t\t (n.parentNode == display.sizer && n != display.mover))\n\t\t return true;\n\t\t }\n\t\t }", "title": "" }, { "docid": "fdc4dfbae123eee92bd66200ebf8699f", "score": "0.5170555", "text": "function vivocha_mediaOnResize() {\r\n vivocha.$(\"#vvc_widget_\" + widget.custom.id + \" .vivocha_media_container\").toggleClass(\"vivocha_minimized\");\r\n vivocha.$(\"#vvc_widget_\" + widget.custom.id + \" .vivocha_owl_container\").toggleClass(\"vivocha_minimized\");\r\n vivocha.$(\"#vvc_widget_\" + widget.custom.id + \" .unreadCounter \").hide().text(0);\r\n if (vivocha.$(\".ui-dialog\").is(\":visible\")) {\r\n jQuery(\"#dialog\").dialog(\"close\");\r\n }\r\n}", "title": "" }, { "docid": "0ca4561d0e762f999766e6d0eb200878", "score": "0.51620686", "text": "setupVisibilityHandler_() {\n // Polling should always be stopped when document is no longer visible.\n this.ampdoc.onVisibilityChanged(() => {\n if (this.ampdoc.isVisible() && this.hasActiveLiveLists_()) {\n // We use immediate so that the user starts getting updates\n // right away when they've switched back to the page.\n this.poller_.start(/** immediate */ true);\n } else {\n this.poller_.stop();\n }\n });\n }", "title": "" }, { "docid": "94f099fbf37e0426ca658aaeeb52c473", "score": "0.5158198", "text": "function eventInWidget(display, e) {\n\t\t for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n\t\t if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n\t\t (n.parentNode == display.sizer && n != display.mover))\n\t\t { return true }\n\t\t }\n\t\t }", "title": "" }, { "docid": "e9be8f9bf31d5f8450b4ac51df7e3895", "score": "0.5155032", "text": "get resizeHandlesVisibility() {\n\t\treturn this.nativeElement ? this.nativeElement.resizeHandlesVisibility : undefined;\n\t}", "title": "" }, { "docid": "18a9ca86fb818826c53ca273dca35c43", "score": "0.5152846", "text": "function displayThumbs() {\n\t$('.nota-thumb:not(:first)').each(function() {\n\n\t\tvar $this = $(this);\n\t\tvar prev_el = $this.prev();\n\n\t\tvar distance = $this.offset().left - prev_el.offset().left;\n\t\tif ( distance < 0 ) {\n\t\t\tprev_el.css('float', 'right');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "933039b539b8a1095fe3a712551a9feb", "score": "0.5146038", "text": "_makeThumbAccessible() {\n const that = this;\n if (that.rangeSlider) {\n if (that.$.thumb[that._settings.offset] === that.$.secondThumb[that._settings.offset] && that._numericProcessor.compare(that.values[1], that.max) === false) {\n that.$thumb.addClass('accessible');\n }\n else {\n that.$thumb.removeClass('accessible');\n }\n }\n }", "title": "" }, { "docid": "1b83fc9a957939a0b987c90f964e0707", "score": "0.5145523", "text": "function setThumbnail(args) {\n let slider = page.getViewById(\"thumbnailSlider\");\n thumbnail = viewModel.get(\"sliderValue\");\n let thumbnailVideo = page.getViewById(\"thumbnailVideo\");\n thumbnailVideo.seekToTime(thumbnail);\n}", "title": "" }, { "docid": "071d033482fd939a36ca499d813532f5", "score": "0.5144607", "text": "hidePreviewImage()\n {\n let wasInPreview = ppixiv.phistory.virtual;\n if(!wasInPreview)\n return;\n\n ppixiv.phistory.back(); \n }", "title": "" }, { "docid": "0b56a532dcc77bc5191da78dd2950789", "score": "0.51402056", "text": "_onUpdateDisplay() {}", "title": "" }, { "docid": "5cea8e36a787846f06888f5fcd519f49", "score": "0.5136024", "text": "function toggleVisibility() {\r\n\t\tif (designImage.style.display == '') {\r\n\t\t\tdesignImage.style.display = 'block';\r\n\t\t\tmeasurement.box.style.display = 'block';\r\n\t\t\tpositionDesignImage()\r\n\t\t\tEstate.Develop.CheckImage.Run( requestURL )\r\n\t\t} else {\r\n\t\t\tdesignImage.style.display = '';\r\n\t\t\tmeasurement.box.style.display = '';\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "4342979e66725ad8ac5cefb5fd97975e", "score": "0.5134699", "text": "function isVisited(child_index) {\n cell = grid.children[child_index];\n search_image = cell.firstChild;\n return search_image.style.visibility == \"visible\";\n}", "title": "" }, { "docid": "60d8c4d60f839db8fd5685dfb3c817ca", "score": "0.5130952", "text": "'visible'(callback) {\n\n\t\t//console.log('vis');\n\n\t\t//return this.style('display', 'block', callback);\n\t\tthis.style('display', 'block', callback);\n\t}", "title": "" }, { "docid": "2782a409ab0ee584efca14d732433f8c", "score": "0.5123061", "text": "function HideThumbnails() { \n if (thumb_flag == 1) {\n $('#thumbnails').slideUp(function () {\n $('#ThumbPanelHideShow').html('<i class=\"fa fa-angle-double-up\"></i> <span>Show Thumbnails</span> <i class=\"fa fa-angle-double-up\"></i>');\n thumb_flag = 0;\n });\n\n }\n}", "title": "" }, { "docid": "01647ea9fbb568aa7c107c84c6a7a7ce", "score": "0.5122172", "text": "function visibilityChange() {\n if (document.visibilityState !== 'visible') {\n if (a.isReady()) {\n a.stopRecording();\n a.release();\n }\n } else {\n if (!a.isReady()) {\n initStream();\n }\n }\n }", "title": "" }, { "docid": "c4ef9f676eddeb498312a27120e259cc", "score": "0.511836", "text": "handleTrailVisibilityChange() {\n if ( this.visibilityTracker && !this.visibilityTracker.trailVisibleProperty.value ) {\n this.focusProperty.value = null;\n this.onRemoveFocus();\n }\n }", "title": "" }, { "docid": "f116b895dd5890f7a2973808ee12615a", "score": "0.51143837", "text": "function repaint(){\n var newThumbnailData = chartManager.getThumbnailData();\n\n // only require to refresh if we get new frame numbers\n var oldFrameIds = _.chain(thumbnailData).values().pluck('extracted_frame_number').value();\n var newFrameIds = _.chain(newThumbnailData).values().pluck('extracted_frame_number').value();\n if (!(_.isEqual(oldFrameIds, newFrameIds))){\n $(thumbnailChartRefresh_div).css(\"display\", \"flex\");\n thumbnailData = newThumbnailData;\n }\n }", "title": "" }, { "docid": "d4e2b3133aa805331690ee41c652ca98", "score": "0.511187", "text": "scaleChildToFit(zoomed) {\n var parentBounds = {\n width: this._node.offsetWidth,\n height: this._node.offsetHeight\n };\n var childBounds = this.props.computeChildBounds(this._node, parentBounds);\n var childWidth = childBounds.width;\n var childHeight = childBounds.height;\n\n if (childWidth > parentBounds.width) {\n var scale = parentBounds.width / childWidth;\n this.setState({\n scale: scale,\n zoomed: zoomed,\n compactHeight: Math.ceil(scale * childHeight),\n expandedHeight: childHeight\n }); // TODO(charlie): Do this as a callback to `setState`. Something is\n // going wrong with that approach in initial testing.\n\n setTimeout(() => {\n // Only show it after the next paint, to allow for CSS\n // transitions to fade it in.\n if (this.isMounted()) {\n this.setState({\n visible: true\n });\n }\n });\n } else {\n this.setState({\n visible: true\n });\n }\n }", "title": "" }, { "docid": "86e0c0a6c8f82abc5803be21f2403ae7", "score": "0.51058817", "text": "function displayLtBox(url, title) {\n document.getElementById(\"ltBoxWrap\").style.visibility = \"visible\";\n changeLightBoxImage(url, title);\n}", "title": "" }, { "docid": "3b35c43e2004329254c0acee5c4a844d", "score": "0.5105303", "text": "_slideThumbnails() {\n this._slider.events.on('indexChanged', () => {\n const currentIndex = this._getCurrentIndex();\n this._thumbnailSlider.goTo(currentIndex);\n });\n\n this._thumbnailSlider.events.on('indexChanged', () => this._activateThumbnailNavigationItem());\n }", "title": "" }, { "docid": "ca180664c209224404c21caf8abd888f", "score": "0.5104336", "text": "function initThumbs() {\n showtheSlide();//hide all but the first entry after build\n $(\".thumbR\").on('click', function () {\n var t = $(this).attr('id').replace('thumb', '');\n currPage = t;//keep track of the page we just loaded\n showtheSlide();//hide all but they page we want\n });\n}", "title": "" }, { "docid": "0316e8e14088a2cc05016dd59a25458c", "score": "0.5102392", "text": "function visChange() {\n if (!isHidden()) {\n console.log(\"Tab gains focus\");\n callback();\n }\n }", "title": "" }, { "docid": "a0eaebae602dcb68989f06ab8a9cb4b8", "score": "0.5092967", "text": "onShowing() {\r\n // Stub\r\n }", "title": "" }, { "docid": "c2230cd9667ac78091e09d1a48b592c7", "score": "0.50878996", "text": "function delayOnVisibilityChange() {\n if ($document[0].hidden) {\n poller.delayAll();\n } else {\n poller.resetDelay();\n }\n }", "title": "" }, { "docid": "46ad0deebe37bdcbc52250d2da1aa929", "score": "0.5083475", "text": "static reset(thumbnailContainer) {\n if (!thumbnailContainer) return;\n let thumbs;\n if (thumbnailContainer && thumbnailContainer._children) {\n thumbs = thumbnailContainer._children;\n } else {\n thumbs = thumbnailContainer;\n }\n for (let i = 0; i < thumbs.length; i++) {\n const ch = thumbs[i];\n if (!ch.active) {\n continue;\n }\n ch.active = false;\n Thumbnail.thumbAnimation(ch.element, {position: {z: 0, x: 0}}, 'elementHide', 100);\n }\n\n }", "title": "" } ]
8ed2690d37a3f6cb24f473de0e49043a
Events '14' and '17'
[ { "docid": "102c7229b73c0cca2344efce968c7523", "score": "0.0", "text": "function udp_job_queing_up(bufUsed, hexCode, rinfo, mgr) {\n let js = {};\n js.fields = [\"type\", \"ip\", \"port\", \"job\", \"mac\", \"msg\"];\n js.ip = rinfo.address;\n js.port = book[mgr][TCPPORT];\n js.type = \"job_queuing_up\";\n let jobpos = find_job_pos(bufUsed);\n let jobnum = bufUsed.slice(0, jobpos).toString();\n if (hexCode == \"14\") {\n js.mac = bufUsed.slice(jobpos + 1, jobpos + 16).toString();\n js.msg = \"TheServer \" + js.mac + \" plans to perform the following Job \" + jobnum;\n } else js.msg = \"Job \" + jobnum + \" is Queing up\";\n mumo_callback(null, js,mgr);\n}", "title": "" } ]
[ { "docid": "1157a0ba182f040e7d6bdf4a83cf06ec", "score": "0.63909996", "text": "function EventHelper (possibleEvents) {\n }", "title": "" }, { "docid": "35e1c5fcfea7b2d06ba7a30f306d3128", "score": "0.6275039", "text": "_events() {\n\n }", "title": "" }, { "docid": "6628679657b84ad889029198ed74ab05", "score": "0.62598443", "text": "_events () {\n\t}", "title": "" }, { "docid": "e10d66a63150da517f23d7752b582d82", "score": "0.62386674", "text": "static get events() {\r\n return { OPEN_END: 'open_end', OPEN_START: 'open_start', CLOSE_END: 'close_end', CLOSE_START: 'close_start' };\r\n }", "title": "" }, { "docid": "88c3ab8203e759c7c50b188102cfb54f", "score": "0.6218963", "text": "function generateEvent() {\n\n}", "title": "" }, { "docid": "01afe54d208f427d977cadd0bfec7121", "score": "0.620407", "text": "_events() {\n }", "title": "" }, { "docid": "b9f4e731f0213ac66666d6209f59a772", "score": "0.61854637", "text": "set events(value) {}", "title": "" }, { "docid": "e84f81a5c1c456f6dbe9b495891bbea8", "score": "0.6175819", "text": "function EventInfo() { }", "title": "" }, { "docid": "27ce4d64fe7ad3a134620836fa533fd7", "score": "0.616519", "text": "function CalendarEventTimesChangedEvent() { }", "title": "" }, { "docid": "c12db7b210929e75ac1b040221bf8d79", "score": "0.61356854", "text": "function independent_events_extd(e) {\r\n\tvar count = parseInt(e);\r\n\tcount++;\r\n\tif(count <= 3) {\r\n\t\tdocument.getElementById('animation').innerHTML = \"<img class='independent_events_1' src='assets/images/independent_events_images/164_independentevents\"+count+\".png'/>\";\r\n\t} else {\r\n\t\tdocument.getElementById('animation').innerHTML = \"\";\r\n\t\tcount = 0;\r\n\t}\r\n\t\tindependent_events(count);\r\n}", "title": "" }, { "docid": "d727dd4f9ba78a3827db21084b5bbdaf", "score": "0.61154044", "text": "get events() {}", "title": "" }, { "docid": "0d62d41b4ebf130fa2a32037cf3016dc", "score": "0.5978802", "text": "createEvent(event) {\n\t\t\tif(this.target.getValue) {\n\t\t\t\tthis.events.push({\n\t\t\t\t\tstartPos: this.target.selection.getCursor(),\n\t\t\t\t\tendPos: this.target.selection.getSelectionAnchor(),\n\t\t\t\t\tcontent: this.target.getValue(),\n\t\t\t\t\ttimestamp: (new Date()).getTime()\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.events.push({\n\t\t\t\t\tstartPos: this.target.selectionStart,\n\t\t\t\t\tendPos: this.target.selectionEnd,\n\t\t\t\t\tcontent: this.target.value,\n\t\t\t\t\ttimestamp: (new Date()).getTime()\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.isReady = false;\n\t\t}", "title": "" }, { "docid": "1df69eed0ebedcb4d6ac93efe2f7e3c9", "score": "0.59599864", "text": "trackEvent() {}", "title": "" }, { "docid": "7c0c41f326eecd590901adea472fd005", "score": "0.59348047", "text": "parseEvent() {\n \n }", "title": "" }, { "docid": "759db6b2afaddc5f13291f6aef30045c", "score": "0.5851381", "text": "function doEvent(event){\n var rtnArray={}; \n $(event).children().each(function(){\n \n if(this.nodeName==\"rdfs:label\"){ // LABEL \n // replace & caractere ... \n rtnArray['setSummary']=format(this.textContent);\n \n \n }else if(this.nodeName==\"icaltzd:dtstart\"){ // START AT \n rtnArray['setStartAt']=$(this).text(); \n }else if(this.nodeName==\"ical:dtstart\"){\n $(this).children().each(function(){\n if(this.nodeName==\"ical:date\"){\n console.log( this );\n rtnArray['setStartAt']=$(this).text(); \n }\n });\n if(!rtnArray['setStartAt'])rtnArray['setStartAt']=$(this).text();\n \n \n }else if(this.nodeName==\"icaltzd:dtend\"){ // END AT\n \n rtnArray['setEndAt']=$(this).text(); \n \n }else if(this.nodeName==\"ical:dtend\"){ \n \n $(this).children().each(function(){\n if(this.nodeName==\"ical:date\"){\n rtnArray['setEndAt']=$(this).text(); \n }\n });\n if(!rtnArray['setEndAt'])rtnArray['setEndAt']=$(this).text();\n \n }else if(this.nodeName==\"dce:description\"){ // DESCRIPTION\n \n rtnArray['setDescription']=format(this.textContent);\n \n }else if(this.nodeName==\"swrc:abstract\"){ // ABSTRACT\n \n rtnArray['setComment']=format(this.textContent);\n \n }else if(this.nodeName==\"swc:hasRelatedDocument\"){ // RELATED PUBLICATION XPROP\n \n var xproperty= {}; \n xproperty['setCalendarEntity']=events.length;\n xproperty['setXNamespace']=\"publication_uri\";\n xproperty['setXValue']=$(this).attr('rdf:resource');\n xproperties.push(xproperty); \n \n }else if(this.nodeName==\"swc:hasLocation\"){ // LOCATION //OWL fix\n var locationName= $(this).attr('rdf:resource').replace('http://data.semanticweb.org/conference/eswc/2013/place/','');\n \n if(getLocationIdFromName(locationName)== -1 ){ locations.push({setDescription:\"\",setName:locationName}); } \n rtnArray.setLocation=getLocationIdFromName(locationName);\n \n }else if(this.nodeName==\"icaltzd:location\"){ // LOCATION\n \n var locationId = getLocationIdFromUri($(this).attr('rdf:resource'));\n rtnArray['setLocation']=locationId;\n \n } else if(this.nodeName==\"foaf:homepage\"){ // url\n \n rtnArray['setUrl']=format($(this).attr('rdf:resource')); \n } \n \n }); \n \n // EVENT CAT\n var catName = event.nodeName.split(\"swc:\").join(\"\").split(\"event:\").join(\"\");\n if(catName==\"NamedIndividual\")catName= getNodeName(event);\n var tmp=catName;\n if(tmp.split(\"Event\").join(\"\")!=\"\")\n {\n catName=tmp;\n }else //OWL fix\n {\n catName = getNodeName(event).split(\"swc:\").join(\"\").split(\"event:\").join(\"\") ;\n tmp=catName;\n if(tmp.split(\"Event\").join(\"\")!=\"\")\n {\n catName=tmp;\n \n }\n } //OWL fix\n\n var catId = getCategoryIdFromName(catName);\n if(catId==undefined){ \n var category= {}; \n category['setName']=catName;\n if(catName == \"ConferenceEvent\") confName = rtnArray['setSummary'];\n categories.push(category);\n catId = categories.length-1;\n }\n rtnArray['addCategorie']=catId;\n \n events.push( rtnArray );\n \n // EVENT XPROP\n var xproperty= {}; \n xproperty['setCalendarEntity']=events.length-1;\n xproperty['setXNamespace']=\"event_uri\";\n xproperty['setXValue']=$(event).attr('rdf:about');\n xproperties.push(xproperty);\n \n \n }", "title": "" }, { "docid": "ae6efbfa523dbed238d7505e4fbe5cbf", "score": "0.5808744", "text": "distribution(events) {\n\t}", "title": "" }, { "docid": "ea72f5c9d26e153123795ebc1bd3dba3", "score": "0.5805488", "text": "function isEvent(opc) {\n\tif (opc < OPC_ACON) return false;\n\tif ((opc & 150) != 144) return false;\n\treturn true;\n}", "title": "" }, { "docid": "d92abd1bc40293806b2b5bac5d3bf56c", "score": "0.5797988", "text": "function onEvent(name, event) {\n // console.log(name, JSON.stringify(event, null, 3));\n return;\n }", "title": "" }, { "docid": "fa13c6a194a9afe5923f0249f953ebe2", "score": "0.57912743", "text": "function event(a) {\n\te = e + a;\n}", "title": "" }, { "docid": "5fdcea41df449951efa41179527333c3", "score": "0.5771113", "text": "printEventInformation() {\n console.log(\"El nombre del evento es: \" + this.eventName + \"\\n\");\n console.log(\"El nombre del siguiente estado al que apunta es: \" + this.nextState + \"\\n\");\n }", "title": "" }, { "docid": "52f76cb10b2c079d70e7408f62e753b1", "score": "0.57666796", "text": "function TtsEvent() {}", "title": "" }, { "docid": "39803607593acccc1852958f1b7786cd", "score": "0.5708262", "text": "function checkSpaceType(event){\r\nconsole.log(event);\r\nswitch(event){\r\n case \"Inn\":\r\n // innMealEvent();\r\n break;\r\n case \"Souvenir\":\r\n // souvenirEvent();\r\n break;\r\n case \"Visitor\":\r\n // visitorEvent();\r\n break;\r\n case \"Cafe\":\r\n // cafeEvent();\r\n break;\r\n case \"Statue\":\r\n // statueEvent();\r\n break; \r\n case \"Mora\":\r\n // moraEvent();\r\n break;\r\n case \"Lake\":\r\n // lakeEvent();\r\n break;\r\n case \"Field\":\r\n // fieldEvent();\r\n break;\r\n case \"Mountain\":\r\n // mountainEvent();\r\n break; \r\n case \"End\":\r\n // EndGameEvent();\r\n break\r\n default:\r\n // code block \r\n }\r\n}", "title": "" }, { "docid": "7194f31210dd7d62a0487c2beef09dde", "score": "0.5700308", "text": "function newEvent(){\n //get random event\n var min = 0\n var max = gameState.allEvents.length - 1\n var idx = getRandomInt(min, max)\n var event = gameState.allEvents[idx]\n\n $('#currentevent .eventname').html('Event: ' + event.name);\n $('#currentevent .eventtxt').html(event.flavortext);\n $('#currentevent .eventeffect').html('End of Turn => '+event.effect);\n }", "title": "" }, { "docid": "155d00af4c79cb0a9dcde3a730acdf50", "score": "0.56962705", "text": "function sec2Events() {\n\n let newVal = $(this).text().trim();\n let oprSeqLen = operationSeq.length;\n let lastElOperationSeq = operationSeq[oprSeqLen - 1];\n\n if (lastElOperationSeq != undefined && lastElOperationSeq.hasOwnProperty('finalResult'))\n calcOn();\n\n oprSeqLen = operationSeq.length;\n op_sign.html('');\n\n if (!isNaN(newVal) && !Number(tempInp) && !tempInp.includes('.'))\n tempInp = Number(newVal).toString();\n else if((newVal != \".\") || (newVal == \".\" && !tempInp.includes(newVal)))\n tempInp += newVal;\n\n if (oprSeqLen) {\n let temp = (operationSeq[oprSeqLen - 1]);\n if (temp.hasOwnProperty('inpData')) {\n countInps--;\n operationSeq.pop();\n }\n else if (temp.hasOwnProperty('resultData'))\n countInps--;\n }\n\n countInps++;\n\n tempInp = formatData(tempInp);\n displayValue(tempInp);\n operationSeq.push({ inpData: tempInp });\n}", "title": "" }, { "docid": "746153c316f31114715e453ec6ba2727", "score": "0.56729466", "text": "function customCodeEvents() {\n\n if (typeof pys_customEvents == 'undefined') {\n return;\n }\n\n $.each(pys_customEvents, function (index, code) {\n eval(code);\n });\n\n }", "title": "" }, { "docid": "683427e7a4f7b65cb07cdceccb031214", "score": "0.5665601", "text": "function sec1Events() {\n let oprSeqLen = operationSeq.length;\n if (oprSeqLen) {\n let lastEl = operationSeq[oprSeqLen - 1];\n let opr = $(this).data('op').trim();\n let type = Object.keys(lastEl)[0];\n\n if (type != \"opData\") {\n tempInp = Object.values(lastEl)[0];\n let errorState = false;\n\n switch (opr) {\n case 'signRev': tempInp *= -1;\n break;\n case 'sqrt': {\n tempInp = Math.sqrt(tempInp);\n if (isNaN(tempInp)) {\n alert(\"Square root can not be taken for negative numbers!\");\n errorState = true;\n }\n }\n }\n\n if (!errorState) {\n tempInp = tempInp.toString();\n tempInp = formatData(tempInp);\n displayValue(tempInp);\n\n if (type === 'finalResult') {\n let val = formatData(tempInp);\n resetCalc();\n tempInp = val;\n operationSeq.push({ inpData: val });\n countInps = 1;\n displayValue(val);\n }\n else\n operationSeq[oprSeqLen - 1].inpData = tempInp;\n }\n }\n }\n}", "title": "" }, { "docid": "5b23ab2169e3cb2cad7475a5c53b31f9", "score": "0.56311035", "text": "eventHandler(p_e) {\n return 0;\n }", "title": "" }, { "docid": "a109c80a7d06b3c8765afd5a2ecb16bd", "score": "0.562107", "text": "function MyEvent() {\n\n\t\t\t}", "title": "" }, { "docid": "a109c80a7d06b3c8765afd5a2ecb16bd", "score": "0.562107", "text": "function MyEvent() {\n\n\t\t\t}", "title": "" }, { "docid": "a109c80a7d06b3c8765afd5a2ecb16bd", "score": "0.562107", "text": "function MyEvent() {\n\n\t\t\t}", "title": "" }, { "docid": "a109c80a7d06b3c8765afd5a2ecb16bd", "score": "0.562107", "text": "function MyEvent() {\n\n\t\t\t}", "title": "" }, { "docid": "d51e388ac337a149f65995d2217f5116", "score": "0.5619635", "text": "function tc_events_global(var1,var2,var3){if(typeof tc_events_1===\"function\")tc_events_1(var1,var2,var3);if(typeof tc_events_2===\"function\")tc_events_2(var1,var2,var3);if(typeof tc_events_3===\"function\")tc_events_3(var1,var2,var3);if(typeof tc_events_4===\"function\")tc_events_4(var1,var2,var3);if(typeof tc_events_5===\"function\")tc_events_5(var1,var2,var3);if(typeof tc_events_6===\"function\")tc_events_6(var1,var2,var3);if(typeof tc_events_7===\"function\")tc_events_7(var1,var2,var3);if(typeof tc_events_8===\"function\")tc_events_8(var1,var2,var3);if(typeof tc_events_9===\"function\")tc_events_9(var1,var2,var3);if(typeof tc_events_20===\"function\")tc_events_20(var1,var2,var3);}", "title": "" }, { "docid": "f954b3f67c08999f21aa90935194b176", "score": "0.5619217", "text": "get events() {\n return {\n 'change select[id$=\"_qtype_name\"]': 'toggleFields',\n 'change select[id$=\"_metadata_type\"]': 'toggleFields',\n };\n }", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.5605747", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "4531d9b056e58b7b73ab36722d5e3086", "score": "0.56049603", "text": "function customCodeEvents() {\n\n if( typeof pys_customEvents == 'undefined' ) {\n return;\n }\n\n $.each( pys_customEvents, function( index, code ) {\n eval( code );\n } );\n\n }", "title": "" }, { "docid": "4a94f8abbba64c5e8ed47f79d512e1b4", "score": "0.5601076", "text": "function InternalEvent() { }", "title": "" }, { "docid": "af74f434e4e853d29c6af8fb7204fe9e", "score": "0.5597717", "text": "function Events( type, data ) {\r\n\t\t\r\n\t//\tlog('AGO_Module - Events ' + type + ' --- ' + JSON.stringify( data || '' ) );\r\n\t\t \r\n\t\tif ( type === 'Content' ) {}\r\n\t}", "title": "" }, { "docid": "b6a0ab3f105832d6b81ce6e40b2b87cc", "score": "0.5593398", "text": "function PlayerEvents() {\n\t\tvar that = this;\n\t\t$rootScope.$on( 'time-change', function() {\n\t\t\tthat.timeChange();\n\t\t});\n\t\t$rootScope.$on( 'time-change-large', function() {\n\t\t\tthat.timeChangeLarge();\n\t\t});\n\t\tthis.checkedTurkey = 0; //Make sure we test each of these events just once in timeChangeLarge\n\t\tthis.checkedDream = 0;\n\t}", "title": "" }, { "docid": "aa896f3fab8b5a3e1ce4fdc4aa8464e3", "score": "0.55887574", "text": "function _getEvents(name) {\n switch(name) {\n case \"Balances\":\n return [\n {\n \"name\": \"BalanceSet\",\n \"args\": [\n \"AccountId\",\n \"u64\",\n \"u64\"\n ],\n \"documentation\": [\n \" A balance was set by root. \\\\[who, free, reserved\\\\]\"\n ]\n },\n {\n \"name\": \"Transfer\",\n \"args\": [\n \"AccountId\",\n \"AccountId\",\n \"u64\"\n ],\n \"documentation\": [\n \" Transfer succeeded. \\\\[from, to, value\\\\]\"\n ]\n },\n ];\n case \"System\":\n return [\n {\n \"name\": \"ExtrinsicSuccess\",\n \"args\": [\n \"DispatchInfo\"\n ],\n \"documentation\": [\n \" An extrinsic completed successfully. \\\\[info\\\\]\"\n ]\n },\n {\n \"name\": \"ExtrinsicFailed\",\n \"args\": [\n \"DispatchError\",\n \"DispatchInfo\"\n ],\n \"documentation\": [\n \" An extrinsic failed. \\\\[error, info\\\\]\"\n ]\n }\n ];\n default:\n null;\n }\n}", "title": "" }, { "docid": "e6903ec7677c2c7ea605ac4771144507", "score": "0.5578627", "text": "function onEvent(name, event) {\n console.log(name, JSON.stringify(event, null, 2));\n }", "title": "" }, { "docid": "30ec277102f2ded1797e9d8c16364fdc", "score": "0.5561875", "text": "addEventTypes() {}", "title": "" }, { "docid": "2b32dd08ce083bf4347f89268321ac88", "score": "0.55454314", "text": "function Event(name, type, host, startDate, startHour, startMin, endDate, endHour, endMin, guests, location, message) {\n // not necessary, but will be added if I choose to provide saved data options in the future\n // guest_array is used for now\n}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.554366", "text": "function Events() {}", "title": "" } ]
5a4e6a858015fe2c590682549ca538c1
parse data from mesh files into float32 arrays
[ { "docid": "958e46a1653a08bf1a993e9e55a0d773", "score": "0.61290133", "text": "function parseMesh(txt,model) {\n\n txt = txt.trim() + '\\n';\n var posA = 0;\n var posB = txt.indexOf(\"\\n\",0);\n var vArr = ['',];\n var verts = [];\n var norms = [];\n var tnorms = [];\n var m = { hx:null,lx:null,hy:null,ly:null,hz:null,lz:null,mx:null,my:null,mz:null,c:0 };\n var sharedverts = {};\n let nindex,mag,ind,vi=0,ni=0,findex=0,newnormx,newnormy,newnormz;\n\n while(posB > posA){\n\n var line = txt.substring(posA,posB).trim();\n\n switch(line.charAt(0)){\n // Sample Data\n //Vertex 1 140.753 133.406 99.9389 \n //Face 5000 2499 2501 2502\n\n case \"V\":\n line = line.split(\" \");\n var x = parseFloat(line[2]);\n var y = parseFloat(line[3]);\n var z = parseFloat(line[4]);\n\n sharedverts[parseInt(line[1])] = [];\n\n //set low and high points for this model\n if (m.c == 0) { m.hx=m.lx=x; m.hy=m.ly=y; m.hz=m.lz=z; m.c++; }\n else {\n if (x<m.lx) m.lx=x;\n if (y<m.ly) m.ly=y;\n if (z<m.lz) m.lz=z;\n if (x>m.hx) m.hx=x;\n if (y>m.hy) m.hy=y;\n if (z>m.hz) m.hz=z;\n }\n //set low and high points for all models\n if (center.count == 0) { center.hx=center.lx=x; center.hy=center.ly=y; center.hz=center.lz=z; center.count++; }\n else {\n if (x<center.lx) center.lx=x;\n if (y<center.ly) center.ly=y;\n if (z<center.lz) center.lz=z;\n if (x>center.hx) center.hx=x;\n if (y>center.hy) center.hy=y;\n if (z>center.hz) center.hz=z;\n }\n\n vArr.push(x,y,z);\n break;\n\n case \"F\":\n line = line.split(\" \");\n\n vert = line[2];\n sharedverts[vert].push((findex++)*3);\n ind = vert*3;\n var x1 = vArr[ind-2];\n var y1 = vArr[ind-1];\n var z1 = vArr[ind];\n\n vert = line[3];\n sharedverts[vert].push((findex++)*3);\n ind = vert*3;\n var x2 = vArr[ind-2];\n var y2 = vArr[ind-1];\n var z2 = vArr[ind];\n\n vert = line[4];\n sharedverts[vert].push((findex++)*3);\n ind = vert*3;\n var x3 = vArr[ind-2];\n var y3 = vArr[ind-1];\n var z3 = vArr[ind];\n\n verts[vi++] = x1;\n verts[vi++] = y1;\n verts[vi++] = z1;\n verts[vi++] = x2;\n verts[vi++] = y2;\n verts[vi++] = z2;\n verts[vi++] = x3;\n verts[vi++] = y3;\n verts[vi++] = z3;\n\n var norm = triNorm(x1,y1,z1,x2,y2,z2,x3,y3,z3);\n tnorms[ni++] = norm[0];\n tnorms[ni++] = norm[1];\n tnorms[ni++] = norm[2];\n tnorms[ni++] = norm[0];\n tnorms[ni++] = norm[1];\n tnorms[ni++] = norm[2];\n tnorms[ni++] = norm[0];\n tnorms[ni++] = norm[1];\n tnorms[ni++] = norm[2];\n break;\n\n }\n posA = posB+1;\n posB = txt.indexOf(\"\\n\",posA);\n }\n\n model.len = vi;\n model.center = [(m.hx+m.lx)/2.0,(m.hy+m.ly)/2.0,(m.hz+m.lz)/2.0];\n\n //make smooth vertex normals from discreet tri normals\n for (var sv in sharedverts){\n newnormx = 0.0;\n newnormy = 0.0;\n newnormz = 0.0;\n for (var si in sharedverts[sv]){\n nindex = sharedverts[sv][si];\n newnormx += tnorms[nindex];\n newnormy += tnorms[nindex+1];\n newnormz += tnorms[nindex+2];\n }\n\n mag = Math.sqrt(newnormx* newnormx+ newnormy* newnormy+ newnormz* newnormz);\n if (mag != 0) { newnormx /= mag; newnormy /= mag; newnormz /= mag; }\n else { newnormx = 0.0; newnormy = 0.0; newnormz = 0.0; }\n\n for (var si in sharedverts[sv]){\n nindex = sharedverts[sv][si];\n norms[nindex] = newnormx;\n norms[nindex+1] = newnormy;\n norms[nindex+2] = newnormz;\n }\n }\n\n model.verts = new Float32Array(verts);\n model.norms = new Float32Array(norms);\n model.tnorms = new Float32Array(tnorms);\n model.color = [];\n return model;\n}", "title": "" } ]
[ { "docid": "f9ac1bb4adf25253c8209efbf2f9d492", "score": "0.66544455", "text": "function buildMesh() {\n this.vertices = [];\n this.faces = [];\n\n function toInt(x) { return parseInt(x); };\n function toFloat(x) { return parseFloat(x); };\n\n for (i=0, l=this.fileData.length; i<l; i++) {\n currentLine = this.fileData[i];\n\n if (currentLine.match(/^V\\(/)) {\n tempValue = currentLine.substring(2, currentLine.length-1).split(\",\").map(toFloat);\n this.vertices.push( new vec4D(tempValue[0] || 0, tempValue[1] || 0, tempValue[2] || 0, 1) );\n }\n\n else if (currentLine.match(/^F\\(/)) {\n tempValue = currentLine.substring(2, currentLine.length-1).split(\",\").map(toInt);\n this.faces.push(tempValue.reverse());\n }\n }\n }", "title": "" }, { "docid": "e38c0371df571be24d08cb0e96b6e1f2", "score": "0.6376457", "text": "_parseNormals() {\n var count = this._tempResult.numVertices * 3;\n var normals = new Float32Array(count);\n\n for (var i = 0; i < count; i++) {\n normals[i] = parseFloat(this._popStack());\n }\n\n this._tempResult.normals = normals;\n }", "title": "" }, { "docid": "1186c01180c68df0e2804acaa50410a3", "score": "0.6303206", "text": "_parseVertices() {\n var count = this._tempResult.numVertices * 3;\n var vertices = new Float32Array(count);\n var that = this;\n\n for (var i = 0; i < count; i++) {\n vertices[i] = parseFloat(this._popStack());\n }\n\n this._tempResult.vertices = vertices;\n }", "title": "" }, { "docid": "88431ed4b4f5bf37cb817bf1f0e08c33", "score": "0.6151463", "text": "function readLocal2Mesh(mobj,fobj) {\n\n // setup callback for errors during reading\n var errorHandler = function(e) {\n window.console.log('FileReader Error:' + e.target.error.code);\n };\n // setup callback after reading\n var loadHandler = function(mobj, fobj) {\n return function(e) {\n // reading complete\n var data = e.target.result;\n mobj.filedata = data;\n }\n };\n\n\n var reader = new FileReader();\n reader.onerror = errorHandler;\n reader.onload = (loadHandler)(mobj,fobj); // bind the current type\n\n // start reading this file\n reader.readAsArrayBuffer(fobj);\n}", "title": "" }, { "docid": "7be908a925b13c51fcb9958d35edf561", "score": "0.61366034", "text": "formatArray(data) {\n const result = [];\n this.requireInputOutputOfOne();\n for (let i = 0; i < data.length; i++) {\n result.push(Float32Array.from([data[i]]));\n }\n return [result];\n }", "title": "" }, { "docid": "b7453e11be4485b17e0b21417fabed9e", "score": "0.6098363", "text": "function parse(objFile){\n var textByLine = objFile.split(\"\\n\")\n for(var i = 0; i < textByLine.length; i++){\n var entry = textByLine[i].toString();\n var parsedLine = entry.split(\" \");\n \n if(parsedLine[0] == \"v\"){\n potVertices.push(parseFloat(parsedLine[1]));\n potVertices.push(parseFloat(parsedLine[2]));\n potVertices.push(parseFloat(parsedLine[3]));\n potNormals.push(0);\n potNormals.push(0);\n potNormals.push(0);\n }\n \n if(parsedLine[0] == \"f\"){\n potFaces.push(parseInt(parsedLine[2])-1);\n potFaces.push(parseInt(parsedLine[3])-1);\n potFaces.push(parseInt(parsedLine[4])-1);\n \n }\n \n }\n \n potNormals = setNorms(potFaces, potVertices, potNormals);\n setupPotBuffers();\n setupShaders();\n setupCubeMap();\n setupBuffers();\n setupTextures();\n gl.uniform1f(shaderProgram2.uniformEnableReflection, 1);\n draw();\n tick();\n}", "title": "" }, { "docid": "259b9c320ea72a3c8a43e2eaa6e8b2b0", "score": "0.6062526", "text": "function createGeometry(data, variables, numVertices, result) {\n var data32PerVertex = variables[\"data32PerVertex\"].size;\n if (undefined == result) {\n result = new Float32Array(data32PerVertex * numVertices);\n }\n var offset = 0;\n var offsetIndex = 0;\n var offsetData = 0;\n var key = \"\";\n var index = 0;\n for (var i = 0; i < numVertices; i++) {\n offset = data32PerVertex * i;\n for (key in data) {\n var variable = variables[key];\n if (undefined == variable) {\n continue;\n }\n var array = data[key];\n offsetData = i * variable.size;\n offsetIndex = offset + variable.offset;\n for (index = 0; index < variable.size; index++) {\n result[offsetIndex + index] = array[offsetData + index];\n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "0467d9f9ce0a73dfb7e0d19044120938", "score": "0.59652746", "text": "toFloat32Array() { return new Float32Array(this); }", "title": "" }, { "docid": "0467d9f9ce0a73dfb7e0d19044120938", "score": "0.59652746", "text": "toFloat32Array() { return new Float32Array(this); }", "title": "" }, { "docid": "41f7185f31bae303bf239ff8f4818419", "score": "0.5918704", "text": "convert(file_data) {\n let lines = file_data.split('\\n');\n\n if (lines.length > 1000000) {\n // five hundred thousand lines is a ton\n alert(\"File too big\");\n return \"\";\n }\n\n // console.log(lines);\n let objdata = new OBJData();\n let mapFloat = (e) => parseFloat(e);\n\n let index = 0;\n while (index < lines.length) {\n let line = lines[index];\n // console.log(line);\n\n if (line.startsWith(\"v \")) {\n // vertex\n let nums = line.split(/\\s+/).slice(1, 4).map(mapFloat);\n // console.log(`v: ${nums}`);\n objdata.addVertex(nums);\n } else if (line.startsWith(\"vt \")) {\n // texCoord\n let nums = line.split(/\\s+/).slice(1, 3).map(mapFloat);\n // console.log(`t: ${nums}`);\n objdata.addTexCoord(nums);\n } else if (line.startsWith(\"vn \")) {\n // normal\n let nums = line.split(/\\s+/).slice(1, 4).map(mapFloat);\n // console.log(`n: ${nums}`);\n objdata.addNormal(nums);\n } else if (line.startsWith(\"f \")) {\n // face\n let points = line.split(/\\s+/).slice(1).filter((e) => e.length > 0).map((e) => {\n return objdata.getPoint(e.split(\"/\").filter((e) => e.length > 0).map(mapFloat));\n });\n // console.log(points);\n\n\n let p_index = 1;\n while (p_index < points.length - 1) {\n objdata.addTriangle(points[0], points[p_index], points[p_index + 1]);\n p_index++;\n }\n\n }\n\n index++;\n }\n // console.log(objdata.string());\n // return objdata.string();\n\n let out_data = `solid ${this.file.slice(0, -4)}\\n`;\n\n let i = 0;\n while (i < objdata.triangles.length) {\n let tri = objdata.triangles[i];\n out_data += `facet normal ${tri.surfaceNormal.x} ${tri.surfaceNormal.y} ${tri.surfaceNormal.z}\\n`;\n // out_data += `facet normal 0 0 0\\n`;\n out_data += `outer loop\\n`;\n out_data += `vertex ${tri.p1.vertex.x} ${tri.p1.vertex.y} ${tri.p1.vertex.z}\\n`;\n out_data += `vertex ${tri.p2.vertex.x} ${tri.p2.vertex.y} ${tri.p2.vertex.z}\\n`;\n out_data += `vertex ${tri.p3.vertex.x} ${tri.p3.vertex.y} ${tri.p3.vertex.z}\\n`;\n out_data += `end loop\\n`;\n out_data += `endfacet\\n`;\n i++;\n }\n return out_data;\n }", "title": "" }, { "docid": "809590e826d56ad7d6d29de5fcc9d289", "score": "0.5904123", "text": "function loadFile(event) {\n\n file = event.target.files[0]; //Store the file\n var reader = new FileReader(); //Make new FileReader\n reader.readAsText(file); //Turn the file into text\n reader.onload = function (event) {\n fileString = reader.result; //Store text in string\n\n var lines = fileString.split(/\\r?\\n/); //Split by line\n\n var ply_index = 0;\n\n console.log(\"# of lines in file: \" + lines.length);\n\n for (var i = 0; i < lines.length; i++){\n if(isReading){ //Done with header\n var e = lines[i].split(\" \");\n\n //Read vertices from file\n if(ply_index < ply_vertices){\n iVertices[ply_index] = [parseFloat(e[0]), parseFloat(e[1]), parseFloat(e[2])];\n\n //Read faces from file\n } else {\n //Reset indices\n if(ply_index == ply_vertices){\n console.log(\"Setting indices to 0...\");\n\n poly_index = 0;\n\n vao_index = 0;\n }\n\n //Store face data\n if(poly_index < ply_poly){\n triangles[poly_index] = [iVertices[e[1]], iVertices[e[2]], iVertices[e[3]]];\n normals[poly_index] = calculateNormal(triangles[poly_index]);\n }\n\n poly_index++;\n }\n\n ply_index++;\n } else { //For reading header\n //Read number of vertices\n if(lines[i].substr(0, \"element vertex\".length) == \"element vertex\")\n ply_vertices = lines[i].split(\" \")[2];\n //Read number of faces\n if(lines[i].substr(0, \"element face\".length) == \"element face\")\n ply_poly = lines[i].split(\" \")[2];\n }\n // Done with header\n if (lines[i] == \"end_header\"){\n isReading = true;\n }\n }\n\n render();\n };\n\n console.log(\"Loading file: <\" + file.name + \">...\");\n\n}", "title": "" }, { "docid": "3ab86f60eb589e1b206e237bb0325d45", "score": "0.5869475", "text": "function readBVFile(gl, text) {\n var input = text.split(/\\s+/);\n var cur = 0;\n function read_vector(n, isRational) {\n var arr = [];\n for (var i = 0; i < n; ++i) {\n var v = new Vec3();\n v.x = Number(input[cur]);\n ++cur;\n v.y = Number(input[cur]);\n ++cur;\n v.z = Number(input[cur]);\n ++cur;\n if (isRational) {\n v.d = Number(input[cur]);\n ++cur;\n }\n arr.push(v);\n }\n return arr;\n }\n var groups = [];\n var currentGroup = new Group('(unamed group)', 0, false);\n while (cur < input.length && input[cur] != '') {\n if (input[cur].toUpperCase() == \"GROUP\") {\n var id = Number(input[++cur]);\n var name_1 = input[++cur];\n var groupExists = false;\n for (var i = 0; i < groups.length; ++i) {\n if (groups[i].id == id) {\n currentGroup = groups[i];\n groupExists = true;\n break;\n }\n }\n if (!groupExists) {\n currentGroup = new Group(name_1, id, false);\n groups.push(currentGroup);\n }\n ++cur;\n }\n var kind = Number(input[cur]);\n ++cur;\n switch (kind) {\n case 1: {\n // polyhedral data (vertex + faces)\n var numVertices = Number(input[cur]);\n cur += 1;\n var numFaces = Number(input[cur]);\n cur += 1;\n // load vertices\n var vertices = [];\n for (var i = 0; i < numVertices; i++) {\n var x = Number(input[cur + 0]);\n var y = Number(input[cur + 1]);\n var z = Number(input[cur + 2]);\n var v = new Vec3();\n v.set(x, y, z);\n vertices.push(v);\n cur += 3;\n }\n // load faces\n var faces = [];\n for (var i = 0; i < numFaces; i++) {\n var faceSize = Number(input[cur]);\n cur += 1;\n if (faceSize == 3) {\n faces.push(Number(input[cur + 0]));\n faces.push(Number(input[cur + 1]));\n faces.push(Number(input[cur + 2]));\n cur += 3;\n }\n else if (faceSize == 4) {\n // transform one quad face into two triangle faces\n var a = Number(input[cur + 0]);\n var b = Number(input[cur + 1]);\n var c = Number(input[cur + 2]);\n var d = Number(input[cur + 3]);\n // triangle a, b, c\n faces.push(a);\n faces.push(b);\n faces.push(c);\n // triangle a, c, d\n faces.push(a);\n faces.push(c);\n faces.push(d);\n cur += 4;\n }\n else {\n throw 'in polyhedral data, a face was specified with ' + faceSize.toString() + ' vertices but must be 3 or 4';\n }\n }\n var p = Patch.MakePolyhedral(vertices, faces);\n currentGroup.objs.push(new RenderablePatch(gl, p));\n break;\n }\n case 3: {\n // triangular bezier patch\n var deg = Number(input[cur]);\n ++cur;\n var cp = read_vector(((deg + 2) * (deg + 1)) / 2, false);\n var p = Patch.MakeTriangle(deg, cp);\n currentGroup.objs.push(new RenderablePatch(gl, p));\n break;\n }\n case 4:\n case 5:\n case 8: {\n // square quad patch (4), general quad patch (5) or rational patch (8)\n var isSquare = kind == 4;\n var isRational = kind == 8;\n var degu = Number(input[cur++]);\n var degv = isSquare ? degu : Number(input[cur++]);\n var cp = read_vector((degu + 1) * (degv + 1), isRational);\n var p = Patch.MakeQuad(degu, degv, cp);\n currentGroup.objs.push(new RenderablePatch(gl, p));\n break;\n }\n case 6: {\n // Trim curve\n throw 'Trim curve (6) not supported';\n }\n case 7: {\n // B-spline tensor product\n throw 'B-spline (7) not supported';\n }\n case 9: {\n // PN triangle\n var deg = Number(input[cur++]);\n var normal_deg = Number(input[cur++]);\n var cp = read_vector(((deg + 2) * (deg + 1)) / 2, false);\n var normals = read_vector(((normal_deg + 2) * (normal_deg + 1)) / 2, false);\n var p = Patch.MakeTriangle(deg, cp);\n p.artificial_normals = {\n degu: normal_deg,\n degv: normal_deg,\n normals: normals\n };\n currentGroup.objs.push(new RenderablePatch(gl, p));\n break;\n }\n case 10: {\n // PN quad\n var degu = Number(input[cur++]);\n var degv = Number(input[cur++]);\n var normal_degu = Number(input[cur++]);\n var normal_degv = Number(input[cur++]);\n var cp = read_vector((degu + 1) * (degv + 1), false);\n var normals = read_vector((normal_degu + 1) * (normal_degv + 1), false);\n var p = Patch.MakeQuad(degu, degv, cp);\n p.artificial_normals = {\n degu: normal_degu,\n degv: normal_degv,\n normals: normals\n };\n currentGroup.objs.push(new RenderablePatch(gl, p));\n break;\n }\n default:\n throw 'kind not supported: ' + kind.toString();\n }\n }\n // if no groups were specified, use the default (named) group\n if (groups.length == 0) {\n groups.push(currentGroup);\n }\n for (var i = 0; i < groups.length; ++i) {\n groups[i].color = i % GroupColors.length;\n }\n return groups;\n}", "title": "" }, { "docid": "5877f105ab955f1560cfd68accbc4903", "score": "0.5779901", "text": "readFloat32Array(length, createNewBuffer = true) {\n var size = length * ByteArrayBase.SIZE_OF_FLOAT32;\n if (!this.validate(size))\n return null;\n if (!createNewBuffer) {\n if (this.position % 4 == 0) {\n var result = new Float32Array(this.buffer, this.position, length);\n this.position += size;\n }\n else {\n var tmp = new Uint8Array(new ArrayBuffer(size));\n for (var i = 0; i < size; i++) {\n tmp[i] = this.data.getUint8(this.position);\n this.position += ByteArrayBase.SIZE_OF_UINT8;\n }\n result = new Float32Array(tmp.buffer);\n }\n }\n else {\n result = new Float32Array(new ArrayBuffer(size));\n for (var i = 0; i < length; i++) {\n result[i] = this.data.getFloat32(this.position, this.endian === ByteArrayBase.LITTLE_ENDIAN);\n this.position += ByteArrayBase.SIZE_OF_FLOAT32;\n }\n }\n return result;\n }", "title": "" }, { "docid": "c3b17510879ec6fea9e29ceb0f87d195", "score": "0.5762557", "text": "importOFFfromString(string){\r\n string.replace(\"\\n \",\"\\n\");\r\n//\t\tvar tokens = string.split(/[\\n' ']/);\r\n\t\tvar tokens = string.split(/\\s+/);\r\n\t\t// tokens[0] == \"OFF\"\r\n\t\tvar ti = 0; // token index\r\n\t\tti++; // skip \"OFF\"\r\n\t\tvar nv = tokens[ti++]; // number of vertices\r\n\t\tvar nf = tokens[ti++]; // number of faces\r\n\t\tti++; // skip number of edges\r\n console.log(tokens[1] + \", \" + tokens[2] + \", \" + tokens[3]);\r\n console.log(tokens[4] + \", \" + tokens[5] + \", \" + tokens[6]);\r\n\t\t\r\n\t\tthis.verts = new Float32Array( nv*6 );\r\n\t\t\t\r\n\t\tfor (var i=0; i<nv; i++) {\r\n\t\t\tthis.verts[ i*6 + 0 ] = tokens[ti++]; // X\r\n\t\t\tthis.verts[ i*6 + 1 ] = tokens[ti++]; // Y\r\n\t\t\tthis.verts[ i*6 + 2 ] = tokens[ti++]; // Z\r\n// console.log(this.verts[ i*6 + 0 ] + \", \" +\r\n// this.verts[ i*6 + 1 ] + \", \" +\r\n// this.verts[ i*6 + 2 ]);\r\n\t\t}\r\n\r\n\t\tthis.tris = new Uint16Array( nf*3 );\r\n\t\tfor (var i=0; i<nf; i++) {\r\n\t\t\tif (tokens[ti++]!=3) { // number of edges (3?) \r\n console.log(\"At face \" + i + \": Non triangular face! file input failed.\");\r\n return;\r\n }\r\n\t\t\tthis.tris[ i*3 + 0 ] = tokens[ti++]; // v0\r\n\t\t\tthis.tris[ i*3 + 1 ] = tokens[ti++]; // v1\r\n\t\t\tthis.tris[ i*3 + 2 ] = tokens[ti++]; // v2\r\n\t\t}\r\n\t\tconsole.log(\"Loaded \"+nf+\" faces and \"+nv+\" vertices\");\r\n\t}", "title": "" }, { "docid": "5d2f588780a6c89330d6672dd3d3be9f", "score": "0.5762432", "text": "_array2float (list) {\n const buffer = new Uint8Array(list).buffer;\n const view = new DataView(buffer);\n return view.getFloat32(0, true);\n }", "title": "" }, { "docid": "57e28ffe1834d967124305539981b441", "score": "0.5718397", "text": "readFloat32() {\n const value = this._data.getFloat32(this.offset, this.littleEndian);\n\n this.offset += 4;\n return value;\n }", "title": "" }, { "docid": "852765596b3efb5859f2e9661dd216d6", "score": "0.5702926", "text": "function parseObj(t) {\n var vertices = [], fverts = [], indices = [], \n normals = [], fnormals = [], flist = [], \n texc = [], ftexc = [];\n\n for(var i = 0; i < t.length; i++) {\n var line = t[i], m = null;\n\n if(m = line.match(/^v ([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)/)) {\n fverts.push(parseFloat(m[1]));\n fverts.push(parseFloat(m[2]));\n fverts.push(parseFloat(m[3]));\n } else if(m = line.match(/^vn ([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)/)) {\n fnormals.push(parseFloat(m[1]));\n fnormals.push(parseFloat(m[2]));\n fnormals.push(parseFloat(m[3]));\n } else if(m = line.match(/^vt ([^\\s]+)\\s+([^\\s]+)/)) {\n ftexc.push(parseFloat(m[1]));\n ftexc.push(parseFloat(m[2]));\n } else if(m = line.match(/^f (\\d+)\\/(\\d*)\\/(\\d+)\\s+(\\d+)\\/(\\d*)\\/(\\d+)\\s+(\\d+)\\/(\\d*)\\/(\\d+)/)) {\n var i1 = m[1], i2 = m[4], i3 = m[7], \n n1 = m[3], n2 = m[6], n3 = m[9],\n f1 = m[2], f2 = m[5], f3 = m[8];\n\n i1--; i2--; i3--;\n n1--; n2--; n3--;\n f1--; f2--; f3--;\n flist.push([i1, n1, f1]);\n flist.push([i2, n2, f2]);\n flist.push([i3, n3, f3]);\n\n }\n\n }\n\n for(var i = 0; i < flist.length; i++) {\n var f = flist[i];\n indices.push(i);\n vertices.push(fverts[f[0] * 3]);\n vertices.push(fverts[f[0] * 3 + 1]);\n vertices.push(fverts[f[0] * 3 + 2]);\n normals.push(fnormals[f[1] * 3]);\n normals.push(fnormals[f[1] * 3 + 1]);\n normals.push(fnormals[f[1] * 3 + 2]);\n texc.push(ftexc[f[2] * 2]);\n texc.push(ftexc[f[2] * 2 + 1]);\n }\n\n return { \n vertices: vertices, \n normals: normals, \n indices: indices, \n textureCoordinates: texc // unused here\n };\n }", "title": "" }, { "docid": "47bcbe1622dff4580d303d87463cae08", "score": "0.5699306", "text": "function loadWavefrontObj(path) {\n\tvar obj = {\n\t\tv: [], vt: [], vn: [], f: []\n\t};\n\n\tvar lo_x = 1e+10, hi_x = -1e+10;\n\tvar lo_y = 1e+10, hi_y = -1e+10;\n\tvar lo_z = 1e+10, hi_z = -1e+10;\n\n\tvar lines = fs.readFileSync(path).toString().split(\"\\n\");\n\tfor (var i = 0; i < lines.length; i++) {\n\t\tvar line = lines[i];\n\t\tif (line.startsWith(\"vt\")) {\n\t\t\t// Vertex texture coordinate.\n\t\t\tvar args = line.split(\" \");\n\t\t\tobj.vt.push([parseFloat(args[1]), parseFloat(args[2]), parseFloat(args[3])]);\n\t\t} else if (line.startsWith(\"vn\")) {\n\t\t\t// Vertex normal.\n\t\t\tvar args = line.split(\" \");\n\t\t\tobj.vn.push([parseFloat(args[1]), parseFloat(args[2]), parseFloat(args[3])]);\n\t\t} else if (line.startsWith(\"v\")) {\n\t\t\t// Vertex.\n\t\t\tvar args = line.split(\" \");\n\t\t\tvar vx = parseFloat(args[1]);\n\t\t\tvar vy = parseFloat(args[2]);\n\t\t\tvar vz = parseFloat(args[3]);\n\t\t\tobj.v.push([vx, vy, vz]);\n\t\t\tif (vx < lo_x) {lo_x = vx;}\n\t\t\tif (vy < lo_y) {lo_y = vy;}\n\t\t\tif (vz < lo_z) {lo_z = vz;}\n\t\t\tif (vx > hi_x) {hi_x = vx;}\n\t\t\tif (vy > hi_y) {hi_y = vy;}\n\t\t\tif (vz > hi_z) {hi_z = vz;}\n\t\t} else if (line.startsWith(\"f\")) {\n\t\t\t// Face.\n\t\t\tvar args = line.split(\" \");\n\t\t\targs.shift();\n\t\t\tvar vertices = [];\n\t\t\tfor (var j = 0; j < args.length; j++) {\n\t\t\t\tvar vtx = args[j].split(\"/\");\n\t\t\t\tvertices.push([parseInt(vtx[0]), parseInt(vtx[1]), parseInt(vtx[2])]);\n\t\t\t}\n\t\t\tobj.f.push(vertices);\n\t\t}\n\t}\n\n\tvar len_x = hi_x - lo_x / 2.0;\n\tvar len_y = hi_y - lo_y;\n\tvar len_z = hi_z - lo_z / 2.0;\n\tfor (var i = 0; i < obj.v.length; i++) {\n\t\tobj.v[i][1] -= lo_y;\n\t\tobj.v[i][0] /= len_x;\n\t\tobj.v[i][1] /= len_y;\n\t\tobj.v[i][2] /= len_z;\n\t}\n\n\treturn obj;\n}", "title": "" }, { "docid": "3cdfb69595b8328870e86e938fd428ed", "score": "0.56952935", "text": "function parse(ab) {\n assert(ab.byteLength > 5);\n const view = new DataView(ab);\n let pos = 0;\n\n // First parse the magic string.\n const byte0 = view.getUint8(pos++);\n const magicStr = dataViewToAscii(new DataView(ab, pos, 5));\n pos += 5;\n if (byte0 !== 0x93 || magicStr !== \"NUMPY\") {\n throw Error(\"Not a numpy file.\");\n }\n\n // Parse the version\n const version = [view.getUint8(pos++), view.getUint8(pos++)].join(\".\");\n if (version !== \"1.0\") {\n throw Error(\"Unsupported version.\");\n }\n\n // Parse the header length.\n const headerLen = view.getUint16(pos, true);\n pos += 2;\n\n // Parse the header.\n // header is almost json, so we just manipulated it until it is.\n // {'descr': '<f8', 'fortran_order': False, 'shape': (1, 2), }\n const headerPy = dataViewToAscii(new DataView(ab, pos, headerLen));\n pos += headerLen;\n const bytesLeft = view.byteLength - pos;\n const headerJson = headerPy\n .replace(\"True\", \"true\")\n .replace(\"False\", \"false\")\n .replace(/'/g, `\"`)\n .replace(/,\\s*}/, \" }\")\n .replace(/,?\\)/, \"]\")\n .replace(\"(\", \"[\");\n const header = JSON.parse(headerJson);\n if (header.fortran_order) {\n throw Error(\"NPY parse error. Implement me.\");\n }\n\n // Finally parse the actual data.\n const size = numEls(header.shape);\n if (header[\"descr\"] === \"<f8\") {\n // 8 byte float. float64.\n assertEqual(bytesLeft, size * 8);\n const s = ab.slice(pos, pos + size * 8);\n const ta = new Float32Array(new Float64Array(s));\n return tf.tensor(ta, header.shape, \"float32\");\n } else if (header[\"descr\"] === \"<f4\") {\n // 4 byte float. float32.\n assertEqual(bytesLeft, size * 4);\n const s = ab.slice(pos, pos + size * 4);\n const ta = new Float32Array(s);\n return tf.tensor(ta, header.shape, \"float32\");\n } else if (header[\"descr\"] === \"<i8\") {\n // 8 byte int. int64.\n assertEqual(bytesLeft, size * 8);\n const s = ab.slice(pos, pos + size * 8);\n const ta = new Int32Array(s).filter((val, i) => i % 2 === 0);\n return tf.tensor(ta, header.shape, \"int32\");\n } else if (header[\"descr\"] === \"|u1\") {\n // uint8.\n assertEqual(bytesLeft, size);\n const s = ab.slice(pos, pos + size);\n const ta = new Uint8Array(s);\n return tf.tensor(ta, header.shape, \"int32\"); // FIXME should be \"uint8\"\n } else {\n throw Error(`Unknown dtype \"${header[\"descr\"]}\". Implement me.`);\n }\n}", "title": "" }, { "docid": "b059197542b5a601e8b86520a2979013", "score": "0.56740475", "text": "readFloat32Array(length, createNewBuffer = true) {\n var size = length * ByteArray.SIZE_OF_FLOAT32;\n if (!this.validate(size))\n return null;\n if (!createNewBuffer) {\n if ((this.bufferOffset + this.position) % 4 == 0) {\n var result = new Float32Array(this.buffer, this.bufferOffset + this.position, length);\n this.position += size;\n }\n else {\n var tmp = new Uint8Array(new ArrayBuffer(size));\n for (var i = 0; i < size; i++) {\n tmp[i] = this.data.getUint8(this.position);\n this.position += ByteArray.SIZE_OF_UINT8;\n }\n result = new Float32Array(tmp.buffer);\n }\n }\n else {\n result = new Float32Array(new ArrayBuffer(size));\n for (var i = 0; i < length; i++) {\n result[i] = this.data.getFloat32(this.position, this.endian === ByteArray.LITTLE_ENDIAN);\n this.position += ByteArray.SIZE_OF_FLOAT32;\n }\n }\n return result;\n }", "title": "" }, { "docid": "47a7d49fd13a7b08a2456502bd206d5e", "score": "0.5650006", "text": "readFloat32Array(length, createNewBuffer = true) {\n var size = length * ByteArray.SIZE_OF_FLOAT32;\n if (!this.validate(size))\n return null;\n if (!createNewBuffer) {\n if ((this.byteOffset + this.position) % 4 == 0) {\n var result = new Float32Array(this.buffer, this.byteOffset + this.position, length);\n this.position += size;\n }\n else {\n var tmp = new Uint8Array(new ArrayBuffer(size));\n for (var i = 0; i < size; i++) {\n tmp[i] = this.data.getUint8(this.position);\n this.position += ByteArray.SIZE_OF_UINT8;\n }\n result = new Float32Array(tmp.buffer);\n }\n }\n else {\n result = new Float32Array(new ArrayBuffer(size));\n for (var i = 0; i < length; i++) {\n result[i] = this.data.getFloat32(this.position, this.endian === ByteArray.LITTLE_ENDIAN);\n this.position += ByteArray.SIZE_OF_FLOAT32;\n }\n }\n return result;\n }", "title": "" }, { "docid": "0deb906deb47ecc9fa77f9a14ba57758", "score": "0.564252", "text": "static createMesh(srcMesh, materials, bUseDrawArrays = false)\n {\n var result = new Mesh();\n result.bUseDrawArrays = bUseDrawArrays;\n\n let vertices = [];\n let texcoords = [];\n let normals = [];\n let faceVertices = [];\n let materialFaceIndices = [];\n let similarVertices = {};\n\n var arrObjLines = FileUtil.GetFile(srcMesh).split(\"\\n\");\n var faceToRender = 0;\n arrObjLines.forEach((elem) =>\n {\n let arrElem = elem.split(\" \");\n switch (arrElem[0])\n {\n case \"g\":\n case \"o\":\n materialFaceIndices.push(faceVertices.length);\n break;\n case \"v\":\n vertices.push(\n {\n \"x\": Number.parseFloat(arrElem[1]),\n \"y\": Number.parseFloat(arrElem[2]),\n \"z\": Number.parseFloat(arrElem[3])\n });\n break;\n case \"vt\":\n texcoords.push(\n {\n \"u\": Number.parseFloat(arrElem[1]),\n \"v\": 1.0 - Number.parseFloat(arrElem[2])\n });\n break;\n case \"vn\":\n normals.push(\n {\n \"x\": Number.parseFloat(arrElem[1]),\n \"y\": Number.parseFloat(arrElem[2]),\n \"z\": Number.parseFloat(arrElem[3])\n });\n break;\n case \"f\":\n for (let i = 1; i < arrElem.length; i++)\n {\n let vertexIndex = 0;\n let texcoordIndex = 0;\n let normalIndex = 0;\n\n let arrFaces = arrElem[i].split(\"/\");\n vertexIndex = Number.parseInt(arrFaces[0]) - 1;\n if (!Number.isNaN(Number.parseFloat(arrFaces[1])))\n {\n texcoordIndex = Number.parseFloat(arrFaces[1]) - 1;\n }\n if (!Number.isNaN(Number.parseInt(arrFaces[2])))\n {\n normalIndex = Number.parseInt(arrFaces[2]) - 1;\n }\n\n // Add face vertex w/ similar normals\n if (similarVertices[texcoordIndex] === undefined)\n {\n similarVertices[texcoordIndex] = [];\n }\n similarVertices[texcoordIndex].push(faceVertices.length);\n\n // Face may have more than 3 vertices because OBJ is weird ... if so,\n // simply add another triangle (as in, pick two older vertices and then\n // lop on the newer one past 3).\n if (i > 3)\n {\n let f1 = {};\n let f2 = {};\n Object.assign(f1, faceVertices[faceVertices.length - 3]);\n Object.assign(f2, faceVertices[faceVertices.length - 1]);\n faceVertices.push(f1);\n faceVertices.push(f2);\n }\n\n faceVertices.push(\n {\n \"vertexIndex\": vertexIndex,\n \"texcoordIndex\": texcoordIndex,\n \"normalIndex\": normalIndex\n });\n }\n break;\n }\n });\n\n result.meshParts = [];\n let meshPart;\n let meshPartLastIndex = 0;\n for (let i = 0; i < faceVertices.length; i++)\n {\n if (i == materialFaceIndices[result.meshParts.length])\n {\n result.meshParts.push({});\n meshPart = result.meshParts[result.meshParts.length - 1];\n meshPart.material = materials[result.meshParts.length - 1];\n\n meshPart.vertices = [];\n meshPart.texcoords = [];\n meshPart.normals = [];\n meshPart.indices = [];\n meshPart.tangents = [];\n meshPart.lastIndex = i;\n\n meshPartLastIndex = i;\n }\n\n let faceVertex = faceVertices[i];\n\n meshPart.vertices.push(vertices[faceVertex.vertexIndex].x);\n meshPart.vertices.push(vertices[faceVertex.vertexIndex].y);\n meshPart.vertices.push(vertices[faceVertex.vertexIndex].z);\n\n if (texcoords.length !== 0)\n {\n meshPart.texcoords.push(texcoords[faceVertex.texcoordIndex].u);\n meshPart.texcoords.push(texcoords[faceVertex.texcoordIndex].v);\n }\n\n if (normals.length !== 0)\n {\n meshPart.normals.push(normals[faceVertex.normalIndex].x);\n meshPart.normals.push(normals[faceVertex.normalIndex].y);\n meshPart.normals.push(normals[faceVertex.normalIndex].z);\n }\n else\n {\n meshPart.normals.push(0);\n meshPart.normals.push(0);\n meshPart.normals.push(0);\n }\n\n if (!result.bUseDrawArrays)\n {\n meshPart.indices.push(i - meshPartLastIndex);\n }\n\n // Calculate and add tangents and bitangents\n if (i % 3 === 0)\n {\n const face1 = faceVertices[i + 0];\n const face2 = faceVertices[i + 1];\n const face3 = faceVertices[i + 2];\n\n const edge1 =\n {\n x: vertices[face2.vertexIndex].x - vertices[face1.vertexIndex].x,\n y: vertices[face2.vertexIndex].y - vertices[face1.vertexIndex].y,\n z: vertices[face2.vertexIndex].z - vertices[face1.vertexIndex].z\n };\n\n const edge2 =\n {\n x: vertices[face3.vertexIndex].x - vertices[face2.vertexIndex].x,\n y: vertices[face3.vertexIndex].y - vertices[face2.vertexIndex].y,\n z: vertices[face3.vertexIndex].z - vertices[face2.vertexIndex].z\n };\n\n const dU1 = texcoords[face2.texcoordIndex].u - texcoords[face1.texcoordIndex].u;\n const dU2 = texcoords[face3.texcoordIndex].u - texcoords[face2.texcoordIndex].u;\n const dV1 = texcoords[face2.texcoordIndex].v - texcoords[face1.texcoordIndex].v;\n const dV2 = texcoords[face3.texcoordIndex].v - texcoords[face2.texcoordIndex].v;\n\n const det = 1.0 / (dU1 * dV2 - dU2 * dV1);\n let tangent =\n [\n det * (edge1.x * dV2 - edge2.x * dV1),\n det * (edge1.y * dV2 - edge2.y * dV1),\n det * (edge1.z * dV2 - edge2.z * dV1)\n ];\n // tangent = GLMathLib.normalize(tangent);\n\n let bitangent =\n [\n det * (edge2.x * dU1 - edge1.x * dU2),\n det * (edge2.y * dU1 - edge1.y * dU2),\n det * (edge2.z * dU1 - edge1.z * dU2)\n ];\n // bitangent = GLMathLib.normalize(bitangent);\n\n // For now, each vertex of the face will have the same tangent vector\n for (let a = 0; a < 3; a++)\n {\n let normal =\n [\n normals[faceVertices[i + a].normalIndex].x,\n normals[faceVertices[i + a].normalIndex].y,\n normals[faceVertices[i + a].normalIndex].z\n ];\n\n meshPart.tangents.push(tangent[0]);\n meshPart.tangents.push(tangent[1]);\n meshPart.tangents.push(tangent[2]);\n meshPart.tangents.push(GLMathLib.dot(GLMathLib.cross(normal, tangent), bitangent) < 0.0 ? -1.0 : 1.0);\n }\n }\n }\n\n // Average out the tangent vectors of similar vertices\n for (let key in similarVertices)\n {\n const arrFaceVertexIndices = similarVertices[key];\n let countLeft = 0;\n let countRight = 0;\n let avgTangentLeft = [0, 0, 0];\n let avgTangentRight = [0, 0, 0];\n\n // Find average tangent vector of similar vertices\n for (let i = 0; i < arrFaceVertexIndices.length; i++)\n {\n const index = arrFaceVertexIndices[i];\n\n for (let j = 0; j < result.meshParts.length; j++)\n {\n if (j + 1 == result.meshParts.length ||\n index < result.meshParts[j + 1].lastIndex)\n {\n const pseudoModuloIndex = index - result.meshParts[j].lastIndex;\n if (result.meshParts[j].tangents[pseudoModuloIndex * 4 + 3] == 1.0)\n {\n avgTangentRight[0] += result.meshParts[j].tangents[pseudoModuloIndex * 4 + 0];\n avgTangentRight[1] += result.meshParts[j].tangents[pseudoModuloIndex * 4 + 1];\n avgTangentRight[2] += result.meshParts[j].tangents[pseudoModuloIndex * 4 + 2];\n countRight++;\n }\n else\n {\n avgTangentLeft[0] += result.meshParts[j].tangents[pseudoModuloIndex * 4 + 0];\n avgTangentLeft[1] += result.meshParts[j].tangents[pseudoModuloIndex * 4 + 1];\n avgTangentLeft[2] += result.meshParts[j].tangents[pseudoModuloIndex * 4 + 2];\n countLeft++\n }\n break;\n }\n }\n }\n avgTangentLeft = GLMathLib.mult(1 / countLeft, avgTangentLeft);\n avgTangentRight = GLMathLib.mult(1 / countRight, avgTangentRight);\n\n // Set the tangent vectors of similar vertices to the average tangent vector\n for (let i = 0; i < arrFaceVertexIndices.length; i++)\n {\n const index = arrFaceVertexIndices[i];\n\n for (let j = 0; j < result.meshParts.length; j++)\n {\n if (j + 1 == result.meshParts.length ||\n index < result.meshParts[j + 1].lastIndex)\n {\n const pseudoModuloIndex = index - result.meshParts[j].lastIndex;\n if (result.meshParts[j].tangents[pseudoModuloIndex * 4 + 3] == 1.0)\n {\n result.meshParts[j].tangents[pseudoModuloIndex * 4 + 0] = avgTangentRight[0];\n result.meshParts[j].tangents[pseudoModuloIndex * 4 + 1] = avgTangentRight[1];\n result.meshParts[j].tangents[pseudoModuloIndex * 4 + 2] = avgTangentRight[2];\n }\n else\n {\n result.meshParts[j].tangents[pseudoModuloIndex * 4 + 0] = avgTangentLeft[0];\n result.meshParts[j].tangents[pseudoModuloIndex * 4 + 1] = avgTangentLeft[1];\n result.meshParts[j].tangents[pseudoModuloIndex * 4 + 2] = avgTangentLeft[2];\n }\n break;\n }\n }\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "88136409a5053f5d0fa91c65de942532", "score": "0.5634879", "text": "function convertObjFileToMeshBlob(obj) {\n //initialize vars\n let vArr = []; //vertices\n let vnArr = []; //vertexNormals\n let fArr = []; //array of arrays of connected vertex's\n let currentWord = ''; //string of current num\n let currentDataType = 'irrelevant'; //what type of data is currently being parsed (vertex, vertexnormal, face, or irrelevant (all other) data)\n\n for (let i = 0; i < obj.length; i++) {\n // console.log(obj[i]);\n if ((obj[i] === ' ') || (obj[i] === '\\n') || obj[i] === '/') { //if at end of word, push data to relevant data type if currentDataType is a keyword\n if (!(Number.isNaN(Number(currentWord)))) { //if string is numeric, then push it to approrpaite array depending of currentDataType\n if (currentDataType === 'irrelevant') {}\n if (currentDataType === 'vertex') {\n vArr.push(Number(currentWord));\n }\n if (currentDataType === 'vertexNormal') {\n vnArr.push(Number(currentWord)); //-1 so index starts at 0 and not 1\n }\n if (currentDataType === 'face') {\n fArr.push(Number(currentWord));\n }\n } else { //if string is not numeric, then it is irrelvant until proven otherwise\n currentDataType = 'irrelevant';\n }\n /*//if at end of word and not current parsing a relevant datatype (v,vn,f)\n then see if word indicates that this is a relevant datatype, otherwise it remains irrelevant*/\n if (currentWord === 'v') {\n currentDataType = 'vertex'\n }\n if (currentWord === 'vn') {\n currentDataType = 'vertexNormal'\n }\n if (currentWord === 'f') {\n currentDataType = 'face'\n }\n // console.log(currentWord);\n currentWord = ''; //reset current word\n\n } else { //if not a space\n currentWord += obj[i]; //add current parsed character to currentWord\n }\n }\n\n //remove unnecessary values from face (all but first letter of face format of a/b/c), leaving only the connected verts (a)\n let reducedFArr = [];\n for (let i = 0; i < fArr.length; i+=3) {\n reducedFArr.push(fArr[i]-1); //make it start at 0\n }\n\n const meshBlob = {\n verts: vArr,\n vertNorms: vnArr,\n faces: reducedFArr\n }\n\n dLog(meshBlob);\n return meshBlob;\n}", "title": "" }, { "docid": "118f04e308cd9d422056a3d3358d30f8", "score": "0.56070346", "text": "formatArrayOfArrayOfArray(data) {\n const result = [];\n for (let i = 0; i < data.length; i++) {\n result.push(arraysToFloat32Arrays(data[i]));\n }\n return result;\n }", "title": "" }, { "docid": "80cd7a185b8573218a769434307ccb10", "score": "0.5593443", "text": "function loadStl(f) {\n\tconsole.log(\"Loading : \" + f);\n\n\tvar buf = fs.readFileSync(f);\n\tvar offset = 80;\n\tvar count = buf.readUInt32LE(offset);\n\toffset += 4;\n\n\tconsole.log(\"Triangles count = \" + count);\n\n\tconsole.log(\"Expected size = \" + (84+count*50));\n\tconsole.log(\"Actual size = \" + buf.length);\n\n\ttry {\n\t\tfor ( var i=0; i<count; i++ ) {\n\t\t\tvar chunk = {\n\t\t\t\tn: [ buf.readFloatLE(offset), buf.readFloatLE(offset+4), buf.readFloatLE(offset+8) ],\n\t\t\t\tv: [\n\t\t\t\t\t[ buf.readFloatLE(offset+12), buf.readFloatLE(offset+16), buf.readFloatLE(offset+20) ],\n\t\t\t\t\t[ buf.readFloatLE(offset+24), buf.readFloatLE(offset+28), buf.readFloatLE(offset+32) ],\n\t\t\t\t\t[ buf.readFloatLE(offset+36), buf.readFloatLE(offset+40), buf.readFloatLE(offset+44) ]\n\t\t\t\t],\n\t\t\t\tattr: buf.readUInt16LE(offset+48),\n\t\t\t}\n\t\t\toffset += 50;\n\n\t\t\tif ( (i%10000) == 0 )\n\t\t\t\tconsole.log(\"read \" + i + \" triangles\");\n\t\t}\n\t\tconsole.log(\"DONE! total \" + i + \" triangles\");\n\t}\n\tcatch(e) {\n\t\tconsole.error(\"ERROR at offset 0x\" + offset.toString(16));\n\t\tconsole.error(e.stack);\n\t}\n}", "title": "" }, { "docid": "0ffac7e4b0c5321adac4af107db4fb96", "score": "0.5571125", "text": "function MeshRenderData(vertexFloatCnt) {\n var _this2;\n\n if (vertexFloatCnt === void 0) {\n vertexFloatCnt = 9;\n }\n\n _this2 = _BaseRenderData2.call(this) || this;\n _this2.vData = void 0;\n _this2.iData = void 0;\n _this2.vertexStart = 0;\n _this2.indicesStart = 0;\n _this2.byteStart = 0;\n _this2.byteCount = 0;\n _this2.lastFilledIndices = 0;\n _this2.lastFilledVertex = 0;\n _this2._formatByte = void 0;\n _this2._formatByte = vertexFloatCnt * Float32Array.BYTES_PER_ELEMENT;\n _this2.vData = new Float32Array(256 * vertexFloatCnt * Float32Array.BYTES_PER_ELEMENT);\n _this2.iData = new Uint16Array(256 * 6);\n return _this2;\n }", "title": "" }, { "docid": "a028b84c3d6924ca0ff46024fa979972", "score": "0.5566554", "text": "function loadRawLidarData(uint8Array, pointSize) {\n /*\n Data Fields:\n datatypes (http://docs.ros.org/api/sensor_msgs/html/msg/PointField.html)\n 4: uint16\n 7: float32\n [\n { name: 'x', offset: 0, datatype: 7, count: 1 },\n { name: 'y', offset: 4, datatype: 7, count: 1 },\n { name: 'z', offset: 8, datatype: 7, count: 1 },\n { name: 'intensity', offset: 16, datatype: 7, count: 1 },\n { name: 'ring', offset: 20, datatype: 4, count: 1 }\n ]\n */\n const pointsCount = uint8Array.length / pointSize;\n const buf = Buffer.from(uint8Array); // eslint-disable-line\n\n // We could return interleaved buffers, no conversion!\n const positions = new Float32Array(3 * pointsCount);\n const reflectance = new Float32Array(pointsCount);\n\n for (let i = 0; i < pointsCount; i++) {\n positions[i * 3 + 0] = buf.readFloatLE(i * pointSize);\n positions[i * 3 + 1] = buf.readFloatLE(i * pointSize + 4);\n positions[i * 3 + 2] = buf.readFloatLE(i * pointSize + 8);\n reflectance[i] = buf.readFloatLE(i * pointSize + 16);\n }\n return {positions, reflectance};\n}", "title": "" }, { "docid": "dd5298c892e8f9d2968a7899337d24c8", "score": "0.55534905", "text": "function load3D(buffer)\n{\n\tdata = parseVTK(buffer);\n\tresults_3d.setData(data);\n\n\t\n\t/*switch for different file types here*/\n\t//results_xy.parseTable(buffer);\t\t\n}", "title": "" }, { "docid": "055f6e92ec3cc1e045c7e51af1179771", "score": "0.55356365", "text": "function defineModel(fileText) {\r\n let model = {status:'ok'};\r\n\r\n let row = 0;\r\n let lines = fileText.split(/\\r?\\n/);\r\n\r\n // check for \"magic\" ply\r\n let words = lines[row++].split('/\\s*/');\r\n if (words[0] !== 'ply') {\r\n return {\r\n status:'error',\r\n error:'File does not begin with ply'\r\n };\r\n }\r\n\r\n // initialize vertex and face count\r\n let vct = 0;\r\n let fct = 0;\r\n let verts, faces, normals;\r\n\r\n // get the count of vertices and faces\r\n while (lines[row] !== 'end_header'){\r\n words = lines[row].split(/\\s+/);\r\n if (words[0] == 'element'){\r\n if (words[1] === 'vertex'){\r\n vct = parseInt(words[2])\r\n words = lines[++row].split(' ');\r\n if (words[1] === 'float' || words[1] === 'float32'){\r\n verts = new Float32Array(vct*3);\r\n normals = new Float32Array(vct*3);\r\n console.log('verts: Float32Array');\r\n } else if (words[1] === 'double') {\r\n verts = new Float64Array(vct*3);\r\n normals = new Float64Array(vct*3);\r\n console.log('verts: Float64Array');\r\n } else {\r\n return {\r\n status:'error',\r\n error:'vertices has an invalid type'\r\n };\r\n }\r\n }\r\n if (words[1] === 'face'){\r\n fct = parseInt(words[2]);\r\n words = lines[++row].split(' ');\r\n if (words[3] === 'int8' || words[3] === 'uint8' || words[3] == 'uchar'){\r\n faces = new Uint8Array(fct*3);\r\n model.indices_type = gl.UNSIGNED_SHORT;\r\n console.log('indices: Uint8Array');\r\n } else if (words[3] === 'int16' || words[3] === 'uint16' || words[3] == 'int'){\r\n faces = new Uint16Array(fct*3);\r\n model.indices_type = gl.UNSIGNED_SHORT;\r\n console.log('indices: Uint16Array');\r\n } else if (words[3] === 'int32' || words[3] === 'uint32'){\r\n faces = new Uint32Array(fct*3);\r\n model.indices_type = gl.UNSIGNED_INT;\r\n console.log('indices: Uint32Array');\r\n } else {\r\n return {\r\n status:'error',\r\n error:'vertex indices has an invalid type'\r\n };\r\n }\r\n }\r\n }\r\n row++;\r\n }\r\n row++;\r\n console.log({vct, fct});\r\n\r\n // parse vertices\r\n let i, j, n;\r\n for (i = 0; i < vct; ++i, ++row){\r\n words = lines[row].split(/\\s+/);\r\n if (words[0] === \"\"){\r\n words = words.slice(1);\r\n }\r\n for (j = 0; j < 3; ++j){\r\n verts[i*3+j] = parseFloat(words[j]);\r\n }\r\n }\r\n\r\n // parse face indices\r\n for (i = 0; i < fct; ++i, ++row){\r\n words = lines[row].split(/\\s+/);\r\n if (words[0] === \"\"){\r\n words = words.slice(1);\r\n }\r\n n = parseInt(words[0]);\r\n for (j = 1; j <= n; ++j){\r\n faces[i*3+j-1] = parseFloat(words[j]);\r\n }\r\n }\r\n\r\n norm(verts);\r\n //normUsed(verts, faces);\r\n\r\n // calculate the normals\r\n for (i = 0; i < faces.length;){\r\n let v1 = faces[i++];\r\n let v1x = verts[v1*3];\r\n let v1y = verts[v1*3+1];\r\n let v1z = verts[v1*3+2];\r\n\r\n let v2 = faces[i++];\r\n let v2x = verts[v2*3];\r\n let v2y = verts[v2*3+1];\r\n let v2z = verts[v2*3+2];\r\n\r\n let v3 = faces[i++];\r\n let v3x = verts[v3*3];\r\n let v3y = verts[v3*3+1];\r\n let v3z = verts[v3*3+2];\r\n\r\n let ux = v2x-v1x;\r\n let uy = v2y-v1y;\r\n let uz = v2z-v1z;\r\n\r\n let vx = v3x-v1x;\r\n let vy = v3y-v1y;\r\n let vz = v3z-v1z;\r\n\r\n let nx = uy*vz-uz*vy;\r\n let ny = uz*vx-ux*vz;\r\n let nz = ux*vy-uy*vx;\r\n\r\n normals[v1*3] += nx;\r\n normals[v1*3+1] += ny;\r\n normals[v1*3+2] += nz;\r\n\r\n normals[v2*3] += nx;\r\n normals[v2*3+1] += ny;\r\n normals[v2*3+2] += nz;\r\n\r\n normals[v3*3] += nx;\r\n normals[v3*3+1] += ny;\r\n normals[v3*3+2] += nz;\r\n }\r\n\r\n normalize(normals);\r\n\r\n // vertex colors\r\n let colors = new Float32Array(verts.length);\r\n for(i = 0; i < verts.length; ++i)\r\n {\r\n colors[i*3+0] = 1;\r\n colors[i*3+1] = 1;\r\n colors[i*3+2] = 1;\r\n }\r\n\r\n model.vertices = verts;\r\n model.indices = faces;\r\n model.normals = normals;\r\n model.vertexColors = colors;\r\n\r\n model.center = {\r\n x: 0.0,\r\n y: 0.0,\r\n z: -2.0\r\n };\r\n\r\n model.scale = {\r\n x: 1.0,\r\n y: 1.0,\r\n z: 1.0\r\n };\r\n\r\n return model;\r\n }", "title": "" }, { "docid": "6c8f6862c1d4fe10656de71305e64aed", "score": "0.55180776", "text": "_parseDimensions(data) {\n return [data.readUInt16LE(0), data.readUInt16LE(2)]\n }", "title": "" }, { "docid": "69cbdb08f170710a2a3ba7e513f26e7a", "score": "0.5506454", "text": "function parseDensityFormat(binaryArray) {\n\t\t// read a 3D array of 256x256x256 floats\n\t\tvar dim = 256;\n\t\tvar cur32idx = 0;\n\t\tvar tmpFloat = new Float32Array(binaryArray);\n\t\tvar densities = [];\n\n\t\tfor(var a = 0; a < dim; a++) {\n\t\t\tdensities.push([]);\n\t\t\tfor(var b = 0; b < dim; b++) {\n\t\t\t\tdensities[a].push([]);\n\t\t\t\tfor(var c = 0; c < dim; c++) {\n\t\t\t\t\tdensities[a][b].push(tmpFloat[(a*dim + b) * (2 * (dim/2 + 1)) + c]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn densities;\n\t}", "title": "" }, { "docid": "f78c31af932e48e9a86f07ca8d0c2dbd", "score": "0.5500926", "text": "function loadOBJFromString(string) {\n\n //Pre-format\n var lines = string.split(\"\\n\");\n var positions = [];\n var vertices = [];\n\n for (var i=0; i<lines.length; i++) {\n var parts = lines[i].trimRight().split(' ');\n if (parts.length > 0) {\n switch(parts[0]) {\n // 'v': vertex coordinates\n case 'v': positions.push(\n vec3.fromValues(\n parseFloat(parts[1]),\n parseFloat(parts[2]),\n parseFloat(parts[3])\n ));\n break;\n // 'f': face indices\n // (relies on all 'v' being parsed before any 'f')\n case 'f': {\n for (var j=0; j<3; j++) {\n Array.prototype.push.apply(\n vertices, \n positions[parseInt(parts[j+1]) - 1]\n );\n }\n break;\n }\n }\n }\n }\n return {\n vertices: new Float32Array(vertices),\n vertexCount: vertices.length / 3\n };\n}", "title": "" }, { "docid": "8535166859a6a2fb7c3152e37555e396", "score": "0.5499067", "text": "index(vertices) {\n this.vertices = this.checkVertices(vertices, 3);\n const prec = this.precision;\n const vcount = vertices.length / 3;\n const fcount = vcount / 3;\n const vround = vertices.map(v => (v * prec) | 0);\n // side records [ vi0, vi1, fn1, fn2 ]\n const sides = new Uint32Array(fcount * 4 * 3).fill(empty);\n // map of side index to face count\n const srecs = {};\n // side extended records when face count exceeds 2 (bad mesh)\n const sideExt = {};\n // face record array [ nx, ny, nz, sn0, sn1, sn2 ]\n const faces = new Float32Array(fcount * 6);\n // vertex key to vertex index\n const vimap = {};\n // normal key to normal index\n const nimap = {};\n // side key to side index\n const simap = {};\n // tmp face vertex indices\n const vinds = [ 0, 0, 0 ];\n // tmp face raw vertex offset\n const viraw = [ 0, 0, 0 ];\n // tmp vector array\n const vects = [ new Vector3(), new Vector3(), new Vector3() ];\n // i=vround index, fi=faces record index\n // vi=vinds index % 3, x,y,z = tmp vars\n // fn=next face index, vn=next vertex index, sn=next side index\n for (let i=0, l=vround.length, fn=0, vn=0, sn=0, fi=0, vi=0, x, y, z; i<l; ) {\n const vroot = i;\n // create unique vertex map\n vects[vi].set(x = vround[i++], y = vround[i++], z = vround[i++]);\n let key = x + ',' + y + ',' + z;\n // vertex index\n let vid = vimap[key];\n if (vid === undefined) {\n vid = vimap[key] = vn++;\n }\n viraw[vi] = vroot;\n vinds[vi++] = vid;\n // completed record for a face\n if (vi === 3) {\n // create indexed unique normal map\n const cfn = THREE.computeFaceNormal(...vects);\n const [ v0, v1, v2 ] = vinds;\n // create consistent side order for index key\n const s0 = (v0 < v1 ? v0 + \",\" + v1 : v1 + \",\" +v0);\n const s1 = (v1 < v2 ? v1 + \",\" + v2 : v2 + \",\" +v1);\n const s2 = (v2 < v0 ? v2 + \",\" + v0 : v0 + \",\" +v2);\n // for storing raw vertex offset in side record\n const [ vr0, vr1, vr2 ] = viraw;\n // store face indexes into sdrec array for each side\n const smap = [ s0, s1, s2 ].map((key,ki) => {\n let sid = simap[key], sdoff, sdcnt;\n if (sid === undefined) {\n sid = simap[key] = sn++;\n sdcnt = srecs[sid] = 1;\n sdoff = sid * 4;\n sides[sdoff] = viraw[ki];\n sides[sdoff + 1] = viraw[(ki + 1) % 3];\n } else {\n sdoff = sid * 4;\n sdcnt = ++srecs[sid];\n }\n if (sdcnt > 2) {\n (sideExt[sid] = sideExt[sid] ||\n [ sides[sdoff], sides[sdoff + 1], sides[sdoff + 2], sides[sdoff + 3] ]\n ).push(fn);\n } else {\n sides[sdoff + sdcnt + 1] = fn;\n }\n return sid;\n });\n faces[fi++] = cfn.x;\n faces[fi++] = cfn.y;\n faces[fi++] = cfn.z;\n faces[fi++] = smap[0];\n faces[fi++] = smap[1];\n faces[fi++] = smap[2];\n vi = 0;\n fn++;\n }\n }\n this.indexed = {\n faces, sides, sideExt\n };\n }", "title": "" }, { "docid": "d6f5503f604b94e9354cf09c099f07e1", "score": "0.54813385", "text": "build_vertices(){\r\n let v, ii,\r\n cnt = this.vertices.length,\r\n buf = new Float32Array( cnt * 3 );\r\n\r\n for( let i=0; i < cnt; i++ ){\r\n v = this.vertices[ i ];\r\n v.idx = i; // Verts can be deleted/Removed, so IDX needs to be set before doing indices to link faces correctly.\r\n\r\n ii = i * 3; // Translate \r\n buf[ ii ] = v.pos[ 0 ];\r\n buf[ ++ii ] = v.pos[ 1 ];\r\n buf[ ++ii ] = v.pos[ 2 ];\r\n }\r\n\r\n return buf;\r\n }", "title": "" }, { "docid": "5e7921ca0b58cf65f6288ae8b4c9810e", "score": "0.54707056", "text": "function gotMagnetoData(evt) {\n var raw = evt.target.value\n // console.log('evt:', evt, raw)\n var magData = new Int32Array(raw.buffer)\n sampleCnt++\n xq.push(magData[0])\n yq.push(magData[1])\n zq.push(magData[2])\n}", "title": "" }, { "docid": "92a8be38f1013eefa069d3cfc3caaa20", "score": "0.54684985", "text": "function parseGrADSdataFiles(header, e, reader, startFidx) {\n\t\t// $log.log(preDebugMsg + \"parseGrADSdataFiles\");\n\t\tdata = {};\n\t\tdata.fieldNames = [];\n\t\tdata.fieldTypes = [];\n\t\tdata.columns = [];\n\t\tdata.metaData = {};\n\n\t\tfor(var v = 0; v < header.vars.length; v++) {\n\t\t\tdata.fieldNames.push(header.vars[v].longName);\n\t\t\tdata.fieldTypes.push(\"3Darray\");\n\t\t\tdata.columns.push([]);\n\t\t}\n\n\t\tdata.fieldNames.push(\"Time Stamp\");\n\t\tdata.fieldTypes.push(\"date\");\n\t\tdata.columns.push([]);\n\n\t\tif((header.edef.hasOwnProperty(\"vals\")\n\t\t\t&& header.edef.vals.length > 0)\n\t\t\t|| header.edef.inFilename) {\n\t\t\tdata.fieldNames.push(\"Band\");\n\t\t\tdata.fieldTypes.push(\"number\");\n\t\t\tdata.columns.push([]);\n\t\t}\n\n\t\tvar foundSomething = false;\n\t\tfor(var fidx = startFidx; !foundSomething && fidx < reader.fileList.length; fidx++) {\n\t\t\tvar f = reader.fileList[fidx];\n\t\t\tvar myidx = fidx;\n\t\t\tvar fn = f.name.toLowerCase();\n\n\t\t\t// $log.log(preDebugMsg + \"check \" + fidx + \" \" + fn);\n\t\t\tif(fn.indexOf(\".dat\") >= 0 || fn.indexOf(\".bin\") >= 0) {\n\t\t\t\t// assume binary data\n\t\t\t\tfoundSomething = true;\n\n\t\t\t\treader.onload = function(e2) { binFileReaderOnLoadCallback(e2, reader, header, f.name, myidx + 1);};\n\n\t\t\t\t// $log.log(preDebugMsg + \"Read \" + f.name + \" (idx \" + fidx + \")\");\n\t\t\t\treader.readAsArrayBuffer(f);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0bfc3d335680f35d941039f890c47f69", "score": "0.54143107", "text": "function SolidParser(materialToUse,babylonMeshesArray,loadingOptions){this._positions=[];//values for the positions of vertices\nthis._normals=[];//Values for the normals\nthis._uvs=[];//Values for the textures\nthis._colors=[];this._meshesFromObj=[];//[mesh] Contains all the obj meshes\nthis._indicesForBabylon=[];//The list of indices for VertexData\nthis._wrappedPositionForBabylon=[];//The list of position in vectors\nthis._wrappedUvsForBabylon=[];//Array with all value of uvs to match with the indices\nthis._wrappedColorsForBabylon=[];// Array with all color values to match with the indices\nthis._wrappedNormalsForBabylon=[];//Array with all value of normals to match with the indices\nthis._tuplePosNorm=[];//Create a tuple with indice of Position, Normal, UV [pos, norm, uvs]\nthis._curPositionInIndices=0;this._hasMeshes=false;//Meshes are defined in the file\nthis._unwrappedPositionsForBabylon=[];//Value of positionForBabylon w/o Vector3() [x,y,z]\nthis._unwrappedColorsForBabylon=[];// Value of colorForBabylon w/o Color4() [r,g,b,a]\nthis._unwrappedNormalsForBabylon=[];//Value of normalsForBabylon w/o Vector3() [x,y,z]\nthis._unwrappedUVForBabylon=[];//Value of uvsForBabylon w/o Vector3() [x,y,z]\nthis._triangles=[];//Indices from new triangles coming from polygons\nthis._materialNameFromObj=\"\";//The name of the current material\nthis._objMeshName=\"\";//The name of the current obj mesh\nthis._increment=1;//Id for meshes created by the multimaterial\nthis._isFirstMaterial=true;this._grayColor=new babylonjs_Buffers_buffer__WEBPACK_IMPORTED_MODULE_0__[\"Color4\"](0.5,0.5,0.5,1);this._materialToUse=materialToUse;this._babylonMeshesArray=babylonMeshesArray;this._loadingOptions=loadingOptions;}", "title": "" }, { "docid": "2568fe5b64fd75097862cb4b9c1416af", "score": "0.54118735", "text": "formatArrayOfArray(data) {\n const result = [];\n const { inputSize, outputSize } = this.options;\n if (inputSize === 1 && outputSize === 1) {\n for (let i = 0; i < data.length; i++) {\n result.push(arrayToFloat32Arrays(data[i]));\n }\n return result;\n }\n if (inputSize !== data[0].length) {\n throw new Error('inputSize must match data input size');\n }\n if (outputSize !== data[0].length) {\n throw new Error('outputSize must match data output size');\n }\n for (let i = 0; i < data.length; i++) {\n result.push(Float32Array.from(data[i]));\n }\n return [result];\n }", "title": "" }, { "docid": "d5a797d9fcf4a2c1763fec12f2f738e6", "score": "0.54062855", "text": "async handleImport (engineData, ids) {\n let meshes = []\n console.log('engineData ', engineData)\n if (!engineData.url) {\n meshes = this.addShapeToTheBox(engineData)\n console.log(meshes)\n }\n else {\n const decode = await attachImgToId(engineData.url, true)\n if (!decode) return\n const raw_content = BABYLON.Tools.DecodeBase64('data:base64,' + decode.data.base64)\n const blob = new Blob([raw_content])\n const BBJSurl = URL.createObjectURL(blob)\n if (BBJSurl) {\n BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING\n console.log(BABYLON.SceneLoader.IsPluginForExtensionAvailable('.glb'))\n meshes = (await BABYLON.SceneLoader.ImportMeshAsync('', '', BBJSurl, this.scene, null, '.glb')).meshes;\n }\n }\n\n if (meshes.length === 0) {\n console.log('Error on import, empty mesh or wrong data to import')\n return\n } \n\n meshes[0].metadata = { \n id: ids[0], \n id1: ids[1], \n id2: ids[2] \n }\n\n meshes[0].meta = engineData\n let drill = meshes.find(obj => {\n return obj.name === 'drill'\n })\n if (drill) {\n if (engineData.drillArray) {\n var parent = drill.parent\n var pos = drill.position.clone()\n drill.dispose(false, true)\n \n drill = this.createShapeFromPoints(engineData.drillArray)\n drill.position = pos\n drill.parent = parent\n }\n this.addUVS(drill)\n drill.setEnabled(false)\n }\n\n meshes[0].electronic = engineData.transform.electronic\n meshes[0].drill = drill\n\n this.actualMod = this.mod.TRANSLATE\n this.tooltip.isVisible = false\n this.resetGizmo(meshes[0])\n this.marker.activeMod(-1)\n\n // update mesh transforms based on engine data\n this.updateValues(engineData.transform.position, engineData.transform.rotation, engineData.transform.scale, engineData.transform.color)\n\n const _this = this\n for (let i = 1; i < meshes.length; i++) {\n _this.fitToView(meshes[i])\n\n if (meshes[i].name.toLowerCase().indexOf('layer1') !== -1 || meshes[i].name.toLowerCase().indexOf('layer21') !== -1) {\n meshes[i].isVisible = false\n }\n \n if (meshes[i].material) {\n meshes[i].material.backFaceCulling = false\n }\n this.addActionsToMesh(meshes[i], meshes[0])\n } \n \n this.items.push(meshes[0])\n }", "title": "" }, { "docid": "644f5eb2c5b4ce178818e656d289f32a", "score": "0.53930616", "text": "readFloat() {\n if (!this.validate(ByteArrayBase.SIZE_OF_FLOAT32))\n return null;\n var value = this.data.getFloat32(this.position, this.endian == ByteArrayBase.LITTLE_ENDIAN);\n this.position += ByteArrayBase.SIZE_OF_FLOAT32;\n return value;\n }", "title": "" }, { "docid": "fda9819fab28bdb5c8d3172044b23b82", "score": "0.5393025", "text": "readFloat() {\n if (!this.validate(ByteArray.SIZE_OF_FLOAT32))\n return null;\n var value = this.data.getFloat32(this.position, this.endian == ByteArray.LITTLE_ENDIAN);\n this.position += ByteArray.SIZE_OF_FLOAT32;\n return value;\n }", "title": "" }, { "docid": "fda9819fab28bdb5c8d3172044b23b82", "score": "0.5393025", "text": "readFloat() {\n if (!this.validate(ByteArray.SIZE_OF_FLOAT32))\n return null;\n var value = this.data.getFloat32(this.position, this.endian == ByteArray.LITTLE_ENDIAN);\n this.position += ByteArray.SIZE_OF_FLOAT32;\n return value;\n }", "title": "" }, { "docid": "45628d05217586ae219f2e860b1548c1", "score": "0.53892016", "text": "function readSOR() {\n\tlet objSOR = readFile();\n\tlet vertices = objSOR.vertices;\n\tlet indexes = objSOR.indexes;\n\tif (vertices.length % (12 * 3) != 0) {\n\t\talert('Selected file doesn\\'t match vertices (points) format. There should be groups of 12 points, each group forming a circle.');\n\t} else if (indexes.length % (4 * 3) != 0) {\n\t\talert('Selected file doesn\\'t match indexes (faces) format. There should be groups of 4 points, each group forming a face.');\n\t} else {\n\t\tlet v = [],\n\t\t\tl = [];\n\t\tfor (let i = 0; i < vertices.length; i += 3) {\n\t\t\tv.push(vertices[i]);\n\t\t\tv.push(vertices[i + 1]);\n\t\t\tv.push(vertices[i + 2]);\n\t\t\tv.push(0.0);\n\t\t\tv.push(0.0);\n\t\t\tv.push(1.0);\n\t\t}\n\t\t// Write vertices into buffer\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(v), gl.STATIC_DRAW);\n\n\t\t// Draw points\n\t\tgl.drawArrays(gl.POINTS, 0, v.length / 6);\n\n\t\tfor (let i = 0; i < indexes.length; i += 12) {\n\t\t\t// Point 1\n\t\t\tl.push(indexes[i]);\n\t\t\tl.push(indexes[i + 1]);\n\t\t\tl.push(indexes[i + 2]);\n\t\t\tl.push(0.0);\n\t\t\tl.push(1.0);\n\t\t\tl.push(0.0);\n\n\t\t\t// Point 2\n\t\t\tl.push(indexes[i + 3]);\n\t\t\tl.push(indexes[i + 4]);\n\t\t\tl.push(indexes[i + 5]);\n\t\t\tl.push(0.0);\n\t\t\tl.push(1.0);\n\t\t\tl.push(0.0);\n\n\t\t\t// Point 2\n\t\t\tl.push(indexes[i + 6]);\n\t\t\tl.push(indexes[i + 7]);\n\t\t\tl.push(indexes[i + 8]);\n\t\t\tl.push(0.0);\n\t\t\tl.push(1.0);\n\t\t\tl.push(0.0);\n\n\t\t\t// Point 2\n\t\t\tl.push(indexes[i + 9]);\n\t\t\tl.push(indexes[i + 10]);\n\t\t\tl.push(indexes[i + 11]);\n\t\t\tl.push(0.0);\n\t\t\tl.push(1.0);\n\t\t\tl.push(0.0);\n\t\t}\n\t\t// Write vertices into buffer\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(l), gl.STATIC_DRAW);\n\n\t\t// Draw points\n\t\tgl.drawArrays(gl.LINE_STRIP, 0, l.length / 6);\n\t}\n}", "title": "" }, { "docid": "97983329f9463f0a07e0667595b8b39b", "score": "0.5377812", "text": "function loadArrays(vertices) {\n\t\t// Always set the arrays to zero, in order to center properly\n\t\taVerts.length = 0;\n\t\taCounterVerts.length = 0;\n\t\tnVerts.length = 0;\n\t\tfor (var i in vertices.a_vertex) {\n\t\t\taVerts.push(p.createVector(vertices.a_vertex[i].x, vertices.a_vertex[i].y));\n\t\t\taVerts[i].x *= scaleFactor;\n\t\t\taVerts[i].x += glyphCenter.x;\n\t\t\taVerts[i].y *= scaleFactor;\n\t\t\taVerts[i].y += glyphCenter.y;\n\t\t}\n\t\tfor (var j in vertices.counter_vertex) {\n\t\t\taCounterVerts.push(p.createVector(vertices.counter_vertex[j].x, vertices.counter_vertex[j].y));\n\t\t\taCounterVerts[j].x *= scaleFactor;\n\t\t\taCounterVerts[j].x += glyphCenter.x;\n\t\t\taCounterVerts[j].y *= scaleFactor;\n\t\t\taCounterVerts[j].y += glyphCenter.y;\n\t\t}\n\t\tfor (var k in vertices.n_vertex) {\n\t\t\tnVerts.push(p.createVector(vertices.n_vertex[k].x, vertices.n_vertex[k].y));\n\t\t\tnVerts[k].x *= nScaleFactor;\n\t\t\tnVerts[k].x += nOffset.x;\n\t\t\tnVerts[k].x *= scaleFactor;\n\t\t\tnVerts[k].x += glyphCenter.x;\n\t\t\tnVerts[k].y *= nScaleFactor;\n\t\t\tnVerts[k].y += nOffset.y;\n\t\t\tnVerts[k].y *= scaleFactor;\n\t\t\tnVerts[k].y += glyphCenter.y;\n\t\t}\n\t}", "title": "" }, { "docid": "319721abcb707b5978f31f578fd573cc", "score": "0.53731245", "text": "function vload4(index, ar)\n{\n\tvar i = index * NUM_VERTEX_COMPONENTS;\n\treturn [ ar[i], ar[i+1], ar[i+2], 1.0 ];\n}", "title": "" }, { "docid": "a4144a21d58b1804c8956dc75875b10a", "score": "0.5368874", "text": "async load() {\n let shape, floatArray\n let files = await promisify(fs.readdir)(this.path)\n let fullPaths = files.filter((x) => x.match(/\\.(jpg|jpeg|png)$/i)).map((filename)=> path.join(this.path, filename))\n // to speed up debug\n //fullPaths = fullPaths.slice(0, 5)\n for (let imgIdx = 0; imgIdx < fullPaths.length; imgIdx++) {\n let imgPath = fullPaths[imgIdx]\n let { data, info } = await sharp(imgPath).raw().toBuffer({ resolveWithObject: true })\n //console.log(`loading ${imgPath}:`, info)\n // if this is the first image, note it's shape for later validation\n if (!shape) shape = [info.height, info.width, info.channels]\n // validate that the image is the same shape as the last image\n if (shape[0] != info.height || shape[1] != info.width || shape[2] != info.channels)\n throw new Error(`${imgPath} doesn't have the same shape as previous image`)\n // setup a float32array to store all the images if one isn't already setup\n if (!floatArray) floatArray = new Float32Array(fullPaths.length * info.height * info.width * info.channels)\n \n // scan out the pixel data from the image in to the big float array\n let imgByteSize = shape[0] * shape[1] * shape[2]\n data.forEach((b, idx)=> floatArray[(imgIdx * imgByteSize) + idx] = b / 255)\n // let tensor = tf.tensor3d(floatArray, [info.width, info.height, info.channels])\n // this.images.push(tensor)\n\n }\n this.dataset = tf.tensor4d(floatArray, [fullPaths.length, shape[0], shape[1], shape[2]])\n return this\n }", "title": "" }, { "docid": "56ebb25448438eb3bced5c724903d04c", "score": "0.53672755", "text": "function transformOBJData(v, n, t , f)\n{\n\t//Create temporary arrays to store all model data\n\tvar vertex = [];\n\tvar texture = [];\n\tvar normals = [];\n\tvar faces = [];\n\tvar colors = [];\n\t\n\t//Transform Data\n\tfor(var i = 0; i < f.length; i += 2)\n\t{\n\t\tfaces.push(i/3);\n\t\tvertex.push(v[(f[i]-1)*3]);\n\t\tvertex.push(v[(f[i]-1)*3+1]);\n\t\tvertex.push(v[(f[i]-1)*3+2]);\n\t\ttexture.push(t[(f[i+1]-1)*2]);\n\t\ttexture.push(t[(f[i+1]-1)*2+1]);\n\t}\n\t// Checking to see if the normals are defined on the file\n\tif( normals.length == 0 )\n\t{\n\t\tcomputeVertexNormals( vertex, normals );\n\t}\n\tfor(var i = 0; i < vertex.length; i++)\n\t{\n\t\tcolors.push(1.0);\n\t}\n\t//Copy array pointer into main data and update bufffers\n\tvar model = new Model();\n\tmodel.vertex = vertex;\n\tmodel.normals = normals;\n\tmodel.texture_coords = texture;\n\tmodel.colors = colors.slice();\n\tmodels.faces = faces;\n\tmodels.push(model);\n\tupdateModelsPosition(models.length-1);\n}", "title": "" }, { "docid": "606541efe92679f6510b9f824ecc9e1e", "score": "0.53569835", "text": "function readFloat32LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat32(offset, true);\n}", "title": "" }, { "docid": "6ab2417e828073f806f8021bf5e7b935", "score": "0.5351769", "text": "function openFileMesh(event){\r\n\r\n if(event == undefined){\r\n console.log(\"No file selected.\");\r\n return;\r\n }\r\n\r\n var file = new FileReader();\r\n\r\n file.readAsText(event.target.files[0]);\r\n\r\n file.onload = function(){\r\n cancelAnimationFrame(id);\r\n\r\n console.log(\"Opened file: \" + event.target.files[0].name);\r\n\r\n var lines = file.result.split(\"\\n\");\r\n\r\n /* HEADER PARSING */\r\n if(!lines[0].includes(\"ply\")){\r\n console.log(\"Invalid file format. Aborting...\");\r\n return false;\r\n }\r\n\r\n verticesAndPolygons(lines);\r\n\r\n gl.enable(gl.DEPTH_TEST); //Enables depth in view\r\n gl.enable(gl.CULL_FACE);\r\n gl.cullFace(gl.BACK);\r\n\r\n gl.clearColor(0.5, 0.82, 0.87, 1.0);\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n\r\n bufferScreen();\r\n renderMesh();\r\n }\r\n}", "title": "" }, { "docid": "274dba6dadcaa3e873d802f1cc5dbdbb", "score": "0.5341904", "text": "async function load_scene_mesh(filename, options = {})\n{\n // Give the user a visual indication that we're loading data.\n const loadSpinner = document.createElement(\"div\");\n loadSpinner.innerHTML = \"Initializing...\";\n loadSpinner.style.color = \"lightgray\";\n document.body.appendChild(loadSpinner);\n\n // Load the data.\n const sceneModule = await import(filename);\n await sceneModule.benchmarkScene.initialize(options);\n\n loadSpinner.remove();\n\n return Rngon.mesh(sceneModule.benchmarkScene.ngons);\n}", "title": "" }, { "docid": "99a822c30c8ccbf0282ddf02d313baed", "score": "0.53418845", "text": "Create() {\n this.data = new Float32Array(this._nextOffset);\n\n for (let name in this.elements) {\n if (this.elements.hasOwnProperty(name)) {\n const el = this.elements[name];\n el.array = this.data.subarray(el.offset, el.offset + el.size);\n\n if (el.value) {\n for (let i = 0; i < el.size; i++) {\n el.array[i] = el.value[i];\n }\n\n Reflect.deleteProperty(el, \"value\");\n }\n }\n }\n }", "title": "" }, { "docid": "747ade8466430eba85c5989093b6f741", "score": "0.53406036", "text": "constructor(arrayBuffer) {\n\t\tvar header32Arr = new Uint32Array(arrayBuffer)\n\t\tif (header32Arr[0] == 859983191) {\n\t\t\t// WMB3\n\t\t\t// 35 headers total\n\t\t\t[this.magic, this.version, this.unknown08, this.flags,\n\t\t\tthis.boundingBox1, this.boundingBox2, this.boundingBox3, this.boundingBox4,\n\t\t\tthis.boundingBox5, this.boundingBox6, this.boneArrayOffset, this.boneCount,\n\t\t\tthis.offsetBoneIndexTranslateTable, this.boneIndexTranslateTableSize, this.vertexGroupArrayOffset, this.vertexGroupCount,\n\t\t\tthis.meshArrayOffset, this.meshCount, this.meshGroupInfoArrayHeaderOffset, this.meshGroupInfoArrayCount,\n\t\t\tthis.colTreeNodesOffset, this.colTreeNodesCount, this.boneMapOffset, this.boneMapCount,\n\t\t\tthis.bonesetOffset, this.bonesetCount, this.materialArrayOffset, this.materialCount,\n\t\t\tthis.meshGroupOffset, this.meshGroupCount, this.offsetMeshMaterials, this.numMeshMaterials,\n\t\t\tthis.unknownWorldDataArrayOffset, this.unknownWorldDataArrayCount, this.unknown8C] = new Uint32Array(arrayBuffer)\n\t\t\t// sike! these are floats\n\t\t\tthis.boundingBoxXYZ = new Float32Array(arrayBuffer.slice(16, 28))\n\t\t\tthis.boundingBoxUVW = new Float32Array(arrayBuffer.slice(28, 40))\n\t\t}\n\t}", "title": "" }, { "docid": "cca8bb63a9cc8633c9114c1e6aa3630f", "score": "0.53356266", "text": "function createAndFillArrayBuffer32(data){\n var buf=gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n gl.bufferData(gl.ARRAY_BUFFER,\n new Float32Array(data),\n gl.STATIC_DRAW);\n return buf;\n }", "title": "" }, { "docid": "99b432de65cfaea0cf4fdeffc0b9b41f", "score": "0.5332447", "text": "static buildMesh(positions, uvs, normals, indices, tangents, bitangents, geometries) {\n\n if ((positions.length % 3) != 0) {\n console.log(\"Vertex attribute lengths not a multiple of 3\");\n return null;\n }\n \n let hasTextCoords = uvs.length > 0 ? true : false;\n let vCount = indices.length;\n let vSize = hasTextCoords ? 14 : 6; // sizeof(position) + sizeof(texcoord) + sizeof(normal) + sizeOf(tangent) + sizeOf(bitangent)\n\n for (let i = 0; i < vCount; ++i) {\n if (indices[i] > vCount) {\n console.log(\"Index out of range\");\n break;\n }\n }\n \n let vBuff = new Float32Array(vCount * vSize);\n let attrs = [];\n\n if (hasTextCoords) {\n for (let i = 0; i < vCount; ++i) {\n let offset = i * vSize;\n let c = 0;\n \n vBuff[offset + c++] = positions[i * 3 + 0];\n vBuff[offset + c++] = positions[i * 3 + 1];\n vBuff[offset + c++] = positions[i * 3 + 2];\n \n vBuff[offset + c++] = uvs[i * 2 + 0];\n vBuff[offset + c++] = uvs[i * 2 + 1];\n\n vBuff[offset + c++] = normals[i * 3 + 0];\n vBuff[offset + c++] = normals[i * 3 + 1];\n vBuff[offset + c++] = normals[i * 3 + 2];\n\n vBuff[offset + c++] = tangents[i * 3 + 0];\n vBuff[offset + c++] = tangents[i * 3 + 1];\n vBuff[offset + c++] = tangents[i * 3 + 2];\n\n vBuff[offset + c++] = bitangents[i * 3 + 0];\n vBuff[offset + c++] = bitangents[i * 3 + 1];\n vBuff[offset + c++] = bitangents[i * 3 + 2];\n }\n\n attrs = [\n new context.MeshAttribute(\"position\", 0, 3),\n new context.MeshAttribute(\"texCoord\", 3, 2),\n new context.MeshAttribute(\"normal\", 5, 3),\n new context.MeshAttribute(\"tangent\", 8, 3),\n new context.MeshAttribute(\"bitangent\", 11, 3)\n ];\n } else {\n for (let i = 0; i < vCount; ++i) {\n let offset = i * vSize;\n let c = 0;\n \n vBuff[offset + c++] = positions[i * 3 + 0];\n vBuff[offset + c++] = positions[i * 3 + 1];\n vBuff[offset + c++] = positions[i * 3 + 2];\n\n vBuff[offset + c++] = normals[i * 3 + 0];\n vBuff[offset + c++] = normals[i * 3 + 1];\n vBuff[offset + c++] = normals[i * 3 + 2];\n }\n\n attrs = [\n new context.MeshAttribute(\"position\", 0, 3),\n new context.MeshAttribute(\"normal\", 5, 3)\n ];\n }\n \n let iBuff = new Uint16Array(indices);\n \n return Mesh.fromData(vBuff, iBuff, attrs, geometries);\n }", "title": "" }, { "docid": "812eebf102230df8c0648497406b469b", "score": "0.531782", "text": "writeFloat32Array(_bytes) {\n this.validateBuffer(this.position + _bytes.length);\n for (var i = 0; i < _bytes.length; i++) {\n this.data.setFloat32(this.position, _bytes[i], this.endian === ByteArrayBase.LITTLE_ENDIAN);\n this.position += ByteArrayBase.SIZE_OF_FLOAT32;\n }\n }", "title": "" }, { "docid": "94ed434f4eaea9f668d5444fe0571fdb", "score": "0.53058857", "text": "function initializeData() {\r\n data.vertices = new Float32Array([\r\n // -0.75, -0.75, 0.0,\r\n // -0.75, 0.75, 0.0,\r\n // 0.75, 0.75, 0.0,\r\n // 0.75, -0.75, 0.0\r\n -1.0, -1.00, 0.0,\r\n -1.0, 1.00, 0.0,\r\n 1.0, 1.00, 0.0,\r\n 1.0, -1.00, 0.0\r\n ]);\r\n\r\n data.indices = new Uint16Array([ 0, 1, 2, 3, 0, 2 ]);\r\n\r\n\r\n //Initialize lights\r\n let Ka = [1.0, 1.0, 1.0];\r\n let La = [0.1, 0.1, 0.1];\r\n let Kd = [1.0, 1.0, 1.0];\r\n let Ld = [\r\n // 1000.0, 1000.0, 1000.0,\r\n // 2000.0, 2000.0, 1200.0,\r\n // 0.0, 0.0, 2000.0\r\n\r\n 0.5, 0.5, 0.5,\r\n 0.2, 0.2, 0.0,\r\n 0.0, 0.0, 0.0\r\n\r\n ];\r\n light.matLight = lightMat(Ka, La);\r\n light.diffuseLight = diffuseLightMat(Kd, Ld);\r\n light.lightPosition =[\r\n 0.0, 0.0, -1.0,\r\n 0.0, 10.0, -3.0,\r\n 10.0, 5.0, -3.0\r\n ];\r\n\r\n //initialize scene\r\n scene.vEye = new Float32Array([0.0, 0.0, 3.0]);\r\n // scene.sphere1 = {\r\n // center: {\r\n // x:0,\r\n // y:0,\r\n // z:0\r\n // },\r\n // radius: 10\r\n\r\n\r\n // };\r\n \r\n\r\n }", "title": "" }, { "docid": "9a45a854df4f6d2c151ba539209412cd", "score": "0.5288301", "text": "f (specs) {\n this.faces = this.faces || [];\n\n let f, elt, v, t, n, fv, ft, fn, v_ok, t_ok, n_ok;\n\n f = {\n vertices: [],\n textures: undefined,\n normals: undefined\n };\n\n fv = [];\n ft = [];\n fn = [];\n\n specs.map((field) => {\n elt = field.split(\"/\");\n\n // Make sure face element specification is of appropriate length\n // (vertex, texture, normal)\n while (elt.length < 3) {\n elt.push(\"\");\n }\n\n v = (elt[0] || undefined) && parseInt(elt[0]);\n t = (elt[1] || undefined) && parseInt(elt[1]);\n n = (elt[2] || undefined) && parseInt(elt[2]);\n\n // Check that all the required geometry information is available\n v_ok = (v === undefined) || (this.vertices !== undefined && v <= this.vertices.length);\n t_ok = (t === undefined) || (this.textures !== undefined && t <= this.textures.length);\n n_ok = (n === undefined) || (this.normals !== undefined && n <= this.normals.length);\n\n if (v_ok && t_ok && n_ok) {\n // Note: Not yet storing into face geometry definiton\n v && fv.push(this.vertices[v]);\n t && ft.push(this.textures[t]);\n n && fn.push(this.normals[n]);\n }\n else {\n throw new Error(\"Missing geometry information - vertices_ok: \" + v_ok + \", textures_ok: \" + t_ok + \", normals_ok: \" + n_ok);\n }\n });\n\n if (fv.length === 3) {\n f.vertices = fv;\n }\n else if (fv.length !== 0) {\n throw new Error(\"Malformed face geometry vertex definition\");\n }\n\n if (ft.length === 3) {\n f.textures = ft;\n }\n else if (ft.length !== 0) {\n throw new Error(\"Malformed face geometry textures definition\");\n }\n\n if (fn.length === 3) {\n f.normals = fn;\n }\n else if (fn.length !== 0) {\n throw new Error(\"Malformed face geometry normals definition\");\n }\n\n this.faces.push(f);\n }", "title": "" }, { "docid": "9429951c41ed0fb23bef5d0be1a3f0e1", "score": "0.52668154", "text": "function readFloatData(data_url_list, staticFiles) {\n var result = [];\n for (var i = 0; i < data_url_list.length; i++) {\n var data_json = HLPR_readJSONfromFile(data_url_list[i], staticFiles);\n if (staticFiles) {\n for (var j = 0; j < data_json.length; j++) {\n data_json[j] = parseFloat(data_json[j]);\n }\n }\n result.push(data_json);\n data_json = null;\n }\n return result;\n}", "title": "" }, { "docid": "d551b29b5f4b6e1c5073664c0457bc97", "score": "0.5252982", "text": "function importTeaPot(teapotInfo){\n var teapotNoReturns = teapotInfo.replace(/\\n/g, \" \");\n var teapotReadyForParse = teapotNoReturns.split(\" \");\n var vOri = 0;\n var doWrite = 1;\n\n //console.log(teapotReadyForParse);\n for(var i = 0; i < teapotReadyForParse.length; i++){\n if(teapotReadyForParse[i] == \"\"){\n //console.log(\"found a blank\");\n }else if(teapotReadyForParse[i] == \"v\"){\n vOri = 0;\n doWrite = 1;\n //console.log(\"got a v\");\n }else if(teapotReadyForParse[i] == \"f\"){\n vOri = 1;\n doWrite = 1;\n //console.log(\"got an f\");\n }else if(teapotReadyForParse[i] == \"#\"){\n doWrite = 0;\n }else if(teapotReadyForParse[i] == \"g\"){\n doWrite = 0;\n }else if(isNaN(teapotReadyForParse[i]) ){\n doWrite = 0;\n }else{\n if(vOri == 0 && doWrite == 1){\n teapotVertexArray.push(teapotReadyForParse[i] *.05);\n }else if(doWrite == 1){\n teapotFaceArray.push(teapotReadyForParse[i] - 1);\n }\n\n }\n }\n\n var vertexArrayVectors = [];\n\n //The following loop will store the vertices as single vectors\n for(var i = 0; i < teapotVertexArray.length; i+=3){\n vertexArrayVectors.push(vec3.fromValues(teapotVertexArray[i],\n teapotVertexArray[i+1],\n teapotVertexArray[i+2]) );\n }\n var vertexNormals = [];\n var normalizedNormals = [];\n for (var i = 0; i < teapotVertexArray.length/3; i++){\n vertexNormals.push( (vec3.fromValues(0,0,0)));\n }\n //console.log(\"vertexArray length: \", vertexArrayVectors.length);\n //console.log(vertexArrayVectors);\n //Calculating normals\n for(var i = 0; i < teapotFaceArray.length; i+=3){\n var pointOne = vertexArrayVectors[teapotFaceArray[i]];\n var pointTwo = vertexArrayVectors[teapotFaceArray[i+1]];\n var pointThree = vertexArrayVectors[teapotFaceArray[i+2]];\n\n var vectorU = vec3.fromValues(0,0,0);\n var vectorV = vec3.fromValues(0,0,0);\n\n vec3.sub(vectorU, pointTwo, pointOne);\n vec3.sub(vectorV, pointThree, pointOne);\n\n var currNorm = vec3.fromValues(0,0,0);\n vec3.cross(currNorm, vectorU, vectorV);\n\n //currNorm now holds the normal vector for our points\n vec3.add(vertexNormals[teapotFaceArray[i]], vertexNormals[teapotFaceArray[i]], currNorm);\n vec3.add(vertexNormals[teapotFaceArray[i+1]], vertexNormals[teapotFaceArray[i+1]], currNorm);\n vec3.add(vertexNormals[teapotFaceArray[i+2]], vertexNormals[teapotFaceArray[i+2]], currNorm);\n }\n //console.log(vertexNormals);\n //console.log(vertexNormals);\n //Each vertex now has a normal. We must normalize the normals\n for(var i = 0; i < vertexNormals.length; i++){\n var tempVec = vec3.fromValues(0,0,0);\n vec3.normalize(tempVec, vertexNormals[i]);\n\n normalizedNormals.push(tempVec);\n }\n //console.log(normalizedNormals);\n //console.log(vertexNormals.length);\n //Finally, pass them to the normal array\n for(var i = 0; i < normalizedNormals.length; i++){\n teapotNormalArray.push(normalizedNormals[i][0]);\n teapotNormalArray.push(normalizedNormals[i][1]);\n teapotNormalArray.push(normalizedNormals[i][2]);\n }\n //console.log(vertexNormals);\n //console.log(teapotNormalArray);\n\n //Create a buffer for the teapot's vertices\n teapotVertexBuffer = gl.createBuffer();\n\n //Select the teapotVertexBuffer as the one to apply vertex operations to from here on out\n gl.bindBuffer(gl.ARRAY_BUFFER, teapotVertexBuffer);\n\n //Now pass the list of vertices into webgl to build the shape.\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(teapotVertexArray), gl.STATIC_DRAW);\n\n //Build the element array buffer for the teapot\n teapotFaceBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, teapotFaceBuffer);\n\n //Now send the element array to GL\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(teapotFaceArray), gl.STATIC_DRAW);\n\n // //Create buffer for teapot's normals\n teapotNormalBuffer = gl.createBuffer();\n\n // //Select normal buffer as one to apply operations to\n gl.bindBuffer(gl.ARRAY_BUFFER, teapotNormalBuffer);\n\n // //Now pass the list of normals into webgl to build the shape\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(teapotNormalArray), gl.STATIC_DRAW);\n\n console.log(\"all this stuff's done\");\n }", "title": "" }, { "docid": "7875dffcbd9beb64a437db11aea03d29", "score": "0.525173", "text": "function readJsonSkinnedAnimatedMesh(event){\r\n\r\n // Abort.\r\n\r\n if ( event.currentTarget.files.length == 0 ) return; \r\n\r\n debugMode && console.log(\"Importing skinned mesh from JSON file.\");\r\n\r\n // FileList object.\r\n\r\n var file = event.target.files[0]; debugMode && console.log(\"file:\", file);\r\n var filename = file.name; debugMode && console.log(\"filename:\", filename);\r\n\t\tvar extension = filename.split( '.' ).pop().toLowerCase(); debugMode && console.log(\"extension:\", extension);\r\n\t\tvar name = filename.split( '.' )[0]; debugMode && console.log(\"name:\", name);\r\n\r\n // Read json file as text.\r\n\r\n var reader = new FileReader();\r\n\r\n // On error...\r\n\r\n reader.onerror = function(err){\r\n\r\n console.error(err);\r\n\r\n var msg = [ \"Sorry. An error occured.\", \r\n \"Please try to upload a skinned mesh json file.\",\r\n err ].join(\" \"); \r\n \r\n alert(msg); \r\n\r\n };\r\n\r\n // When reading competed...\r\n\r\n reader.onloadend = function(event){\r\n \r\n try {\r\n\r\n // debugMode && console.log(event.target.result);\r\n var contents = event.target.result;\r\n // Skinned Json data for skinned collection input.\r\n var skinnedJsonData = event.target.result;\r\n // debugMode && console.log(\"contents:\", contents);\r\n debugMode && console.log(\"json contents readed as text.\");\r\n\r\n // 1. Parse json string as json data with JSON parser.\r\n\r\n // Parse json contents string as json data.\r\n var data = JSON.parse( contents );\r\n debugMode && console.log(\"json contents parsed as data:\", data);\r\n // Get Json contents metadata.\r\n var metadata = data.metadata;\r\n debugMode && console.log(\"json metadata:\", metadata);\r\n\r\n // 2. Parse again json data with a new JSONLoader to get the geometry/material.\r\n\r\n var loader = new THREE.JSONLoader();\r\n var result = loader.parse( data );\r\n // debugMode && console.log(\"json data parsed with THREE.JSONLoader as JSON object {geometry, materials}.\");\r\n debugMode && console.log(\"result:\", result);\r\n\r\n // Check if this is skinned.\r\n if ( !result.geometry \r\n || !result.geometry.bones \r\n || !result.geometry.bones.length ) {\r\n\r\n var msg = [\r\n \"Sorry. This doesn't seem to be a skinned mesh file.\", \r\n \"Please try to upload a valid skinned mesh json file.\"\r\n ].join(\" \"); \r\n\r\n console.warn(msg);\r\n\r\n alert(msg);\r\n\r\n return;\r\n }\r\n\r\n // 3. Create the geometry from json results.\r\n\r\n var geometry = result.geometry;\r\n debugMode && console.log(\"geometry:\", geometry);\r\n geometry.computeVertexNormals();\r\n \t geometry.computeBoundingBox();\r\n geometry.sourceType = \"ascii\";\r\n \t\t geometry.sourceFile = file.name;\r\n \t //\r\n \r\n // 4. Create the materials from json results.\r\n\r\n var material;\r\n \t\t\tif ( result.materials !== undefined ) {\r\n \r\n for ( var i = 0; i < result.materials.length; i++ ) {\r\n var originalMaterial = result.materials[ i ];\r\n originalMaterial.skinning = true;\r\n }\r\n \r\n if ( result.materials.length > 1 )\r\n \t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.materials );\r\n \t\t\t\telse \r\n \t\t\t\t\tmaterial = result.materials[ 0 ];\r\n \r\n \t\t\t} else {\r\n \r\n \t\t\t\tmaterial = new THREE.MeshPhongMaterial();\r\n \r\n \t\t\t}\r\n \r\n \t\t\tdebugMode && console.log(\"material:\", material);\r\n\r\n // 5. Create the json skinned mesh object.\r\n\r\n \t\t\tif ( !!geometry.bones && !!geometry.bones.length ) {\r\n\r\n // Remove old skinnedmesh from scene.\r\n if (!!avatar) scene.remove(avatar);\r\n // Remove old armature helper.\r\n if (!!armatureHelper) scene.remove(armatureHelper);\r\n\r\n avatar = new THREE.SkinnedMesh(geometry, material, false);\r\n avatar.name = \"AVATAR\";\r\n avatar.position.set( 0, 0, 0 );\r\n avatar.scale.set( 1, 1, 1 );\r\n avatar.rotation.set( 0, 0, 0 );\r\n avatar.userData.animationData = {};\r\n // scene.add(avatar);\r\n skins.push(avatar);\r\n debugMode && console.log(\"Avatar loaded:\", avatar);\r\n \r\n \t\t\t} else {\r\n \r\n var msg = [\r\n \"Sorry. This is not a skinned mesh.\", \r\n \"Please try to upload skinned mesh json file.\"\r\n ].join(\" \"); debugMode && console.log(msg);\r\n \r\n alert(msg);\r\n\r\n return;\r\n \t\t\t}\r\n \r\n // -------------------------------------------------------------------------- //\r\n // VERY IMPORTANT: This is for not disappear avatar when camera come to close. //\r\n \r\n avatar.frustumCulled = false; // VERY IMPORTANT //\r\n \r\n // VERY IMPORTANT: This is for not disappear avatar when camera come to close. //\r\n // -------------------------------------------------------------------------- //\r\n \r\n // 6. Add new mesh in SKIN scene.\r\n //\r\n \t\t\tscene.add(avatar);\r\n \t\t\tdebugMode && console.log(\"avatar added in Animator scene:\", scene.children);\r\n // Loading completed.\r\n debugMode && console.log(\"Loading skinned json file\", filename, \"completed.\");\r\n // Focus Editor controls.\r\n controls.focus(avatar, true);\r\n \r\n // 7. Add all the rest things in scene.\r\n\r\n armatureHelper = newSkeletonHelper(avatar);\r\n scene.add(armatureHelper);\r\n armatureHelper.visible = false;\r\n debugMode && console.log(\"Armature Helper created:\", armatureHelper);\r\n \r\n // Initialize Bones Drop list.\r\n initBonesSelect(avatar);\r\n debugMode && console.log(\"Bones select initialized.\");\r\n \r\n // Define the animationData object to create the init animation.\r\n var animationData = {\"name\":null, \"fps\":null, \"length\":null, \"hierarchy\":[]};\r\n animationData.name = nameAnimField.value;\r\n animationData.fps = Number(fpsSlider.value);\r\n animationData.length = Number(animtimerSlider.max);\r\n \r\n // Prepear animationData for first init animation keys.\r\n \r\n // Create the init key (time:0) for every bone of avatar in animationData.hierarchy.\r\n for (var i in avatar.skeleton.bones) {\r\n animationData.hierarchy.push({\"keys\":[]});\r\n var initAnimationKey = {\"pos\":[0,0,0], \"rot\":[0,0,0,1], \"scl\":[1,1,1], \"time\":0};\r\n initAnimationKey.pos = avatar.skeleton.bones[i].position.toArray();\r\n initAnimationKey.rot = avatar.skeleton.bones[i].quaternion.toArray();\r\n initAnimationKey.scl = avatar.skeleton.bones[i].scale.toArray();\r\n animationData.hierarchy[i].keys.push(initAnimationKey);\r\n }\r\n\r\n debugMode && console.log( \"Animation Data created:\", animationData );\r\n\r\n // Create the animation.\r\n THREE.AnimationHandler.animations = [];\r\n animation = new THREE.Animation( avatar, animationData );\r\n animation.isPlaying = false;\r\n animation.currentTime = 0;\r\n timescaleSlider.value = 0;\r\n playButton.innerHTML = \"Play\";\r\n debugMode && console.log(\"Animation created:\", animation);\r\n //\r\n ensureLooping();\r\n\r\n // Create a userData array to store rest pose.\r\n avatar.userData.restPose = [];\r\n \r\n // Store init key as rest pose in userData.\r\n for (var i in animation.hierarchy) {\r\n var restPoseKey = {\"pos\":[0,0,0], \"rot\":[0,0,0,1], \"scl\":[1,1,1]};\r\n restPoseKey.pos = animation.hierarchy[i].position.toArray();\r\n restPoseKey.rot = animation.hierarchy[i].quaternion.toArray();\r\n restPoseKey.scl = animation.hierarchy[i].scale.toArray();\r\n avatar.userData.restPose.push( restPoseKey );\r\n }\r\n\r\n debugMode && console.log( \"Rest pose saved:\", avatar.userData.restPose );\r\n\r\n // Now that we have create the animation\r\n // we can get the currentBone and initialize\r\n // the bones values in bone adjust sliders.\r\n\r\n getCurrentBone(); \r\n \r\n initBonesAdjustValues();\r\n \r\n debugMode && console.log(\"Avatar loading completed and ready to animate.\");\r\n \r\n removeKeymarks(); // IMPORTANT // ??? WHY ???\r\n \r\n } catch(err) {\r\n\r\n reader.onerror(err);\r\n\r\n }\r\n\t };\r\n\r\n // Read json file as a text.\r\n reader.readAsText(file);\r\n\r\n }", "title": "" }, { "docid": "769f97c5e54b5fd7d6bb0009096a8b95", "score": "0.5238705", "text": "packBatches() {\n this.batchDirty++, this.uvsFloat32 = new Float32Array(this.uvs);\n const batches = this.batches;\n for (let i2 = 0, l2 = batches.length; i2 < l2; i2++) {\n const batch = batches[i2];\n for (let j2 = 0; j2 < batch.size; j2++) {\n const index2 = batch.start + j2;\n this.indicesUint16[index2] = this.indicesUint16[index2] - batch.attribStart;\n }\n }\n }", "title": "" }, { "docid": "e1efb1e861e4158cc549ed41ee93fc3a", "score": "0.52253187", "text": "function convertFloat32ToInt16(buffer) {\n\t\tlet l = buffer.length;\n\t\tlet buf = new Int16Array(l / 3);\n\t\n\t\twhile (l--) {\n\t\t\tif (l % 3 == 0) {\n\t\t\t\tbuf[l / 3] = buffer[l] * 0xFFFF;\n\t\t\t}\n\t\t}\n\t\treturn buf.buffer\n\t}", "title": "" }, { "docid": "a3d8ab7a957755c4e5b63b723cfd0ff8", "score": "0.5181023", "text": "constructor(dim /*:number[]*/) {\n this.dim = dim; // dimensions of the grid for the entire unit cell\n this.values = new Float32Array(dim[0] * dim[1] * dim[2]);\n }", "title": "" }, { "docid": "e37b16a2e61914d0c3c118d4ac656032", "score": "0.5180735", "text": "async function processAllFiles() {\n let file;\n while ((file = await inbox.pop())) {\n var data = await file.arrayBuffer();\n //console.log(`File name: ${file.name} (Size: ${file.length} bytes)`);\n \n let rawData = new Array();\n let totalRecords = file.length/(recSize*batchSize);\n for (let i = 0; i<totalRecords; i++) {\n let recordData = new Array();\n for (let j = 0; j<batchSize; j++) {\n let accX = data.slice((0*batchSize)+(j*2)+(i*recSize*batchSize),(0*batchSize)+2+(j*2)+(i*recSize*batchSize));\n let accY = data.slice((2*batchSize)+(j*2)+(i*recSize*batchSize),(2*batchSize)+2+(j*2)+(i*recSize*batchSize));\n let accZ = data.slice((4*batchSize)+(j*2)+(i*recSize*batchSize),(4*batchSize)+2+(j*2)+(i*recSize*batchSize));\n\n let gyrX = data.slice((6*batchSize)+(j*2)+(i*recSize*batchSize),(6*batchSize)+2+(j*2)+(i*recSize*batchSize));\n let gyrY = data.slice((8*batchSize)+(j*2)+(i*recSize*batchSize),(8*batchSize)+2+(j*2)+(i*recSize*batchSize));\n let gyrZ = data.slice((10*batchSize)+(j*2)+(i*recSize*batchSize),(10*batchSize)+2+(j*2)+(i*recSize*batchSize));\n \n let actType = data.slice((12*batchSize)+(j*1)+(i*recSize*batchSize),(12*batchSize)+1+(j*1)+(i*recSize*batchSize));\n\n let uintAccelX = new Uint16Array(new Uint8Array(accX).buffer)[0];\n let uintAccelY = new Uint16Array(new Uint8Array(accY).buffer)[0];\n let uintAccelZ = new Uint16Array(new Uint8Array(accZ).buffer)[0];\n\n let uintGyroX = new Uint16Array(new Uint8Array(gyrX).buffer)[0];\n let uintGyroY = new Uint16Array(new Uint8Array(gyrY).buffer)[0];\n let uintGyroZ = new Uint16Array(new Uint8Array(gyrZ).buffer)[0];\n\n let accelX = util.uInt16ToFloat(uintAccelX);\n let accelY = util.uInt16ToFloat(uintAccelY);\n let accelZ = util.uInt16ToFloat(uintAccelZ);\n\n let gyroX = util.uInt16ToFloat(uintGyroX);\n let gyroY = util.uInt16ToFloat(uintGyroY);\n let gyroZ = util.uInt16ToFloat(uintGyroZ);\n\n let activityType = new Uint8Array(actType)[0];\n recordData = recordData.concat([[[activityType],[accelX],[accelY],[accelZ],[gyroX],[gyroY],[gyroZ]]]);\n }\n rawData = rawData.concat([recordData]);\n }\n // Upload the received records to a server\n util.uploadDataToServer(rawData);\n }\n\n}", "title": "" }, { "docid": "0c68b0fa21a94faf7ac60b8bdc507d18", "score": "0.51793015", "text": "function parseFile (data, callback) {\n var arr = [];\n data = data.trim();\n var lines = data.split(/\\r\\n|\\r|\\n/);\n var columns = lines[0].split(',');\n for (var i = 0; i < lines.length; i++){\n var row = [];\n var nums = lines[i].split(',');\n for (var j = 0; j < columns.length; j++) {\n row.push(nums[j]);\n }\n arr.push(row);\n }\n\n // Asi se retorna el objeto en donde se llama\n callback(arr);\n}", "title": "" }, { "docid": "a87d2f6cd0d79a713c98931128b51d5a", "score": "0.5176138", "text": "function loadModels() {\n \n //inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\"); // read in the triangle data\n //inputTriangles = jsonTriangles;\n var a = [];\n a.push(fieldVertex);\n inputTriangles = a.concat(boardState);\n //inputTriangles.push(fieldVertex);\n //inputTriangles.concat(boardState);\n //inputTriangles = boardState;\n\n try {\n if (inputTriangles == String.null)\n throw \"Unable to load triangles file!\";\n else {\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd; // vtx coords to add to the coord array\n var normToAdd; // vtx normal to add to the coord array\n var triToAdd; // tri indices to add to the index array\n var maxCorner = vec3.fromValues(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE); // bbox corner\n var minCorner = vec3.fromValues(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE); // other corner\n \n // process each triangle set to load webgl vertex and triangle buffers\n numTriangleSets = inputTriangles.length; // remember how many tri sets\n for (var whichSet=0; whichSet<numTriangleSets; whichSet++) { // for each tri set\n \n // set up hilighting, modeling translation and rotation\n inputTriangles[whichSet].center = vec3.fromValues(0,0,0); // center point of tri set\n inputTriangles[whichSet].on = false; // not highlighted\n inputTriangles[whichSet].translation = vec3.fromValues(0,0,0); // no translation\n inputTriangles[whichSet].xAxis = vec3.fromValues(1,0,0); // model X axis\n inputTriangles[whichSet].yAxis = vec3.fromValues(0,1,0); // model Y axis \n\n // set up the vertex and normal arrays, define model center and axes\n inputTriangles[whichSet].glVertices = []; // flat coord list for webgl\n inputTriangles[whichSet].glNormals = []; // flat normal list for webgl\n var numVerts = inputTriangles[whichSet].vertices.length; // num vertices in tri set\n for (whichSetVert=0; whichSetVert<numVerts; whichSetVert++) { // verts in set\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert]; // get vertex to add\n normToAdd = inputTriangles[whichSet].normals[whichSetVert]; // get normal to add\n inputTriangles[whichSet].glVertices.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); // put coords in set coord list\n inputTriangles[whichSet].glNormals.push(normToAdd[0],normToAdd[1],normToAdd[2]); // put normal in set coord list\n vec3.max(maxCorner,maxCorner,vtxToAdd); // update world bounding box corner maxima\n vec3.min(minCorner,minCorner,vtxToAdd); // update world bounding box corner minima\n vec3.add(inputTriangles[whichSet].center,inputTriangles[whichSet].center,vtxToAdd); // add to ctr sum\n } // end for vertices in set\n vec3.scale(inputTriangles[whichSet].center,inputTriangles[whichSet].center,1/numVerts); // avg ctr sum\n\n // send the vertex coords and normals to webGL\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty webgl set vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glVertices),gl.STATIC_DRAW); // data in\n normalBuffers[whichSet] = gl.createBuffer(); // init empty webgl set normal component buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glNormals),gl.STATIC_DRAW); // data in\n \n // set up the triangle index array, adjusting indices across sets\n inputTriangles[whichSet].glTriangles = []; // flat index list for webgl\n triSetSizes[whichSet] = inputTriangles[whichSet].triangles.length; // number of tris in this set\n for (whichSetTri=0; whichSetTri<triSetSizes[whichSet]; whichSetTri++) {\n triToAdd = inputTriangles[whichSet].triangles[whichSetTri]; // get tri to add\n inputTriangles[whichSet].glTriangles.push(triToAdd[0],triToAdd[1],triToAdd[2]); // put indices in set list\n } // end for triangles in set\n\n // send the triangle indices to webGL\n triangleBuffers.push(gl.createBuffer()); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(inputTriangles[whichSet].glTriangles),gl.STATIC_DRAW); // data in\n\n } // end for each triangle set \n } // end if triangle file loaded\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end load models", "title": "" }, { "docid": "0e7910e8e826327548d3ae61715325a2", "score": "0.5170619", "text": "function readFloat32BE(array, offset) {\n if (offset === void 0) { offset = 0; }\n var view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n return view.getFloat32(offset);\n}", "title": "" }, { "docid": "9614f483d5dbe9512b123c71b3f3cf2a", "score": "0.51528096", "text": "function parseFileandBegin()\n{\n\t/*request the spline file*/\n\tvar request = new XMLHttpRequest();\n\trequest.open(\"GET\", \"http://users.wpi.edu/~mhperlman/webgl/project1/spline1.txt\", true);\n\t/*a callback function for once the file has been loaded*/\n\trequest.onload = function(e)\n\t{\n\t\t/*read the file turn it into an array split at every new line character*/\n\t\tvar file = request.responseText.split(\"\\n\");\n\t\t/*local variables used for file parsing*/\n\t\tvar splitFileItems = [];\n\t\tvar currentLocation = 0;\n\t\tvar unparsedPositions = [[]];\n\t\tvar unparsedRotations = [[]];\n\t\t/*eliminate all lines in the file beginning with a \"#\" or an empty character*/\n\t\tfile.forEach\n\t\t(\n\t\t\tfunction(item)\n\t\t\t{\n\t\t\t\tif(item.charAt(0) != \"#\" && item.charAt(0) != \"\")\n\t\t\t\t{\n\t\t\t\t\tsplitFileItems.push(item);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t/*read in the spline count*/\n\t\tsplineCount = parseInt(splitFileItems[currentLocation]);\n\t\tcurrentLocation += 1;\n\t\t/*for each spline*/\n\t\tfor(var i = 0; i < splineCount; i += 1)\n\t\t{\n\t\t\t/*store the number of control points for that spline*/\n\t\t\tsplineControlPointCount[i] = parseInt(splitFileItems[currentLocation]);\n\t\t\tcurrentLocation += 1;\n\t\t\t/*store the transition time for that spline*/\n\t\t\tsplineTransitionTimes[i] = parseInt(splitFileItems[currentLocation]);\n\t\t\tcurrentLocation += 1;\n\t\t\t/*store an unparsed version of both the denoted position and rotation vectors*/\n\t\t\tfor(var j = 0; j < splineControlPointCount[i]; j += 1)\n\t\t\t{\n\t\t\t\tunparsedPositions[i][j] = splitFileItems[currentLocation];\n\t\t\t\tcurrentLocation += 1;\n\t\t\t\tunparsedRotations[i][j] = splitFileItems[currentLocation];\n\t\t\t\tcurrentLocation += 1;\n\t\t\t}\n\t\t}\n\t\t/*for each unparsedposition/rotation*/\n\t\tfor(var i = 0; i < unparsedPositions.length; i += 1)\n\t\t{\n\t\t\tfor(var j = 0; j < unparsedPositions[i].length; j += 1)\n\t\t\t{\n\t\t\t\t/*split the position and rotation at the \",\" mark*/\n\t\t\t\tvar tempPos = unparsedPositions[i][j].split(\",\");\n\t\t\t\tvar tempRot = unparsedRotations[i][j].split(\",\");\n\t\t\t\t/*store the newly parsed positions and rotations to arrays*/\n\t\t\t\tsplinePositions[i][j] = new THREE.Vector3(\n\t\t\t\t\t\tparseFloat(tempPos[0]),\n\t\t\t\t\t\tparseFloat(tempPos[1]),\n\t\t\t\t\t\tparseFloat(tempPos[2]));\n\t\t\t\tsplineRotations[i][j] = new THREE.Vector3(\n\t\t\t\t\t\tparseFloat(tempRot[0]),\n\t\t\t\t\t\tparseFloat(tempRot[1]),\n\t\t\t\t\t\tparseFloat(tempRot[2]));\n\t\t\t}\n\t\t}\n\t\t/*call the init function to prepare the scene*/\n\t\tinit();\n\t\t/*call the render function to begin drawing the scene every frame*/\n\t\trender();\n\t};\n\t/*send the file request*/\n\trequest.send();\n}", "title": "" }, { "docid": "48aa0d77865f1ab8ae157ccc282f76e6", "score": "0.5143006", "text": "loadBattleModel(config, filename, loadGeometry) {\n\n var buffer = fs.readFileSync(config.inputBattleBattleDirectory + '/' + filename);\n\n var r = new FF7BinaryDataReader(buffer);\n\n let fileSizeBytes = buffer.length;\n r.offset = 0;\n\n let battleModel = {};\n var sectionOffset = 0;\n var sectionOffsetBase = 0;\n\n battleModel.unk = [r.readUInt(), r.readUInt(), r.readUInt()];\n battleModel.numBones = r.readUInt();\n battleModel.unk2 = [r.readUInt(), r.readUInt()];\n battleModel.numTextures = r.readUInt();\n battleModel.numBodyAnimations = r.readUInt();\n battleModel.unk3 = [r.readUInt(), r.readUInt()];\n battleModel.numWeaponAnimations = r.readUInt();\n battleModel.unk4 = [r.readUInt(), r.readUInt()];\n battleModel.bones = [];\n\tbattleModel.weaponModels = [];\n battleModel.name = filename;\n let baseName = filename.substring(0, 2);\n let pSufix1 = 97; // 'a'\n let pSufix2 = null;\n let b = false;\n\n if (battleModel.numBones == 0) { // It's a battle location model\n battleModel.isBattleLocation = true;\n for (let pSufix2 = 109; pSufix2 <= 122; pSufix2++) { // 109='m', 122='z'\n let pieceFilename = config.inputBattleBattleDirectory + '/' + baseName + String.fromCharCode(pSufix1) + String.fromCharCode(pSufix2);\n let pieceFilenameAbsolute = config.inputBattleBattleDirectory + '/' + pieceFilename;\n if (fs.existsSync(pieceFilenameAbsolute)) {\n //ReDim Preserve .Bones(.NumBones)\n if (loadGeometry) {\n let boneIndex = battleModel.numBones;\n let bone = this.loadBattleLocationPiece(config, pieceFilenameAbsolute, boneIndex);\n battleModel.bones.push(bone);\n }\n battleModel.numBones++;\n }\n }\n } else { // It's a character battle model\n battleModel.isBattleLocation = false;\n pSufix2 = 109;\n\t //console.log(\"TOTAL BONES = \" + battleModel.numBones);\n\t \n for (let bi=0; bi<battleModel.numBones; bi++) {\n let pieceFilename = baseName + String.fromCharCode(pSufix1) + String.fromCharCode(pSufix2);\n let pieceFilenameAbsolute = config.inputBattleBattleDirectory + '/' + pieceFilename;\n let bone = this.loadBattleBone(config, r, 52 + bi * 12, bi, pieceFilename, loadGeometry);\n battleModel.bones.push(bone);\n if (pSufix2 >= 122) {\n pSufix1 = pSufix1 + 1;\n pSufix2 = 97;\n } else {\n pSufix2++;\n }\n\t\t//console.log(\"Bone= \" + bi);\n\t\t\n //console.log(\"DEBUG: bone \" + bi + \" = \" + JSON.stringify(bone, null, 0));\n }\t \n\n battleModel.weaponModelFilenames = [];\n // weapon model filename suffixes are \"ck, cl, cm, ..., cz\"\n pSufix1 = 99; // 99='c'\n battleModel.numWeapons = 0;\n for (let pSufix2 = 107; pSufix2 <= 122; pSufix2++) { // 107='k' 122='z'\n let weaponFilename = baseName + String.fromCharCode(pSufix1) + String.fromCharCode(pSufix2);\n let weaponFilenameAbsolute = config.inputBattleBattleDirectory + '/' + weaponFilename;\n if (fs.existsSync(weaponFilenameAbsolute)) {\n if (loadGeometry) {\t\t\t\n battleModel.weaponModelFilenames.push(weaponFilename);\t\t\t\n }\n battleModel.numWeapons++;\n }\t\t\n }\t \n\t let weaponFilename = battleModel.weaponModelFilenames[0];\n\t let weaponFilenameAbsolute = config.inputBattleBattleDirectory + '/' + weaponFilename;\n if (fs.existsSync(weaponFilenameAbsolute)) {\n\t\tlet bi = battleModel.numBones;\n\t\tlet weaponBone = this.loadWeaponBone(config, r, 52 + bi * 12, bi, weaponFilename, loadGeometry);\n\t\tbattleModel.bones.push(weaponBone);\n\t\tbattleModel.hasWeapon = true;\t\t\n\t }\n\t else\n\t {\n\t\t battleModel.hasWeapon = false;\n\t }\n }\n\n // Texture file suffixes are ac, ad, ..., aj\n battleModel.textureFilenames = [];\n pSufix1 = 97;\n\n if (loadGeometry) {\n // ReDim .TexIDS(.NumTextures)\n // ReDim .textures(.NumTextures)\n let ti = 0;\n let pSuffix2End = 99 + battleModel.numTextures - 1;\n //for (let pSufix2 = 99; pSufix2 <= pSuffix2End; pSufix2++) {\n for (let ti=0; ti<battleModel.numTextures; ti++) {\n let pSufix2 = 99 + ti;\n let texFileName = baseName + String.fromCharCode(pSufix1) + String.fromCharCode(pSufix2);\n let texFileNameAbsolute = config.inputBattleBattleDirectory + '/' + texFileName;\n battleModel.textureFilenames.push(texFileName);\n\t\tconsole.log(\"TEXTURES ARE \"+texFileName);\n }\n }\n\n return battleModel;\n\n }", "title": "" }, { "docid": "9a07869904ce21bd95bff2e2ea3f863d", "score": "0.5141686", "text": "function loadIntegrationVars(){\n vertArr = body.mesh.geometry.vertices; //shorthand \n}", "title": "" }, { "docid": "57fe0961ceafe4d954e8aa42dd5096df", "score": "0.51289034", "text": "formatArrayOfObject(data) {\n this.requireInputOutputOfOne();\n if (!this.inputLookup) {\n const lookupTable = new LookupTable(data);\n this.inputLookup = this.outputLookup = lookupTable.table;\n this.inputLookupLength = this.outputLookupLength = lookupTable.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n result.push(objectToFloat32Arrays(data[i]));\n }\n return result;\n }", "title": "" }, { "docid": "0bdf956b4181c845fa3d28d2e12d701a", "score": "0.51256543", "text": "function readSOR2() {\n\tlet SORCollection = readFile2();\n\tobjects = [];\n\tfor (let i = 0; i < SORCollection.length; i++) {\n\t\tlet vertices = SORCollection[i].vertices;\n\t\tlet indexes = SORCollection[i].indexes;\n\n\t\tif (vertices.length % (12 * 3) != 0) {\n\t\t\talert('Selected file doesn\\'t match vertices (points) format in [' + SORCollection[i].name + '] object. There should be groups of 12 points, each group forming a circle.');\n\t\t} else if (indexes.length % (4 * 3) != 0) {\n\t\t\talert('Selected file doesn\\'t match indexes (faces) format in [' + SORCollection[i].name + '] object. There should be groups of 4 points, each group forming a face.');\n\t\t} else {\n\t\t\tlet v = [],\n\t\t\t\tl = [];\n\n\t\t\tfor (let j = 0; j < vertices.length; j += 3) {\n\t\t\t\tv.push(vertices[j]);\n\t\t\t\tv.push(vertices[j + 1]);\n\t\t\t\tv.push(vertices[j + 2]);\n\t\t\t\tv.push(0.0);\n\t\t\t\tv.push(0.0);\n\t\t\t\tv.push(1.0);\n\t\t\t}\n\n\t\t\t// Write vertices into buffer\n\t\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(v), gl.STATIC_DRAW);\n\n\t\t\t// Draw points\n\t\t\tgl.drawArrays(gl.POINTS, 0, v.length / 6);\n\n\t\t\tfor (let j = 0; j < indexes.length; j += 12) {\n\t\t\t\t// Point 1\n\t\t\t\tl.push(indexes[j]);\n\t\t\t\tl.push(indexes[j + 1]);\n\t\t\t\tl.push(indexes[j + 2]);\n\t\t\t\tl.push(0.0);\n\t\t\t\tl.push(1.0);\n\t\t\t\tl.push(0.0);\n\n\t\t\t\t// Point 2\n\t\t\t\tl.push(indexes[j + 3]);\n\t\t\t\tl.push(indexes[j + 4]);\n\t\t\t\tl.push(indexes[j + 5]);\n\t\t\t\tl.push(0.0);\n\t\t\t\tl.push(1.0);\n\t\t\t\tl.push(0.0);\n\n\t\t\t\t// Point 2\n\t\t\t\tl.push(indexes[j + 6]);\n\t\t\t\tl.push(indexes[j + 7]);\n\t\t\t\tl.push(indexes[j + 8]);\n\t\t\t\tl.push(0.0);\n\t\t\t\tl.push(1.0);\n\t\t\t\tl.push(0.0);\n\n\t\t\t\t// Point 2\n\t\t\t\tl.push(indexes[j + 9]);\n\t\t\t\tl.push(indexes[j + 10]);\n\t\t\t\tl.push(indexes[j + 11]);\n\t\t\t\tl.push(0.0);\n\t\t\t\tl.push(1.0);\n\t\t\t\tl.push(0.0);\n\t\t\t}\n\n\t\t\t// Write vertices into buffer\n\t\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(l), gl.STATIC_DRAW);\n\n\t\t\t// Draw points\n\t\t\tgl.drawArrays(gl.LINE_STRIP, 0, l.length / 6);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "827c6679494d02d5266f5e81db38a00a", "score": "0.5120987", "text": "function loadinffile(){\n fs.readFile('infomgr.inf', function(err, data) {\n if(err) throw err;\n array = data.toString().split(\"\\n\");\n load2array();\n });\n}", "title": "" }, { "docid": "c178138de4e762336ed084e304f3c031", "score": "0.51177317", "text": "_parseColors() {\n var colorFlag = parseInt(this._popStack(), 10);\n var colors;\n var count;\n\n if (colorFlag === 0) {\n colors = new Float32Array(4);\n for (var i = 0; i < 4; i++){\n colors[i] = parseFloat(this._popStack());\n }\n } else if (colorFlag === 1) {\n count = this._tempResult.num_polygons * 4;\n colors = new Float32Array(count);\n for (var i = 0; i < count; i++){\n colors[i] = parseFloat(this._popStack());\n }\n } else if (colorFlag === 2) {\n count = this._tempResult.numVertices * 4;\n colors = new Float32Array(count);\n for (var i = 0; i < count; i++){\n colors[i] = parseFloat(this._popStack());\n }\n } else {\n this._tempResult.error = true;\n this._tempResult.errorMessage = \"Invalid color flag: \" + colorFlag;\n }\n\n this._tempResult.colorFlag = colorFlag;\n this._tempResult.colors = colors;\n }", "title": "" }, { "docid": "be32aa36f687e00a965f8a212acaae70", "score": "0.5117095", "text": "readData(M, N) {\n let gl = this.context;\n\n // create destination buffer\n let rawbuffer = new ArrayBuffer(M * N * Float32Array.BYTES_PER_ELEMENT);\n\n // read the result into our buffer, as bytes\n let prod = new Uint8Array(rawbuffer);\n gl.readPixels(0, 0, N, M, gl.RGBA, gl.UNSIGNED_BYTE, prod);\n\n // return raw result bytes\n return new Float32Array(rawbuffer); // M x N\n }", "title": "" }, { "docid": "05a1c7a15bf774969d7da01169d0508b", "score": "0.5111929", "text": "readFloat() {\n const retVal = this.buffer.readFloatLE(this.length);\n this.length += 4;\n return retVal;\n }", "title": "" }, { "docid": "c5ade981961c12e2ef3364b2eba887c1", "score": "0.50949216", "text": "function n$1v(){return new Float32Array(2)}", "title": "" }, { "docid": "1b0e80210a8f293932537a991e7c7782", "score": "0.50814295", "text": "function h$geojson_parseMultiLineString(arr) {\n var x, df, dfs = [], points = [], sizes = [], padded = true, shifts = [0];\n for(var i = 0; i < arr.length; i++) {\n x = h$geojson_parsePointSeq(arr[i]);\n points = points.concat(x[0]);\n sizes.push(x[1]);\n padded = padded && x[2];\n shifts.push(points.length);\n }\n df = new Float32Array(points);\n for(var i = 0; i < shifts.length - 1; i++) {\n x = df.subarray(shifts[i],shifts[i+1]);\n dfs.push(x);\n }\n return [dfs, sizes, padded];\n}", "title": "" }, { "docid": "62d89edbf6bb25a371bd009254cc986e", "score": "0.50789887", "text": "function readobj(objID) {\n\n var positions = [];\n var normals = [];\n var triIndices = [];\n\n var objText = document.getElementById(objID).innerHTML;\n var lines = objText.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n if (lines[i].length == 0) {\n continue;\n }\n\n var tokens = lines[i].split(\" \");\n switch(tokens[0]) {\n case \"\":\n break;\n case \"v\":\n positions.push(+tokens[1]);\n positions.push(+tokens[2]);\n positions.push(+tokens[3]);\n break;\n case \"vn\":\n normals.push(+tokens[1]);\n normals.push(+tokens[2]);\n normals.push(+tokens[3]);\n break;\n case \"f\":\n var position = new Array(tokens.length-1)\n for(var j=1; j<tokens.length; ++j) {\n var indices = tokens[j].split(\"/\")\n position[j-1] = (indices[0]|0)-1\n }\n triIndices.push(position[0])\n triIndices.push(position[1])\n triIndices.push(position[2])\n break;\n default:\n throw new Error(\"unrecognized obj directive\");\n }\n }\n var ret = [];\n ret.push(positions);\n ret.push(normals);\n ret.push(triIndices);\n\n return ret;\n}", "title": "" }, { "docid": "bb57b574ad41accff845239be65c5d86", "score": "0.5068357", "text": "function parseHdr(buffer) {\n if (buffer instanceof ArrayBuffer) {\n buffer = new Uint8Array(buffer);\n }\n\n var fileOffset = 0;\n var bufferLength = buffer.length;\n\n var NEW_LINE = 10;\n\n function readLine() {\n var buf = '';\n do {\n var b = buffer[fileOffset];\n if (b == NEW_LINE) {\n ++fileOffset\n break;\n }\n buf += String.fromCharCode(b);\n } while (++fileOffset < bufferLength);\n return buf;\n }\n\n var width = 0;\n var height = 0;\n var exposure = 1;\n var gamma = 1;\n var rle = false;\n\n for (var i = 0; i < 20; i++) {\n var line = readLine();\n var match;\n if (match = line.match(radiancePattern)) {\n } else if (match = line.match(formatPattern)) {\n rle = true;\n } else if (match = line.match(exposurePattern)) {\n exposure = Number(match[1]);\n } else if (match = line.match(commentPattern)) {\n } else if (match = line.match(widthHeightPattern)) {\n height = Number(match[1]);\n width = Number(match[2]);\n break;\n }\n }\n\n if (!rle) {\n throw new Error('File is not run length encoded!');\n }\n\n var data = new Uint8Array(width * height * 4);\n var scanline_width = width;\n var num_scanlines = height;\n\n readPixelsRawRLE(buffer, data, 0, fileOffset, scanline_width, num_scanlines);\n\n // TODO: Should be Float16\n var floatData = new Float32Array(width * height * 4);\n for (var offset = 0; offset < data.length; offset += 4) {\n var r = data[offset + 0] / 255;\n var g = data[offset + 1] / 255;\n var b = data[offset + 2] / 255;\n var e = data[offset + 3];\n var f = Math.pow(2.0, e - 128.0)\n\n r *= f;\n g *= f;\n b *= f;\n\n var floatOffset = offset;\n\n floatData[floatOffset + 0] = r;\n floatData[floatOffset + 1] = g;\n floatData[floatOffset + 2] = b;\n floatData[floatOffset + 3] = 1.0;\n }\n\n return {\n shape: [width, height], exposure: exposure, gamma: gamma, data: floatData\n }\n}", "title": "" }, { "docid": "1eb49c5ef6222ec1c91cf26cdaa2495e", "score": "0.5060581", "text": "function ObjParser() {\n\n\n addEventListener('message',function (e) {\n // console.log(e.data)\n let objString = e.data;\n let meshData = parse(objString);\n\n let totalSteps = meshData.cells.length * meshData.cells[0].length + meshData.positions.length;\n let progressStep = 0;\n\n\n // Usually 3 because polygons are triangle, but OBJ allows different\n const verticesPerPolygon = meshData.cells[0].length;\n let indices = new Uint32Array( verticesPerPolygon * meshData.cells.length );\n let positions = new Float32Array( 3 * meshData.positions.length );\n\n // flattening the indices\n for (let i=0; i<meshData.cells.length; i += 1) {\n let newIndex = i * verticesPerPolygon;\n for (let ii=0; ii<verticesPerPolygon; ii += 1) {\n indices[newIndex + ii] = meshData.cells[i][ii];\n\n\n // sending some progress info\n if(progressStep%~~(totalSteps/100)===0){\n postMessage({\n status: 'progress',\n step: 'processing',\n progress: progressStep/totalSteps\n });\n }\n\n progressStep ++;\n }\n }\n\n // flatening the positions\n for (let p=0; p<meshData.positions.length; p += 1) {\n let newIndex = p * 3;\n positions[newIndex] = meshData.positions[p][0];\n positions[newIndex+1] = meshData.positions[p][1];\n positions[newIndex+2] = meshData.positions[p][2];\n\n\n // sending some progress info\n if(progressStep%~~(totalSteps/100)===0){\n postMessage({\n status: 'progress',\n step: 'processing',\n progress: progressStep/totalSteps\n });\n }\n\n progressStep ++;\n }\n\n postMessage({\n status: 'progress',\n step: 'done',\n progress: 1\n });\n\n postMessage({\n status: 'done',\n indices: indices,\n positions: positions,\n verticesPerPolygon: verticesPerPolygon\n });\n\n });\n}", "title": "" }, { "docid": "54e7dea96b32aa4f25f6e61573747f7c", "score": "0.5058955", "text": "function fileUploadCallback() {\r\n const filetype = document.getElementById('file_type_select').value;\r\n const file = this.files[0];\r\n\r\n const reader = new FileReader();\r\n reader.onload = function() {\r\n if(filetype === 'stl') {\r\n const mesh = parseSTL(new Buffer(reader.result));\r\n models.loadParsedSTL(mesh);\r\n }\r\n\r\n if(filetype === 'obj') {\r\n const mesh = parseOBJ(new Buffer(reader.result));\r\n models.loadParsedSTL(mesh); // STL loader also works for OBJ after parsing\r\n }\r\n\r\n if(filetype === 'line') {\r\n lines.parseArrayBuffer(reader.result);\r\n lines.make3dModel();\r\n initLineWidthSettings();\r\n }\r\n\r\n renderer.update();\r\n rerenderSlice = true;\r\n };\r\n reader.readAsArrayBuffer(file);\r\n}", "title": "" }, { "docid": "5bda982ae68abf5a4da9eae048cd888f", "score": "0.5057179", "text": "formatArrayOfDatumOfArray(data) {\n const result = [];\n this.requireInputOutputOfOne();\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n result.push(inputOutputArrayToFloat32Arrays(datum.input, datum.output));\n }\n return result;\n }", "title": "" }, { "docid": "8a237efc3ede45a9d1e237a9922b8b16", "score": "0.5054822", "text": "initMeshForRendering(shaderVarsToAttributeNames, mesh) {\n let j;\n this.shaderVarsToAttribs = shaderVarsToAttributeNames;\n switch (mesh.getFaceType()) {\n case PolygonMesh_1.Mesh.FaceType.Triangle:\n this.faceType = this.gl.TRIANGLES;\n break;\n case PolygonMesh_1.Mesh.FaceType.TriangleFan:\n this.faceType = this.gl.TRIANGLE_FAN;\n break;\n case PolygonMesh_1.Mesh.FaceType.TriangleStrip:\n this.faceType = this.gl.TRIANGLE_STRIP;\n break;\n case PolygonMesh_1.Mesh.FaceType.Lines:\n this.faceType = this.gl.LINES;\n break;\n case PolygonMesh_1.Mesh.FaceType.LineStrip:\n this.faceType = this.gl.LINE_STRIP;\n break;\n case PolygonMesh_1.Mesh.FaceType.LineLoop:\n this.faceType = this.gl.LINE_LOOP;\n break;\n }\n //create buffers\n this.vbo = this.gl.createBuffer();\n this.ibo = this.gl.createBuffer();\n //get a list of all the vertex attributes from the mesh\n let vertexDataList = mesh.getVertexAttributes();\n let primitives = mesh.getIndices();\n //get the indices for the mesh into a buffer\n let indicesArray = new Uint16Array(primitives);\n this.numIndices = indicesArray.length;\n /*\n now put all the vertex attributes in a single array, so that we can copy it over to the vertex buffer. When we convert an IVertexData to a bunch of numbers, we must remember where each attribute starts, because we will need to give it to vertexAttribPointer when drawing\n */\n let floatsPerVertex = 0;\n //for each attribute available in the vertex data:\n for (let [shaderVar, attribName] of this.shaderVarsToAttribs) {\n //the first vertex data will begin at this offset. Required for vertexAttribPointer\n this.offsets.set(attribName, floatsPerVertex);\n //how many floats for this attribute?\n let length = vertexDataList[0].getData(attribName).length;\n //update the number of floats by this amount\n floatsPerVertex += length;\n //remember how many floats for this attribute, Required for vertexAttribPointer\n this.vertexDataLengths.set(attribName, length);\n }\n if (this.shaderVarsToAttribs.size > 1) //if there are multiple attributes per vertex\n this.stride = floatsPerVertex;\n else\n this.stride = 0;\n let vertexDataAsNumbers = [];\n //now generate the array\n vertexDataList.forEach(v => {\n for (let [shaderVar, attribName] of this.shaderVarsToAttribs) {\n let data = v.getData(attribName);\n //copy over the floats for this attribute\n for (j = 0; j < data.length; j++) {\n vertexDataAsNumbers.push(data[j]);\n }\n }\n });\n //copy all the data to the vbo\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.vbo);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array(vertexDataAsNumbers), this.gl.STATIC_DRAW);\n //copy over the indices to the ibo\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.ibo);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, indicesArray, this.gl.STATIC_DRAW);\n }", "title": "" }, { "docid": "625d1007baa0f3318641664065c9e3d6", "score": "0.5052779", "text": "function LayerMesh() {\n\n const vertices = [];\n const vertex_uvs = [];\n const faces_indexes = [];\n\n\n\n\n\n}", "title": "" }, { "docid": "0c6ae5bb2e57672953068ca733837fa8", "score": "0.50512236", "text": "function addMeshData(geometry) {\n room.mesh.positions.push(...geometry.positions);\n room.mesh.normals.push(...geometry.normals);\n }", "title": "" }, { "docid": "17afc8f02514b4e4708b71fb91127ff5", "score": "0.5033609", "text": "function Figure () {\n\t\n\tthis.center = new Vector();\n\tthis.dimensions;\n\tthis.vertices = [];\n\tthis.lines = [];\n\tthis.faces = [];\n\t// The number of perpendicular planes in the space the figure lives in\n\t// (used for performing 2D rotations) is the triangular number if \n\t// n = number of dimensions \n\tthis.rotation = [];\n\tthis.scale = [];\n\tthis.vertexSource = 'no shader source';\n\tthis.fragmentSource = 'no shader source';\n\t\n\tthis.createMesh = function createMesh() {\n\t\t\n\t\tthis.geometry = new THREE.BufferGeometry();\n\t\t\n\t\t/*\n\t\tthis.scaleAxis = function scaleAxis ( axis, scaleFactor ) {\n\t\t\tthis.scale[axis] *= scaleFactor;\n\t\t}\n\t\t\n\t\tthis.scaleAll = function scaleAll ( scaleFactor ) {\n\t\t\tfor (var axis = 0; axis < this.scale.length; axis++ ) {\n\t\t\t\tthis.scale[axis] *= scaleFactor;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t\t// N-dimensional Vectors must be split up into sets of components\n\t\t// so that they can fit into the \"vec3\" data structure of the webgl shaders\n\t\tvar vertAxisChunks = [ [], [], [], [], [] ];\n\t\tvar faceIndices = [];\n\t\t\n\t\tfor (var vertIndex = 0; vertIndex < this.vertices.length; vertIndex++) {\n\t\t\tfor (var axis = 0; axis < this.dimensions; axis++) {\n\t\t\t\tvertAxisChunks[ Math.floor( axis / 3 ) % 3 ][ vertIndex * 3 + axis % 3 ] = this.vertices[ vertIndex ].getAxis( axis );\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (var faceIndex = 0; faceIndex < this.faces.length; faceIndex++) {\n\t\t\tfor (var triangle = 0; triangle < this.faces[ faceIndex ].pieces.length; triangle++) {\n\t\t\t\tfaceIndices.push( this.faces[ faceIndex ].pieces[ triangle ].a );\n\t\t\t\tfaceIndices.push( this.faces[ faceIndex ].pieces[ triangle ].b );\n\t\t\t\tfaceIndices.push( this.faces[ faceIndex ].pieces[ triangle ].c );\n\t\t\t}\n\t\t}\n\t\talert( new Float32Array( vertAxisChunks[ 0 ] ).toString() );\n\t\talert( new Float32Array( vertAxisChunks[ 1 ] ).toString() );\n\t\talert( new Float32Array( vertAxisChunks[ 2 ] ).toString() );\n\t\talert( new Float32Array( vertAxisChunks[ 3 ] ).toString() );\n\t\talert( new Float32Array( vertAxisChunks[ 4 ] ).toString() );\n\t\talert( \"indices\" + new Uint16Array( faceIndices ) );\n\t\t\n\t//\tthis.geometry.addAttribute( 'color', new THREE.BufferAttribute( vertices, 3 ) );\n\t\tthis.geometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertAxisChunks[ 0 ] ), 3 ) );\n\t\tthis.geometry.addAttribute( 'index', new THREE.BufferAttribute( new Uint16Array( faceIndices ), 3 ) );\n\t\tthis.geometry.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( vertAxisChunks[ 0 ] ), 3) );\n\t\tthis.geometry.addAttribute( 'positionChunk1', new THREE.BufferAttribute( new Float32Array( vertAxisChunks[ 0 ] ), 3 ) );\n\t\tthis.geometry.addAttribute( 'positionChunk2', new THREE.BufferAttribute( new Float32Array( vertAxisChunks[ 1 ] ), 3 ) );\n\t\tthis.geometry.addAttribute( 'positionChunk3', new THREE.BufferAttribute( new Float32Array( vertAxisChunks[ 2 ] ), 3 ) );\n\t\tthis.geometry.addAttribute( 'positionChunk4', new THREE.BufferAttribute( new Float32Array( vertAxisChunks[ 3 ] ), 3 ) );\n\t\tthis.geometry.addAttribute( 'positionChunk5', new THREE.BufferAttribute( new Float32Array( vertAxisChunks[ 4 ] ), 3 ) );\n\t//\tthis.geometry.computeVertexNormals();\n\t//\tthis.geometry.normalizeNormals();\n\t\tthis.geometry.computeBoundingSphere();\n\t\t\n\t\tthis.uniforms = {\n\t\t\t\ttime: { type: \"f\", value: 1.0 },\n\t\t\t\tnPlaneDistance: { type: \"f\", value: 3.0 }\n\t\t};\n\t\t\n\t\tthis.attribs = {\n\t\t\t\tpositionChunk1: { type: \"f\", value: null },\n\t\t\t\tpositionChunk2: { type: \"f\", value: null },\n\t\t\t\tpositionChunk3: { type: \"f\", value: null },\n\t\t\t\tpositionChunk4: { type: \"f\", value: null }\n\t\t};\n\t\t\n\t\tthis.shaderMaterial = new THREE.ShaderMaterial( {\n\t\t\tuniforms: this.uniforms,\n\t\t\tattributes: this.attribs,\n\t\t\tvertexShader: this.vertexSource,\n\t\t\tfragmentShader: this.fragmentSource,\n\t\t\tside: THREE.DoubleSide,\n\t\t\ttransparent: false,\n\t\t\topacity: 0.1\n\t\t});\n\t\t\n\t\treturn new THREE.Mesh( this.geometry, this.shaderMaterial );\n\t}\n}", "title": "" }, { "docid": "245478ced9ac7e7424c7cec9dbad5e87", "score": "0.50236624", "text": "getChannelData(_) {\n return new Float32Array(0);\n }", "title": "" }, { "docid": "0fa8fbf64e554ec3da388e2e249280d5", "score": "0.50231165", "text": "function loadTriangles() {\n inputTriangles = [\n {\n \"material\": {\n \"ambient\": [\n 0.1,\n 0.1,\n 0.1\n ],\n \"diffuse\": [\n 0.6,\n 0.4,\n 0.4\n ],\n \"specular\": [\n 0.3,\n 0.3,\n 0.3\n ],\n \"n\": 11\n },\n \"vertices\": [\n [\n 0.15,\n 0.6,\n 0.75\n ],\n [\n 0.25,\n 0.9,\n 0.75\n ],\n [\n 0.35,\n 0.6,\n 0.75\n ]\n ],\n \"normals\": [\n [\n 0,\n 0,\n -1\n ],\n [\n 0,\n 0,\n -1\n ],\n [\n 0,\n 0,\n -1\n ]\n ],\n \"triangles\": [\n [\n 0,\n 1,\n 2\n ]\n ]\n },\n {\n \"material\": {\n \"ambient\": [\n 0.1,\n 0.1,\n 0.1\n ],\n \"diffuse\": [\n 0.6,\n 0.6,\n 0.4\n ],\n \"specular\": [\n 0.3,\n 0.3,\n 0.3\n ],\n \"n\": 17\n },\n \"vertices\": [\n [\n 0.15,\n 0.15,\n 0.75\n ],\n [\n 0.15,\n 0.35,\n 0.75\n ],\n [\n 0.35,\n 0.35,\n 0.75\n ],\n [\n 0.35,\n 0.15,\n 0.75\n ]\n ],\n \"normals\": [\n [\n 0,\n 0,\n -1\n ],\n [\n 0,\n 0,\n -1\n ],\n [\n 0,\n 0,\n -1\n ],\n [\n 0,\n 0,\n -1\n ]\n ],\n \"triangles\": [\n [\n 0,\n 1,\n 2\n ],\n [\n 2,\n 3,\n 0\n ]\n ]\n }\n ];\n if (inputTriangles != String.null) {\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var coordArray = []; // 1D array of vertex coords for WebGL\n var indexArray = []; // 1D array of triangle coords\n var vertexBufferSize = 0;\n var vertexToAdd = [];\n var indexOffset = vec3.create();\n var triToAdd = vec3.create();\n\n var normalArray = [];\n var normalToAdd = [];\n var diffuseArray = [];\n var diffuseToAdd = vec3.create();\n var specularArray = [];\n var specularToAdd = vec3.create();\n var ambientArray = [];\n var ambientToAdd = vec3.create();\n var reflectivityArray = [];\n\n for (var whichSet = 0; whichSet < inputTriangles.length; whichSet++) {\n vec3.set(indexOffset, vertexBufferSize, vertexBufferSize, vertexBufferSize);\n\n // set up the vertex coord array\n for (whichSetVert = 0; whichSetVert < inputTriangles[whichSet].vertices.length; whichSetVert++) {\n vertexSet.push(whichSet);\n vertexToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n coordArray.push(vertexToAdd[0], vertexToAdd[1], vertexToAdd[2]);\n }\n\n // set up the triangle array\n for (whichSetTri = 0; whichSetTri < inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd, indexOffset, inputTriangles[whichSet].triangles[whichSetTri]);\n indexArray.push(triToAdd[0], triToAdd[1], triToAdd[2]);\n }\n\n // set up the normal array\n for (whichSetVert = 0; whichSetVert < inputTriangles[whichSet].normals.length; whichSetVert++) {\n normalToAdd = inputTriangles[whichSet].normals[whichSetVert];\n normalArray.push(normalToAdd[0], normalToAdd[1], normalToAdd[2]);\n }\n\n // set up the diffuse color array\n for (whichSetTri = 0; whichSetTri < inputTriangles[whichSet].triangles.length; whichSetTri++) {\n diffuseToAdd = inputTriangles[whichSet].material.diffuse;\n diffuseArray.push(diffuseToAdd[0], diffuseToAdd[1], diffuseToAdd[2]);\n diffuseArray.push(diffuseToAdd[0], diffuseToAdd[1], diffuseToAdd[2]);\n diffuseArray.push(diffuseToAdd[0], diffuseToAdd[1], diffuseToAdd[2]);\n }\n\n // set up the specular color array\n for (whichSetTri = 0; whichSetTri < inputTriangles[whichSet].triangles.length; whichSetTri++) {\n specularToAdd = inputTriangles[whichSet].material.specular;\n specularArray.push(specularToAdd[0], specularToAdd[1], specularToAdd[2]);\n specularArray.push(specularToAdd[0], specularToAdd[1], specularToAdd[2]);\n specularArray.push(specularToAdd[0], specularToAdd[1], specularToAdd[2]);\n }\n\n // set up the ambient color array\n for (whichSetTri = 0; whichSetTri < inputTriangles[whichSet].triangles.length; whichSetTri++) {\n ambientToAdd = inputTriangles[whichSet].material.ambient;\n ambientArray.push(ambientToAdd[0], ambientToAdd[1], ambientToAdd[2]);\n ambientArray.push(ambientToAdd[0], ambientToAdd[1], ambientToAdd[2]);\n ambientArray.push(ambientToAdd[0], ambientToAdd[1], ambientToAdd[2]);\n }\n\n // set up the reflectivity coefficient array\n for (whichSetTri = 0; whichSetTri < inputTriangles[whichSet].triangles.length; whichSetTri++) {\n reflectivityArray.push(inputTriangles[whichSet].material.n);\n reflectivityArray.push(inputTriangles[whichSet].material.n);\n reflectivityArray.push(inputTriangles[whichSet].material.n);\n }\n\n vertexBufferSize += inputTriangles[whichSet].vertices.length;\n triBufferSize += inputTriangles[whichSet].triangles.length;\n\n } // end for each triangle set\n num = inputTriangles.length;\n triBufferSize *= 3\n\n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(coordArray), gl.STATIC_DRAW); // coords to that buffer\n\n normalBuffer = gl.createBuffer(); // init empty index buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normalArray), gl.STATIC_DRAW); // coords to that buffer\n\n diffuseBuffer = gl.createBuffer(); // init empty diffuse buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, diffuseBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(diffuseArray), gl.STATIC_DRAW); // coords to that buffer\n\n specularBuffer = gl.createBuffer(); // init empty specular buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, specularBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(specularArray), gl.STATIC_DRAW); // coords to that buffer\n\n ambientBuffer = gl.createBuffer(); // init empty ambient buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, ambientBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(ambientArray), gl.STATIC_DRAW); // coords to that buffer\n\n reflectivityBuffer = gl.createBuffer(); // init empty reflectivity buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, reflectivityBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(reflectivityArray), gl.STATIC_DRAW); // coords to that buffer\n\n triangleBuffer = gl.createBuffer(); // init empty index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indexArray), gl.STATIC_DRAW); // coords to that buffer\n\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "6f41f62a493257e0777bd1f7115d8ceb", "score": "0.50066054", "text": "function readData() {\n\t\tconst realWidth = Math.max(width, height);\n\t\t// https://stackoverflow.com/questions/28282935/working-around-webgl-readpixels-being-slow\n\t\tgl.readPixels(0, 0, realWidth, 2, gl.RGBA, gl.FLOAT, readBuffer);\n\t\t// console.log(readBuffer);\n\t\tif (MEASURE_TIME) window.performance.mark(\"a\");\n\n\t\tlet sumRow = 0, sumRowAll = 0;\n\t\tfor (let i = realWidth * 4; i < realWidth * 4 + height * 4; i += 4) { // every 1st pixel in each row and each pixel has four values (RGBA)\n\t\t\tlet value = readBuffer[i];\n\t\t\tif (value > 0.5) {\n\t\t\t\tsumRow += value;\n\t\t\t\tsumRowAll += readBuffer[i + 1];\n\t\t\t}\n\t\t}\n\t\tconst yCoord = sumRowAll / sumRow;\n\n\t\tlet sumCol = 0, sumColAll = 0;\n\t\tfor (let i = 0; i < width * 4; i += 4) { // every pixel in the 1st row and each pixel has four values (RGBA)\n\t\t\tlet value = readBuffer[i];\n\t\t\tif (value > 0.5) {\n\t\t\t\tsumCol += value;\n\t\t\t\tsumColAll += readBuffer[i + 1];\n\t\t\t}\n\t\t}\n\t\tconst xCoord = sumColAll / sumCol;\n\n\t\tconsole.log(xCoord, sumColAll, sumCol, \"xCoord, col\");\n\t\tconsole.log(yCoord, sumRowAll, sumRow, \"yCoord, row\");\n\t}", "title": "" }, { "docid": "aabff6cf1124a0e24bc2884237285ed6", "score": "0.5004064", "text": "fillNewFloatArrayBuffer(gl, data) {\n const buffer = gl.createBuffer();\n\n // The buffer will be used for vertex data, like coordinates, colors or\n // texture coordinates.\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n\n // Fill the buffer.\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW);\n\n return buffer;\n }", "title": "" }, { "docid": "e1bbf9334669142fbf75b3fd8e7d21a8", "score": "0.49882534", "text": "function loadTriangles() {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n\n if (inputTriangles != String.null) {\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n\n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n var vtxToAdd = []; // vtx coords to add to the coord array\n var indexOffset = vec3.create(); // the index offset for the current set\n var triToAdd = vec3.create(); // tri indices to add to the index array\n var normalToAdd = [];\n var coordArray = []; // 1D array of vertex coords for WebGL\n var indexArray = []; // 1D array of vertex indices for WebGL\n var normalArray = [];\n var centroid = [0,0,0];\n var vtxLength = inputTriangles[whichSet].vertices.length;\n // set up the vertex coord array\n for (whichSetVert=0; whichSetVert<vtxLength; whichSetVert++) {\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n centroid = [centroid[0]+vtxToAdd[0],centroid[1]+vtxToAdd[1],centroid[2]+vtxToAdd[2]];\n }\n centroid = [centroid[0]/vtxLength,centroid[1]/vtxLength,centroid[2]/vtxLength]\n for (whichSetVert=0; whichSetVert<vtxLength; whichSetVert++) {\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n normalToAdd = inputTriangles[whichSet].normals[whichSetVert];\n normalArray.push(normalToAdd[0]);\n normalArray.push(normalToAdd[1]);\n normalArray.push(normalToAdd[2]);\n coordArray.push(vtxToAdd[0]-centroid[0],vtxToAdd[1]-centroid[1],vtxToAdd[2]-centroid[2]);\n } // end for vertices in set\n\n // set up the triangle index array, adjusting indices across sets\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd,indexOffset,inputTriangles[whichSet].triangles[whichSetTri]);\n indexArray.push(triToAdd[0],triToAdd[1],triToAdd[2]);\n } // end for triangles in set\n\n var mMatrix = mat4.create();\n mat4.identity(mMatrix);\n mat4.translate(mMatrix,mMatrix,centroid); // model\n var triBuffer = new TriangleBuffer(gl, mMatrix, shaderProgram, false);\n triBuffer.centroid = centroid;\n triBuffer.UpdateShaderData(coordArray, indexArray, normalArray);\n triBuffer.AddColor(inputTriangles[whichSet].material.ambient,\n inputTriangles[whichSet].material.diffuse,\n inputTriangles[whichSet].material.specular, 5.0);\n //triBuffer.DrawElements();\n viewport.AddBuffer(triBuffer);\n } // end for each triangle set\n //triBufferSize *= 3; // now total number of indices\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "bc50bbdfeae392c9695450d9d1b51f2b", "score": "0.49872237", "text": "function parseData() {\n\t\t//$log.log(preDebugMsg + \"parseData\");\n\t\tparsingDataNow = true;\n\t\tresetVars();\n\t\tvar firstNonNullData = true;\n\t\tvar minXVal = 0;\n\t\tvar maxXVal = 0;\n\t\tvar minYVal = 0;\n\t\tvar maxYVal = 0;\n\t\tvar dataIsCorrupt = false;\n\n\t\tfor(var src = 0; src < dataMappings.length; src++) {\n\t\t\t// not done this way, dataMappings[src].activate(dataMappings[src].active);\n\t\t\tif(dataMappings[src].active) {\n\t\t\t\tvar w = $scope.getWebbleByInstanceId(dataMappings[src].srcID);\n\t\t\t\tvar ls = w.scope().gimme(dataMappings[src].slotName);\n\n\t\t\t\tfor(var f = 0; f < dataMappings[src].map.length; f++) {\n\t\t\t\t\tvar fieldInfo = ls[dataMappings[src].map[f].srcIdx];\n\t\t\t\t\tdataMappings[src].map[f].listen = fieldInfo.listen;\n\n\t\t\t\t\tif(dataMappings[src].map[f].name == \"dataX\") {\n\t\t\t\t\t\tvar lenX = fieldInfo.size;\n\t\t\t\t\t\tdataMappings[src].xFun = fieldInfo.val;\n\t\t\t\t\t\tdataMappings[src].selFun = fieldInfo.sel;\n\t\t\t\t\t\tdataMappings[src].size = lenX;\n\t\t\t\t\t\tdataMappings[src].newSelections = fieldInfo.newSel;\n\t\t\t\t\t}\n\t\t\t\t\tif(dataMappings[src].map[f].name == \"dataY\") {\n\t\t\t\t\t\tvar lenY = fieldInfo.size;\n\t\t\t\t\t\tdataMappings[src].yFun = fieldInfo.val;\n\t\t\t\t\t\tdataMappings[src].newSelections = fieldInfo.newSel;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdataMappings[src].clean = true;\n\t\t}\n\n\t\tfor(var src = 0; !dataIsCorrupt && src < dataMappings.length; src++) {\n\t\t\tvar fx = dataMappings[src].xFun;\n\t\t\tvar fy = dataMappings[src].yFun;\n\n\t\t\tfor(i = 0; !dataIsCorrupt && i < dataMappings[src].size; i++) {\n\t\t\t\tx = fx(i);\n\t\t\t\ty = fy(i);\n\n\t\t\t\tif(x !== null && y !== null) {\n\t\t\t\t\tunique++;\n\n\t\t\t\t\tif(firstNonNullData) {\n\t\t\t\t\t\tif(typeof x == 'number') {\n\t\t\t\t\t\t\txType = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(x instanceof Date) {\n\t\t\t\t\t\t\txType = 1;\n\t\t\t\t\t\t\t//x = x.getTime();\n\t\t\t\t\t\t\tx = new Date(x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof x == 'string') {\n\t\t\t\t\t\t\txType = 2;\n\t\t\t\t\t\t\tx = Date.parse(x); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\tvar xs = x.toString().substr(0,32);\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + xs + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(typeof y == 'number') {\n\t\t\t\t\t\t\tyType = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y instanceof Date) {\n\t\t\t\t\t\t\tyType = 1;\n\t\t\t\t\t\t\t//y = y.getTime();\n\t\t\t\t\t\t\ty = new Date(y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof y == 'string') {\n\t\t\t\t\t\t\tyType = 2;\n\t\t\t\t\t\t\ty = Date.parse(y); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\tvar ys = y.toString().substr(0,32);\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + ys + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tminXVal = x;\n\t\t\t\t\t\tmaxXVal = x;\n\t\t\t\t\t\tminYVal = y;\n\t\t\t\t\t\tmaxYVal = y;\n\n\t\t\t\t\t\tfirstNonNullData = false;\n\t\t\t\t\t}\n\t\t\t\t\telse { // not first non-null data\n\t\t\t\t\t\tif(typeof x == 'number') {\n\t\t\t\t\t\t\tif(xType != 0) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(x instanceof Date) {\n\t\t\t\t\t\t\tif(xType != 1) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//x = x.getTime();\n\t\t\t\t\t\t\tx = new Date(x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof x == 'string') {\n\t\t\t\t\t\t\tif(xType != 2) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tx = Date.parse(x); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + x + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(typeof y == 'number') {\n\t\t\t\t\t\t\tif(yType != 0) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y instanceof Date) {\n\t\t\t\t\t\t\tif(yType != 1) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//y = y.getTime();\n\t\t\t\t\t\t\ty = new Date(y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(typeof y == 'string') {\n\t\t\t\t\t\t\tif(yType != 2) {\n\t\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ty = Date.parse(y); // what if it is something like \"21\"?\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t\t\t//$log.log(preDebugMsg + \"Cannot handle value '\" + y + \"'\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tminXVal = Math.min(x, minXVal);\n\t\t\t\t\t\tmaxXVal = Math.max(x, maxXVal);\n\t\t\t\t\t\tminYVal = Math.min(y, minYVal);\n\t\t\t\t\t\tmaxYVal = Math.max(y, maxYVal);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isNaN(x) || isNaN(y)) {\n\t\t\t\t\t\tdataIsCorrupt = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tNULLs++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(firstNonNullData) {\n\t\t\tdataIsCorrupt = true; // only null values\n\t\t}\n\n\t\tif(!dataIsCorrupt) {\n\t\t\tlimits = {};\n\n\t\t\tif(minXVal == maxXVal) {\n\t\t\t\tminXVal--;\n\t\t\t\tmaxXVal++;\n\t\t\t}\n\n\t\t\tif(minYVal == maxYVal) {\n\t\t\t\tminYVal--;\n\t\t\t\tmaxYVal++;\n\t\t\t}\n\n\t\t\tlimits.minX = minXVal;\n\t\t\tlimits.maxX = maxXVal;\n\t\t\tlimits.minY = minYVal;\n\t\t\tlimits.maxY = maxYVal;\n\t\t\tlimits.spanX = maxXVal - minXVal;\n\t\t\tlimits.spanY = maxYVal - minYVal;\n\t\t\tif(limits.spanX <= 0) {\n\t\t\t\tlimits.spanX = 1;\n\t\t\t}\n\t\t\tif(limits.spanY <= 0) {\n\t\t\t\tlimits.spanY = 1;\n\t\t\t}\n\n\t\t\tzoomMinX = limits.minX;\n\t\t\tzoomMaxX = limits.maxX;\n\t\t\tzoomMinY = limits.minY;\n\t\t\tzoomMaxY = limits.maxY;\n\t\t\t$scope.set(\"MinX\", limits.minX);\n\t\t\t$scope.set(\"MaxX\", limits.maxX);\n\t\t\t$scope.set(\"MinY\", limits.minY);\n\t\t\t$scope.set(\"MaxY\", limits.maxY);\n\n\t\t\tif(xType == 1 || xType == 2) {\n\t\t\t\tif(limits.minX == limits.maxX) {\n\t\t\t\t\tlimits.dateFormatX = 'full';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar d1 = new Date(limits.minX);\n\t\t\t\t\tvar d2 = new Date(limits.maxX);\n\t\t\t\t\tif(d2.getFullYear() - d1.getFullYear() > 10) {\n\t\t\t\t\t\tlimits.dateFormatX = 'onlyYear';\n\t\t\t\t\t}\n\t\t\t\t\telse if(d2.getFullYear() - d1.getFullYear() > 1) {\n\t\t\t\t\t\tlimits.dateFormatX = 'yearMonth';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar days = (d2.getTime() - d1.getTime()) / (24*3600*1000);\n\t\t\t\t\t\tif(d2.getMonth() != d1.getMonth()) {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'monthDay';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 5) {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'day';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 1) {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'dayTime';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlimits.dateFormatX = 'time';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(yType == 1 || yType == 2) {\n\t\t\t\tif(limits.minY == limits.maxY) {\n\t\t\t\t\tlimits.dateFormatY = 'full';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar d1 = new Date(limits.minY);\n\t\t\t\t\tvar d2 = new Date(limits.maxY);\n\t\t\t\t\tif(d2.getFullYear() - d1.getFullYear() > 10) {\n\t\t\t\t\t\tlimits.dateFormatY = 'onlyYear';\n\t\t\t\t\t}\n\t\t\t\t\telse if(d2.getFullYear() - d1.getFullYear() > 1) {\n\t\t\t\t\t\tlimits.dateFormatY = 'yearMonth';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar days = (d2.getTime() - d1.getTime()) / (24*3600*1000);\n\t\t\t\t\t\tif(d2.getMonth() != d1.getMonth()) {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'monthDay';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 5) {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'day';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(days > 1) {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'dayTime';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlimits.dateFormatY = 'time';\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\t//$log.log(preDebugMsg + \"parseData limits: \" + JSON.stringify(limits));\n\t\t}\n\n\t\tif(dataIsCorrupt) {\n\t\t\t//$log.log(preDebugMsg + \"data is corrupt\");\n\n\t\t\tfor(var src = 0; src < dataMappings.length; src++) {\n\t\t\t\tfor(var f = 0; f < dataMappings[src].map.length; f++) {\n\t\t\t\t\tif(dataMappings[src].map[f].listen !== null) {\n\t\t\t\t\t\t//$log.log(preDebugMsg + \"Data corrupt, stop listening to \" + dataMappings[src].map[f].name + \" \" + dataMappings[src].map[i].srcIdx);\n\t\t\t\t\t\tdataMappings[src].map[f].listen(myInstanceId, false, null, null, []);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tresetVars();\n\t\t}\n\n\t\tif(unique > 0) {\n\t\t\tvar giveUp = checkSelectionsAfterNewData();\n\t\t\tif(giveUp) {\n\t\t\t\t$scope.selectAll();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tupdateLocalSelections(false);\n\t\t\t\tsaveSelectionsInSlot();\n\t\t\t}\n\t\t}\n\t\telse { // no data\n\t\t\tupdateLocalSelections(false);\n\n\t\t\tif(selectionCtx === null) {\n\t\t\t\tselectionCtx = selectionCanvas.getContext(\"2d\");\n\t\t\t\tvar W = selectionCanvas.width;\n\t\t\t\tvar H = selectionCanvas.height;\n\t\t\t\tselectionCtx.clearRect(0,0, W,H);\n\t\t\t}\n\t\t}\n\t\tparsingDataNow = false;\n\t\tupdateGraphicsHelper(false, true, true);\n\t}", "title": "" }, { "docid": "0c56bc3802fc03b89239e9955582f12d", "score": "0.49780518", "text": "calculateVertices() {\n const verticesBuffer = this.geometry.buffers[0], vertices = verticesBuffer.data, vertexDirtyId = verticesBuffer._updateID;\n if (vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID)\n return;\n this._transformID = this.transform._worldID, this.vertexData.length !== vertices.length && (this.vertexData = new Float32Array(vertices.length));\n const wt = this.transform.worldTransform, a2 = wt.a, b2 = wt.b, c2 = wt.c, d2 = wt.d, tx = wt.tx, ty = wt.ty, vertexData = this.vertexData;\n for (let i2 = 0; i2 < vertexData.length / 2; i2++) {\n const x2 = vertices[i2 * 2], y2 = vertices[i2 * 2 + 1];\n vertexData[i2 * 2] = a2 * x2 + c2 * y2 + tx, vertexData[i2 * 2 + 1] = b2 * x2 + d2 * y2 + ty;\n }\n if (this._roundPixels) {\n const resolution = settings.RESOLUTION;\n for (let i2 = 0; i2 < vertexData.length; ++i2)\n vertexData[i2] = Math.round(vertexData[i2] * resolution) / resolution;\n }\n this.vertexDirty = vertexDirtyId;\n }", "title": "" }, { "docid": "462ceede1bd970ef1a7a681044569060", "score": "0.4975064", "text": "scanMesh (dimensions, gridRes, rayLength) {\n let values = []\n let intersect = false\n \n let m = 0\n for (let k = -dimensions[0]; k <= dimensions[0]; k+= gridRes) {\n values[m] = []\n let n = 0\n for (let j = -dimensions[1]; j <= dimensions[1]; j+= gridRes) {\n values[m][n] = []\n let o = 0\n this.scannedMeshes = {}\n for (let i = -dimensions[2]; i <= dimensions[2]; i+= gridRes) {\n intersect = this.checkIntersection2(k, j, i, rayLength)\n if (intersect === true) {\n values[m][n][o] = 2 // surface\n }\n else {\n let noIntersect = true\n for (var key in this.scannedMeshes) {\n if (this.scannedMeshes.hasOwnProperty(key)) {\n // console.log(this.scannedMeshes[key])\n if (this.scannedMeshes[key] !== 0 && this.scannedMeshes[key] % 2 !== 0) {\n noIntersect = false\n values[m][n][o] = 0 // exterior\n }\n }\n }\n if (noIntersect) {\n values[m][n][o] = 1 // interior\n }\n }\n o++\n }\n n++\n }\n m++\n }\n\n this.addDotsToDebug(values, dimensions, gridRes)\n \n console.log(values)\n return values\n }", "title": "" }, { "docid": "f4d11b7ec27e59a8f387a262e1f20d80", "score": "0.49692753", "text": "function convert32BitsColor(arr){\n var arr32 = new Float32Array(arr.length*4);\n var count = 0;\n for(var i=0; i<arr.length; i++){\n for(var j = 0; j < 4; j++){\n arr32[count] = arr[i][j];\n count++; \n }\n \n }\n return arr32;\n }", "title": "" }, { "docid": "bc7927d7ccbe3f816df0a2d99561470c", "score": "0.49672523", "text": "function loadBuffers(buffer, vbo) {\n var reader = new DataView(buffer);\n //get number of vertices and faces\n var numVertices = reader.getUint32(0);\n var numFaces = reader.getUint32(4);\n vbo.numVertices = numVertices;\n vbo.numFaces = numFaces;\n //put that data in some arrays\n vbo.vertexData = new Float32Array(buffer,8,numVertices*6);\n vbo.indexData = new Uint16Array(buffer, numVertices*24+8, numFaces*3);\n //push that data to the GPU\n vbo.vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vbo.vertexData, gl.STATIC_DRAW);\n \n vbo.indexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, vbo.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, vbo.indexData, gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "40e3672bc3dd00def2756c2f65e139a9", "score": "0.49636737", "text": "formatArrayOfObjectMulti(data) {\n if (!this.inputLookup) {\n const lookupTable = new LookupTable(data);\n this.inputLookup = this.outputLookup = lookupTable.table;\n this.inputLookupLength = this.outputLookupLength = lookupTable.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n result.push([\n objectToFloat32Array(data[i], this.inputLookup, this.inputLookupLength),\n ]);\n }\n return result;\n }", "title": "" }, { "docid": "d832e7a8c4b22009fa8dd79c417408fd", "score": "0.4956177", "text": "function octetsToFloat32( octets ) {\n var buffer = new ArrayBuffer(4);\n new Uint8Array( buffer ).set( octets );\n return new DataView( buffer ).getFloat32(0, false);\n}", "title": "" }, { "docid": "cc19773c943167dfb28b2723e5df73c8", "score": "0.49512583", "text": "function generate_mesh(data, verts, inds) {\n\tlet off = verts.length, n = data.length, m = data[0].length;\n\t// Just the vertices\n\tfor (let i = 0; i < n; i++) {\n\t\tfor (let j = 0; j < m; j++) {\n\t\t\tverts.push(vec4(2*i/(n-1)-1, data[i][j], 2*j/(m-1)-1, 1.0));\n\t\t}\n\t}\n\t// Rectangles\n\tfor (let i = 0; i < n-1; i++) {\n\t\tfor (let j = 0; j < m; j++) {\n\t\t\tinds.push(off+i*m+j);\n\t\t\tinds.push(off+(i+1)*m+j);\n\t\t}\n\t\tinds.push(off+(i+2)*m-1);\n\t\tinds.push(off+(i+1)*m);\n\t}\n}", "title": "" } ]
78c362452bacb43ed087bab3080ae006
Return a css property mapped to a potentially vendor prefixed property
[ { "docid": "1a4c1f2c9d5fb8126d2fa139c1bf1330", "score": "0.0", "text": "function vendorPropName( name ) {\n\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "46bb006245aa08935352186631c860ae", "score": "0.81193846", "text": "function vendorPropName(name){// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "46bb006245aa08935352186631c860ae", "score": "0.81193846", "text": "function vendorPropName(name){// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.81005985", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "8eb144a649adfeb2286a4eb40ab576f3", "score": "0.81005985", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}// Return a property mapped along what jQuery.cssProps suggests or to", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.78016007", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.78016007", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "f3d4562c1d34858d64c86b738e60949b", "score": "0.78016007", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "0e5e007bab193dec7f8b67a70d22f765", "score": "0.7792374", "text": "function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property", "title": "" }, { "docid": "05c955f505ba074795579453ec9833d9", "score": "0.7738331", "text": "function vendorPropName(name){ // Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;} // Check for vendor prefixed names\nvar capName=name[0].toUpperCase() + name.slice(1),i=cssPrefixes.length;while(i--) {name = cssPrefixes[i] + capName;if(name in emptyStyle){return name;}}}", "title": "" }, { "docid": "702f084f7b8db0f1c59f73ff7b9720b8", "score": "0.76077086", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\r\n\tif(name in emptyStyle){return name;}// Check for vendor prefixed names\r\n\tvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "title": "" }, { "docid": "65ec86e750a3565295d274ee9c3a17b5", "score": "0.7600333", "text": "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\n\tif(name in emptyStyle){return name;}// Check for vendor prefixed names\n\tvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "title": "" }, { "docid": "adccfd5d73c5315c238f330345e99697", "score": "0.75352526", "text": "function vendorPropName(style,name){ // shortcut for names that are not vendor prefixed\nif(name in style){return name;} // check for vendor prefixed names\nvar capName=name.charAt(0).toUpperCase() + name.slice(1),origName=name,i=cssPrefixes.length;while(i--) {name = cssPrefixes[i] + capName;if(name in style){return name;}}return origName;}", "title": "" }, { "docid": "eb3176f1554fed82fcc2bcd8da5957bc", "score": "0.74653137", "text": "function vendorPropName( name ) {\n\n // Shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n}", "title": "" }, { "docid": "f88ab94e7d4850c18187110991de1f53", "score": "0.7429414", "text": "function vendorPropName(style,name){ // Shortcut for names that are not vendor prefixed\n\tif(name in style){return name;} // Check for vendor prefixed names\n\tvar capName=name[0].toUpperCase() + name.slice(1),origName=name,i=cssPrefixes.length;while(i--) {name = cssPrefixes[i] + capName;if(name in style){return name;}}return origName;}", "title": "" }, { "docid": "3dc74f9c82d01a933b9eae7a9bf2b02e", "score": "0.7407577", "text": "function vendorPropName(name) {\n // Shortcut for names that are not vendor prefixed\n if (name in emptyStyle) {\n return name;\n }\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1), i = cssPrefixes.length;\n while (i--) {\n name = cssPrefixes[i] + capName;\n if (name in emptyStyle) {\n return name;\n }\n }\n}", "title": "" }, { "docid": "394dd351a66c9766bf9b98ecedadd764", "score": "0.7406668", "text": "function vendorPropName(style,name){ // Shortcut for names that are not vendor prefixed\n\tif(name in style){return name;} // Check for vendor prefixed names\n\tvar capName=name[0].toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in style){return name;}}return origName;}", "title": "" }, { "docid": "7bb84d6927309bfd324462c540fe6a01", "score": "0.73951685", "text": "function vendorPropName( name ) {\n\n // Shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "1296001228cf522c45a643b5a1be6ad6", "score": "0.7394964", "text": "function vendorPropName( name ) {\n\n // Shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "3aa20c40abce51b13419befff4873bb6", "score": "0.7377006", "text": "function vendorPropName(name) {\n // Shortcut for names that are not vendor prefixed\n if (name in emptyStyle) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n if (name in emptyStyle) {\n return name;\n }\n }\n }", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e46283fe696c0e0958d0701487ea4283", "score": "0.7376416", "text": "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "00c30bfbba4bdf716bd0aca5f872126d", "score": "0.73286325", "text": "function vendorPropName( name ) {\n\t\n\t\t// shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// check for vendor prefixed names\n\t\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a22e34846e811e01ee0afae3c01ef562", "score": "0.73255706", "text": "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "title": "" } ]
f748b5400028099f3d1f3ca63fddaecb
Generate a simple progress bar
[ { "docid": "8759ff67fb7a876ceffd3ce6aa97eb11", "score": "0.0", "text": "_bar(value, total) {\n\n const percent = Math.min(value / total, 1);\n const width = 25;\n const n_filled = Math.floor(width * percent);\n const n_blank = width - n_filled;\n const filled = chalk.cyan(figures.hamburger.repeat(n_filled));\n const blank = ' '.repeat(n_blank);\n\n return `|${filled}${blank}| ${Math.round(percent * 100)}%`;\n\n }", "title": "" } ]
[ { "docid": "f40cbcf22e0d16a7ef45acd18bb2d0a9", "score": "0.80290765", "text": "function drawProgressBar() {\n // Draw a growing rectangle, from left to right\n noStroke();\n fill('blue');\n rect( hMargin, vMargin + progBarHeight, progBarWidth*simpleTimer.getPercentageElapsed(), progBarHeight );\n \n // draw an outline on top of the rect\n noFill();\n stroke(50);\n strokeWeight(1);\n rect( hMargin, vMargin + progBarHeight, progBarWidth, progBarHeight );\n\n noStroke();\n}", "title": "" }, { "docid": "a92a11407e4719890137010002d05000", "score": "0.7738321", "text": "function progBar(totalTime) {\n const bar1 = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);\n bar1.start(100, 0);\n var i;\n for (i=0;i<totalTime;i=i+10) {\n bar1.update(i);\n sleep.sleep(totalTime/10);\n }\n bar1.stop();\n}", "title": "" }, { "docid": "e1a811a25f9f197401994fa846cc34d0", "score": "0.7434228", "text": "function createProgressIndicator() {\n let currentProgress = 0;\n\n process.stdout.write(\"game in progress: \");\n\n return function updateProgress(percentage) {\n const maxLength = Math.round(percentage / 2);\n if (maxLength !== currentProgress) {\n process.stdout.cursorTo(17 + maxLength);\n process.stdout.write(\"#\");\n currentProgress = maxLength;\n\n if (currentProgress === 50) {\n process.stdout.write(\"\\n\");\n }\n }\n };\n}", "title": "" }, { "docid": "a57ba62cf33c06d206d8d87154e84e89", "score": "0.7413118", "text": "function progressBar(percent) {\n console.log(percent * 100);\n}", "title": "" }, { "docid": "6d1c49737be79d65d9b0156ba675eae7", "score": "0.7379647", "text": "function display_progress() {\n if ( typeof display_progress.counter == 'undefined' ) {\n display_progress.counter = 0;\n }\n display_progress.counter++;\n process.stdout.write(\" working\"\n + function(){\n var ellipsis = \"\";\n for (var i = 0; i < display_progress.counter % 4; i++) {\n ellipsis += \".\";\n }\n return ellipsis;\n }()\n + \" \" // add spaces to clear previous periods\n + \"\\r\"); // add return carriage to move cursor to the beginning of the line\n}", "title": "" }, { "docid": "3d4c6a9b9bb19b9a2a36703844c9ae5c", "score": "0.72644424", "text": "function updateProgressIndicator(progress) {\n\t// Update/animate progress bar\n\t$('#generator-progress-value').animate({value: progress});\n\t// Update/animate number display(s)\n\t$('.generator-progress-value-print').each(function(index, element) {\n\t\t$({countNum: $(element).text()}).animate({countNum: Math.floor(progress * 100)}, {\n\t\t\tduration: 800,\n\t\t\teasing:'linear',\n\t\t\tstep: function() {\n\t\t\t\t$(element).text(Math.floor(this.countNum));\n\t\t\t},\n\t\t\tcomplete: function() {\n\t\t\t\t$(element).text(this.countNum);\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "a7137127ccb5d49d372d026ea518257c", "score": "0.7227768", "text": "function progressBar(elem){\n\t $elem = elem;\n\t //build progress bar elements\n\t buildProgressBar();\n\t //start counting\n\t start();\n\t }", "title": "" }, { "docid": "59ebd92a610b3ff2dc5161db0e2f5361", "score": "0.7226208", "text": "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "title": "" }, { "docid": "59ebd92a610b3ff2dc5161db0e2f5361", "score": "0.7226208", "text": "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "title": "" }, { "docid": "c86fca968b1157cee14afea58d8b1afa", "score": "0.7215824", "text": "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "title": "" }, { "docid": "0140ada7621ecaebe2c29269318605c9", "score": "0.720113", "text": "function buildProgressBar() {\n $progressBar = $(\"<div>\", {\n id: \"progressBar\"\n });\n $bar = $(\"<div>\", {\n id: \"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "title": "" }, { "docid": "10de6acd505b43787869a51afb805b55", "score": "0.7190035", "text": "function progressBar(elem) {\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "title": "" }, { "docid": "c71ee4b318bffe0b1b38c2b0b7c5e237", "score": "0.7181715", "text": "function runProgressBar() {\n intervalId = setInterval(function() {\n counter += 1;\n updateProgressBar();\n }, 1000);\n}", "title": "" }, { "docid": "0e44ac80e28a5efebfa2cc1b13b8aeeb", "score": "0.71671736", "text": "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "title": "" }, { "docid": "cc854abe4e602c1a4c2e29e1f2b3c3dd", "score": "0.7163268", "text": "function progress_bar() {\r\n\t\tif ($g('send_units_form') || $g('units')) {\r\n\t\t\tif ($g('progressbar')) {\r\n\t\t\t\tvar style_bgred = \"background: url(\"+ pImage['pbar_bgII'] +\") repeat-x scroll 0 0 transparent; height: 25px; margin: 0 auto; width: 466px;\";\r\n\t\t\t\tvar style_norm = \"background: url(http://static.grepolis.com/images/game/towninfo/progressbar_bg.png) repeat-x scroll 0 0 transparent; height: 25px; margin: 0 auto; width: 466px;\";\r\n\t\t\t\tif ($g(\"capacity_current\") != null) {\r\n\t\t\t\t\tvar ca = parseInt($g('capacity_current').firstChild.nodeValue, 10);\r\n\t\t\t\t\tvar cm = parseInt($g('capacity_max').firstChild.nodeValue, 10);\r\n\t\t\t\t\tif ((ca > cm) && (cm > 0)) {\r\n\t\t\t\t\t\tif (pr_bar == 0) {\r\n\t\t\t\t\t\t\tGM_addStyle (\" #progressbar { \"+ style_bgred +\"}\" );\r\n\t\t\t\t\t\t\tpr_bar = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (pr_bar == 1) {\r\n\t\t\t\t\t\t\tGM_addStyle (\" #progressbar { \"+ style_norm +\" }\" );\r\n\t\t\t\t\t\t\tpr_bar = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7d923a20506dc1dd41c63d4982494265", "score": "0.71595407", "text": "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "title": "" }, { "docid": "d22d24bd5c8b45ca43a8e2f0539816bb", "score": "0.7137443", "text": "function progressBar(elem) {\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n}", "title": "" }, { "docid": "dcbe215972b4001c6d75b18728a86581", "score": "0.71294427", "text": "function Progress () {\n this.percent = 0;\n this.size(0);\n this.fontSize(11);\n this.font('helvetica, arial, sans-serif');\n}", "title": "" }, { "docid": "f6cbf4d7a31d0295744404d171683eff", "score": "0.7129202", "text": "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "title": "" }, { "docid": "f6cbf4d7a31d0295744404d171683eff", "score": "0.7129202", "text": "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "title": "" }, { "docid": "8afdf8297ada983a16098bba97962438", "score": "0.71276623", "text": "function buildProgressBar() {\r\n $progressBar = $(\"<div>\", {\r\n id: \"progressBar\"\r\n });\r\n $bar = $(\"<div>\", {\r\n id: \"bar\"\r\n });\r\n $progressBar.append($bar).prependTo($elem);\r\n }", "title": "" }, { "docid": "8c46122cc30e9d5f2bf8e28580dfe313", "score": "0.7111686", "text": "function progressBar(elem) {\r\n $elem = elem;\r\n //build progress bar elements\r\n buildProgressBar();\r\n //start counting\r\n start();\r\n }", "title": "" }, { "docid": "7717192116f37b8f1bd06b5ba2de3ea9", "score": "0.7098701", "text": "function progressBar(elem) {\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "title": "" }, { "docid": "66f258bf1939372c2d5952631648aba1", "score": "0.70954245", "text": "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "title": "" }, { "docid": "142cb82ff50158936365ade0ab4a777d", "score": "0.7088475", "text": "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "title": "" }, { "docid": "e66ed9846cff650ddf8917d0f8f95a0b", "score": "0.7084804", "text": "function loading_bar(progress)\n{\n\trectfill(canvas,5,SCREEN_H-55,SCREEN_W-10,50,makecol(0,0,0));\n\trectfill(canvas,10,SCREEN_H-50,SCREEN_W-20,40,makecol(255,255,255));\n\trectfill(canvas,15,SCREEN_H-45,SCREEN_W-30,30,makecol(0,0,0));\n\trectfill(canvas,20,SCREEN_H-40,scaleclamp(progress,0,1,0,(SCREEN_W-40)),20,makecol(255,255,255));\n}", "title": "" }, { "docid": "25b3bf34fac5f4f7bb5faa5771d64203", "score": "0.7083693", "text": "function buildProgressBar(){\n $progressBar = jQuery(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = jQuery(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "title": "" }, { "docid": "eac26160b5602ac46ea717c251021af5", "score": "0.7072285", "text": "function Progress() {\n this.percent = 0;\n this.size(0);\n this.fontSize(11);\n this.font('helvetica, arial, sans-serif');\n}", "title": "" }, { "docid": "eac26160b5602ac46ea717c251021af5", "score": "0.7072285", "text": "function Progress() {\n this.percent = 0;\n this.size(0);\n this.fontSize(11);\n this.font('helvetica, arial, sans-serif');\n}", "title": "" }, { "docid": "eac26160b5602ac46ea717c251021af5", "score": "0.7072285", "text": "function Progress() {\n this.percent = 0;\n this.size(0);\n this.fontSize(11);\n this.font('helvetica, arial, sans-serif');\n}", "title": "" }, { "docid": "eac26160b5602ac46ea717c251021af5", "score": "0.7072285", "text": "function Progress() {\n this.percent = 0;\n this.size(0);\n this.fontSize(11);\n this.font('helvetica, arial, sans-serif');\n}", "title": "" }, { "docid": "a7c38b11e91f292017fd11baa2976458", "score": "0.70691377", "text": "function buildProgressBar() {\r\n\t\t$progressBar = $(\"<div>\", {\r\n\t\t\tid : \"progressBar\"\r\n\t\t});\r\n\t\t$bar = $(\"<div>\", {\r\n\t\t\tid : \"bar\"\r\n\t\t});\r\n\t\t$progressBar.append($bar).prependTo($elem);\r\n\t}", "title": "" }, { "docid": "668019559288114c1e0c37e2ca20522e", "score": "0.7068182", "text": "function progressBar(elem){\n\t\t$elem = elem;\n\t\t//build progress bar elements\n\t\tbuildProgressBar();\n\t\t//start counting\n\t\tstart();\n\t}", "title": "" }, { "docid": "f75fbc46c8c45f61f85d729c34f1ab5d", "score": "0.7065838", "text": "function buildProgressBar() {\n $progressBar = $(\"<div>\", {\n id: \"progressBar\"\n });\n $bar = $(\"<div>\", {\n id: \"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n}", "title": "" }, { "docid": "449886d8fad2d666f33cb3f9c4afa904", "score": "0.7063346", "text": "function progbar() {\n var green = (JSON.parse(hikeDist) / JSON.parse(totalDist)) * 101\n var blue = (JSON.parse(swimDist) / JSON.parse(totalDist)) * 101\n var yellow = (JSON.parse(bikeDist) / JSON.parse(totalDist)) * 101\n var red = (JSON.parse(runDist) / JSON.parse(totalDist)) * 101\n hbar.style = `width: ${green}%`\n sbar.style = `width: ${blue}%`\n bbar.style = `width: ${yellow}%`\n rbar.style = `width: ${red}%`\n }", "title": "" }, { "docid": "d93af86652a18517318b6a1e96810b74", "score": "0.70590955", "text": "function determinate(){\n $progressBarContainer.append($(render_template(DeterminateProgressBarTemplate)));\n \n progressBar = new ProgressBar.Line( $progressBarContainer.find('.progressBar')[0], {\n color: defaultColor,\n trailColor: trailColor,\n text: {\n value: '0%',\n className: 'progressBarPercentageLabel',\n autoStyle: false\n }\n });\n }", "title": "" }, { "docid": "eb8840d9f5f11feb16be2a5989588f44", "score": "0.7051963", "text": "function buildProgressBar() {\n $progressBar = jQuery(\"<div>\", {\n id: \"progressBar\"\n });\n $bar = jQuery(\"<div>\", {\n id: \"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "title": "" }, { "docid": "864bccde96671e4df8a551240dcc0d02", "score": "0.7051219", "text": "function createProgressElement(time){\n var progress = document.createElement('div');\n progress.className = \"ui indicating small progress myProgress\";\n progress.id = \"myProgress\";\n progress.setAttribute(\"data-value\", 0);\n progress.setAttribute(\"data-total\",time);\n var div = document.createElement('div');\n div.className = \"bar\";\n var div2 = document.createElement('div');\n div2.className = \"progress\";\n progress.appendChild(div);\n div.appendChild(div2);\n return progress;\n}", "title": "" }, { "docid": "e194e025b7dbc028415a034ea614b210", "score": "0.70489174", "text": "function Progress() {\n this.element = newElement('span', 'progress')\n this.updatePoints = (points) => {\n this.element.innerHTML = points\n }\n\n this.updatePoints(0)\n}", "title": "" }, { "docid": "7b1df6a67453f8c4a5b71280aab0e89e", "score": "0.7030686", "text": "function Progress() {\r\n this.percent = 0;\r\n this.size(0);\r\n this.fontSize(11);\r\n this.font('helvetica, arial, sans-serif');\r\n}", "title": "" }, { "docid": "4e73323c755166ae8c86fd69559727f1", "score": "0.70229894", "text": "function progressBar(){\n for(var qIndex = 0; qIndex <= lastQuestion; qIndex++){\n progress.innerHTML += \"<div class='prog' id=\"+ qIndex +\"></div>\";\n }\n}", "title": "" }, { "docid": "c2611fb652131263d89719c4bbf817b9", "score": "0.7006138", "text": "function buildProgressBar(){\n\t $progressBar = $(\"<div>\",{\n\t id:\"progressBar\"\n\t });\n\t $bar = $(\"<div>\",{\n\t id:\"bar\"\n\t });\n\t $progressBar.append($bar).appendTo($elem);\n\t }", "title": "" }, { "docid": "dfee348b4121b5b65d0df10554fc7ecc", "score": "0.69895196", "text": "function progressBar(){\r\n\t\tthis.indexes=[];\r\n\t\tthis.names=[];\r\n\t\tthis.sum=0;\r\n\r\n\t\tthis.addItem = function(name, progressLength){\r\n\t\t\tvar previousName=this.names[this.names.length-1];\r\n\r\n\t\t\t//if the process being added is the same as the current one, combine them\r\n\t\t\tif(this.names.length>0 && previousName==name)\r\n\t\t\t{\r\n\t\t\t\tthis.indexes[this.indexes.length-1] += progressLength;\r\n\t\t\t\tthis.sum += progressLength;\r\n\t\t\t\tposition+=progressLength;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(previousName!=\"idle\" && previousName!=\"context switch\" && name!= \"idle\" && position!=0 && contexSwitch >0\r\n\t\t\t\t||name==\"idle\" && progressLength<=contexSwitch && position!=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.indexes[this.indexes.length]=contexSwitch;\r\n\t\t\t\t\tthis.names[this.names.length]=\"context switch\";\r\n\t\t\t\t\tthis.sum += contexSwitch;\r\n\t\t\t\t\tposition+=contexSwitch;\r\n\t\t\t\t\tposition=parseFloat(position.toPrecision(12));\r\n\t\t\t\t}\r\n\t\t\t\tif( (name==\"idle\" && progressLength<=contexSwitch && position!=0 ) ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.indexes[this.indexes.length]=progressLength;\r\n\t\t\t\t\tthis.names[this.names.length]=name;\r\n\t\t\t\t\tthis.sum += progressLength;\r\n\t\t\t\t\tposition+=progressLength;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tposition=parseFloat(position.toPrecision(12));\r\n\t\t\tthis.sum=parseFloat(this.sum.toPrecision(12));\r\n\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\r\n\t\tthis.displayBar = function(){\r\n\t\t\t\r\n\r\n\t\t\tvar pos=0;\r\n\r\n\t\t\tfor(var i=0; i<this.indexes.length;i++)\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"name:\"+this.names[i]+\" index:\"+this.indexes[i]);\r\n\t\t\t\tvar length= (this.indexes[i]/this.sum)*100;\r\n\t\t\t\taddToBar(this.names[i],length, pos ,this.indexes[i], i);\r\n\t\t\t\tpos+=this.indexes[i];\r\n\t\t\t\tpos=parseFloat(pos.toPrecision(12));\r\n\t\t\t}\r\n\r\n\t\t\tcreateRuler(this.sum);\r\n\r\n\t\t\tconsole.log(\"sum:\"+this.sum+\" \"+runningTime);\r\n\r\n\t\t\tvar utilization= 100- ( ( (this.sum- runningTime)/this.sum )*100 ) ;\r\n\t\t\tutilization= Math.round(utilization*100)/100 ;\r\n\r\n\t\t\tsortNames();\r\n\r\n\t\t\tvar waitTimes=[];\r\n\r\n\t\t\twaitTimes[0]=processArray[0].finishTime - processArray[0].arrivalTime - processArray[0].initialBurst;\r\n\t\t\twaitTimes[0]= parseFloat(waitTimes[0].toPrecision(12));\r\n\t\t\tvar fullExplanation='';\r\n\r\n\t\t\tfullExplanation+= '<p class=\"lead\"> CPU utilization: $ '+utilization+'\\\\% $'+\r\n\t\t\t\t'<br><br>Average Wait Time: <span style=\"font-size:24px\">$ \\\\frac{'+waitTimes[0];\r\n\r\n\t\t\t\tvar waitSum=waitTimes[0];\r\n\r\n\t\t\tfor (var i =1; i< processArray.length; i++) {\r\n\t\t\t\twaitTimes[i]= processArray[i].finishTime - processArray[i].arrivalTime - processArray[i].initialBurst;\r\n\t\t\t\twaitTimes[i]= parseFloat(waitTimes[i].toPrecision(12));\r\n\r\n\t\t\t\tfullExplanation+= '+'+waitTimes[i];\r\n\t\t\t\twaitSum+= waitTimes[i];\r\n\t\t\t}\r\n\r\n\t\t\tvar averageWait= waitSum/processArray.length;\r\n\t\t\taverageWait= Math.round(averageWait*10000)/10000 ;\r\n\r\n\t\t\tfullExplanation+= '}{'+processArray.length+'} $</span> $ = '+averageWait+' $';\r\n\r\n\t\t\t//set the equation text\r\n\t\t\t$(\"#explanation-equation\").html(fullExplanation);\r\n\t\r\n\r\n\t\t\t//updates equation\r\n\t\t\tPreview.Update();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "ae318b23d24bdcb4677641ec12d91388", "score": "0.6984027", "text": "function ProgressBar(fraction, size_arg = new ImVec2(-1, 0), overlay = null) {\n bind.ProgressBar(fraction, size_arg, overlay);\n}", "title": "" }, { "docid": "02b5715cf2b9cbbe415f7d671d834545", "score": "0.6978221", "text": "function progressBar(elem) {\r\n\t\t$elem = elem;\r\n\t\t//build progress bar elements\r\n\t\tbuildProgressBar();\r\n\t\t//start counting\r\n\t\tstart();\r\n\t}", "title": "" }, { "docid": "92c51efdaa4dbfe3ab75f66379655136", "score": "0.69625205", "text": "setupProgressBar() {\n this.progressBar = new goog.ui.ProgressBar();\n this.progressBar.setOrientation(goog.ui.ProgressBar.Orientation.HORIZONTAL);\n this.progressBar.render(goog.dom.getElement('progress'));\n\n this.listeners_.add(\n chrome.imageWriterPrivate.onWriteProgress,\n goog.bind(this.onProgress, this));\n }", "title": "" }, { "docid": "f3ff0a1970af876966480ee66d39c51e", "score": "0.6946173", "text": "function renderProgress() {\n for (let qIndex = 0; qIndex <= lastQuestion; qIndex++) {\n progress.innerHTML += \"<div class='prog' id=\" + qIndex + \"></div>\";\n }\n }", "title": "" }, { "docid": "0656c60f4a5e9f299017529738cc1d91", "score": "0.6939811", "text": "function buildProgressBar(){\n\t\t$progressBar = $(\"<div>\",{\n\t\t\tid:\"progressBar\"\n\t\t});\n\t\t$bar = $(\"<div>\",{\n\t\t\tid:\"bar\"\n\t\t});\n\t\t$progressBar.append($bar).prependTo($elem);\n\t}", "title": "" }, { "docid": "d20257415cac11d04cbfe2a36ce3588d", "score": "0.69397676", "text": "function doProgressBar(percent) {\n $progressBar.css('width', percent +'%');\n}", "title": "" }, { "docid": "385d41d177660f8559089a9fee3e06fa", "score": "0.6934673", "text": "function createBar (rm) {\n // create progress element\n var el = document.createElement('div'),\n width = 0,\n here = 0,\n on = 0,\n bar = {\n el: el,\n go: go\n }\n\n addClass(el, 'bar')\n\n // animation loop\n function move () {\n var dist = width - here\n\n if (dist < 0.1 && dist > -0.1) {\n place(here)\n on = 0\n if (width >= 100) {\n el.style.height = 0\n setTimeout(function () {\n rm(el)\n }, 300)\n }\n } else {\n place(width - dist / 4)\n setTimeout(go, 16)\n }\n }\n\n // set bar width\n function place (num) {\n width = num\n el.style.width = width + '%'\n }\n\n function go (num) {\n if (num >= 0) {\n here = num\n if (!on) {\n on = 1\n move()\n }\n } else if (on) {\n move()\n }\n }\n return bar\n }", "title": "" }, { "docid": "15adc92b1976c70e2134c15b49070fa8", "score": "0.6930001", "text": "updateProgressBar() {\n // get percentage of questions left\n const percentage =\n ((game.questionNumber + 1) / game.questions.length) * 100;\n //set progress bar width with percentage\n this.progress.style.width = `${percentage}%`;\n // set progress bar text with current question number and total question number\n this.progressText.textContent = `Question ${game.questionNumber + 1} / ${\n game.questionAmount\n }`;\n }", "title": "" }, { "docid": "abdf8da0505233b33e0cafe3fb33cc7b", "score": "0.69220865", "text": "function progress(value, total, progressBar) { \n var percentageComplete = Math.round((value / total) * 100); \n progressBar.style.width = percentageComplete + \"%\"; \n}", "title": "" }, { "docid": "e2012fb5824e710a8f58d2ab06eefa52", "score": "0.6902534", "text": "function drawUI (count) {\n var $progress = $(\"<div class='module'></div>\");\n\n $container.append(\"<h1 class='module'>Link Checker</h1>\");\n $progress.append(\"<div class='progress-bar'><div class='progress' style='width:0'></div></div>\");\n $progress.append(\"<span class='complete'>0</span>\");\n $progress.append(\"<span class='total'>\" + count + \"</span>\");\n\n $container.append($progress);\n $container.appendTo(\"body\");\n }", "title": "" }, { "docid": "3d495eb498a2d1234da6bc03c76f6cc7", "score": "0.6900679", "text": "function progRess() {\r\n /* required bootstrap-progressbar.min.js*/\r\n \r\n $('.progress .bar.text-no').progressbar();\r\n $('.progress .bar.text-filled').progressbar({\r\n display_text: 1\r\n });\r\n $('.progress .bar.text-centered').progressbar({\r\n display_text: 2\r\n });\r\n}", "title": "" }, { "docid": "fbf6d0688c05a3bcafbd9d4802639efb", "score": "0.68949133", "text": "function update_progress(num, num_trials) {\n debug(\"update progress\");\n var width = 2 + 98 * (num / (num_trials - 1.0));\n $(\"#indicator-stage\").css({\"width\": width + \"%\"});\n $(\"#progress-text\").html(\"Progress \" + (num + 1) + \"/\" + num_trials);\n}", "title": "" }, { "docid": "5362366eb5101097310ad459c1def340", "score": "0.6893442", "text": "function progressBarSim(al) {\n var bar = document.getElementById('progressBar');\n var status = document.getElementById('status');\n status.innerHTML = al + \"%\";\n bar.value = al;\n al++;\n var sim = setTimeout(\"progressBarSim(\" + al + \")\", 100);\n if (al == 100) {\n status.innerHTML = \"98%\";\n bar.value = 98;\n clearTimeout(sim);\n }\n}", "title": "" }, { "docid": "dc7ea37a794bc98c6e8fd17858024295", "score": "0.68882537", "text": "function ProgressBar() {\n return (\n <div style={{\n position: 'relative',\n bottom: 0, left: '0', right: '0',\n height: '0.5em',\n width: '100%',\n background: '#00B791'\n }}/>\n )\n}", "title": "" }, { "docid": "6230200a88d0360234f5991c1a82821b", "score": "0.68852556", "text": "progressbar(bar){\r\n \t\tvar progress = 0;\r\n \t this.xhr.upload.onprogress = (e) => {\r\n\r\n \t \tvar done = e.position || e.loaded, total = e.totalSize || e.total;\r\n \t\t\t progress =(Math.floor(done / total * 1000) / 10 );\r\n \t\t\t bar.style.display = 'block';\r\n \t\t\t bar.style.height = '5px';\r\n \t\t\t bar.style.width = `${progress}%`;\r\n \t\t\t if(progress == 100){\r\n \t\t\t \tselect('.progress').style.height = 'none';\r\n \t\t\t }\r\n \t\t\t console.log(progress);\r\n\r\n \t\t\t /* Show Toast When Done */\r\n \t } // End Of Arrow Function\r\n\r\n \t}", "title": "" }, { "docid": "7da433863aca77bcea587263bb7bc8c2", "score": "0.68607473", "text": "function updateProgress(barIncrease) {\n\n var pBar = document.getElementById('pBar');\n pBar.style.width = barIncrease;\n //pBar.getElementsByTagName('span')[0].innerHTML = barIncrease;\n\n}", "title": "" }, { "docid": "3c4253fc58fbc3de48f52eac795d001d", "score": "0.68548965", "text": "function drawPercentBar(width, percent, color, background) \n { \n var pixels = width * (percent / 100); \n if (!background) { background = \"none\"; }\n \n document.write(\"<div style=\\\"position: relative; line-height: 1em; background-color: \" \n\n + background + \"; border: 1px solid #D2B48C; width: \" \n + width + \"px\\\">\"); \n document.write(\"<div style=\\\"height: 1.5em; width: \" + pixels + \"px; background-color: \"\n + color + \";\\\"></div>\"); \n document.write(\"<div style=\\\"position: absolute; text-align: center; padding-top: .25em; width: \" \n + width + \"px; top: 0; left: 0\\\">\" + percent + \"%</div>\"); \n\n document.write(\"</div>\"); \n }", "title": "" }, { "docid": "8cc235d0c4cf96fad90d6f4bc0fee9d3", "score": "0.68538165", "text": "function evGetProgressBar(percentFill)\r\n{\r\n var content = \"\";\r\n \r\n if (percentFill >= 80) {\r\n content += '<div class=\"progress progress-striped\">\\\r\n <div class=\"progress-bar progress-bar-success\" role=\"progressbar\" aria-valuenow=\"100\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 100%\">\\\r\n <span class=\"sr-only\">100% Complete</span>\\\r\n </div>\\\r\n </div>';\r\n }\r\n else {\r\n /* Empty bargraph doesn't look good :( */\r\n if (percentFill < 3) {\r\n percentFill = 3;\r\n }\r\n \r\n content += '<div class=\"progress progress-striped active\">\\\r\n <div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"' + percentFill + '\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: ' + percentFill + '%\">\\\r\n <span class=\"sr-only\">' + percentFill + '% Complete</span>\\\r\n </div>\\\r\n </div>';\r\n }\r\n\r\n return content;\r\n}", "title": "" }, { "docid": "3bb77ea9bd1c60d9279dcd508cb876af", "score": "0.68458474", "text": "progressBar(t, total) {\n const computedWidth = t * 1000 / (total * 1000) * 100 + '%';\n return d3\n .select('#progress')\n .transition()\n .duration(100)\n .at({\n width: computedWidth,\n height: 50,\n });\n }", "title": "" }, { "docid": "ec605c91b206e916f92ac291999a7c2d", "score": "0.6830095", "text": "function Progress() {\n\t this.percent = 0;\n\t this.size(0);\n\t this.fontSize(11);\n\t this.font('helvetica, arial, sans-serif');\n\t}", "title": "" }, { "docid": "5872661bd8b19a61f88a0356b1d31216", "score": "0.6813564", "text": "function progress() {\n var val = jQuery(\"#progressbar\").progressbar(\"value\") || 0;\n jQuery(\"#progressbar\").progressbar(\"value\", val + 1);\n if (val < progress_bar_percent) {\n setTimeout(progress, 20);\n }\n }", "title": "" }, { "docid": "fb09f02c4935045b1e43b18f8e2b33d6", "score": "0.6813316", "text": "function showProgress(percent) {\n progressbar.attr('aria-valuenow', percent);\n progressbar.css('width', percent + '%');\n progressbar.text(percent + '%')\n}", "title": "" }, { "docid": "593e76520349451c1bd6338f393d4169", "score": "0.6812146", "text": "function changeProgress(numComplete)\n{\n\tvar percent = (numComplete/20)*100;\n\t$(\"#pbar\").attr(\"aria-valuenow\", percent);\n\t$(\"#pbar\").attr(\"style\", \"width:\" + percent + \"%\");\n}", "title": "" }, { "docid": "e3740741db08c57289705dd9e2642a54", "score": "0.6808052", "text": "function updateProgressBar(percentage){\n \n $(\"#next-lvl-bar\").attr(\"aria-valuenow\", percentage+\" \").attr(\"style\", \"width:\"+percentage+\"%\");\n $(\"#next-lvl-bar span\").text(percentage + \"% Complete\");\n}", "title": "" }, { "docid": "e2f5a5777708b272253a537ef39a70f5", "score": "0.68069845", "text": "function updateProgressSecond() {\n var dot = '.';\n document.getElementById(\"progress_text\").innerText = \"Generating the city \" + dot.repeat(progressCounter + 1);\n progressCounter++;\n progressCounter = progressCounter % 10;\n}", "title": "" }, { "docid": "edbb4d16d051544a652f013552335b6e", "score": "0.6802171", "text": "function increase(val){ \n\t \tvar progress = document.getElementById(progressId);\n\t \tvalue = value+val;\n\t \tif(value <= 0) value = 0;\n\t \tif(value > limit){\n\t \t\tprogress.removeAttribute('progress-bar');\n\t \t\tprogress.setAttribute('class','warning-progress-bar')\n\t \t}else{\n\t \t\tprogress.setAttribute('class','progress-bar')\n\t \t}\n\t \tprogress.value = value;\n\t \tprogress.innerText=value+\"%\";\t\t \n\t \tprogress.style.width = value + \"%\";\n\t }", "title": "" }, { "docid": "d86ccca89b87a49b8d6bc50be3cab0f1", "score": "0.67993754", "text": "function timedProg() {\n if (i <= 300) {\n if (i > 40) {\n document.getElementById(\"container_bar\").innerHTML=parseInt(i/3)+\"%\";\n }\n document.getElementById(\"b\").style.width=i+\"px\";\n var j=0; \n while (j<=100)\n j++; \n setTimeout(\"timedProg();\", 20);\n i++; \n }\n }", "title": "" }, { "docid": "e76fdc317c25deb9c50cf90d18d9a316", "score": "0.6798775", "text": "function simulateProgress(){\n var i;\n for(i = 0; i < 100; i++){\n sleep(100);\n updateProgress(i);\n }\n sleep(2000);\n updateProgress(0);\n}", "title": "" }, { "docid": "0264da8546a6a21490fc581ea331f801", "score": "0.67957604", "text": "function renderProgressBar() {\n\tif (width >= 100) {\n\t\tclearInterval(renderInterval)\n\t\tdownloading = false\n\n\t\tnew Notification('Update Complete', {\n\t\t\tbody: 'Client is now up-to-date.'\n\t\t})\n\t\treturn\n\t}\n\n\tif (progress > width) {\n\t\twidth = round(lerp(width, progress, progress / 100), 2)\n\t\telements.launchBarProgress.style.width = width + '%'\n\t}\n\n\telements.launchButton.textContent = progress + '%'\n}", "title": "" }, { "docid": "a22a23e0b9472737f3d6aed3ef424e28", "score": "0.6778995", "text": "function progresBar(){\n var progressBar=document.getElementById(\"progress\");\n progressBar.setAttribute(\"style\",`width:${zbirTacnih}%`);\n progressBar.setAttribute(\"aria-valuenow\",`${zbirTacnih}`);\n}", "title": "" }, { "docid": "403075238541ae6777bcc6db70768111", "score": "0.67760295", "text": "function createProgress(id, parent, label, color, templateId='progress_bar_template'){\n\n // Clone progress bar from existing template with all children and event handlers\n var div = document.getElementById(templateId),\n clone = div.cloneNode(true);\n clone.id = id;\n clone.children[0].className += ` ${color}`; // Set progress color\n\n // Add label\n var p = document.createElement('P');\n p.innerText = label;\n p.style.textAlign = 'center';\n\n // Append to parent on DOM\n var containerDiv = document.createElement('DIV');\n containerDiv.style.width = '20%';\n containerDiv.appendChild(clone);\n containerDiv.appendChild(p);\n document.getElementById(parent).appendChild(containerDiv);\n }", "title": "" }, { "docid": "b5ea3b371f3143b4ca9dc8cb1c8a15fa", "score": "0.6761303", "text": "function barraProgreso(ev){\n var barra = document.getElementById(\"barraProgreso\");\n var complete = Math.round(ev.loaded / ev.total * 100);\n //progress.value = progress.innerHTML = complete;\n barra.style.width = complete + \"%\";\n}", "title": "" }, { "docid": "baacf9f280d651e5d706a98164846c98", "score": "0.67504835", "text": "function setProgressbar(value) {\r\n $(\"#progressbar\").progressbar({\r\n value: value\r\n });\r\n\r\n $(\".progress-label\").text(value + \"%\")\r\n}", "title": "" }, { "docid": "eab6b4d4c8d91f52d1e4cf0ce16ddffc", "score": "0.67313844", "text": "function swfuploaderUpdateProgressBar(fileId, percentage) {\n\tprogbar = \"<div style='height:5px;width:100px;background-color:#999;'><div style='height:5px;background-color:#000;width:\" + percentage + \"px;'></div></div>\";\n\tvar progressbarCell = document.getElementById('uploaderProgressBar-'+fileId);\n\tprogressbarCell.innerHTML = progbar;\n}", "title": "" }, { "docid": "40ea235876f34d539626a95088e89f00", "score": "0.67260575", "text": "function updateProgressSaving() {\n var dot = '.';\n document.getElementById(\"progress_text\").innerText = \"Saving the polaroid \" + dot.repeat(progressCounter + 1);\n progressCounter++;\n progressCounter = progressCounter % 10;\n}", "title": "" }, { "docid": "953bc9e89c8e4b7d25eab80a0c040d76", "score": "0.6699342", "text": "function progressBar(percentAge){\n\tvar percentBar;\n\n\tif (percentAge === 0){\n\t\tpercentBar = \":white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (0 <= percentAge && percentAge <= 10){\n\t\tpercentBar = \":white_large_square: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (10 <= percentAge && percentAge <= 20){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (20 <= percentAge && percentAge <= 30){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (30 <= percentAge && percentAge <= 40){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (40 <= percentAge && percentAge <= 50){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_square_button: :white_square_button: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (50 <= percentAge && percentAge <= 60){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_square_button: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (60 <= percentAge && percentAge <= 70){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_square_button: :white_square_button: :white_square_button:\"\n\t}else if (70 <= percentAge && percentAge <= 80){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_square_button: :white_square_button:\"\n\t}else if (80 <= percentAge && percentAge <= 90){\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_square_button:\"\n\t}else{\n\t\tpercentBar = \":white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square: :white_large_square:\"\n\t}\n\n\treturn percentBar;\n}", "title": "" }, { "docid": "46e3667261464984b5f178a307bab010", "score": "0.6688723", "text": "function setProgress(value){\n $(\"#progressBar\").css(\"width\", value+\"%\");\n $(\"#progressText\").html(\"Avancement: \"+value+\"%\");\n}", "title": "" }, { "docid": "0240a158b057cab53c8e94e42fc5b82e", "score": "0.6683615", "text": "function renderProgress(){\r\n for(var qIndex = 0; qIndex <= lastQuestion; qIndex++){\r\n progress.innerHTML += \"<div class='prog' id=\"+ qIndex +\"></div>\";\r\n }\r\n}", "title": "" }, { "docid": "d673ca6335123aca2e10b03c102b2abe", "score": "0.66796213", "text": "function updateProgressFirst() {\n var dot = '.';\n document.getElementById(\"progress_text\").innerText = \"Loading the page \" + dot.repeat(progressCounter + 1);\n progressCounter++;\n progressCounter = progressCounter % 10;\n}", "title": "" }, { "docid": "1b4be32b937d7af1fb795ae274d492c1", "score": "0.66764146", "text": "updateProgressBar() {\n styleElem.innerHTML = `\n .footer__time-bar__time-progress::before {\n left: 99%;\n transition: all ${TIME}s linear;\n } .footer__time-bar__time-progress::after {\n width: 100%;\n transition: all ${TIME}s linear;\n }`;\n }", "title": "" }, { "docid": "c03ae9b891887cba3c26df06f14562df", "score": "0.66757715", "text": "function createProgressIndicators(){\n\n // Create container for progress bars\n var div = document.createElement('DIV');\n div.id = 'progress-div';\n div.style.height = '20vh';\n div.style.padding = '2rem';\n div.className = 'd-flex flex-row justify-content-around';\n document.body.appendChild(div);\n\n // Add progress bars\n createProgress('goal-covid-progress', 'progress-div', 'COVID risk', 'bg-danger');\n createProgress('goal-economy-progress', 'progress-div', 'Economy', 'bg-warning');\n createProgress('goal-wellbeing-progress', 'progress-div', 'Wellbeing', 'bg-info');\n\n // Create progress bars (clone)\n function createProgress(id, parent, label, color, templateId='progress_bar_template'){\n\n // Clone progress bar from existing template with all children and event handlers\n var div = document.getElementById(templateId),\n clone = div.cloneNode(true);\n clone.id = id;\n clone.children[0].className += ` ${color}`; // Set progress color\n\n // Add label\n var p = document.createElement('P');\n p.innerText = label;\n p.style.textAlign = 'center';\n\n // Append to parent on DOM\n var containerDiv = document.createElement('DIV');\n containerDiv.style.width = '20%';\n containerDiv.appendChild(clone);\n containerDiv.appendChild(p);\n document.getElementById(parent).appendChild(containerDiv);\n }\n\n}", "title": "" }, { "docid": "42498905a3347cc9f670412ca0c721fd", "score": "0.66686344", "text": "function moveProgress() {\n var elem = document.getElementById(\"progressBarPerc\");\n var width = 0;\n var id = setInterval(frame, 39);\n function frame() {\n if (width >= 100) {\n clearInterval(id);\n } else {\n width++; \n elem.style.width = width + '%';\n }\n }\n}", "title": "" }, { "docid": "6301990980d5ec37e9d95f03ba4d454f", "score": "0.666658", "text": "function showProgress(){ \n progressEl.textContent = (index + \" / \" + questions.length + \" completed\");\n}", "title": "" }, { "docid": "21d327f3d4b3595c6cb1de53117354a6", "score": "0.6654147", "text": "function progressBar(percentage) {\n var progress = $('.progress-inner');\n progress.width(percentage + '%');\n }", "title": "" }, { "docid": "42a8346e3a2fd2cb1b5a9860703cafd9", "score": "0.66476953", "text": "function onProgress(value) {\n document.getElementById('counter').innerHTML = Math.round(value);\n}", "title": "" }, { "docid": "7c94aa6651453ad3a9da257f37e74077", "score": "0.66342443", "text": "function updateProgress(){\n\n\t\t//determine percent\n\t\tprogress = (currentSecond / totalSeconds) * 100;\n\n\t\t//update progress\n\t\t$(\"#bar\").width(progress + '%');\n\t}", "title": "" }, { "docid": "9ca79e2e00844c94079e7250fad133d7", "score": "0.6632123", "text": "function showProgress(){\n const duration = audio.duration;\n const currentTime = audio.currentTime;\n const progressTime = (currentTime / duration ) * 100;\n \n progressBar.style.width = `${progressTime}%`;\n}", "title": "" }, { "docid": "079ab8904306ec09931d0c4b19cc3c36", "score": "0.6629609", "text": "function progressBar() {\n var oAudio = document.getElementById('myaudio');\n //get current time in seconds\n var elapsedTime = Math.round(oAudio.currentTime);\n //update the progress bar\n if (canvas.getContext) {\n var ctx = canvas.getContext(\"2d\");\n //clear canvas before painting\n ctx.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight);\n ctx.fillStyle = \"#4caf50\";\n var fWidth = (elapsedTime / oAudio.duration) * (canvas.clientWidth);\n if (fWidth > 0) {\n ctx.fillRect(0, 0, fWidth, canvas.clientHeight);\n }\n }\n}", "title": "" }, { "docid": "89119c4144d9ea986d50dfbc1cf8962e", "score": "0.660349", "text": "function progress(text) {\n\tsystem.stdout.write(text);\n}", "title": "" }, { "docid": "2c5ac25372fcce095bdd147720fbfc93", "score": "0.66022176", "text": "function initializeBar(){\n\tfor(let bar of progressBar){\n\t\tbar.style.width = 0 +'%';\n\t}\n}", "title": "" }, { "docid": "aa98d5ac2f5090879cc9ce53381b8c48", "score": "0.6599102", "text": "function ProgressBar(props) {\n var _props$value = props.value,\n value = _props$value === void 0 ? 0 : _props$value,\n styles = ProgressBar_objectWithoutProperties(props, [\"value\"]);\n\n return /*#__PURE__*/react_default.a.createElement(StyledProgressBar, ProgressBar_extends({\n height: \"18px\"\n }, styles, {\n value: value,\n isCompleted: false\n }), /*#__PURE__*/react_default.a.createElement(\"span\", null));\n}", "title": "" }, { "docid": "eb45fd1866e393e258b9337529ada8a7", "score": "0.6594087", "text": "function setProgress(currstep) {\n var percent = parseFloat(100 / widget.length) * currstep;\n percent = percent.toFixed();\n $(\".progress-bar\").css(\"width\", percent + \"%\").html(percent + \"%\");\n }", "title": "" }, { "docid": "688ee1d31a242a7e046e46d88f07bf82", "score": "0.6574012", "text": "function updateProgressBar(){\n var currentTime = audioA.currentTime;\n var totalTime = audioA.duration;\n var progressBarTarget = (currentTime / totalTime * 100) + \"%\";\n progressMarker.style.setProperty(\"left\", progressBarTarget);\n}", "title": "" }, { "docid": "3415c2bfeaa1b55f37f1bff77a50335e", "score": "0.65715367", "text": "function progressBar(percent, $element) {\r\n var progressBarWidth = percent * $element.width() / 100;\r\n $element.find('div').animate({ width: progressBarWidth }, 500).html(percent + \"%&nbsp;\");\r\n}", "title": "" }, { "docid": "c7cd382c2ac9eae78577e9c53e26a9b9", "score": "0.65671355", "text": "function fillProgress (completed) {\n completed = (completed > 95) ? 100 : completed\n $('#progressbar').text(completed + '%')\n var progresspx = Math.round(3.4 * completed)\n if (progresspx > 330) {\n progresspx == 330\n }\n $('#filler').css('width', progresspx)\n if (completed > 95) {\n setTimeout(function () {\n $('#progressbarimage').css('background', 'url(/img/indicator_full.png)')\n }, 500)\n }\n}", "title": "" }, { "docid": "425b076bb6b3ef38fa125a2cc9b375e3", "score": "0.65547013", "text": "function create_fragment$U(ctx) {\n\t\tlet progress;\n\t\tlet t0;\n\t\tlet t1;\n\t\tlet progress_class_value;\n\n\t\treturn {\n\t\t\tc() {\n\t\t\t\tprogress = element(\"progress\");\n\t\t\t\tt0 = text(/*value*/ ctx[0]);\n\t\t\t\tt1 = text(\"%\");\n\t\t\t\tattr(progress, \"class\", progress_class_value = \"\\n progress\\n \" + /*classes*/ ctx[4] + \"\\n \" + (/*color*/ ctx[2] ? `is-${/*color*/ ctx[2]}` : \"\") + \"\\n \" + (/*size*/ ctx[3] ? `is-${/*size*/ ctx[3]}` : \"\"));\n\t\t\t\tprogress.value = /*value*/ ctx[0];\n\t\t\t\tattr(progress, \"max\", /*max*/ ctx[1]);\n\t\t\t},\n\t\t\tm(target, anchor) {\n\t\t\t\tinsert(target, progress, anchor);\n\t\t\t\tappend(progress, t0);\n\t\t\t\tappend(progress, t1);\n\t\t\t},\n\t\t\tp(ctx, [dirty]) {\n\t\t\t\tif (dirty & /*value*/ 1) set_data(t0, /*value*/ ctx[0]);\n\n\t\t\t\tif (dirty & /*classes, color, size*/ 28 && progress_class_value !== (progress_class_value = \"\\n progress\\n \" + /*classes*/ ctx[4] + \"\\n \" + (/*color*/ ctx[2] ? `is-${/*color*/ ctx[2]}` : \"\") + \"\\n \" + (/*size*/ ctx[3] ? `is-${/*size*/ ctx[3]}` : \"\"))) {\n\t\t\t\t\tattr(progress, \"class\", progress_class_value);\n\t\t\t\t}\n\n\t\t\t\tif (dirty & /*value*/ 1) {\n\t\t\t\t\tprogress.value = /*value*/ ctx[0];\n\t\t\t\t}\n\n\t\t\t\tif (dirty & /*max*/ 2) {\n\t\t\t\t\tattr(progress, \"max\", /*max*/ ctx[1]);\n\t\t\t\t}\n\t\t\t},\n\t\t\ti: noop,\n\t\t\to: noop,\n\t\t\td(detaching) {\n\t\t\t\tif (detaching) detach(progress);\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "d73fc742af1cb6d8fe5e8c22475afeb8", "score": "0.654873", "text": "function updateProgressBar() {\n calculatedCounter = calculateProzent().toString() + '%';\n $('#playerControlProgressBar').attr('aria-valuenow', calculatedCounter).css('width', calculatedCounter);\n}", "title": "" }, { "docid": "116a915b733ac22ef435c96a5d3e0b79", "score": "0.6545107", "text": "function setProgress(prog) {\r\n\tvar bar = document.getElementById('progressBar');\r\n\tif (prog < 0) {\r\n\t\tbar.parentNode.style.display = 'none';\r\n\t\tbar.style.width = '0%';\r\n\t\treturn;\r\n\t}\r\n\tbar.parentNode.style.display = 'block';\r\n\tbar.style.opacity = 1;\r\n\tvar start = parseInt(bar.style.width);\r\n\tvar stop = prog * 100;\r\n\tanimate(bar, start, stop, 5, 'width', 15, '%', null);\r\n\tif (prog >= 1) {\r\n\t\twindow.setTimeout(function() { animate(bar, 1, 0, 0.05, 'opacity', 15, '') }, 1000);\r\n\t\twindow.setTimeout(function() { animate(bar, 100, 0, 5 , 'width', 15, '%') }, 1000);\r\n\t\tg_completed = -1;\r\n\t\tdocumentWasParsed();\r\n\t}\r\n}", "title": "" } ]
3332e8d4f1fbe9feef4cacbff9f17ded
return instance with given id
[ { "docid": "c749f9d58fdfe2aa5115a476e03c7a62", "score": "0.7790468", "text": "getInstance(id) {\n return this.instances[id];\n }", "title": "" } ]
[ { "docid": "0634c677e0f402a47164f2c9dd22982b", "score": "0.7551155", "text": "getById( id ) {\n return this.where('id', id);\n }", "title": "" }, { "docid": "2354a69c7db91243fa567469c06f5991", "score": "0.7493522", "text": "getById(id) {\n const object = CollectionUtil.findById(this._data, id);\n return object;\n }", "title": "" }, { "docid": "c25ef1de72af4e5705beb93116211651", "score": "0.74053067", "text": "find (id) {\n return this.model.id(id).get();\n }", "title": "" }, { "docid": "602260522578dd4387fbfc409269b6ba", "score": "0.73318076", "text": "function byId() {\n return byKey('id');\n }", "title": "" }, { "docid": "e35c12f9b8bdc6cb83cc97ab0bc0f344", "score": "0.7262788", "text": "static async get(id) {\n const select_query = `select * from ${this._table} where id = $1`;\n if (DEBUG)\n console.log('[get query]', select_query, [id]);\n const result = await this._conn.query(select_query, [id]);\n if (result.rows.length == 0) {\n return null;\n }\n else {\n const instance = new this(result.rows[0]);\n return instance;\n }\n }", "title": "" }, { "docid": "40cb676d63d4dad796b66ec18ce6c440", "score": "0.71291614", "text": "function getById(id) {\n this.id = id || 1;\n var get = createAjaxCall('GET', {id : id});\n $.ajax(get);\n }", "title": "" }, { "docid": "56d7c5b5bf827d707488ecfec2db633d", "score": "0.70762295", "text": "async function getbyid(id){\n if(id === undefined){\n throw 'input is empty';\n }\n if(id.constructor != ObjectID){\n if(ObjectID.isValid(id)){\n id = new ObjectID(id);\n }\n else{\n throw 'Id is invalid!(in data/patient.getbyid)'\n }\n }\n\n const patientCollections = await patient();\n const target = await patientCollections.findOne({ _id: id });\n if(target === null) throw 'Patient not found!';\n\n return target;\n}", "title": "" }, { "docid": "52fcef23427a94c8489f75a65c072bc0", "score": "0.7073349", "text": "function getOne(id) {\n return Page.getOne({id: id})\n .$promise\n .catch(handleErr);\n }", "title": "" }, { "docid": "511ca15385168a435c22939219b80231", "score": "0.7062633", "text": "async getOne(id) {\n const records = await this.getAll();\n return records.find(record => record.id === id);\n }", "title": "" }, { "docid": "e6b145e74d9e2ffe613ef9b3d1c1559b", "score": "0.7057157", "text": "getObjectById(id) {\n return this.idIndex.get(id)[0];\n }", "title": "" }, { "docid": "bd148f2a43e9390c45dc91d8c3428464", "score": "0.69780815", "text": "async getID (id){\n const located = await model.findOne({\n where: {\n id: id\n }\n })\n\n if (!located) {\n throw new ClientNotFound()\n }\n\n return located\n }", "title": "" }, { "docid": "2ace32df899fee2cfda5d11604a24854", "score": "0.69218993", "text": "async function getbyid(id) {\n if (id === undefined) {\n throw 'input is empty';\n }\n if (id.constructor != ObjectID) {\n if (ObjectID.isValid(id)) {\n id = new ObjectID(id);\n }\n else {\n // throw 'Id is invalid!(in data/reservation.getbyid)'\n return;\n }\n }\n\n const reservationCollections = await reservations();\n const target = await reservationCollections.findOne({ _id: id });\n // if(target === null) throw 'Reservation not found!';\n\n return await processReservationData(target);\n\n // return target;\n}", "title": "" }, { "docid": "200d1b06624586bee5630a43eb7c9881", "score": "0.6867128", "text": "getById(id) {\n let item = this.nodeMap.get(id);\n if (!item) {\n item = this.apiNodeFromId(id);\n this.nodeMap.set(id, item);\n }\n return item;\n }", "title": "" }, { "docid": "554655ff3d2ecefc7189a450bf288177", "score": "0.6854796", "text": "get(_id) {\n\t\tlet queryObject = _id ? {_id} : {};\n\t\treturn this.schema.find(queryObject);\n\t}", "title": "" }, { "docid": "b3eb400443fa496ca06f37335596d49c", "score": "0.684393", "text": "static getById(id) {\n return db.one(`\n SELECT * FROM avatar WHERE id = $1`,\n [id]\n )\n .then(result => {\n return new Avatar(result.id, result.id_user, result.name, result.img);\n });\n }", "title": "" }, { "docid": "f3eb4ebbe46ecddf069c09ef917c6b5f", "score": "0.6830146", "text": "getById(id) {\n return super.getById(id) || this.idRegister[id];\n }", "title": "" }, { "docid": "498c12f4e4cf16613dd95f08ee1833c4", "score": "0.6827466", "text": "function getObjectFromId(id, obj) {\n let newObj = Object.assign({}, obj[id]);\n return newObj;\n}", "title": "" }, { "docid": "6e9e62b75dcaa710b21e280a935e5e56", "score": "0.6802609", "text": "get(id) {\r\n return this.endpoint.get(this.path('/' + id));\r\n }", "title": "" }, { "docid": "5754f7656c0b774f9eeab33356bcbd9d", "score": "0.6780727", "text": "function findById(id, settings) {\n return Private.findById(id, settings);\n }", "title": "" }, { "docid": "5754f7656c0b774f9eeab33356bcbd9d", "score": "0.6780727", "text": "function findById(id, settings) {\n return Private.findById(id, settings);\n }", "title": "" }, { "docid": "5754f7656c0b774f9eeab33356bcbd9d", "score": "0.6780727", "text": "function findById(id, settings) {\n return Private.findById(id, settings);\n }", "title": "" }, { "docid": "5754f7656c0b774f9eeab33356bcbd9d", "score": "0.6780727", "text": "function findById(id, settings) {\n return Private.findById(id, settings);\n }", "title": "" }, { "docid": "a274e9adbf0396d6bdf031f3bf30f3fa", "score": "0.67708033", "text": "function getByItem(id) {\n\t\treturn this.get({'itemId': id});\n\t}", "title": "" }, { "docid": "72ff84bee55ebc6236665d2e57b27b8b", "score": "0.6766861", "text": "static getUserById(id) {\n return db.one(`select * from users where id = $1`, [id])\n .then(user => {\n const instance = new Users(user.id, user.username, user.phash);\n return instance;\n })\n\n }", "title": "" }, { "docid": "74467caeef1a3c5cdda7cc3900c230fb", "score": "0.67318547", "text": "static async getOne(id) {\n try {\n let criteria = {\"id\": id, \"createdBy\": app.get('user')}\n let result = await DatabaseService.findByCriteria(collectionName,criteria);\n return result.get();\n } catch (err) {\n throw err;\n }\n\n }", "title": "" }, { "docid": "d4a5c29e2ea3022f7896c650b3daa1a0", "score": "0.67119014", "text": "get(id) {\n return this.db.get(id)\n }", "title": "" }, { "docid": "de81ef4ede2c83da8a523c5c841fbced", "score": "0.6708082", "text": "function byId(id) {\n\treturn document.getElementById(id);\n}", "title": "" }, { "docid": "de81ef4ede2c83da8a523c5c841fbced", "score": "0.6708082", "text": "function byId(id) {\n\treturn document.getElementById(id);\n}", "title": "" }, { "docid": "438e6650e8721b8ca3ef6a46707ea650", "score": "0.66990536", "text": "function getObjectById(data, id) {\n for( var i = 0; i < data.length; i++ ) {\n if( data[i].id == id ) { return data[i]; }\n }\n return {};\n }", "title": "" }, { "docid": "92975045f5991a5c65eb4e03c50c55b5", "score": "0.669765", "text": "function id(id) {\n return document.getElementById(id);\n }", "title": "" }, { "docid": "c7c415f154ea3c8b630f9094b6b63778", "score": "0.6697077", "text": "function getTvShowObject(id) {\n return tvShowsList.find((tvShow) => tvShow.show.id === parseInt(id));\n}", "title": "" }, { "docid": "d9d828a3d462c4acc3e26745f9bc01aa", "score": "0.66866887", "text": "findById(id) {\n return this.model.findById(id);\n }", "title": "" }, { "docid": "6eeda37549c1d2368ccf307df14ba87a", "score": "0.6679867", "text": "findById(id) {\n return this.model.findById(id);\n }", "title": "" }, { "docid": "7a2c886eeba2b0056c515a3691436dde", "score": "0.6668504", "text": "function getById(id) {\n return db(\"items\").where({ id }).first();\n}", "title": "" }, { "docid": "2d3fbf93ff8a949787ecf34902c10545", "score": "0.6667443", "text": "function getId ( id ) {\n return document.getElementById(id);\n }", "title": "" }, { "docid": "2ecca5779f432bffe5c33730c19d6ac3", "score": "0.6657798", "text": "static async get(conn, id) {\n\t\tvar result = await r.table(this.table).get(id).run(conn);\n\t\tif(!result)\n\t\t\tthrow new errors.NotFoundError();\n\n\t\treturn new this(conn, result);\n\t}", "title": "" }, { "docid": "43ec989269ba5734c63264874a102aa0", "score": "0.6633769", "text": "getById(id) {\n return db('items').where('id', id)\n .catch(err => console.error(`Error getting item by id ${err}`));\n }", "title": "" }, { "docid": "9577cc4d909f595355ed14b4c2c84978", "score": "0.66064996", "text": "async findById(id) {\n var result = await this.find({\n where: {\n _id: id\n }\n });\n return result ? result[0] : null;\n }", "title": "" }, { "docid": "c3ea7f88550c8de00a8caef86c652dc9", "score": "0.65980357", "text": "async recuperarPeloId(id){\n const item = await Item.findById(id);\n return item;\n }", "title": "" }, { "docid": "ad592b6c890c9c7b1ff2bf04d940b409", "score": "0.65942675", "text": "find(id) {\n return this.data.get(id);\n }", "title": "" }, { "docid": "f23f5768a5a3c7e0afe82f981fb39506", "score": "0.6577887", "text": "function byid(id) {\n\n\treturn document.getElementById(id);\n\n}", "title": "" }, { "docid": "c167f9624a94213f2495cb5964afa119", "score": "0.65768164", "text": "function findById(id) {\n return db('classes').where({ id }).first();\n}", "title": "" }, { "docid": "e6c3c9f80c499afb61d441b070749708", "score": "0.65761095", "text": "function getById(id) {\n return db('users')\n .where({ id })\n .first();\n}", "title": "" }, { "docid": "7d4f1a22db2435bb67e2f433123cb01e", "score": "0.65527487", "text": "async findById(id, options) {\n if (!id || !this.isId(id)) {\n return null;\n }\n\n const pooled = this.getStoragePool().get(this, id);\n\n if (pooled) {\n return pooled;\n }\n\n if (!options) {\n options = {};\n }\n\n const newParams = _objectSpread(_objectSpread({}, options), {}, {\n query: {\n id\n }\n });\n\n return await this.findOne(newParams);\n }", "title": "" }, { "docid": "0bf972d12667407f566c901a40fda97e", "score": "0.6547618", "text": "_getByID(html, id) {\n return html.parent().parent().find(`#${this.item._id}-${id}`);\n }", "title": "" }, { "docid": "ee2358b46f2c581bace3f0c53a616734", "score": "0.6533324", "text": "get(id) {\n if(id) {\n return this.db.find(record => record.id === id);\n } else {\n return this.db;\n }\n }", "title": "" }, { "docid": "399b97e04500620bcd8abe9ee0dc988a", "score": "0.6529228", "text": "findCandidateById (id) {\n return Candidate.find(id);\n }", "title": "" }, { "docid": "b4e5b9c3650c937b78c4c87ac0eaed15", "score": "0.652568", "text": "function get(id) {\r\n\t\tvar o = this.getQuiet(id);\r\n\t\tif (typeof o === \"function\") o = $.newApplyArgs(o, Array.prototype.slice.call(arguments, 1));\r\n\t\tif (o === undefined) o = null;\r\n\t\tthis.doEvent({ type:\"get\", context:this, id:id, instance:o });\r\n\t\treturn o;\r\n\t}", "title": "" }, { "docid": "bf2956b66dd23b1129e264504e4b1dbd", "score": "0.65093833", "text": "function getId(id){\n\treturn document.getElementById(id);\n}", "title": "" }, { "docid": "bf62a49bb3567e1329f57a92083779f8", "score": "0.6507845", "text": "findById(id) {\n return db(this.name)\n .where({ id })\n .first(\n \"id\",\n \"first_name\",\n \"last_name\",\n \"email\",\n \"is_driver\",\n \"phone_number\",\n \"zip_code\",\n \"is_admin\",\n \"is_disabled\",\n \"bio\",\n \"profile_picture\"\n );\n }", "title": "" }, { "docid": "3f023e80d900364033ed9249c0f05b47", "score": "0.6504219", "text": "getById (id) {\n\t\treturn this.stories.find(story => story.id == id);\n\t}", "title": "" }, { "docid": "980d558b0d55f98e595075016c0d94c4", "score": "0.65014255", "text": "function getId(id) {\n\treturn document.getElementById(id)\n}", "title": "" }, { "docid": "057c063c532dc7d9dd9c86edd59afa64", "score": "0.6501279", "text": "static findById(id) {\n return this.all.find((grocery) => grocery.id == id);\n }", "title": "" }, { "docid": "444b39df57805fa29d55b19a05a6f8e2", "score": "0.6491023", "text": "function id(id) {\n\treturn document.getElementById(id);\n}", "title": "" }, { "docid": "7ba70d3dad009876450e5b32baca6e3d", "score": "0.6484067", "text": "findItemById(id) {\n\t\treturn this.item.find(element => element.id == id)\n }", "title": "" }, { "docid": "62702696cb3d16283ece627d527cd2c6", "score": "0.6476793", "text": "function getById(id) {\n return db('projects').where({ id: id }).first()\n}", "title": "" }, { "docid": "5dcdda8613c266304649ab963ec5bfd4", "score": "0.6469466", "text": "static read(id) {\n\t\treturn Team.findById(id)\n\t\t\t.then((team) => {\n\t\t\t\treturn team;\n\t\t\t});\n\t}", "title": "" }, { "docid": "a09a8cb72fbe053d98511392656eda6c", "score": "0.64626604", "text": "findById(id) {\n return kernel_1.Kernel.findById(id, this.serverSettings);\n }", "title": "" }, { "docid": "bc11d503747ea0845405f9c1cca2380d", "score": "0.64610827", "text": "static findById(id) {\n\t\treturn db.query('select * from ?? where id = ?', [TOKEN, id])\n\t\t\t.then(rows => {\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\treturn Promise.resolve(null);\n\t\t\t\t}\n\t\t\t\treturn new Token(rows[0]);\n\t\t\t});\n\t}", "title": "" }, { "docid": "80c618559bf6bde444a4b77d61d9817b", "score": "0.6460932", "text": "function byId(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "58135e82614c3e7aeec3389f5343e5be", "score": "0.64473444", "text": "function getbyid(id) {\n return db.one(`select * from todos where id = $1`)\n .catch(err => {\n //got nuthing\n return {\n name: 'no todo found.'\n };\n })\n\n}", "title": "" }, { "docid": "79e7cd03f556af0e84b95b8b6cc6b254", "score": "0.6446837", "text": "async getById(id){\r\n const filter={\"_id\":new ObjectID(id)};\r\n let swotDocument=await this.swotColl.FindOne(filter);\r\n return swotDocument;\r\n }", "title": "" }, { "docid": "aa8318a9a129d4e4fbbf88dde863af7e", "score": "0.6409143", "text": "function findById(id) {\n return db(\"Bids\").where(\"id\", id).first()\n}", "title": "" }, { "docid": "3d3dd948005a5efb8c7ba91c24b19167", "score": "0.6407834", "text": "async getPetById(id){\n if(!id) throw \"You must provide an id to search for\";\n\n const pet = await Pets.findOne({_id: id});\n\n if (pet === null) throw \"No pet with that id\";\n return pet;\n }", "title": "" }, { "docid": "f191e213cb646ae5b020490d3baca54f", "score": "0.6400282", "text": "async getItemById(id) {\n return Item.findOne({_id: id})\n }", "title": "" }, { "docid": "52ac8dd176e99dc1d08feb83657e2f59", "score": "0.6396438", "text": "async findById(Model, id) {\n // Get collection ID of provided Model\n const collectionId = modelCollectionId(Model);\n\n // Find single Model instance data matching provided ID\n const foundValue = await this._plug.findById(collectionId, id);\n\n // Return null if no data was found\n if (foundValue == null) {\n return null;\n }\n\n // Return Model instance constructed from fetched data\n return new Model(foundValue.object, id);\n }", "title": "" }, { "docid": "6ec49db12cb3f4772a01bda184b96472", "score": "0.6392398", "text": "function findById(id){\n return db('posts')\n .select('id', 'post_body', 'title', 'best_place')\n .orderBy('id').where({id}).first(); \n}", "title": "" }, { "docid": "bb80402d3ced081cbd0edc7a297cb55f", "score": "0.6392099", "text": "function _id (id) {\n return document.getElementById(id);\n }", "title": "" }, { "docid": "5a2c8c148ddcd3e7d8b160c2aaa0e6ec", "score": "0.6392052", "text": "function getId(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "f65a8d8555c4b3c0396aad69f8b5e71c", "score": "0.6391615", "text": "function getId(id){\treturn document.getElementById(id);}", "title": "" }, { "docid": "29eaf70d349fa6c3ccebcbe529fb32b6", "score": "0.638922", "text": "getById(id) {\n return db('users').where('id', id)\n .catch(err => console.error(`Error getting user by id ${err}`));\n }", "title": "" }, { "docid": "6c6210b6418f2061d585616a41bd3003", "score": "0.63861746", "text": "function objectForClass(className, id) {\r\n var instObject = {};\r\n instObject[RHO_CLASS_PARAM] = className;\r\n instObject[RHO_ID_PARAM] = id;\r\n return new (namespace(className))(instObject);\r\n }", "title": "" }, { "docid": "63cae9c39905efb4430b85b500cbe1a3", "score": "0.6383361", "text": "static async getOne(id) {\n console.log(typeof id)\n const result = await db.query(\n `SELECT title, salary, equity, company_handle\n FROM jobs\n WHERE id=$1`,\n [id]);\n\n if (result.rows.length === 0) {\n const err = new Error(`No job found`);\n err.status = 404;\n throw err;\n }\n \n return result.rows[0];\n }", "title": "" }, { "docid": "6a2a3bbd4f632a2a55923512875e5a17", "score": "0.6382123", "text": "findById(id, options) {\n return this.connection.call('child', id).call('once', 'value').call('val').then((data) => {\n if (data == null) {\n return Promise.reject(httpError(404));\n }\n return data;\n });\n }", "title": "" }, { "docid": "84e8ce6f8530187d2e5928bcdd6193c2", "score": "0.6367526", "text": "function getById(id) {\n return db(\"clients\").where({ id }).first();\n}", "title": "" }, { "docid": "eea57b234de31662e22ffaae1f46ba2f", "score": "0.63644594", "text": "function IdToObject(id)\n\t{\n\t\tconst ret = idMap.get(id);\n\n\t\tif (typeof ret === \"undefined\")\n\t\t\tthrow new Error(\"missing object id: \" + id);\n\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "4ac91d4a08dc2d14aa5742a007934c2c", "score": "0.6362673", "text": "findById(lid) {\n const res = this.list.filtered(`_id = \"${lid}\"`);\n return (res && res.length > 0) ? res['0'] : null;\n }", "title": "" }, { "docid": "e056362eecea8ba820c5874379c46938", "score": "0.6352189", "text": "function findById( id ) {\n return db('users')\n .where({ id })\n .first();\n}", "title": "" }, { "docid": "171108ba6928265ae5d7d05264ed78a2", "score": "0.63512814", "text": "function byId(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "15545f897c8ff732d2fb3570dca22f57", "score": "0.6344926", "text": "get id() {return this._id}", "title": "" }, { "docid": "1d0609edf1ec34e5f6f7bd98a4760834", "score": "0.63431865", "text": "get(id) {\n return this.rest.get(`${this.baseUrl}/${id}`);\n }", "title": "" }, { "docid": "1d0609edf1ec34e5f6f7bd98a4760834", "score": "0.63431865", "text": "get(id) {\n return this.rest.get(`${this.baseUrl}/${id}`);\n }", "title": "" }, { "docid": "db6bb8b610e901c937c4b7fa0d33d964", "score": "0.63393223", "text": "findById(id) {\n return session_1.Session.findById(id, this.serverSettings);\n }", "title": "" }, { "docid": "c200910fe64cf0e2739ce5364fa457fd", "score": "0.63300556", "text": "function getId(id) {\r\n return document.getElementById(id);\r\n}", "title": "" }, { "docid": "5af834d1770a3a98622445ec543119cd", "score": "0.6329097", "text": "function findById(id) {\n return db(\"users\")\n .where({ id })\n .first()\n .then(user => {\n if (user) {\n return user;\n } else {\n return null;\n }\n });\n}", "title": "" }, { "docid": "7d890ba97bf4e9f7f134bfb7e2f56865", "score": "0.6325003", "text": "get(_id) {\n if (_id) {\n return this.schema.findOne({_id});\n }\n else {\n return this.schema.find({});\n }\n }", "title": "" }, { "docid": "648638e8a3be5041c6e55981038353ce", "score": "0.63221306", "text": "getById(id) {\n // do the post and merge the result into a TimeZone instance so the data and methods are available\n return spPost(this.clone(TimeZones, `GetById(${id})`).usingParser(spODataEntity(TimeZone)));\n }", "title": "" }, { "docid": "e65f1e02c92c4d7afb453d1c949453c0", "score": "0.63195705", "text": "getOne(id) {\n return this.messages.find(account => account.id === id);\n }", "title": "" }, { "docid": "9bc0432e3512156615728d7a591b73d9", "score": "0.6319086", "text": "findById (id) {\n return User.findOne({ where: { id: id } })\n }", "title": "" }, { "docid": "4b24f252e5622f3eb5bb72a073d2217d", "score": "0.63145494", "text": "static find(id, config = {}) {\n return new Promise((resolve, reject) => {\n const model = new this();\n model.$request = this.request('get', config.uri || model.uri(id), config);\n model.$request.send().then(response => {\n resolve(model.initialize(response.data));\n }, error => {\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "a6747fcc9587581ec91ee279986e5462", "score": "0.6291926", "text": "function getIdElement(id) {\n return document.getElementById(id);\n }", "title": "" }, { "docid": "bd4ddb8609db386618d00557804b2136", "score": "0.6288504", "text": "getItemById(id) {\n const index = this.getItemIndex(id);\n if (!~index) {\n return null;\n }\n const targetItem = this.#items[index];\n return { ...targetItem }; // return a copy, so it can't be affected outside\n }", "title": "" }, { "docid": "607bc15eb6722afc05f5779bfb053c05", "score": "0.62837905", "text": "getById(knex, id) {\n return knex\n .from('live_alert_users')\n .select('*')\n .where('id', id)\n .first();\n }", "title": "" }, { "docid": "82c765fb495b87ea5e34ddec27cbb1e8", "score": "0.6281968", "text": "function findById(id, settings) {\n return default_1.DefaultKernel.findById(id, settings);\n }", "title": "" }, { "docid": "82c765fb495b87ea5e34ddec27cbb1e8", "score": "0.6281968", "text": "function findById(id, settings) {\n return default_1.DefaultKernel.findById(id, settings);\n }", "title": "" }, { "docid": "cd2d7ba3c864666f1b0b67366dc62740", "score": "0.6280929", "text": "findRessourceById (model, id) {\n\t\treturn model.findOne({\n\t\t\twhere: {\n\t\t\t\tid: id,\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "536b907024f00da3d4a74325f83551ed", "score": "0.62693727", "text": "function findByID(id) {\r\n return db(\"analysis\")\r\n .where({ id })\r\n .first();\r\n}", "title": "" }, { "docid": "b407c0ff3fbc48debea281c2ea1b3284", "score": "0.6264206", "text": "function getUser(id) {\n const user = users.find((user) => user.id === id);\n\n if (user == null) {\n return new NullUser();\n } else {\n return user;\n }\n}", "title": "" }, { "docid": "c01d5b88ef39d563aae69f8b9229a401", "score": "0.62614125", "text": "function getPostFromId(id) {\n return blogPosts.find((post) => post._id === parseInt(id))\n }", "title": "" }, { "docid": "fe27c611d643d81cfa341d9059251bd0", "score": "0.625957", "text": "getObject(id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.cache.has(id)) {\n // retrieve the original object from the DB\n const ret = yield global_1.Global.adapter.getForeignObjectAsync(id);\n // and remember it in the cache\n if (ret != null)\n this.storeObject(ret);\n }\n return this.retrieveObject(id);\n });\n }", "title": "" } ]
288bce60e6a60e15a0aea61f5323867e
initial shopify get request
[ { "docid": "395f08f23d426835426bfeef8f90b4e1", "score": "0.77421755", "text": "function shopifyGetCall(){\n\n\tconst authKey = Buffer.from(USERK + \":\" + USERP).toString('base64');\n\tconst options = {\n\t\turl:SURL,\n\t\theaders:{\n\t\t\t\"Authorization\": \"Basic \" + authKey\n\t\t}\n\t};\n\n\trequest(options,shopifyCallbackGet);\n\n}", "title": "" } ]
[ { "docid": "61029aa40200cfafde1625436086e311", "score": "0.6455703", "text": "static async get(request, reply) {\n return reply({helo: 'checkout world'});\n }", "title": "" }, { "docid": "20ca21ad32afadd55c4aadd3d7fdc3cf", "score": "0.62571853", "text": "GET() {\n this.execute('GET');\n }", "title": "" }, { "docid": "a163d517abdd38321ac4224dea8e6ee0", "score": "0.6251007", "text": "get (url, data = {}){ return this.#requestBuilder('GET', url, data); }", "title": "" }, { "docid": "73ffc8c70d28efd0d63818f34ba5f03e", "score": "0.61227137", "text": "function requestSpotify(data) {\n $.getJSON(spotifyURL, data, spotifyCallback);\n }", "title": "" }, { "docid": "69b3a73a5ffe31abdb5f563941c1c194", "score": "0.60222566", "text": "function getProducts(){\n return get('data/products.json');\n}", "title": "" }, { "docid": "cf3195d973e0caad0456dfaea3b60fdf", "score": "0.60176307", "text": "function listProductos() {\n $.get('/FarmSystem/Adm/AlmInven/store').done(function (data) { \n listProductos1(data);\n }).fail(function () {\n alertify.error(\"ERROR SERVER INVENTARIO STOCK\");\n });\n}", "title": "" }, { "docid": "81d9b93f4aa7cd35ec65ea7a87171b3d", "score": "0.6015046", "text": "function shopifyCallbackGet(error, response,body){\n\t\n\tconst parsedBody = JSON.parse(body);\n\t//left here maybe useful for debugging\n\t//console.log(\"Error \", error);\n\t//console.log(\"response \", response);\n\t//console.log(\"parsed body \", parsedBody);\n\t//console.log(parsedBody.errors);\n\tif(!parsedBody.errors){\n\t\t//eventually this will have to pass to a function that will compare shopify data with erp data\n\t\t//console.log(\"successful call\",parsedBody);\n\t\tconsole.log(\"successful call\");\n\t\tconst currentTime = Math.round(new Date().getTime() / 1000);\n\t\t//console.log(\"shopify data \", parsedBody);\n\t\tconst sortedBody = sortData(parsedBody.products,\"title\");\n\t\t\n\t\tsortedBody.push(currentTime);\n\t\t//console.log(sortedBody);\n\t\tshopifySortedData = sortedBody.slice();\n\t}\n\telse{\n\t\t//just stop functioning if api error\n\t\tconsole.log(\"failed call\", parsedBody.errors);\n\t}\n}", "title": "" }, { "docid": "a57d6a87a1993d31d38a20c8154fbc2d", "score": "0.60103905", "text": "getProducts(){\n this.apiCall(\"/api/products\", this.showProducts);\n }", "title": "" }, { "docid": "19479820ddbde155ac69e22ece373772", "score": "0.60059476", "text": "async get_cartlist(payload) {\n var data = {\n url: `/cart/list`,\n method: 'GET',\n // Cookie: localStorage.getItem(\"currentCookie\")\n }\n\n try {\n const response = await Repository.get(`${baseUrl}/cart/list`)\n return response.data;\n } catch (error) {\n console.log(error)\n }\n }", "title": "" }, { "docid": "859435d8d9d7e5aa7576da6bb81bff7e", "score": "0.6001973", "text": "function getInventory() {\n $.ajax({\n type: 'GET',\n url: '/api/inventory',\n })\n .then(function(response) {\n console.log('GET response: ', response);\n render(response);\n });\n}", "title": "" }, { "docid": "7241ab9eb2855e8c8e86e7a1f4fa7409", "score": "0.60015315", "text": "get(url) {\n const req = this.client.get(url);\n\n return this.preRequest(req);\n }", "title": "" }, { "docid": "7241ab9eb2855e8c8e86e7a1f4fa7409", "score": "0.60015315", "text": "get(url) {\n const req = this.client.get(url);\n\n return this.preRequest(req);\n }", "title": "" }, { "docid": "8be535fce632c0608823cf2d03716215", "score": "0.59585375", "text": "static get(url, data) {\n return this.request('GET', url, data)\n }", "title": "" }, { "docid": "f769cfb613d48950d4eb3343663d6114", "score": "0.5926593", "text": "request() {\n this.requestUrl()\n return fetch(this.url)\n }", "title": "" }, { "docid": "99e18c2e6a80d3d03b68582592caa709", "score": "0.5904955", "text": "static async get(request, reply) {\n\n // Appropriate ID/permission validations should have been done in route prerequisites\n return reply(await new CheckoutSerializer(request.pre.checkout).serialize());\n }", "title": "" }, { "docid": "b2347d54ecdb67270f361d34a6305f50", "score": "0.5889337", "text": "constructor() {\n\t\tsuper();\n\t\tconst token = 'b9bdb0efc4f677ef3e699ea413280eb3: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';\n\t\tconst hash = base64.encode(token);\n\t\tconst Basic = 'Basic ' + hash;\n\n\t\tvar herokuCors = 'https://cors-anywhere.herokuapp.com/';\n\t\tlet url = herokuCors + 'https://float-there.myshopify.com/admin/api/2020-04/products.json?limit=250';\n\n\t\taxios\n\t\t\t.get(url, { headers: { Authorization: Basic } })\n\t\t\t.then((data) => {\n\t\t\t\tthis.setState({ allProducts: data.data.products });\n\t\t\t}).then(() => {\n\t\t\t\tthis.getRecommendedProducts(this.state.allProducts)\n\t\t\t}).catch((err) => console.log(err));\n\n\t}", "title": "" }, { "docid": "5be51698732174ea81ca68f60deeca65", "score": "0.5889127", "text": "function get() {\n http.get(`products?page=${BASIC_STATE.nextPage}`).then((result) => {\n const nextPage = result.nextPage.split(\"=\")[1];\n const products = result.products;\n\n for(let product of products) {\n const card = createCard(product);\n document.getElementById(\"productList\").insertAdjacentHTML('beforeend', card);\n }\n\n BASIC_STATE.nextPage = nextPage;\n });\n}", "title": "" }, { "docid": "99857e928b094be427dc39a0d9ab780b", "score": "0.58698523", "text": "function getProducts() {\r\n $.get(\"/api/products\", renderProductList);\r\n }", "title": "" }, { "docid": "51a14a129ea9d03517c454a941b98027", "score": "0.5861242", "text": "function request() {\n chrome.browserAction.setTitle({\n title: localStorage[\"fromCurrency\"] + \"-\" + localStorage[\"toCurrency\"]\n });\n $.ajax({\n url: \"http://api.fixer.io/latest?base=\" + localStorage[\"fromCurrency\"] + \"&symbols=\" + localStorage[\"toCurrency\"],\n async: true,\n type: 'GET',\n success: su,\n error: er\n });\n}", "title": "" }, { "docid": "eea2afd031bc5d8cb6fbcaa76f28de9a", "score": "0.58030415", "text": "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"noReq\"),\n\t\t\tthis.endpoints.get,\n\t\t\tthis.data.get\n\t\t);\n\t}", "title": "" }, { "docid": "457cd1f8c4bfbf6f2ca5aa6390accac1", "score": "0.57977074", "text": "get(url, opt = {}) {\n opt.method = 'GET'\n return this.sendRequest(url, opt)\n }", "title": "" }, { "docid": "69be7ec4ca345a59dfd9e3db87d36ccc", "score": "0.5797246", "text": "async nuxtServerInit({\n commit,store,dispatch,state\n }) {\n\n const { data } = await axios.get(state.rootApi+'/productview')\n commit('viewing/SET_ROOTAPI',state.rootApi)\n }", "title": "" }, { "docid": "0ec0e9c737d2ff7ec99703576302e282", "score": "0.5785847", "text": "GET_GOODSRECEIPTS_FOR_PI(context, slug) {\n context.commit(\"CLEAR_ERROR\");\n return new Promise((resolve, reject) => {\n ApiService.setHeader();\n ApiService.get(\"/api/purchase/gr\", slug)\n .then(result => {\n console.log(result, 'ini di purchase');\n resolve(result);\n })\n .catch(err => {\n reject(err);\n context.commit(\"SET_ERROR\", { result: err.message });\n });\n });\n }", "title": "" }, { "docid": "5cc1d769fdad7b83dcad010848466abe", "score": "0.57686055", "text": "function get(id,next){\n const cdb = get_query(opts)\n const uri = cdb+ '/'+id\n console.log(uri)\n const req = superagent.get(uri)\n .type('json')\n .set('accept','application/json')\n auth_check(req,opts)\n return cb_or_promise(next,req)\n }", "title": "" }, { "docid": "1b4b15fc1fe6fa9656feccb30a956564", "score": "0.576386", "text": "fetcher() {\n this.getProductInfo(this.state.currentPageItemId);\n this.getRating(this.state.currentPageItemId);\n this.getRelatedItemIds(this.state.currentPageItemId);\n this.getProductQuestions();\n this.getStyles(this.state.currentPageItemId);\n }", "title": "" }, { "docid": "988abe33c975885c23077745162ef54e", "score": "0.57618046", "text": "request() {}", "title": "" }, { "docid": "7679b6afdaf22a4b6d6ef6a8eca78d41", "score": "0.57504356", "text": "function handleGetShoppingListRequest(req, res) {\r\n\tvar userId = req.params.userId || null;\r\n\tvar shoppingListId = req.params.shoppingListId || null;\r\n\tvar accountRepository = new AccountRepository();\r\n\tvar shoppingListRepository = new ShoppingListRepository();\r\n\tif (userId && shoppingListId) {\r\n\t\tQ.all([accountRepository.findById(userId), shoppingListRepository.findById(shoppingListId)])\r\n\t\t\t.then(function(promises){\r\n\t\t\t\tvar account = promises[0];\r\n\t\t\t\tvar shoppingList = promises[1];\r\n\t\t\t\tif (account && shoppingList) {\r\n\t\t\t\t\t// 3) Ask the security if the user can retrieve the list\r\n\t\t\t\t\tif (security.userCanFetchShoppingList(account, shoppingList)) {\r\n\t\t\t\t\t\tlogger.log('info', 'User ' + userId + ' retrieved shopping list ' + shoppingListId + '. ' +\r\n\t\t\t\t\t\t\t'Request from address ' + req.connection.remoteAddress + '.');\r\n\t\t\t\t\t\tres.json(200, shoppingList);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlogger.log('info', 'Could not retrieve shopping list ' + shoppingListId +\r\n\t\t\t\t\t\t\t', user ' + userId + ' is not authorised. Request from address ' + req.connection.remoteAddress + '.');\r\n\t\t\t\t\t\tres.json(401, {\r\n\t\t\t\t\t\t\terror: \"User is not authorised\"\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// return 404\r\n\t\t\t\t\tlogger.log('info', 'Could not retrieve shopping list ' + shoppingListId +\r\n\t\t\t\t\t\t' for user ' + userId + '. User and/or shopping list non existent . Request from address ' + req.connection.remoteAddress + '.');\r\n\t\t\t\t\tres.json(404, {\r\n\t\t\t\t\t\terror: \"User and/or shopping list non existent\"\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t})\r\n\t\t\t.fail(function(err) {\r\n\t\t\t\tres.json(500, {\r\n\t\t\t\t\terror: err.message\r\n\t\t\t\t});\r\n\t\t\t\tlogger.log('error', 'An error has occurred while processing a request ' +\r\n\t\t\t\t\t' to retrieve shopping list with id ' + shoppingListId + ' for user ' + userId + ' from ' +\r\n\t\t\t\t\treq.connection.remoteAddress + '. Stack trace: ' + err.stack);\r\n\t\t\t});\r\n\t}\r\n\telse {\r\n\t\t// 400 BAD REQUEST\r\n\t\tlogger.log('info', 'Bad request from ' +\r\n\t\t\treq.connection.remoteAddress + '.');\r\n\t\tres.json(400);\r\n\t}\r\n}", "title": "" }, { "docid": "fc3002389936eca6b121710e9ec838e0", "score": "0.5749291", "text": "getProducts() {\n return fetch(`${this.baseUrl}/products`) \n .then(resp => resp.json())\n}", "title": "" }, { "docid": "7a03bc73662b22c18f5d620add747817", "score": "0.57443345", "text": "get(url, options = {}) {\n return this.request('GET', url, options)\n }", "title": "" }, { "docid": "412e398fd0fe32ab1dcd5e658b8d91c0", "score": "0.57223314", "text": "function runGetRequest() { \n var url = \"http://129.157.179.180:3000/reactorCore/320/650/blue/frenkzappa\";\n request(url, function(error, response, body) {\n if(!error) {\n console.log(body);\n } else {\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "2f6f794c96a3a477639f9582c8b91492", "score": "0.5722087", "text": "function SiteCatalyst_InitializeShoppingListDetails()\n{\n // generate the post body\n var postdata = {url:document.URL, requestArguments:GSNContext.RequestArguments};\n\n // Make the request\n $jq.ajax(\n {\n type : 'post',\n dataType: 'json',\n data: JSON.stringify(postdata),\n contentType: 'application/json; charset=utf-8',\n url : (mSiteCatalystShoppingListPageWebServiceUrl + 'GetSiteCatalystShoppingListDetails'),\n success: SiteCatalyst_InitializeShoppingListDetailsEvent\n }\n );\n\n}", "title": "" }, { "docid": "03805515f2fccce233469c65ab17dd05", "score": "0.5711946", "text": "function requestIngredients(){\r\n let url = \"/requestingredients/\";\r\n getRequest(url, function (xhr) {\r\n });\r\n}", "title": "" }, { "docid": "ff2232bc32938a19cad9fefa25c4ba26", "score": "0.570873", "text": "constructor() {\n this.products = this.getJSONProducts()\n this.shoppingCart = []\n this.getCartQuery()\n }", "title": "" }, { "docid": "812d9bf54d5c143507e6a64ebd3bb21f", "score": "0.5700554", "text": "[GET_PURCHASE](context, slug) {\n context.commit(\"CLEAR_ERROR\");\n return new Promise((resolve, reject) => {\n ApiService.setHeader();\n ApiService.get(\"/api/purchase\", slug)\n .then(result => {\n // console.log(result, \"result purcahse\");\n resolve(result);\n context.commit(\"SET_PURCHASE\", result.data);\n })\n .catch(err => {\n reject(err);\n context.commit(\"SET_ERROR\", { result: err.message });\n });\n });\n }", "title": "" }, { "docid": "b5349ad0771d38d32b555f3067113b8a", "score": "0.56927973", "text": "function getItems() {\n console.log('in getItems');\n\n $.ajax({\n type: 'GET',\n url: '/items'\n }).then(function (response) {\n console.log(response);\n render(response);\n }).catch(function (error) {\n console.log('error in GET', error);\n });\n\n}// end getItems", "title": "" }, { "docid": "89f9d1ee8f8919dca5daba551b18e464", "score": "0.5688609", "text": "all() {\n return fetch(`${BASE_URL}/products`, {\n credentials: \"include\"\n }).then(res => res.json());\n }", "title": "" }, { "docid": "cbd6a4b066574852ad79478361577543", "score": "0.567122", "text": "get (url, data, options = {}) {\n options.url = url\n options.data = data\n options.method = 'GET'\n return this.request(options)\n }", "title": "" }, { "docid": "05dd39eac2ef21572cb89f605eb20a1b", "score": "0.5664021", "text": "function GetProducts() {\n\treturn Getproduct(\"/products\", \"GET\");\n}", "title": "" }, { "docid": "03b32e693b607e884bc207e53b4af264", "score": "0.56577486", "text": "getData(storeData, url = MyAppGlobals.apiPath + '/api/ppd'){\n if (typeof this.muzId !== 'undefined') {\n url = url + '?muztahik_id=' + this.muzId\n this.shadowRoot.querySelector(\".filter-side\").style.display = 'none'\n this.shadowRoot.querySelector(\"#main\").style.margin = \"0\"\n this.shadowRoot.querySelector(\"#main\").style.padding = \"0\"\n }\n this.$.GetPendaftaran.url= url\n this.$.GetPendaftaran.headers['authorization'] = this.storedUser.access_token;\n this.$.GetPendaftaran.generateRequest();\n\n \n }", "title": "" }, { "docid": "9b4910a174d0a04280e04ad58c1e1316", "score": "0.5657652", "text": "async get() {\n try {\n var loc = window.location.pathname;\n let result = await fetch(\"./scripts/products.json\");\n return await result.json();\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "2ab772ae55d1b29365c38cbe7ab7acdc", "score": "0.56488276", "text": "getPurchases(purchase_id) {\n fetch('https://budgy-r5enpvgyka-uc.a.run.app/user/items/' + purchase_id, {\n method: 'GET' ,\n headers: {\n 'Authorization': 'Bearer ' + this.context.token,\n 'Content-type': 'application/json'\n }})\n .then((response) => response.json())\n .then((json) => {\n this.getCategories(json.data)\n })\n .catch((error) => {\n console.error(error);\n });\n }", "title": "" }, { "docid": "e1bbeb02cd66f4092fbd7d3c937b8892", "score": "0.56437975", "text": "function getItems(){\n $.ajax({\n url: 'https://woofshop.herokuapp.com/items',\n headers: {\n 'Content-Type':'application/json'\n },\n method: 'GET',\n success: function(data){\n itemsFromData = data\n createItemCards(getItemsWithFilter(data));\n },\n error: function(error_msg) {\n var err = (error_msg.responseText)\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "7bdde4a17a1b2c59cdb2719837496092", "score": "0.56375706", "text": "function load() {\n const url = \"http://localhost:3000/api/products\";\n const productId = new URLSearchParams(window.location.search).get(\"id\");\n const productUrl = url + \"/\" + productId;\n fetch(productUrl).then((response) => {\n response\n .json()\n .then((data) => {\n displayProduct(data);\n })\n\n .catch((error) => {\n console.error(error);\n });\n });\n}", "title": "" }, { "docid": "1c55ec9ece2dfb22087796fe291d9053", "score": "0.5629467", "text": "static getAll() {\n return request.get('/item/');\n }", "title": "" }, { "docid": "1a098428af2a0fca0fafcab06f688390", "score": "0.56207055", "text": "function products(root, args, context) {\n const backendURL = context.backendURL\n const foxxMountPoint = context.foxxServMountPoints.generic\n const endPoint = `${context.foxxServGenericEndPoints.CollectionGet}/${collectionName}`\n return genericHelper.fetchQuery(backendURL,foxxMountPoint,endPoint,productsAfterGetHandler, args)\n //return fetch(genericHelper.buildURL(backendURL,foxxMountPoint,endPoint)).then(res => res.json())\n //// return fetch(`${backendURL}/${foxxMountPoint}/genericCollectionGet/${collectionName}`).then(res => res.json())\n}", "title": "" }, { "docid": "2907aebfd19be3b8d467d4f00b652e8f", "score": "0.5611025", "text": "function getStocks() {\n $.get(\"/api/examples\", function (data) {\n // res.redirect(\"/\")\n stocks = data;\n // console.log(\"stocks: \" + JSON.stringify(stocks));\n\n // initializeRows();\n });\n // location.reload();\n}", "title": "" }, { "docid": "794397480c3041c3a6b557b01a052fb3", "score": "0.5595256", "text": "get url() { return \"product-details\"; }", "title": "" }, { "docid": "258804ce2cf7f8e2127040eab6015f3d", "score": "0.5586058", "text": "async getCart() {\n const response = await fetch('/api/storefront/carts');\n let data = await response.json();\n return data;\n }", "title": "" }, { "docid": "67b489e03245ff864e912c2d2285b198", "score": "0.55810285", "text": "function handleGetShoppingListsRequest(req, res) {\r\n\tvar userId = req.params.userId || null;\r\n\tvar query = req.query;\r\n\t// If we have a query, it means we want to retrieve templates\r\n\tif (query && query.isTemplate) {\r\n\t\thandleGetTemplateListsForUserRequest(req, res, userId);\r\n\t}\r\n\telse {\r\n\t\thandleGetListsForUserRequest(req, res, userId);\r\n\t}\r\n}", "title": "" }, { "docid": "de932b0776d8d65c24642c76735fba7e", "score": "0.55791813", "text": "function getCustomers() {\n console.log(\"=================> running getCustomers()\")\n $.get(\"api/customers\", renderCustomersList);\n}", "title": "" }, { "docid": "e34afca9c9985dfa2aa8d4e2e84e59fa", "score": "0.5576287", "text": "addEmptyRequest() {\n this.appendRequest({\n url: 'http://',\n method: 'GET'\n });\n }", "title": "" }, { "docid": "69fe531b42d1448ab6f517d5722cffb5", "score": "0.5574257", "text": "function atelierReq() {\n let productID = props.currentProduct; // will be passed down as props when user clicks on an item\n axios.get(`/products/${productID}`)\n .then((res) => {\n setProduct(res.data); // res.data is an object with info of one product\n })\n .catch((err) => {\n console.log('there was an error!: ', err)\n })\n }", "title": "" }, { "docid": "76dc716118445ec2eba07a9376c15196", "score": "0.5562853", "text": "function getCart() {\n return $.get(config.getCartUrl);\n }", "title": "" }, { "docid": "8c75e665499855f61645793f251d8347", "score": "0.55465615", "text": "async getCart() {\n const options = {\n method: 'GET'\n }\n\n try {\n const response = await fetch(`${window.location.protocol}//${window.location.hostname}/cart`, options);\n const data = await response.json();\n if(response.status == 200) { // there is a cart\n console.log(\"Cart Found\");\n this.setState({cart:data});\n console.log(data);\n } else if (response.status == 404) {\n console.log(\"Cart not found\");\n if(this.state.isLoggedIn) this.createCart();\n }\n } catch(e) {\n console.error(e);\n }\n }", "title": "" }, { "docid": "272ad754fb0058ad914c3e6e18b4b1a1", "score": "0.55399364", "text": "function getProdWeb(cb){\r\n let url = getURL()+'?'+Date.now() /* Esta es una tecnica para evitar problemas de cache, ya que al inyectar el date.now en el url obliga a resfrescar la pagina*/\r\n \r\n\r\n $.ajax({url, method:'get'})\r\n .then(cb)\r\n .catch(error => {\r\n console.log(error)\r\n listaProductos=leerListaProductosLocal(listaProductos)\r\n cb(listaProductos)\r\n })\r\n\r\n }", "title": "" }, { "docid": "b44b7df6561b7bcf5ea06852f7f20ae6", "score": "0.5535545", "text": "getData(){\n const request = new Request(this.url);\n request.get()\n .then((items) => {\n PubSub.publish('Items:all-data-ready', items);\n })\n .catch(console.error);\n }", "title": "" }, { "docid": "205f8e1ac8063f74084f9956564ca9c4", "score": "0.55347884", "text": "function populateGet() {{{\n var obj = {}, params = location.search.slice(1).split('&');\n for(var i=0,len=params.length;i<len;i++) {\n var keyVal = params[i].split('=');\n obj[decodeURIComponent(keyVal[0])] = decodeURIComponent(keyVal[1]);\n }\n return obj;\n}}}", "title": "" }, { "docid": "dfbc8896503c1b5c4ddef07e3b8d5ab1", "score": "0.5531731", "text": "function getProducts() {\n $.get(\"/api/products\", function (data) {\n products = data;\n initilizeRows();\n });\n }", "title": "" }, { "docid": "e485d70e86c3c885e6c147c7bc9e94e2", "score": "0.55251896", "text": "function product(parent,args,context) {\n const id = args._key\n const backendURL = context.backendURL\n const foxxMountPoint = context.foxxServMountPoints.generic\n const endPoint = `${context.foxxServGenericEndPoints.DocumentByKeyGet}/${collectionName}/${id}`\n return genericHelper.fetchQuery(backendURL,foxxMountPoint,endPoint,productAfterGetHandler)\n //return fetch(genericHelper.buildURL(backendURL,foxxMountPoint,endPoint)).then(res => res.json())\n //return fetch(`${backendURL}/${foxxMountPoint}/genericDocumentByKeyGet/${collectionName}/${id}`).then(res => res.json())\n}", "title": "" }, { "docid": "96e32f18722ad35699d6189fdb21f34e", "score": "0.5522464", "text": "function onGetAction($) {\r\n var result = JSON.stringify($.GET) + JSON.stringify($.PATH) + $.pewpew();\r\n\r\n $.send(result);\r\n}", "title": "" }, { "docid": "c4f61edccc90b877d1ce819106976e2f", "score": "0.5520624", "text": "function _getItemsFromAPI() {\n if (!promise) {\n promise = $.get(\"./api/shopping-cart/\").then(function(items) {\n return items;\n });\n }\n return promise;\n }", "title": "" }, { "docid": "0292400995de5aaa4d32241c54eea9ca", "score": "0.5509209", "text": "async get_shop_goods({commit},callback){\n const result=await reqShopGoods()\n if(result.code==0){\n const goods=result.data\n commit(RECEIVE_SHOP_GOODS,{goods})\n //回调,通知组件,callback可传可不传\n callback && callback()\n }\n }", "title": "" }, { "docid": "ed5a7d677a7d36e32c025a86862219cf", "score": "0.55059093", "text": "function doFoodSearch(url) {\n // var queryURL = getQueryURL(search);\n $.ajax({\n url: url,\n method: \"GET\"\n }).then(populateRecipeCarousel);\n}", "title": "" }, { "docid": "848b617713bd0efc52a031df17c336f2", "score": "0.55033004", "text": "function main() {\n shoppingList.bindEventListeners();\n shoppingList.render();\n api.getItems()\n .then(res => res.json())\n .then((items) => {\n items.forEach((item) => store.addItem(item));\n shoppingList.render();\n })\n .catch(err => {\n return shoppingList.handleError(err);\n });\n}", "title": "" }, { "docid": "3eefca5cf8a49739686a297298b835d7", "score": "0.5501713", "text": "getShoppingCart() {\n return this.$_Angular2HttpClient.post(this.$baseURL + '/management/management.rpc.js?ManageCore-getShoppingCart', rpc.buildClientData()).map(rpc.Converter.convertJsonResponse).toPromise();\n }", "title": "" }, { "docid": "b8f23a59745b845faa35b629501041d5", "score": "0.5494907", "text": "getArbitraryProduct() {\n return requester.getProducts({ page: 1, count: 1 })\n .then(products => {\n return products[0];\n })\n .catch(console.log);\n }", "title": "" }, { "docid": "2fbe67f6a9150fff9641876a4aa799cf", "score": "0.54899496", "text": "function getProducts() {\n return fetch(`${LOCAL_URL}/products`)\n .then((res) => res.json())\n .then((res) => res.data)\n .catch((error) => console.log(error));\n}", "title": "" }, { "docid": "08ea18136574a6e1c21b1c4bca6cbbaa", "score": "0.5488348", "text": "function getProduse() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n produse = JSON.parse(this.responseText);\n drawCards();\n }\n };\n xhttp.open(\"GET\", `https://shop-lounge.firebaseio.com/.json`, true)\n xhttp.send();\n}", "title": "" }, { "docid": "3ba4a3e454d9879ce2e55fd2b95f41a5", "score": "0.54873604", "text": "function kiwi_init(obj)\n{\n query_init_common(obj);\n\n /* set query attributes */\n if (!obj.query.hasOwnProperty('serverQueryURL')) {\n if (obj.query.hasOwnProperty('serverURL') || obj.query.serverURL) {\n obj.query.baseURI = obj.query.serverURL;\n if (obj.query.baseURI[obj.query.baseURI.length - 1] != '/') {\n obj.query.baseURI += \"/\";\n }\n obj.query.baseURI += \"?\";\n } else {\n obj.query.baseURI = \"/?\";\n }\n }\n obj.query.type = 'GET';\n obj.query.scriptCharset = 'utf-8';\n obj.query.dataType = '';\n obj.query.headers = {};\n obj.query.update_query = kiwi_update_query;\n obj.query.cb_recv_response = kiwi_cb_recv_response;\n}", "title": "" }, { "docid": "d2eecd8a00a4febb87bc4eedcdbf198e", "score": "0.54777014", "text": "function requestAddCostumer(name, email, password, storeId) {\n\t$.ajaxSetup({\n\t\t\"async\" : false\n\t});\n\tvar data = $.getJSON(\"../../ajax/store/addCostumer.php?\", {\n\t\tname : name,\n\t\temail : email,\n\t\tpassword : password,\n\t\tstoreId : storeId\n\t});\n\t$.ajaxSetup({\n\t\t\"async\" : true\n\t});\n\treturn $.parseJSON(data[\"responseText\"])[\"result\"];\n}", "title": "" }, { "docid": "cca97b09669b4cc81f5271700de1f707", "score": "0.54748774", "text": "getProducts() {\n return this.httpClient.get(this.baseUrl);\n }", "title": "" }, { "docid": "829a774dd38f717b01e48a7ddcf931df", "score": "0.5473827", "text": "fetchPhases(){\n var myHeaders = new Headers();\n\t\tmyHeaders.append(\"Content-Type\", \"application/json\");\n\t\tmyHeaders.append(\"Authorization\", 'Bearer '+window.sessionStorage.accessToken);\n var myInit = { headers: myHeaders };\n\t\tfetch(Constants.restApiPath+'phases', myInit)\n\t\t.then(function(res){\n\t\t\tif(res.ok){\n\t\t\t\tres.json().then(function(res){\n\t\t\t\t\tdispatcher.dispatch({\n\t\t\t\t\t\ttype: \t\"FETCH_PHASES_FROM_API\",\n\t\t\t\t\t\tres,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t}\n\t\t\telse{\n console.log('phases');\n\t\t\t\tconsole.log(Strings.error.restApi);\n\t\t\t\tconsole.log(res.json());\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "6923ee9ac499915748493d0371e58de7", "score": "0.54723245", "text": "async getCatalog() {\n return await axios.get('http://localhost:8000/phones');\n }", "title": "" }, { "docid": "da4cd9b326e88ea40b6553482d4c0c29", "score": "0.5468402", "text": "function handleGet() {\n\t// Retrieve data here and return results in JSON/other format \n\t$.response.status = $.net.http.OK;\n\tvar queryResults = executeDummyQuery();\n //$.response.setBody(JSON.stringify(queryResults));\n return queryResults;\n}", "title": "" }, { "docid": "a9c78ab540626518ed95042e495bc679", "score": "0.54629636", "text": "retrieveSales() {\n this.cache = []\n var pathToFetch = 'http://127.0.0.1:4000/vueApp/' + this.path + this.client;\n console.log(pathToFetch)\n fetch(pathToFetch)\n .then(res => res.json())\n .then(res => {\n res.forEach(element => {\n this.cache.push(element)\n })\n })\n //The result list is first cached and then push to Vue so there is no noticeable fliker on the front end.\n .then(res => {\n if(this.cache.length>0){\n this.urls=this.cache\n }else if(this.cache==0){\n // When trying to retrieve fron an empty catalog, it alerts the user an loads all the files.\n alert(\"This ID is empty in the database\")\n this.retrieveAll()\n }\n })\n \n }", "title": "" }, { "docid": "eb2fe4428dc6b0c3061d31f368b7f873", "score": "0.5462336", "text": "function test() {\n doGet({\n parameter: {\n name: \"Thomas\",\n location: \"seattle, wa\",\n note: \"hello, world\",\n favorite: 3\n }\n });\n}", "title": "" }, { "docid": "a297397b5b2026a57af9f70c5b9d436b", "score": "0.5458273", "text": "function conGet() {\n //peticion GET con url y la funcion que procesara la respuesta\n $.get(url, procesarJson);\n }", "title": "" }, { "docid": "edb4be9aa40cefb2f04e2b1727a9c7fa", "score": "0.5456795", "text": "getProducts(data) {\n if (user == undefined) {\n alert('please Log in first.')\n throw Error('please Log in first.')\n } else {\n fetch(`https://amazon-price1.p.rapidapi.com/search?keywords=${data}&marketplace=US`, {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-host\": \"amazon-price1.p.rapidapi.com\",\n \"x-rapidapi-key\": \"04ffdca11fmsh6d2319daea4c209p172278jsn9b371a9115f8\"\n }\n })\n .then((r) => { return r.json() })\n .then((info) => {\n info.forEach((p) => {\n const product = new Product(p);\n product.display();\n this.searchedProducts.push(p);\n\n })\n\n })\n .catch(err => {\n console.log(err);\n });\n }\n }", "title": "" }, { "docid": "6e6d0b6a0f6628c965c92aa582e813c4", "score": "0.5453672", "text": "function requestAddToCart(storeId, productId){\n\t$.ajaxSetup({\n\t\t\"async\" : false\n\t});\n\tvar data = $.getJSON(\"../../ajax/store/addToCart.php?\", {\n\t\tproductId : productId,\n\t\tstoreId : storeId\n\t});\n\t$.ajaxSetup({\n\t\t\"async\" : true\n\t});\n\treturn $.parseJSON(data[\"responseText\"])[\"result\"];\n}", "title": "" }, { "docid": "62af868fd1eb60f9d82def8ce3a00376", "score": "0.54518545", "text": "function getProduct() {\n\n // récupérer l'url avec le bon Id\n function getId() {\n const params = (new URL(window.location)).searchParams;\n let id = params.get(\"id\");\n return id;\n }\n id = getId();\n\n // récupérer la réponse de l'API \n fetch(\"http://localhost:3000/api/cameras/\" + id)\n .then(response => response.json())\n .then(response => {\n addProductInfo(response);\n basketContentNav();\n })\n .catch((err) => {\n console.log(err);\n alert(\"Problème de serveur, merci de revenir plus tard.\");\n });\n\n}", "title": "" }, { "docid": "37aeb40d2a1894a6c209e1ef392cf9a4", "score": "0.5451619", "text": "function getProducts() {\n $.get( \"http://localhost:3000/products\", function( res ) {\n for (eachProduct in res.data) {\n showProduct(res.data[eachProduct]);\n }\n });\n}", "title": "" }, { "docid": "4e1240cfdd6917a265daa92364a3e961", "score": "0.54502386", "text": "one(id) {\n return fetch(`${BASE_URL}/products/${id}`, {\n credentials: \"include\"\n }).then(res => res.json());\n }", "title": "" }, { "docid": "d278377b87113b449245fc2d79117a46", "score": "0.5445461", "text": "get(endpoint, options, cb) {\n return this.request('GET', endpoint, options, cb);\n }", "title": "" }, { "docid": "808008c6d525f698cea01f93b93c28ed", "score": "0.5444003", "text": "static getById(id) {\n return request.get(`/item/${id}/`);\n }", "title": "" }, { "docid": "06b1aa1499730da961994642a2fc356c", "score": "0.5440694", "text": "function getInfo(getUrl) { \n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\tvar request = $http({\n\t\t\tmethod: \"GET\",\n\t\t\turl: 'v1/'+getUrl,\n\t\t\theaders: {\n\t\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t'Authorization' : 'Bearer 45345c0c046a4d04b5d1282fdb86e56c'\n\t\t\t\t\t }\n\t\t\n\t\t});\n\t\t \n\t\treturn( request.then( handleSuccess, handleError ) );\n\t}", "title": "" }, { "docid": "80c6417ba392e5b9332d475c3943e4ac", "score": "0.54343367", "text": "function handleGet() {\n\t// Retrieve data here and return results in JSON/other format \n\t\n}", "title": "" }, { "docid": "25f8950a0ac6a5dad6dc4bacac17a014", "score": "0.5433799", "text": "search(context,data) {\n // eslint-disable-next-line no-debugger\n fetch('http://10.177.68.16:8082/merchantAndProduct/dashbord/'+data, {\n method: 'GET',\n // body: JSON.stringfy(data)\n })\n .then(res => res.json())\n .then(res => {\n context.commit('setTodos',res)\n\n // success && success(res)\n \n // }).catch(err => {\n // window.console.log(err)\n // fail && fail()\n })\n\n }", "title": "" }, { "docid": "0cf65d2762e56da71d1169006296e8ff", "score": "0.5433682", "text": "componentWillMount(){\n let url=\"http://services.wine.com/api/beta2/service.svc/json/catalog?apikey=\"+apikey+\"&search=\"+this.props.wineSearchTerm;\n axios.get(url)\n .then(this._saveQuery)\n }", "title": "" }, { "docid": "f88c7287958404b5366ff64c35279f8b", "score": "0.54290503", "text": "init () {\n this.replaceData(this.manager.get(\"noReq\"), this.endpoints.get, this.data.get);\n }", "title": "" }, { "docid": "df3eb18c7da89bc428fda62498b4c689", "score": "0.54270667", "text": "function loadAllItems() {\n if ($('#products').length) {\n $.get('https://cs341group4.tk/Product/GetAll' + window.location.search)\n .done(function (data) {\n $('#message').html(\"\");\n itemList(data.products);\n })\n .fail(function (data) { \n $('#message').html(data.responseJSON.message); \n }); \n } \n if($('#categoryField').length && $.urlParam('category')) {\n $('#categoryField').val($.urlParam('category')); \n } \n if($('#categoriesNavBar').length) {\n loadCategories('navbar', 'categoriesNavBar');\n }\n }", "title": "" }, { "docid": "201a29d4662caf80c8bb5eaf25eaeb17", "score": "0.54251623", "text": "function getShoppingList(eventId, callback) {\n // returns the event's shopping list (list of item objects)\n // each item can have: item_id, display_name, quantity, cost, supplier, ready\n\tvar authToken = LetsDoThis.Session.getInstance().getAuthToken();\n\tvar shoppingListUrl = \"http://159.203.12.88/api/events/\"+eventId+\"/shoppinglist/\";\n\n\t$.ajax({\n\t\ttype: 'GET',\n\t\turl: shoppingListUrl,\n\t\tdataType: 'json',\n\t\tbeforeSend: function(xhr) {\n\t\t\txhr.setRequestHeader(\"Authorization\", \"JWT \" + authToken);\n\t\t},\n\t\tsuccess: function (resp) {\n\t\t\tconsole.log(\"Received Shopping List\");\n\t\t\tcallback(resp);\n\t\t},\n\t\terror: function(e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "770f1ed87d2e7f00e6a2cf215860aab7", "score": "0.5424415", "text": "function getProducts() {\n $.get(\"/api/14products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "da463dc80ee6faea85df4164870d3a6c", "score": "0.54211456", "text": "getShoppingListItems() {\n // global.showSpinner(this);\n global.clearMessages(this);\n //Make an HTTP request to the API to get all shopping list items of the shopping list\n global.callAPI('/shoppinglists/' + this.state.id + '/items/1000/1', 'GET')\n //Handle promise response\n .then((responseJson) => {\n if (responseJson.status && responseJson.status === \"success\") {\n if (this._mounted) {\n this.setState({\n shoppingListItems: responseJson.shoppingListItems\n });\n global.dismissSpinner(this.props.home_component);\n }\n }\n })\n //Handle errors\n .catch((error) => {\n global.dismissSpinner(this.props.home_component);\n });\n }", "title": "" }, { "docid": "33c237e0153ea62e4755a9d29beac0d5", "score": "0.5421053", "text": "function getProducts(req, res, next) {\n console.log(\"Simar\");\n var query = 'SELECT * FROM \"PRODUCT\"';\n var productId = parseInt(req.query.productId);\n\n if(productId){\n query += ' WHERE \"PRODUCT_ID\" = ' + productId;\n }\n \n dataBase.any(query)\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Retrieved all products'\n });\n })\n .catch(function (err) {\n console.log(err);\n return next(err);\n });\n}", "title": "" }, { "docid": "ae391e24e131e4a832c6b71b8b92a491", "score": "0.54177976", "text": "function getProducts() {\n $.get(\"/api/4products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "a721731ae60cf29fb6d3361a664783d7", "score": "0.5405053", "text": "function get() {\n return dispatch => {\n dispatch(request());\n\n cartService.get()\n .then(\n value => {\n console.log(value);\n dispatch(success(value));\n dispatch(alertActions.success(\"Cart retrieved\"))\n },\n error => {\n console.log(error);\n dispatch(failure(error.toString()));\n dispatch(alertActions.error(error.toString()));\n }\n );\n };\n\n function request(value) { return { type: cartConstants.GET_CART_REQUEST, value } }\n function success(value) { return { type: cartConstants.GET_CART_SUCCESS, value } }\n function failure(error) { return { type: cartConstants.GET_CART_FAILURE, error } }\n}", "title": "" }, { "docid": "c5358587aada76508bf7b4860ea20901", "score": "0.54008996", "text": "getItems() {\r\n\t\tvar request = new XMLHttpRequest(),\r\n\t\t\tmethod = 'GET',\r\n\t\t\turl = 'api/index.php/shoppinglist';\r\n\t\trequest.open(method, url, true);\r\n\t\trequest.onreadystatechange = () => {\r\n\t\t\tif (request.readyState === XMLHttpRequest.DONE && request.status === 200) {\r\n\t\t\t\tvar response = JSON.parse(request.responseText);\r\n\t\t\t\tthis.items = response.data;\r\n\t\t\t\tthis.render();\r\n\t\t\t}\r\n\t\t}\r\n\t\trequest.send();\r\n\t}", "title": "" }, { "docid": "d0c0b752c8600e3bca0ee2fb278cc4a1", "score": "0.5398994", "text": "function getRequest(){\n axios.request({\n method : \"GET\",\n url : \"https://jsonplaceholder.typicode.com/posts\",\n }).then(getSuccess).catch(failure);\n}", "title": "" }, { "docid": "14ecd7bf292120f8ac7bdeaefb6b158f", "score": "0.5397829", "text": "getProducts({ commit }) {\n axios.get('/products')\n .then(response => {\n commit('GET_PRODUCTS', response.data)\n })\n }", "title": "" }, { "docid": "1e08b2a659f85581ec8e5322006e9487", "score": "0.5395623", "text": "function loadProducts() {\n $http.get(\"http://localhost:3000/api/meals\").success(function (offerings) {\n app.offerings = offerings;\n });\n }", "title": "" } ]
d4880739cfb5c04b7f57294cd0a534b7
Assign the internal encoding name from the argument encoding name.
[ { "docid": "ebee41fb58e39edb969f7235c60b1de2", "score": "0.67385846", "text": "function assignEncodingName(target) {\n\t var name = '';\n\t var expect = ('' + target).toUpperCase().replace(/[^A-Z0-9]+/g, '');\n\t var aliasNames = getKeys(EncodingAliases);\n\t var len = aliasNames.length;\n\t var hit = 0;\n\t var encoding, encodingLen, j;\n\t\n\t for (var i = 0; i < len; i++) {\n\t encoding = aliasNames[i];\n\t if (encoding === expect) {\n\t name = encoding;\n\t break;\n\t }\n\t\n\t encodingLen = encoding.length;\n\t for (j = hit; j < encodingLen; j++) {\n\t if (encoding.slice(0, j) === expect.slice(0, j) ||\n\t encoding.slice(-j) === expect.slice(-j)) {\n\t name = encoding;\n\t hit = j;\n\t }\n\t }\n\t }\n\t\n\t if (hasOwnProperty.call(EncodingAliases, name)) {\n\t return EncodingAliases[name];\n\t }\n\t\n\t return name;\n\t}", "title": "" } ]
[ { "docid": "8df015d0c8ac1a0bd2d3d829a7ffb750", "score": "0.67938566", "text": "getEncodingName(encoding) {\n for (let [name, enc] of Object.entries(this.encoding)) {\n if (enc == encoding) return name;\n }\n }", "title": "" }, { "docid": "f7334230ec7d5fb585cc977f30e26286", "score": "0.67407817", "text": "function assignEncodingName(target) {\n var name = '';\n var expect = ('' + target).toUpperCase().replace(/[^A-Z0-9]+/g, '');\n var aliasNames = util.getKeys(EncodingAliases);\n var len = aliasNames.length;\n var hit = 0;\n var encoding, encodingLen, j;\n for (var i = 0; i < len; i++) {\n encoding = aliasNames[i];\n if (encoding === expect) {\n name = encoding;\n break;\n }\n encodingLen = encoding.length;\n for (j = hit; j < encodingLen; j++) {\n if (encoding.slice(0, j) === expect.slice(0, j) ||\n encoding.slice(-j) === expect.slice(-j)) {\n name = encoding;\n hit = j;\n }\n }\n }\n if (hasOwnProperty.call(EncodingAliases, name)) {\n return EncodingAliases[name];\n }\n return name;\n }", "title": "" }, { "docid": "83b1f865c1502f4ea41733b04b77284a", "score": "0.5450197", "text": "function normalizeEncoding(enc) {\n\t\t\t var nenc = _normalizeEncoding(enc);\n\t\t\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t\t return nenc || enc;\n\t\t\t}", "title": "" }, { "docid": "83b1f865c1502f4ea41733b04b77284a", "score": "0.5450197", "text": "function normalizeEncoding(enc) {\n\t\t\t var nenc = _normalizeEncoding(enc);\n\t\t\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t\t return nenc || enc;\n\t\t\t}", "title": "" }, { "docid": "83b1f865c1502f4ea41733b04b77284a", "score": "0.5450197", "text": "function normalizeEncoding(enc) {\n\t\t\t var nenc = _normalizeEncoding(enc);\n\t\t\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t\t return nenc || enc;\n\t\t\t}", "title": "" }, { "docid": "83b1f865c1502f4ea41733b04b77284a", "score": "0.5450197", "text": "function normalizeEncoding(enc) {\n\t\t\t var nenc = _normalizeEncoding(enc);\n\t\t\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t\t return nenc || enc;\n\t\t\t}", "title": "" }, { "docid": "83b1f865c1502f4ea41733b04b77284a", "score": "0.5450197", "text": "function normalizeEncoding(enc) {\n\t\t\t var nenc = _normalizeEncoding(enc);\n\t\t\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t\t return nenc || enc;\n\t\t\t}", "title": "" }, { "docid": "13fb0ff8fa026a11cedb8e790fc9dc85", "score": "0.54298097", "text": "function getEncoding(platformID, encodingID) {\n\t var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n\t if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n\t return MAC_LANGUAGE_ENCODINGS[languageID];\n\t }\n\n\t return ENCODINGS[platformID][encodingID];\n\t}", "title": "" }, { "docid": "13fb0ff8fa026a11cedb8e790fc9dc85", "score": "0.54298097", "text": "function getEncoding(platformID, encodingID) {\n\t var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n\t if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n\t return MAC_LANGUAGE_ENCODINGS[languageID];\n\t }\n\n\t return ENCODINGS[platformID][encodingID];\n\t}", "title": "" }, { "docid": "13fb0ff8fa026a11cedb8e790fc9dc85", "score": "0.54298097", "text": "function getEncoding(platformID, encodingID) {\n\t var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n\t if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n\t return MAC_LANGUAGE_ENCODINGS[languageID];\n\t }\n\n\t return ENCODINGS[platformID][encodingID];\n\t}", "title": "" }, { "docid": "b60b3df90525214b74e6595e29d7a11c", "score": "0.5425154", "text": "function normalizeEncoding(enc) {\n\t\t var nenc = _normalizeEncoding(enc);\n\t\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t return nenc || enc;\n\t\t}", "title": "" }, { "docid": "b60b3df90525214b74e6595e29d7a11c", "score": "0.5425154", "text": "function normalizeEncoding(enc) {\n\t\t var nenc = _normalizeEncoding(enc);\n\t\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t\t return nenc || enc;\n\t\t}", "title": "" }, { "docid": "a4a8e09720b8bf834d33d3eda63cb2d3", "score": "0.5419935", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "a4a8e09720b8bf834d33d3eda63cb2d3", "score": "0.5419935", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "122682e51b9a04412bf55db73a1af768", "score": "0.5386758", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "b37b6393f7e44ecef1402f79d3c1e493", "score": "0.5374257", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (\n typeof nenc !== 'string' &&\n (Buffer.isEncoding === isEncoding || !isEncoding(enc))\n )\n throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "cd2619e94822a3f44b843d31383cf57d", "score": "0.5367551", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (\n typeof nenc !== \"string\" &&\n (Buffer.isEncoding === isEncoding || !isEncoding(enc))\n )\n throw new Error(\"Unknown encoding: \" + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "9f19129f0e9d03d592f4baafd880ac51", "score": "0.5352682", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (\n typeof nenc !== \"string\" &&\n (Buffer.isEncoding === isEncoding || !isEncoding(enc))\n )\n throw new Error(\"Unknown encoding: \" + enc);\n return nenc || enc;\n }", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "eb7dccd2f15d6164d50b56a7eaf7bf74", "score": "0.5320027", "text": "function normalizeEncoding(enc) {\n\t var nenc = _normalizeEncoding(enc);\n\t if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n\t return nenc || enc;\n\t}", "title": "" }, { "docid": "bf45a052a0ac362f4d5c8ae15dbbf07e", "score": "0.53146595", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer$8.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "deda094cdbc59fff6f70888fdfbf7806", "score": "0.52785933", "text": "function getEncoding(platformID, encodingID) {\n var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n return MAC_LANGUAGE_ENCODINGS[languageID];\n }\n\n return ENCODINGS[platformID][encodingID];\n}", "title": "" }, { "docid": "deda094cdbc59fff6f70888fdfbf7806", "score": "0.52785933", "text": "function getEncoding(platformID, encodingID) {\n var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n return MAC_LANGUAGE_ENCODINGS[languageID];\n }\n\n return ENCODINGS[platformID][encodingID];\n}", "title": "" }, { "docid": "deda094cdbc59fff6f70888fdfbf7806", "score": "0.52785933", "text": "function getEncoding(platformID, encodingID) {\n var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n return MAC_LANGUAGE_ENCODINGS[languageID];\n }\n\n return ENCODINGS[platformID][encodingID];\n}", "title": "" }, { "docid": "deda094cdbc59fff6f70888fdfbf7806", "score": "0.52785933", "text": "function getEncoding(platformID, encodingID) {\n var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n return MAC_LANGUAGE_ENCODINGS[languageID];\n }\n\n return ENCODINGS[platformID][encodingID];\n}", "title": "" }, { "docid": "deda094cdbc59fff6f70888fdfbf7806", "score": "0.52785933", "text": "function getEncoding(platformID, encodingID) {\n var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {\n return MAC_LANGUAGE_ENCODINGS[languageID];\n }\n\n return ENCODINGS[platformID][encodingID];\n}", "title": "" }, { "docid": "c3c3c654e4f05906381647f7591bdda8", "score": "0.5259404", "text": "function specify(encoding, spec, index) {\n\t\t\t var s = 0;\n\t\t\t if(spec.encoding.toLowerCase() === encoding.toLowerCase()){\n\t\t\t s |= 1;\n\t\t\t } else if (spec.encoding !== '*' ) {\n\t\t\t return null\n\t\t\t }\n\n\t\t\t return {\n\t\t\t i: index,\n\t\t\t o: spec.i,\n\t\t\t q: spec.q,\n\t\t\t s: s\n\t\t\t }\n\t\t\t}", "title": "" }, { "docid": "60da8b3e34fe2f5c7bd9c883d54e89d8", "score": "0.5258532", "text": "function specify(encoding,spec,index){var s=0;if(spec.encoding.toLowerCase()===encoding.toLowerCase()){s|=1;}else if(spec.encoding!=='*'){return null;}return{i:index,o:spec.i,q:spec.q,s:s};}", "title": "" }, { "docid": "d461561697aa87b8beb7f73d3a701425", "score": "0.52575225", "text": "function validateEncoding(encoding) {\n if (encoding === undefined) {\n return 'utf-8';\n }\n\n if (!Iconv.encodingExists(encoding)) {\n throw new Error(`encoding not recognized: '${encoding}'`);\n }\n\n return encoding;\n}", "title": "" }, { "docid": "96d1f508300c6edda4d55d34ec9feba3", "score": "0.52472234", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer$a.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "d855a4e9ab000b8411c089f5050c153a", "score": "0.5242863", "text": "function getEncoding(platformID,encodingID){var languageID=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(platformID===1&&MAC_LANGUAGE_ENCODINGS[languageID]){return MAC_LANGUAGE_ENCODINGS[languageID];}return ENCODINGS[platformID][encodingID];}// Map of platform ids to encoding ids.", "title": "" }, { "docid": "3be9717eb38ff50892eb486974d55fb1", "score": "0.5226806", "text": "InitializeDecode(string, EncodingType) {\n\n }", "title": "" }, { "docid": "be326f8155e8b2c97680dfadae1ec83e", "score": "0.52080894", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer$4.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" }, { "docid": "74f7d12b4db895f258cfa6c750cabd4b", "score": "0.52018416", "text": "function normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}", "title": "" } ]
af17a488ca8aecdabc7122eaa2f049fd
Initialize a new namespace.
[ { "docid": "12711edeabc7504a7e41712b0867d159", "score": "0.6433371", "text": "createNamespace(name) {\n const namespaceResource = {\n functions: new Map(),\n tags: new Map(),\n advancements: new Map(),\n predicates: new Map(),\n loot_tables: new Map(),\n recipes: new Map(),\n };\n this.namespaces.set(name, namespaceResource);\n return namespaceResource;\n }", "title": "" } ]
[ { "docid": "d76e1d467095c959f653d9150d8680fd", "score": "0.7095451", "text": "function Namespace() {}", "title": "" }, { "docid": "42ad4fd4c322eb853228e04e67c26b36", "score": "0.6374505", "text": "function _createNamespace(name) {\n if (!name || typeof name != \"string\") {\n throw new Error('First parameter must be a string');\n }\n if (storage_available) {\n if (!window.localStorage.getItem(name)) {\n window.localStorage.setItem(name, '{}');\n }\n if (!window.sessionStorage.getItem(name)) {\n window.sessionStorage.setItem(name, '{}');\n }\n } else {\n if (!window.localCookieStorage.getItem(name)) {\n window.localCookieStorage.setItem(name, '{}');\n }\n if (!window.sessionCookieStorage.getItem(name)) {\n window.sessionCookieStorage.setItem(name, '{}');\n }\n }\n var ns = {\n localStorage: $.extend({}, $.localStorage, {_ns: name}),\n sessionStorage: $.extend({}, $.sessionStorage, {_ns: name})\n };\n if (typeof Cookies === 'object') {\n if (!window.cookieStorage.getItem(name)) {\n window.cookieStorage.setItem(name, '{}');\n }\n ns.cookieStorage = $.extend({}, $.cookieStorage, {_ns: name});\n }\n $.namespaceStorages[name] = ns;\n return ns;\n }", "title": "" }, { "docid": "85a130c01dc0d15184d71070d1d1d140", "score": "0.6368488", "text": "function Namespace() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n var symbol = Symbol(name);\n return function namespace(object) {\n var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (data) {\n return data;\n };\n\n if (object[symbol] === undefined) {\n object[symbol] = init({});\n }\n return object[symbol];\n };\n}", "title": "" }, { "docid": "f03a14e4f00e4831795f00eeed555d1d", "score": "0.6352165", "text": "function init() {\n\t\t\tvar library, namespaces = [], previousValues = {};\n\n\t\t\tlibrary = factory('global');\n\t\t\tlibrary.fork = init;\n\t\t\tlibrary.noConflict = noConflict;\n\t\t\treturn library;\n\n\t\t\t//sets library namespaces\n\t\t\tfunction noConflict( ) {\n\t\t\t\tvar args, nI, newNamespaces;\n\n\t\t\t\tnewNamespaces = Array.prototype.slice.apply(arguments);\n\n\t\t\t\tfor(nI = 0; nI < namespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof previousValues[namespaces[nI]] === 'undefined') {\n\t\t\t\t\t\tdelete context[namespaces[nI]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext[namespaces[nI]] = previousValues[namespaces[nI]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpreviousValues = {};\n\n\t\t\t\tfor(nI = 0; nI < newNamespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof newNamespaces[nI] !== 'string') {\n\t\t\t\t\t\tthrow new Error('Cannot replace namespaces. All new namespaces must be strings.');\n\t\t\t\t\t}\n\t\t\t\t\tpreviousValues[newNamespaces[nI]] = context[newNamespaces[nI]];\n\t\t\t\t\tcontext[newNamespaces[nI]] = library;\n\t\t\t\t}\n\n\t\t\t\tnamespaces = newNamespaces;\n\n\t\t\t\treturn namespaces;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f03a14e4f00e4831795f00eeed555d1d", "score": "0.6352165", "text": "function init() {\n\t\t\tvar library, namespaces = [], previousValues = {};\n\n\t\t\tlibrary = factory('global');\n\t\t\tlibrary.fork = init;\n\t\t\tlibrary.noConflict = noConflict;\n\t\t\treturn library;\n\n\t\t\t//sets library namespaces\n\t\t\tfunction noConflict( ) {\n\t\t\t\tvar args, nI, newNamespaces;\n\n\t\t\t\tnewNamespaces = Array.prototype.slice.apply(arguments);\n\n\t\t\t\tfor(nI = 0; nI < namespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof previousValues[namespaces[nI]] === 'undefined') {\n\t\t\t\t\t\tdelete context[namespaces[nI]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext[namespaces[nI]] = previousValues[namespaces[nI]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpreviousValues = {};\n\n\t\t\t\tfor(nI = 0; nI < newNamespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof newNamespaces[nI] !== 'string') {\n\t\t\t\t\t\tthrow new Error('Cannot replace namespaces. All new namespaces must be strings.');\n\t\t\t\t\t}\n\t\t\t\t\tpreviousValues[newNamespaces[nI]] = context[newNamespaces[nI]];\n\t\t\t\t\tcontext[newNamespaces[nI]] = library;\n\t\t\t\t}\n\n\t\t\t\tnamespaces = newNamespaces;\n\n\t\t\t\treturn namespaces;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f03a14e4f00e4831795f00eeed555d1d", "score": "0.6352165", "text": "function init() {\n\t\t\tvar library, namespaces = [], previousValues = {};\n\n\t\t\tlibrary = factory('global');\n\t\t\tlibrary.fork = init;\n\t\t\tlibrary.noConflict = noConflict;\n\t\t\treturn library;\n\n\t\t\t//sets library namespaces\n\t\t\tfunction noConflict( ) {\n\t\t\t\tvar args, nI, newNamespaces;\n\n\t\t\t\tnewNamespaces = Array.prototype.slice.apply(arguments);\n\n\t\t\t\tfor(nI = 0; nI < namespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof previousValues[namespaces[nI]] === 'undefined') {\n\t\t\t\t\t\tdelete context[namespaces[nI]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext[namespaces[nI]] = previousValues[namespaces[nI]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpreviousValues = {};\n\n\t\t\t\tfor(nI = 0; nI < newNamespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof newNamespaces[nI] !== 'string') {\n\t\t\t\t\t\tthrow new Error('Cannot replace namespaces. All new namespaces must be strings.');\n\t\t\t\t\t}\n\t\t\t\t\tpreviousValues[newNamespaces[nI]] = context[newNamespaces[nI]];\n\t\t\t\t\tcontext[newNamespaces[nI]] = library;\n\t\t\t\t}\n\n\t\t\t\tnamespaces = newNamespaces;\n\n\t\t\t\treturn namespaces;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ee7fee5b1a922ea04705250ca8a1fa3e", "score": "0.6344278", "text": "function createNamespace() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n var symbol = Symbol(name);\n return function namespace(object) {\n var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (data) {\n return data;\n };\n\n if (object[symbol] === undefined) {\n // eslint-disable-next-line no-param-reassign\n object[symbol] = init({});\n }\n return object[symbol];\n };\n}", "title": "" }, { "docid": "496054c74ba0da3a00f22ff01a21295a", "score": "0.62440896", "text": "function Namespace() {\n\t\t\t\n\t\t\t//private function to use the logger or just directly print to the console\n\t\t\tfunction _log(message, useAlert) {\n\t\t\t\tif (this.get('Logger') && useAlert) this.get('Logger').errorAlert(message);\n\t\t\t\telse if (this.get('Logger')) this.get('Logger').error(message);\n\t\t\t\telse if (useAlert) alert('Error: ' + message);\n\t\t\t\telse cosnsole.log('Error: ' + message);\n\t\t\t};\n\t\t\t\n\t\t\t//private function to get a value, used so that internal calls won't infinite loop\n\t\t\tfunction _get(key, shouldLog) {\n\t\t\t\tvar retVar = contents[key] || null;\n\t\t\t\tif (shouldLog && !retVar) _log.call(this, 'Returned null value for key ' + key);\n\t\t\t\treturn retVar;\n\t\t\t};\n\t\t\t\n\t\t\t//holds the actual values set\n\t\t\tvar contents = {};\n\t\t\t\n\t\t\t//getter method\n\t\t\tthis.get = function(key) {\n\t\t\t\treturn _get(key, true);\n\t\t\t};\n\t\t\t\n\t\t\t//setter method, doesn't overwrite existing values\n\t\t\tthis.set = function(key, val) {\n\t\t\t\tif (_get(key, false)) {\n\t\t\t\t\t//log some error and don't set the value\n\t\t\t\t\t_log.call(this, 'Tried to overwrite existing object in global namespace: ' + key, true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//set the value\n\t\t\t\t\tcontents[key] = val;\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t}", "title": "" }, { "docid": "746b7067cc27fb2e2345db0f6ebd38b6", "score": "0.6229539", "text": "function defineNamespace(ns, ns_string) {\n var parts = ns_string.split('.'),\n parent = ns,\n pl, i;\n if (parts[0] == \"myApp\") {\n parts = parts.slice(1);\n }\n pl = parts.length;\n for (i = 0; i < pl; i++) {\n //create a property if it doesnt exist \n if (typeof parent[parts[i]] == 'undefined') {\n parent[parts[i]] = {};\n }\n parent = parent[parts[i]];\n }\n return parent;\n}", "title": "" }, { "docid": "f35660d07c8f1febf324cf869f388839", "score": "0.611767", "text": "function namespace( ns, ns_string ) {\n var parts = ns_string.split('.'),\n parent = ns,\n pl, i;\n if (parts[0] == \"MEUI\") {\n parts = parts.slice(1);\n }\n pl = parts.length;\n for (i = 0; i < pl; i++) {\n //create a property if it doesnt exist\n if (typeof parent[parts[i]] == 'undefined') {\n parent[parts[i]] = {};\n }\n parent = parent[parts[i]];\n }\n return parent;\n}", "title": "" }, { "docid": "951e36ed626c910fbba0c740a066d373", "score": "0.61043596", "text": "function Namespace(name, label, settings) {\n\t\tthis.name = name;\n\t\tthis.label = label;\n\t\tthis.settings = settings;\n\t}", "title": "" }, { "docid": "689afa6c389578609eed4f2e7a628048", "score": "0.60628885", "text": "function constructGlobal() {\n\t\tvar library;\n\n\t\t//create a library instance\n\t\tlibrary = init();\n\t\tlibrary.noConflict.apply(null, namespaces);\n\n\t\t//spawns a library instance\n\t\tfunction init() {\n\t\t\tvar library, namespaces = [], previousValues = {};\n\n\t\t\tlibrary = factory('global');\n\t\t\tlibrary.fork = init;\n\t\t\tlibrary.noConflict = noConflict;\n\t\t\treturn library;\n\n\t\t\t//sets library namespaces\n\t\t\tfunction noConflict( ) {\n\t\t\t\tvar args, nI, newNamespaces;\n\n\t\t\t\tnewNamespaces = Array.prototype.slice.apply(arguments);\n\n\t\t\t\tfor(nI = 0; nI < namespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof previousValues[namespaces[nI]] === 'undefined') {\n\t\t\t\t\t\tdelete context[namespaces[nI]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext[namespaces[nI]] = previousValues[namespaces[nI]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpreviousValues = {};\n\n\t\t\t\tfor(nI = 0; nI < newNamespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof newNamespaces[nI] !== 'string') {\n\t\t\t\t\t\tthrow new Error('Cannot replace namespaces. All new namespaces must be strings.');\n\t\t\t\t\t}\n\t\t\t\t\tpreviousValues[newNamespaces[nI]] = context[newNamespaces[nI]];\n\t\t\t\t\tcontext[newNamespaces[nI]] = library;\n\t\t\t\t}\n\n\t\t\t\tnamespaces = newNamespaces;\n\n\t\t\t\treturn namespaces;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5c3e0c04c719a3e41815bc65b2303f8d", "score": "0.6045075", "text": "function CreateNamespace(namespaceString)\n{\n var parts = namespaceString.split('.'),\n parent = window,\n currentPart = '';\n\n for (var i = 0, length = parts.length; i < length; i++)\n {\n currentPart = parts[i];\n parent[currentPart] = parent[currentPart] || {};\n parent = parent[currentPart];\n }\n\n return parent;\n}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.6017359", "text": "function init() {}", "title": "" }, { "docid": "5b0e1ffc66150f2c543674e03d1a8f5f", "score": "0.58691007", "text": "init() {\n this._parseNameCache = (0, _utils.dictionary)(null);\n }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.5826228", "text": "function init() { }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.5826228", "text": "function init() { }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.5826228", "text": "function init() { }", "title": "" }, { "docid": "c26d9a308aa11ce2f0210f331e0a0090", "score": "0.5826228", "text": "function init() { }", "title": "" }, { "docid": "a82da5d92779f1cb5acb9a40fcd5f2f1", "score": "0.58231837", "text": "constructor() {\n console.log('Initializing cryptomoji handler with namespace:', NAMESPACE);\n super(FAMILY_NAME, [FAMILY_VERSION], [NAMESPACE]);\n }", "title": "" }, { "docid": "316ef310e39cb9c1ae7cdc26d501c1f7", "score": "0.58171684", "text": "function constructGlobal() {\n\t\tvar library;\n\n\t\t//create a library instance\n\t\tlibrary = init();\n\t\tlibrary.noConflict('KeyboardJS', 'k');\n\n\t\t//spawns a library instance\n\t\tfunction init() {\n\t\t\tvar library, namespaces = [], previousValues = {};\n\n\t\t\tlibrary = factory('global');\n\t\t\tlibrary.fork = init;\n\t\t\tlibrary.noConflict = noConflict;\n\t\t\treturn library;\n\n\t\t\t//sets library namespaces\n\t\t\tfunction noConflict( ) {\n\t\t\t\tvar args, nI, newNamespaces;\n\n\t\t\t\tnewNamespaces = Array.prototype.slice.apply(arguments);\n\n\t\t\t\tfor(nI = 0; nI < namespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof previousValues[namespaces[nI]] === 'undefined') {\n\t\t\t\t\t\tdelete context[namespaces[nI]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext[namespaces[nI]] = previousValues[namespaces[nI]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpreviousValues = {};\n\n\t\t\t\tfor(nI = 0; nI < newNamespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof newNamespaces[nI] !== 'string') {\n\t\t\t\t\t\tthrow new Error('Cannot replace namespaces. All new namespaces must be strings.');\n\t\t\t\t\t}\n\t\t\t\t\tpreviousValues[newNamespaces[nI]] = context[newNamespaces[nI]];\n\t\t\t\t\tcontext[newNamespaces[nI]] = library;\n\t\t\t\t}\n\n\t\t\t\tnamespaces = newNamespaces;\n\n\t\t\t\treturn namespaces;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "316ef310e39cb9c1ae7cdc26d501c1f7", "score": "0.58171684", "text": "function constructGlobal() {\n\t\tvar library;\n\n\t\t//create a library instance\n\t\tlibrary = init();\n\t\tlibrary.noConflict('KeyboardJS', 'k');\n\n\t\t//spawns a library instance\n\t\tfunction init() {\n\t\t\tvar library, namespaces = [], previousValues = {};\n\n\t\t\tlibrary = factory('global');\n\t\t\tlibrary.fork = init;\n\t\t\tlibrary.noConflict = noConflict;\n\t\t\treturn library;\n\n\t\t\t//sets library namespaces\n\t\t\tfunction noConflict( ) {\n\t\t\t\tvar args, nI, newNamespaces;\n\n\t\t\t\tnewNamespaces = Array.prototype.slice.apply(arguments);\n\n\t\t\t\tfor(nI = 0; nI < namespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof previousValues[namespaces[nI]] === 'undefined') {\n\t\t\t\t\t\tdelete context[namespaces[nI]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext[namespaces[nI]] = previousValues[namespaces[nI]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpreviousValues = {};\n\n\t\t\t\tfor(nI = 0; nI < newNamespaces.length; nI += 1) {\n\t\t\t\t\tif(typeof newNamespaces[nI] !== 'string') {\n\t\t\t\t\t\tthrow new Error('Cannot replace namespaces. All new namespaces must be strings.');\n\t\t\t\t\t}\n\t\t\t\t\tpreviousValues[newNamespaces[nI]] = context[newNamespaces[nI]];\n\t\t\t\t\tcontext[newNamespaces[nI]] = library;\n\t\t\t\t}\n\n\t\t\t\tnamespaces = newNamespaces;\n\n\t\t\t\treturn namespaces;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "e35dcaad55ad8e12fd5a61bcd85d99a4", "score": "0.57911426", "text": "init(){}", "title": "" }, { "docid": "e331df186a7250715ed19aa2fa0e2864", "score": "0.5784909", "text": "function parse_namespace(state, parent)\n{\n\t// handle \"namespace\" keyword\n\tlet where = state.get();\n\tlet token = module.get_token(state);\n\tmodule.assert(token.type == \"keyword\" && token.value == \"namespace\", \"[parse_namespace] internal error\");\n\n\t// check the parent\n\tif (parent.petype != \"global scope\" && parent.petype != \"namespace\") state.error(\"/syntax/se-63\");\n\n\t// display name prefix\n\tlet prefix = \"\";\n\t{\n\t\tlet p = parent;\n\t\twhile (p.petype == \"namespace\")\n\t\t{\n\t\t\tprefix = p.name + \".\" + prefix;\n\t\t\tp = p.parent;\n\t\t}\n\t}\n\n\t// obtain namespace name\n\ttoken = module.get_token(state);\n\tif (token.type != \"identifier\") state.error(\"/syntax/se-64\");\n\tlet nname = token.value;\n\n\t// check namespace name\n\tif (module.options.checkstyle && ! state.builtin() && nname[0] >= 'A' && nname[0] <= 'Z')\n\t{\n\t\tstate.error(\"/style/ste-3\", [\"namespace\", nname]);\n\t}\n\n\t// obtain the named object corresponding to the namespace globally across instances\n\tlet global_nspace = null;\n\tif (parent.names.hasOwnProperty(nname))\n\t{\n\t\t// extend the existing namespace\n\t\tglobal_nspace = parent.names[nname];\n\t\tif (global_nspace.petype != \"namespace\") state.error(\"/name/ne-19\", [nname]);\n\t}\n\telse\n\t{\n\t\t// create the namespace\n\t\tglobal_nspace = { \"petype\": \"namespace\", \"parent\": parent, \"name\": nname, \"displayname\": prefix + nname, \"names\": {}, \"declaration\": true };\n\t\tparent.names[nname] = global_nspace;\n\t}\n\n\t// create the local namespace PE instance containing the commands\n\tlet local_nspace = { \"petype\": \"namespace\", \"where\": where, \"parent\": parent, \"names\": global_nspace.names, \"commands\": [], \"name\": nname, \"displayname\": prefix + nname, \"step\": scopestep, \"sim\": simfalse };\n\n\t// parse the namespace body\n\ttoken = module.get_token(state);\n\tif (token.type != \"grouping\" || token.value != '{') state.error(\"/syntax/se-40\", [\"namespace declaration\"]);\n\tstate.indent.push(-1 - token.line);\n\twhile (true)\n\t{\n\t\t// check for end-of-body\n\t\ttoken = module.get_token(state, true);\n\t\tif (token.type == \"grouping\" && token.value == '}')\n\t\t{\n\t\t\tstate.indent.pop();\n\t\t\tif (module.options.checkstyle && ! state.builtin())\n\t\t\t{\n\t\t\t\tlet indent = state.indentation();\n\t\t\t\tlet topmost = state.indent[state.indent.length - 1];\n\t\t\t\tif (topmost >= 0 && topmost != indent) state.error(\"/style/ste-2\");\n\t\t\t}\n\t\t\tmodule.get_token(state);\n\t\t\tbreak;\n\t\t}\n\n\t\t// parse sub-declarations\n\t\tlet sub = parse_statement_or_declaration(state, local_nspace);\n\t\tif (sub.hasOwnProperty(\"name\")) sub.displayname = prefix + nname + \".\" + sub.name;\n\t\tlocal_nspace.commands.push(sub);\n\t}\n\n\treturn local_nspace;\n}", "title": "" }, { "docid": "6f3c550460cbfe36333dd77e01efb6bd", "score": "0.5780317", "text": "function init() {\n\t\tif (trimlibs === false) {\n\t\t\ttrimlibs = {};\n\t\t\t$('link[rel=trimlib]').each(function() {\n\t\t\t\tvar trimlib = new Trimlib(this);\n\t\t\t\ttrimlibs[trimlib.namespace] = trimlib;\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "3e0bac7b7532b66db72c2b6df9934652", "score": "0.5727842", "text": "function USING_NAMESPACE(n)\r\n{\r\n\treturn mol.USING_NAMESPACE(n);\r\n}", "title": "" }, { "docid": "a76325ef596819df6722cb13bf31f802", "score": "0.5719156", "text": "function XNamespace(nspPath)\r\n {\r\n this.path = nspPath;\r\n this.nsp = io.of(this.path || '/', null);\r\n }", "title": "" }, { "docid": "25c10cf908dc288b9dd238ad7b8ca4b8", "score": "0.571221", "text": "function init(){}", "title": "" }, { "docid": "14d3c93e5050d0f208f89f42504120fc", "score": "0.57052374", "text": "static _create(document, localName, namespace = null, namespacePrefix = null) {\n const node = new ElementImpl();\n node._localName = localName;\n node._namespace = namespace;\n node._namespacePrefix = namespacePrefix;\n node._nodeDocument = document;\n return node;\n }", "title": "" }, { "docid": "14d3c93e5050d0f208f89f42504120fc", "score": "0.57052374", "text": "static _create(document, localName, namespace = null, namespacePrefix = null) {\n const node = new ElementImpl();\n node._localName = localName;\n node._namespace = namespace;\n node._namespacePrefix = namespacePrefix;\n node._nodeDocument = document;\n return node;\n }", "title": "" }, { "docid": "56dc3eb8770145f07fa76be84212af28", "score": "0.5693509", "text": "lockNamespace() {\n }", "title": "" }, { "docid": "1b91ef39833b0cd6df7a729573354cc3", "score": "0.56904995", "text": "function init() {\n\t//TODO\n}", "title": "" }, { "docid": "e55e9bf103425c6e10eafd459328c6bf", "score": "0.5683409", "text": "function NAMESPACE(n)\r\n{\r\n\treturn mol.NAMESPACE(n);\r\n}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5679569", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5679569", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5679569", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5679569", "text": "initialize() {}", "title": "" }, { "docid": "6f58a24addd4d3707740b463fbcebb91", "score": "0.5653761", "text": "setNamespace(value) {\n this.context.setNamespace(value);\n return this;\n }", "title": "" }, { "docid": "f9e5050e58babfca28103f3ce0d9015f", "score": "0.5645067", "text": "initialize () {}", "title": "" }, { "docid": "f9e5050e58babfca28103f3ce0d9015f", "score": "0.5645067", "text": "initialize () {}", "title": "" }, { "docid": "7c07cdc5a5a806e56086a3c386a740ab", "score": "0.5634776", "text": "initialise() { }", "title": "" }, { "docid": "945200a71d430959fd5c9ad2f303950c", "score": "0.5613843", "text": "function _init() {\n }", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56123894", "text": "init() {}", "title": "" }, { "docid": "a3ebf3bc688735e0bc377859d232d783", "score": "0.55642474", "text": "constructor(localName) {\n super();\n this._namespace = null;\n this._namespacePrefix = null;\n this._element = null;\n this._value = '';\n this._localName = localName;\n }", "title": "" }, { "docid": "c76c7b08b69e87c0d3f09c958a107275", "score": "0.5559196", "text": "async init() {}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5535791", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5535791", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5535791", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5535791", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5535791", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5535791", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.5535791", "text": "init() { }", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.5533471", "text": "function Ctor() {}", "title": "" }, { "docid": "1914a737e28940ae05868f3f23cab214", "score": "0.5523727", "text": "function namespace( name, object ) {\n //if ( !/[\\w$_]*(\\..+[^\\.]$)?/.test( name ) ) throw new Error( \"UnExpected Naming\", \"UnExpected Naming\" );\n\n var attrs = name.split( \".\" );\n if ( attrs[attrs.length - 1] == \"\" ) throw new Error( \"Incomplete Naming on \" + name, \"Incomplete Naming on \" + name );\n\n var currentObject = window[attrs[0]] = window[attrs[0]] || {};\n attrs.shift();\n attrs.forEach( function ( attr ) {\n try{\n currentObject[attr] = currentObject[attr] || {};\n }\n catch ( e ) {\n\t console.log( \"cannot create \" + attr + \" from \" + name );\n throw new Error( \"Namespace Allready aquired by a non-object\", \"Namespace Allready aquired by non-object\" );\n }\n currentObject = currentObject[attr];\n } );\n for ( var i in object ) {\n try {\n if ( typeof object[i] == \"object\" && object[i] instanceof Accessor ) {\n Object.defineProperty( currentObject, i, object[i]._accessorProperty );\n } else {\n currentObject[i] = object[i];\n }\n }\n catch ( e ) {\n\t console.log( \"cannot create \" + i + \" from \" + name );\n throw new Error( \"Namespace Allready aquired by a non-object\", \"Namespace Allready aquired by non-object\" );\n }\n }\n }", "title": "" }, { "docid": "69e3bb084c1c845312a226cb4f20b443", "score": "0.5522592", "text": "function namespace(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(\".\");o=window;for(j=0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]]}};return o}", "title": "" }, { "docid": "0a6f77832d7f956d06ce4e6cc283a6aa", "score": "0.5522104", "text": "__init() {\n\n\t}", "title": "" }, { "docid": "df9f2ec10a63714630083b386d9cc886", "score": "0.55173165", "text": "function _init() {\n \n }", "title": "" }, { "docid": "031b5b8c4ecb32c02cee2c0feeb2c326", "score": "0.5513764", "text": "function init() {\n \n }", "title": "" }, { "docid": "e48ee69e9809cd26b47db0e522be031b", "score": "0.5477439", "text": "static initialize(obj, workspace) { \n obj['workspace'] = workspace;\n }", "title": "" }, { "docid": "4f0353230bbfb7ef873664c04730863c", "score": "0.54394746", "text": "function init() {\n \n }", "title": "" }, { "docid": "a28c433de8f50fe618e5ebd20d396576", "score": "0.5418146", "text": "function namespace(ns) {\n return function(text) {\n text = text\n .toString()\n .replace('var ACE_NAMESPACE = \"\";', 'var ACE_NAMESPACE = \"' + ns +'\";')\n .replace(/(\\.define)|\\bdefine\\(/g, function(_, a) {\n return a || ns + \".define(\"\n });\n\n return text;\n };\n}", "title": "" }, { "docid": "40d0831c40d519b29716eaa141266ba5", "score": "0.5416986", "text": "function fromNamespace(ns, delimiter = '.') {\n const segments = ns.split(delimiter);\n return {\n collection: segments[0],\n name: segments[1] || segments[0],\n ns\n };\n}", "title": "" }, { "docid": "0cdc17d13013f7cc322db1fb0117ea91", "score": "0.54083955", "text": "function namespace(namespace) {\n\t\tvar names = namespace.split('.').reverse(),\n\t\t\tspace = window,\n\t\t\tname;\n\t\twhile (names.length) {\n\t\t\tname = names.pop();\n\t\t\tspace = space[name] = space[name] || {};\n\t\t}\n\t\treturn space;\n\t}", "title": "" }, { "docid": "f74c415191d9c95e805343cf65378312", "score": "0.54059225", "text": "initialize() {\n // Map of namespace names to their types.\n const options = new cast.framework.CastReceiverOptions();\n options.customNamespaces = {};\n options.customNamespaces[NAMESPACE] =\n cast.framework.system.MessageType.STRING;\n this.castContext_.start(options);\n this.streamManager_ =\n new google.ima.dai.api.StreamManager(this.mediaElement_);\n }", "title": "" }, { "docid": "beff6224845143b836925b1bf8d2ff37", "score": "0.5402954", "text": "init ()\n {\n }", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.53897625", "text": "init() {\n }", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.53897625", "text": "init() {\n }", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.53897625", "text": "init() {\n }", "title": "" }, { "docid": "93e8fc98c968bb1e147e89a11c38c296", "score": "0.5384873", "text": "function Namespace(builtins, globalMacros) {\n if (builtins === void 0) {\n builtins = {};\n }\n\n if (globalMacros === void 0) {\n globalMacros = {};\n }\n\n this.current = void 0;\n this.builtins = void 0;\n this.undefStack = void 0;\n this.current = globalMacros;\n this.builtins = builtins;\n this.undefStack = [];\n }", "title": "" }, { "docid": "60148fca6ef5c2f8aea4fbea0d244174", "score": "0.53551495", "text": "function init()\n {\n }", "title": "" }, { "docid": "050d7c5b621a84441675939dd0c3d707", "score": "0.5345722", "text": "init() {\n }", "title": "" }, { "docid": "050d7c5b621a84441675939dd0c3d707", "score": "0.5345722", "text": "init() {\n }", "title": "" } ]